[PYTHON] -remove inherit functions when it's possible 7.0
authorLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Fri, 27 Jan 2017 08:00:09 +0000 (09:00 +0100)
committerLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Fri, 27 Jan 2017 08:00:09 +0000 (09:00 +0100)
point_of_sale.py

index 350277c..abc0c71 100644 (file)
@@ -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