Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
4715 Widoki

I'm using Odoo 12. From the XMLRPC API, I am adding a single route_id to a single product.product entry with the following params object according to the official documentation:

{ route_id: [[4, 18, false]] }

It is working fine. However, when I add the route to one variant, then it gets automatically added to all variants. The same thing happens when I use the UI to add a route to single variant.

I do not want this and I do not see the benefit of automatically updating all variants.

Is there some configuration setting I need to change?

Awatar
Odrzuć

I would like to know the answer to this as well.

Hi, did you get any solution for this?

Najlepsza odpowiedź

Hi, James


"route_ids" belongs to the "product.template" model not from "product.product" and as you know "product.product" inherits all the properties from "product.template".

https://github.com/odoo/odoo/blob/cc0f6e205262f73fe83b39c6ea0e29e3ae1cf355/addons/stock/models/product.py#L598 

So you update any field which belongs "product.template" not from "product.product" then value will be updated inside all the variants. 
In order to achieve this part you need to define same field inside the "product.product" model. Like Odoo manages other fields of "product.product".

https://github.com/odoo/odoo/blob/fa852ba1c5707b71469c410063f338eef261ab2b/addons/product/models/product.py#L135 

But I recommend you to follow this step only if you have complete idea of Odoo routing flow.

Feel free to ask in case you have any confusion related to the above point.


Thanks,
Ashish Singh (Team Lead)
Webkul Software Private Limited

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
cze 25
928
1
wrz 24
2099
0
wrz 24
873
1
lut 24
5180
0
mar 15
5398