I just lost my hope, that I will solve this problem alone and I cannot find any solution or even suggestion how to do this.
So the problem:
I have multicompany env with 3 companys:
COM_1, COM_2, COM_3
Every company has it`s own products. When I create SALE.ORDER and I add SALE.ORDER.LINE I can select ALL products that belongs to companys, to which my current RES.USER has access. But this cause later a lot of problems, so I would like to limit selection list to products, that belongs to company selected on SALE.ORDER form.
I hope this is more or less understandable ;)
So what I would like to achieve is:
- on sale.order form I select company, let`s say COM_1
- on sale.order.line I add products and I see ONLY products that belongs to COM_1
Could someone please help me with this task?
Thanks in advance,
You achieve acheive this simply by adding domain to your product field in sale.order.line object both its tree and form view for Sale order (by overriding the form view of sale.order)
and at product_id field do this
<xpath expr="//YOUR_PATH_TO_product_id" position="attributes">
<attribute name="domain">[('company_id', '=', parent.company_id.id)]</attribute>
Hope it helps
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
|Asked: 9/22/15, 5:36 AM|
|Seen: 996 times|
|Last updated: 3/13/16, 5:18 AM|