Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2414 Представления

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.

Аватар
Отменить