Skip to Content
Menu
This question has been flagged
2 Replies
3056 Views

Hello Community,


I'm using product variant heavily and it was working fine to add variant on sale order lines and the description represent the variant name perfectly on V9C. After upgrading to V10C and importing all data. when adding product to sale order lines it shows only product name, no more variant name.

I've checked name_get function on product.py for product.product class and the code to display variant name is there. but not propagating to order line name (description) as expected.


Please advise.

Avatar
Discard
Best Answer

May be it's related with

https://github.com/odoo/odoo/issues/18878


Make sure that your variant has more than one attr value, since only will be displayed the "description" if variant has more than one attr value

https://github.com/odoo/odoo/blob/722dbcfa075a29692339469abcb5a556ef951420/addons/product/models/product.py#L394


Best regards!

Avatar
Discard
Author Best Answer

Changing the mentioned line as per the instructions fixed the issue correctly. 

From:

variable_attributes = product.attribute_line_ids.filtered(lambda l: len(l.value_ids) > 1).mapped('attribute_id')


To:

           variable_attributes = product.attribute_line_ids.filtered(lambda l: len(l.value_ids) >= 1).mapped('attribute_id')


This should be the fix. Thanks a lot.

Avatar
Discard
Related Posts Replies Views Activity
2
Dec 15
4211
0
Sep 24
122
3
Aug 24
528
0
Feb 24
263
0
Feb 24
157