mirror of
https://github.com/NaN-tic/trytond-account_invoice_facturae.git
synced 2023-12-14 03:32:59 +01:00
Only try to render invoices of type 'out' and in posted/paid state. Move the check to generated_facturae.
This commit is contained in:
parent
0ffe9fb7c3
commit
97e7697353
|
@ -255,6 +255,8 @@ class Invoice(metaclass=PoolMeta):
|
||||||
config = Configuration(1)
|
config = Configuration(1)
|
||||||
transaction = Transaction()
|
transaction = Transaction()
|
||||||
|
|
||||||
|
if self.type != 'out' or self.state not in ('posted', 'paid'):
|
||||||
|
return
|
||||||
# send facturae to service
|
# send facturae to service
|
||||||
if not service and config.facturae_service:
|
if not service and config.facturae_service:
|
||||||
service = config.facturae_service
|
service = config.facturae_service
|
||||||
|
@ -301,11 +303,6 @@ class Invoice(metaclass=PoolMeta):
|
||||||
Date = pool.get('ir.date')
|
Date = pool.get('ir.date')
|
||||||
Rate = pool.get('currency.currency.rate')
|
Rate = pool.get('currency.currency.rate')
|
||||||
|
|
||||||
if self.type != 'out':
|
|
||||||
return
|
|
||||||
if self.state not in ('posted', 'paid'):
|
|
||||||
return
|
|
||||||
|
|
||||||
# These are an assert because it shouldn't happen
|
# These are an assert because it shouldn't happen
|
||||||
assert self.invoice_date <= Date.today(), (
|
assert self.invoice_date <= Date.today(), (
|
||||||
"Invoice date of invoice %s is in the future" % self.id)
|
"Invoice date of invoice %s is in the future" % self.id)
|
||||||
|
|
Loading…
Reference in a new issue