mirror of
https://bitbucket.org/presik/trytonpsk-staff_payroll_co.git
synced 2023-12-14 06:42:56 +01:00
fix post move liquidation
This commit is contained in:
parent
c029e82dcd
commit
f635cc5cf7
1 changed files with 3 additions and 4 deletions
|
@ -156,7 +156,6 @@ class Liquidation(Workflow, ModelSQL, ModelView):
|
|||
def default_state():
|
||||
return 'draft'
|
||||
|
||||
|
||||
@staticmethod
|
||||
def default_currency():
|
||||
Company = Pool().get('company.company')
|
||||
|
@ -357,7 +356,7 @@ class Liquidation(Workflow, ModelSQL, ModelView):
|
|||
for moveline in line.move_lines:
|
||||
to_reconcile.append(moveline)
|
||||
account_id = moveline.account.id
|
||||
amount_line = abs(moveline.debit - moveline.credit)
|
||||
amount_line = moveline.debit - moveline.credit * -1
|
||||
if account_id not in grouped.keys():
|
||||
grouped[account_id] = {
|
||||
'amount': [],
|
||||
|
@ -428,7 +427,7 @@ class Liquidation(Workflow, ModelSQL, ModelView):
|
|||
'party': party_id,
|
||||
}
|
||||
if analytic:
|
||||
res['analytic_lines']= [
|
||||
res['analytic_lines'] = [
|
||||
('create', [{
|
||||
'debit': res['debit'],
|
||||
'credit': res['credit'],
|
||||
|
@ -598,7 +597,7 @@ class Liquidation(Workflow, ModelSQL, ModelView):
|
|||
('origin', 'in', ['staff.loan.line,' + str(m)]),
|
||||
])
|
||||
party = m.loan.party_to_pay.id if m.loan.party_to_pay else None
|
||||
res = self.get_line_(m.loan.wage_type, m.amount, 1, m.loan.account_debit.id, party=party)
|
||||
res = self.get_line_(m.loan.wage_type, m.amount * -1, 1, m.loan.account_debit.id, party=party)
|
||||
res['move_lines'] = [('add', move_lines)]
|
||||
res['liquidation'] = self.id
|
||||
line_, = LiquidationLine.create([res])
|
||||
|
|
Loading…
Reference in a new issue