Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I am using price lists for the sales price of the products in my odoo set up. The price lists are working. Now, when opening a product form, I would like to show the "Sale Price" (list_price) of the product by getting it through my price lists so that when I update my sales price lists, the "Sale Price" field in the product form will automatically show the updated sales price (getting from the updated price lists). I cannot figure out how to do it.
Here's the code I tried:
from openerp import models, fields, api
from addons.decimal_precision import decimal_precision as dp
self.list_price = [not sure how to write this part???]
list_price=fields.Float('Sale Price', compute='_set_sales_price', digits_compute=dp.get_precision('Product Price'),
help="Base price to compute the customer price. Sometimes called the catalog price.")
i have the following questions:
1) Is the above the right way to overwrite an existing field (list_price) in product.template?
2) Please advise how to write the part [not sure how to write this part???]. I tried to find how to do this in odoo's source code and found something like
but cannot figure out what I should put for the parameters when calling price_get.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 5/2/16, 7:45 AM|
|Seen: 846 times|
|Last updated: 5/2/16, 8:17 AM|