Skip to content

Commit

Permalink
REF _compute_amount : clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
eLBati committed Oct 6, 2015
1 parent f43acf9 commit 0be0847
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions l10n_it_split_payment/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,10 @@ class AccountInvoice(models.Model):
@api.one
@api.depends('invoice_line.price_subtotal', 'tax_line.amount')
def _compute_amount(self):
self.amount_untaxed = sum(
line.price_subtotal for line in self.invoice_line)
super(AccountInvoice, self)._compute_amount()
if self.fiscal_position.split_payment:
self.amount_sp = sum(line.amount for line in self.tax_line)
self.amount_sp = self.amount_tax
self.amount_tax = 0
else:
self.amount_tax = sum(line.amount for line in self.tax_line)
self.amount_sp = 0
self.amount_total = self.amount_untaxed + self.amount_tax

def reconcile_sp(self, sp_line):
Expand Down

0 comments on commit 0be0847

Please sign in to comment.