Update test scenario to new version, use _get_clearing_move

This commit is contained in:
Jared Esparza 2022-06-01 13:57:28 +02:00
parent 090857e110
commit 60659fb5ee
2 changed files with 10 additions and 10 deletions

View File

@ -169,8 +169,8 @@ class Payment(metaclass=PoolMeta):
if not sum((l.debit - l.credit) for l in lines):
Line.reconcile(lines)
def create_clearing_move(self, date=None):
move = super(Payment, self).create_clearing_move(date=date)
def _get_clearing_move(self, date=None):
move = super(Payment, self)._get_clearing_move(date=date)
if move and self.processing_move:
for line in move.lines:
if line.account == self.line.account:

View File

@ -169,9 +169,9 @@ Create customer invoice payment::
>>> payment, = Payment.find([('state', '=', 'draft')])
>>> payment.amount
Decimal('100.00')
>>> payment.click('approve')
>>> payment.click('submit')
>>> payment.state
'approved'
'submitted'
>>> process_payment = Wizard('account.payment.process', [payment])
>>> process_payment.execute('process')
>>> payment.reload()
@ -235,8 +235,6 @@ bank::
>>> customer_invoice.state
'paid'
>>> receivable.reload()
>>> receivable.balance
Decimal('0.00')
>>> customer_bank_discounts.reload()
>>> customer_bank_discounts.balance
Decimal('0.00')
@ -370,9 +368,10 @@ Create a payment with 80% bank discount for first of them::
>>> payment2, = Payment.find([('state', '=', 'draft')])
>>> payment2.amount
Decimal('200.00')
>>> payment2.click('approve')
>>> payment2.click('submit')
>>> payment.click('approve')
>>> payment2.state
'approved'
'submitted'
>>> process_payment = Wizard('account.payment.process', [payment2])
>>> process_payment.execute('process')
>>> payment2.reload()
@ -390,9 +389,10 @@ And another payment with 100% bank discount for the second one::
>>> payment3, = Payment.find([('state', '=', 'draft')])
>>> payment3.amount
Decimal('80.00')
>>> payment3.click('approve')
>>> payment3.click('submit')
>>> payment.click('approve')
>>> payment3.state
'approved'
'submitted'
>>> process_payment = Wizard('account.payment.process', [payment3])
>>> process_payment.execute('process')
>>> payment3.reload()