|
@ -35,7 +35,8 @@ class BeesdooProduct(models.Model): |
|
|
@api.one |
|
|
@api.one |
|
|
@api.depends('taxes_id', 'list_price', 'taxes_id.amount', 'taxes_id.tax_group_id', 'total_with_vat', 'display_weight', 'weight') |
|
|
@api.depends('taxes_id', 'list_price', 'taxes_id.amount', 'taxes_id.tax_group_id', 'total_with_vat', 'display_weight', 'weight') |
|
|
def _get_total(self): |
|
|
def _get_total(self): |
|
|
consignes_group = self.env.ref('beesdoo_product.consignes_group_tax') |
|
|
|
|
|
|
|
|
consignes_group = self.env.ref('beesdoo_product.consignes_group_tax', raise_if_not_found=False) |
|
|
|
|
|
|
|
|
tax_amount_sum = sum([tax._compute_amount(self.list_price, self.list_price) for tax in self.taxes_id if tax.tax_group_id != consignes_group]) |
|
|
tax_amount_sum = sum([tax._compute_amount(self.list_price, self.list_price) for tax in self.taxes_id if tax.tax_group_id != consignes_group]) |
|
|
self.total_deposit = sum([tax._compute_amount(self.list_price, self.list_price) for tax in self.taxes_id if tax.tax_group_id == consignes_group]) |
|
|
self.total_deposit = sum([tax._compute_amount(self.list_price, self.list_price) for tax in self.taxes_id if tax.tax_group_id == consignes_group]) |
|
|
self.total_with_vat = self.list_price + tax_amount_sum |
|
|
self.total_with_vat = self.list_price + tax_amount_sum |
|
|