X-Git-Url: http://git.cyclocoop.org/?p=burette%2Fanalytic_point_of_sale.git;a=blobdiff_plain;f=point_of_sale.py;fp=point_of_sale.py;h=abc0c71283068a3577ce21f33852c53f3f6aa1ab;hp=350277c3ba77c87241ffeab2d22476cb87408826;hb=ad39b28de754d81542e5dc07b071a332ec3acd0c;hpb=815096298d0b1925488e3a7fbf5794bfa2ceac33 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