Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
2051 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Auteur

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.

Gerelateerde posts Antwoorden Weergaven Activiteit
1
jun. 25
764
2
apr. 25
1209
2
feb. 25
6096
0
jan. 25
1132
1
dec. 24
1590