|
@ -15,7 +15,6 @@ class BeesdooProduct(models.Model): |
|
|
|
|
|
|
|
|
display_weight = fields.Float(compute='get_display_weight') |
|
|
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 = fields.Float(compute='get_total_with_vat') |
|
|
|
|
|
|
|
|
total_with_vat_by_unit = fields.Float(compute='get_total_with_vat_by_unit') |
|
|
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: |
|
|
if self.display_unit: |
|
|
self.display_weight = self.weight / self.display_unit.factor |
|
|
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 |
|
|
@api.one |
|
|
def get_total_with_vat(self): |
|
|
def get_total_with_vat(self): |
|
|
tax_amount_sum = 0.0 |
|
|
tax_amount_sum = 0.0 |
|
|
if hasattr(self, 'taxes_id'): |
|
|
if hasattr(self, 'taxes_id'): |
|
|
for tax in self.taxes_id: |
|
|
for tax in self.taxes_id: |
|
|
tax_amount_sum = tax_amount_sum + tax.amount |
|
|
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 |
|
|
@api.one |
|
|
def get_total_with_vat_by_unit(self): |
|
|
def get_total_with_vat_by_unit(self): |
|
|