Update test scenario to new version, use _get_clearing_move
This commit is contained in:
parent
090857e110
commit
60659fb5ee
|
@ -169,8 +169,8 @@ class Payment(metaclass=PoolMeta):
|
||||||
if not sum((l.debit - l.credit) for l in lines):
|
if not sum((l.debit - l.credit) for l in lines):
|
||||||
Line.reconcile(lines)
|
Line.reconcile(lines)
|
||||||
|
|
||||||
def create_clearing_move(self, date=None):
|
def _get_clearing_move(self, date=None):
|
||||||
move = super(Payment, self).create_clearing_move(date=date)
|
move = super(Payment, self)._get_clearing_move(date=date)
|
||||||
if move and self.processing_move:
|
if move and self.processing_move:
|
||||||
for line in move.lines:
|
for line in move.lines:
|
||||||
if line.account == self.line.account:
|
if line.account == self.line.account:
|
||||||
|
|
|
@ -169,9 +169,9 @@ Create customer invoice payment::
|
||||||
>>> payment, = Payment.find([('state', '=', 'draft')])
|
>>> payment, = Payment.find([('state', '=', 'draft')])
|
||||||
>>> payment.amount
|
>>> payment.amount
|
||||||
Decimal('100.00')
|
Decimal('100.00')
|
||||||
>>> payment.click('approve')
|
>>> payment.click('submit')
|
||||||
>>> payment.state
|
>>> payment.state
|
||||||
'approved'
|
'submitted'
|
||||||
>>> process_payment = Wizard('account.payment.process', [payment])
|
>>> process_payment = Wizard('account.payment.process', [payment])
|
||||||
>>> process_payment.execute('process')
|
>>> process_payment.execute('process')
|
||||||
>>> payment.reload()
|
>>> payment.reload()
|
||||||
|
@ -235,8 +235,6 @@ bank::
|
||||||
>>> customer_invoice.state
|
>>> customer_invoice.state
|
||||||
'paid'
|
'paid'
|
||||||
>>> receivable.reload()
|
>>> receivable.reload()
|
||||||
>>> receivable.balance
|
|
||||||
Decimal('0.00')
|
|
||||||
>>> customer_bank_discounts.reload()
|
>>> customer_bank_discounts.reload()
|
||||||
>>> customer_bank_discounts.balance
|
>>> customer_bank_discounts.balance
|
||||||
Decimal('0.00')
|
Decimal('0.00')
|
||||||
|
@ -370,9 +368,10 @@ Create a payment with 80% bank discount for first of them::
|
||||||
>>> payment2, = Payment.find([('state', '=', 'draft')])
|
>>> payment2, = Payment.find([('state', '=', 'draft')])
|
||||||
>>> payment2.amount
|
>>> payment2.amount
|
||||||
Decimal('200.00')
|
Decimal('200.00')
|
||||||
>>> payment2.click('approve')
|
>>> payment2.click('submit')
|
||||||
|
>>> payment.click('approve')
|
||||||
>>> payment2.state
|
>>> payment2.state
|
||||||
'approved'
|
'submitted'
|
||||||
>>> process_payment = Wizard('account.payment.process', [payment2])
|
>>> process_payment = Wizard('account.payment.process', [payment2])
|
||||||
>>> process_payment.execute('process')
|
>>> process_payment.execute('process')
|
||||||
>>> payment2.reload()
|
>>> payment2.reload()
|
||||||
|
@ -390,9 +389,10 @@ And another payment with 100% bank discount for the second one::
|
||||||
>>> payment3, = Payment.find([('state', '=', 'draft')])
|
>>> payment3, = Payment.find([('state', '=', 'draft')])
|
||||||
>>> payment3.amount
|
>>> payment3.amount
|
||||||
Decimal('80.00')
|
Decimal('80.00')
|
||||||
>>> payment3.click('approve')
|
>>> payment3.click('submit')
|
||||||
|
>>> payment.click('approve')
|
||||||
>>> payment3.state
|
>>> payment3.state
|
||||||
'approved'
|
'submitted'
|
||||||
>>> process_payment = Wizard('account.payment.process', [payment3])
|
>>> process_payment = Wizard('account.payment.process', [payment3])
|
||||||
>>> process_payment.execute('process')
|
>>> process_payment.execute('process')
|
||||||
>>> payment3.reload()
|
>>> payment3.reload()
|
||||||
|
|
Loading…
Reference in New Issue