Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
4730 Представления

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?

Аватар
Отменить

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

Hi, did you get any solution for this?

Лучший ответ

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
июн. 25
931
1
сент. 24
2103
0
сент. 24
874
1
февр. 24
5184
0
мар. 15
5400