Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Work with stored values - tell product "you were added"

By
birduser
on 4/23/14, 1:26 AM 576 views

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?

0

René Schuster

--René Schuster--
1560
| 5 5 8
Weinheim, Germany
--René Schuster--

Challenge Everything!

René Schuster
On 5/15/14, 8:42 AM

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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 4/23/14, 1:26 AM
Seen: 576 times
Last updated: 3/16/15, 8:10 AM