Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
4732 Vizualizări

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?

Imagine profil
Abandonează

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

Hi, did you get any solution for this?

Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
iun. 25
931
1
sept. 24
2103
0
sept. 24
874
1
feb. 24
5184
0
mar. 15
5400