İçereği Atla
Menü
Bu soru işaretlendi

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
Vazgeç

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

Üretici En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
Tiered discounts Çözüldü
1
Nis 25
1360
1
Kas 24
1577
1
Oca 24
1524
1
Mar 24
3406
2
Nis 23
6284