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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
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
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.
相关帖文 | 回复 | 查看 | 活动 | |
---|---|---|---|---|
|
3
9月 25
|
1666 | ||
|
1
6月 25
|
797 | ||
|
2
4月 25
|
1244 | ||
|
2
2月 25
|
6122 | ||
|
0
1月 25
|
1157 |