one2many – odoo


 from openerp.osv import fields, osv

class crm_lead(osv.osv):
    _inherit="crm.lead"
    _columns ={
        'products_ids':fields.one2many('crm.products.line','products_id',string="Products"),
    }


class crm_products_line(osv.osv):
    _name="crm.products.line"
    _columns ={
        'products_id':fields.many2one('crm.lead',string="Reference"),
        'product': fields.many2one('product.product',string='Products'),
    }
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s