İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
2049 Görünümler

Hello Odoo community.

I would like to create a list view field for the Product section that allows me to display all the sales prices of a specific price. Through studio I don't know how to display all the information contained in a variable.

With the little knowledge I have in Python, logic and intuition tells me that I could use the ID of the price I need to display contained in property_product_pricelist.

So, what would be the syntax of this field? property_product_pricelist_id or something like ('res.partner.pricelistvariable', string.id='14')?

How is the python rule to display the data of a parent field?

Thanks in advance for all the information you can give me.

Avatar
Vazgeç
En İyi Yanıt

Try creating a field of the same type as the sub-field you are trying to show and using the related attribute to provide the value of a sub-field.

If you are trying to show it in a list view, it is important to use store=True

product_template_price = fields.Float(related='product_tmpl_id.price', store=True)

https://www.odoo.com/documentation/15.0/developer/reference/backend/orm.html#related-fields

Avatar
Vazgeç
Üretici

product.pricelist is the parent model where all price lists are contained. In turn, fixed_price is the field that contains all the specific prices of that price list and this in turn is contained in product.pricelist.item.

I'm sorry but I can't understand what you mean.

I created the following field:

Type of field: monetary
Dependencies: product.pricelist.item
Calculate: for record in self:
record['x_studio_price_vr'] = record.pricelist_id

Here the field I created is equal to the display of this pricelist but I can not add the specific ID that this is displayed.

İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Haz 25
757
2
Nis 25
1202
2
Şub 25
6075
0
Oca 25
1131
1
Ara 24
1571