Automatically fill One2many in Odoo

#T&C in each SO
class sale_order(models.Model):
    _inherit = "sale.order"
    #By default load the terms and conditions configured in the master T&C configuration
    def _default_so_tc(self):
        terms_obj = self.env['so.terms.config']
        terms = []
        termsids =[])
        for rec in termsids:
            values = {}
            values['name'] =
            values['description'] = rec.description
            terms.append((0, 0, values))
        return terms

    terms = fields.One2many('sale.order.terms.conditions','order_id',string='Terms and Conditions',copy=True,default=_default_so_tc)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.