Inovoice to Statement
This commit is contained in:
parent
d49e22a6ff
commit
0d5d1f85a7
16
sale.py
16
sale.py
|
@ -138,18 +138,22 @@ class WizardSalePayment(metaclass=PoolMeta):
|
|||
active_id = Transaction().context.get('active_id', False)
|
||||
sale = Sale(active_id)
|
||||
|
||||
if sale.state != 'draft':
|
||||
line = self.get_statement_line(sale)
|
||||
if line:
|
||||
line.save()
|
||||
return 'end'
|
||||
else:
|
||||
sale.description = sale.reference
|
||||
sale.save()
|
||||
Sale.workflow_to_end([sale])
|
||||
|
||||
line = self.get_statement_line(sale)
|
||||
if line:
|
||||
line.save()
|
||||
|
||||
if sale.total_amount != sale.paid_amount:
|
||||
return 'start'
|
||||
if sale.state != 'draft':
|
||||
return 'end'
|
||||
|
||||
sale.description = sale.reference
|
||||
sale.save()
|
||||
Sale.workflow_to_end([sale])
|
||||
|
||||
return 'end'
|
||||
|
||||
|
|
Loading…
Reference in New Issue