Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TMP FIX] compute odumbo prices #538

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)
record.odumbo_price = res['total_included']