Skip to content

Commit

Permalink
[TMP FIX] compute odumbo prices
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-zanotti committed Aug 15, 2023
1 parent 00adad1 commit dbb6135
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion product_ux/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Product UX',
'version': "16.0.4.0.0",
'version': "16.0.5.0.0",
'category': 'Products',
'sequence': 14,
'summary': '',
Expand Down
9 changes: 9 additions & 0 deletions product_ux/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@ class ProductTemplate(models.Model):
)
warranty = fields.Float()
pricelist_price = fields.Float(compute='_compute_product_pricelist_price', digits='Product Price')
odumbo_price = fields.Float(compute='_compute_product_odumbo_price', digits='Product Price')
pricelist_id = fields.Many2one('product.pricelist', store=False,)

@api.depends_context('pricelist', 'quantity', 'uom', 'date', 'no_variant_attributes_price_extra')
def _compute_product_pricelist_price(self):
for product in self:
product.pricelist_price = product._get_contextual_price()

@api.depends_context('pricelist', 'quantity', 'uom', 'date', 'no_variant_attributes_price_extra')
def _compute_product_odumbo_price(self):
for record in self:
company_id = self._context.get('company_id', self.env.company.id)
price = record._get_contextual_price()
res = record.taxes_id.filtered(lambda x: x.company_id.id == company_id).compute_all(price, product=record)
self.odumbo_price = res['total_included']

0 comments on commit dbb6135

Please sign in to comment.