From ad39b28de754d81542e5dc07b071a332ec3acd0c Mon Sep 17 00:00:00 2001 From: Ludovic CHEVALIER Date: Fri, 27 Jan 2017 09:00:09 +0100 Subject: [PATCH] [PYTHON] -remove inherit functions when it's possible --- point_of_sale.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/point_of_sale.py b/point_of_sale.py index 350277c..abc0c71 100644 --- a/point_of_sale.py +++ b/point_of_sale.py @@ -49,16 +49,6 @@ class pos_order(orm.Model): grouped_data = {} have_to_group_by = session and session.config_id.group_by or False - def compute_tax(amount, tax, line): - if amount > 0: - tax_code_id = tax['base_code_id'] - tax_amount = line.price_subtotal * tax['base_sign'] - else: - tax_code_id = tax['ref_base_code_id'] - tax_amount = line.price_subtotal * tax['ref_base_sign'] - - return (tax_code_id, tax_amount,) - for order in self.browse(cr, uid, ids, context=context): if order.account_move: continue @@ -169,7 +159,7 @@ class pos_order(orm.Model): tax_amount = 0 while computed_taxes: tax = computed_taxes.pop(0) - tax_code_id, tax_amount = compute_tax(amount, tax, line) + tax_code_id, tax_amount = super(sale_order, self).compute_tax(amount, tax, line) # If there is one we stop if tax_code_id: @@ -191,7 +181,7 @@ class pos_order(orm.Model): # For each remaining tax with a code, whe create a move line for tax in computed_taxes: - tax_code_id, tax_amount = compute_tax(amount, tax, line) + tax_code_id, tax_amount = super(sale_order, self).compute_tax(amount, tax, line) if not tax_code_id: continue -- 2.20.1