Hello.
I am French, I hope you understand :)
I'm trying to develop a module that creates a relationship between products. A product can be linked to several other products: they are identical but are occasions.
So there is a one2many relation (child_ids, one product for several occasions) and another many2one relation (parent_id, many opportunities for one parent). This is equivalent to reproduce the same relation between a partner (res.partner) and contacts (res.partner too).
When a user creates a sale order line (sale.order.line) in an order (sale.order), he must select the a product. If the selected product has occasion product(s), so I want to warn and allow him to select one.
It is necessary to overload the product_id_change() method (onchange on the product_id field defined on parent class) and search for existing attached product(s) (occasions).
I must to display the list of attached product and allow user to replace the product in the sale order line.
My questions:
- Should I force a new search (like "search more ..." link) from the product_id_change() function?
- Should I use a wizard (osv.memory) to open the popup and show him the available opportunities?
- If so, how can I update the parent form (sale.order.line) to change the value of product_id field?
- If not, are there any other way to achieve this?
Thank you for your help.