跳至内容
菜单
此问题已终结
1 回复
2415 查看

When I add a many2many product Field - for example in the res.partner view - like

'product_list': fields.many2many('product.product','product_product_lieferantenprodukt','product_id','lieferantenprodukt_id','lieferantenprodukt'),

and I add a product to this "product_list" field, how can I tell the product that it has been added to this form?

形象
丢弃
最佳答案

You can easily add a bidirectional many2many relation by adding a many2many field to your product.product model:

'supplier_list': fields.many2many('res.partner', 'product_product_lieferantenprodukt','lieferantenprodukt_id', 'product_id', 'Lieferanten'),

The product will automatically 'know' that it has been added, since it is stored in a special table 'product_product_lieferantenprodukt' in your database.

See also: https://doc.openerp.com/6.0/developer/2_5_Objects_Fields_Methods/field_type/#relational-types

Regards.

形象
丢弃