Skip to Content
मेन्यू
This question has been flagged

Hello,


I am trying to add a new related field in the "Vendor pricelist" list. The related field is the "product_code" which is stored in database in the table product_supplierinfo as "product_code" for each product variant.


My issue is that when I loaded the "product_id.seller_ids.product_code" field, what I am getting is the same product_code value for all product variants, regardless the provider line.

I mean, I have two different providers, with two different product_code for the same product and when I get this related field, it is getting the same product_code for both providers, which is incorrect and I have checked in the database that both have different codes for all products.

Also, I have checked it inside the providers products view, where the field value is correct.


So clearly I am not getting the correct related field or it is not working as it should. Which field should I get to show the correct product_code for each product and for each provider in the vendor pricelists list?


Thanks a lot!


Note: Odoo v16

Avatar
Discard

hi, did you tried to loop through seller_ids and access the product_code.product_id.name instead? if it's successfully, try to change the .name into something you want to grab. Or perhaps could you please share the code for better analysis? thank you

Author Best Answer

Hi Altela,

Thanks for your help.

I am doing this in the graphic editor studio (domain.odoo.com/web#action=studio&mode=editor&_action=169&_view_type=list&_tab=views&menu_id=334&cids=1) so I can not share with you any code. If there is a way to do this by code, I will appreciate your help if you tell me how should I do it.

In the related field generated, this is the code generated for the field: product_id.seller_ids.product_code. I tried to get the field by many ways, but always getting the same result (same product_code for different vendors and even same product_code for different variants).

Thanks and regards!

Avatar
Discard
Related Posts Replies Views Activity
1
अप्रैल 25
1392
1
नव॰ 24
1610
1
जन॰ 24
1532
1
मार्च 24
3474
2
अप्रैल 23
6303