[FIX] product: make get price public method
The purpose of this change is to be able to get the price of the products from external APIs. closes odoo/odoo#142402 X-original-commit: 420406d392dd3764f08ac698b67440a86abb2ca5 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
@@ -794,6 +794,9 @@ class ProductProduct(models.Model):
|
||||
(tmpl_to_deactivate + tmpl_to_activate).toggle_active()
|
||||
return result
|
||||
|
||||
def get_contextual_price(self):
|
||||
return self._get_contextual_price()
|
||||
|
||||
def _get_contextual_price(self):
|
||||
self.ensure_one()
|
||||
return self.product_tmpl_id._get_contextual_price(self)
|
||||
|
||||
@@ -1383,6 +1383,9 @@ class ProductTemplate(models.Model):
|
||||
'template': '/product/static/xls/product_template.xls'
|
||||
}]
|
||||
|
||||
def get_contextual_price(self, product=None):
|
||||
return self._get_contextual_price(product=product)
|
||||
|
||||
def _get_contextual_price(self, product=None):
|
||||
self.ensure_one()
|
||||
pricelist = self._get_contextual_pricelist()
|
||||
|
||||
Reference in New Issue
Block a user