Odoo - Product Price - how product pricing is done in Odoo?
In product_template model, there are five price-related columns:
In product_product model, there are three price-related columns:
This is the cost or purchase price of a product. It is used to calculate the cost of goods -- mostly for accounting purpose.
Whenever its value changes, Odoo calls _set_standard_price to store value history in the product.price.history table.
The price_extra is a computed field. A product template may have multiple product variants that have a combination of some attribute values.
An attribute value can have an extra price. For example, 32GB memory may add an extra $50.
The sum of hose extra prices for applicable product variant attributes will the the price_extra.
This field is the sales or product price displayed in a web site. When one wants to change the list_price of a product,
it should change it in the product template. For individual product variant, change the attribute extra price.
lst_price in product_template model
it seems that the lst_price field can be used for both product_template and product_product as the product sale price.
In product_template model, it points to the list_price field.
lst_price in product_product model
In product_product model, it is computed field that calls _product_lst_price.
This function calculates the lst_price of a product variant by adding its list_price and its price_extra.
The field also has an inverse function _set_product_lst_price that sets list_price when lst_price changes.
The list_price value is the subtraction of price_extra from lst_price.
For a product variant, the lst_price is the sales or product price displayed in a web site.
In both product_template model and product_product model, it is a computed field to calculate its value.
The method uses product.pricelist model to calculate a price based on rules defined in product.pricelist.item.
Many context variables, such as partner, UOM, currency and rule name, are used in finding the price.
The price_get method is called in the calculation.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!