From 01174cd880c85b6e6068b5504a22f6a2a37e327c Mon Sep 17 00:00:00 2001 From: gregoire Date: Thu, 12 May 2016 22:43:44 +0200 Subject: [PATCH] remove total base on pricelist and use list_price instead --- beesdoo_product/models/beesdoo_product.py | 8 +------- beesdoo_product/views/beesdoo_product.xml | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/beesdoo_product/models/beesdoo_product.py b/beesdoo_product/models/beesdoo_product.py index 0f851c1..f83ddc2 100644 --- a/beesdoo_product/models/beesdoo_product.py +++ b/beesdoo_product/models/beesdoo_product.py @@ -15,7 +15,6 @@ class BeesdooProduct(models.Model): display_weight = fields.Float(compute='get_display_weight') - total = fields.Float(compute='get_total') total_with_vat = fields.Float(compute='get_total_with_vat') total_with_vat_by_unit = fields.Float(compute='get_total_with_vat_by_unit') @@ -26,18 +25,13 @@ class BeesdooProduct(models.Model): if self.display_unit: self.display_weight = self.weight / self.display_unit.factor - @api.one - def get_total(self): - price_ht = self.env['product.pricelist'].search([])[0].price_get(self.id, 1)[1] - self.total = price_ht - @api.one def get_total_with_vat(self): tax_amount_sum = 0.0 if hasattr(self, 'taxes_id'): for tax in self.taxes_id: tax_amount_sum = tax_amount_sum + tax.amount - self.total_with_vat = self.total * (100.0 + tax_amount_sum) / 100 + self.total_with_vat = self.list_price * (100.0 + tax_amount_sum) / 100 @api.one def get_total_with_vat_by_unit(self): diff --git a/beesdoo_product/views/beesdoo_product.xml b/beesdoo_product/views/beesdoo_product.xml index f963803..980ffa0 100644 --- a/beesdoo_product/views/beesdoo_product.xml +++ b/beesdoo_product/views/beesdoo_product.xml @@ -9,9 +9,9 @@ + -