Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
4721 Weergaven

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?

Avatar
Annuleer

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

Hi, did you get any solution for this?

Beste antwoord

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

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
jun. 25
929
1
sep. 24
2102
0
sep. 24
874
1
feb. 24
5184
0
mrt. 15
5399