Allow to pay a sale with amount 0
This commit is contained in:
parent
a5fe0dd36f
commit
bafc7adacb
21
sale.py
21
sale.py
@ -142,16 +142,17 @@ class WizardSalePayment(Wizard):
|
|||||||
if not sale.reference:
|
if not sale.reference:
|
||||||
Sale.set_reference([sale])
|
Sale.set_reference([sale])
|
||||||
|
|
||||||
payment = StatementLine(
|
if form.payment_amount:
|
||||||
statement=statements[0].id,
|
payment = StatementLine(
|
||||||
date=Date.today(),
|
statement=statements[0].id,
|
||||||
amount=form.payment_amount,
|
date=Date.today(),
|
||||||
party=sale.party.id,
|
amount=form.payment_amount,
|
||||||
account=sale.party.account_receivable.id,
|
party=sale.party.id,
|
||||||
description=sale.reference,
|
account=sale.party.account_receivable.id,
|
||||||
sale=active_id
|
description=sale.reference,
|
||||||
)
|
sale=active_id
|
||||||
payment.save()
|
)
|
||||||
|
payment.save()
|
||||||
|
|
||||||
if sale.total_amount != sale.paid_amount:
|
if sale.total_amount != sale.paid_amount:
|
||||||
return 'start'
|
return 'start'
|
||||||
|
Loading…
Reference in New Issue
Block a user