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
df8fd09ac9
commit
dd0262ce9d
|
@ -255,6 +255,8 @@ class Invoice(metaclass=PoolMeta):
|
|||
config = Configuration(1)
|
||||
transaction = Transaction()
|
||||
|
||||
if self.type != 'out' or self.state not in ('posted', 'paid'):
|
||||
return
|
||||
# send facturae to service
|
||||
if not service and config.facturae_service:
|
||||
service = config.facturae_service
|
||||
|
@ -301,11 +303,6 @@ class Invoice(metaclass=PoolMeta):
|
|||
Date = pool.get('ir.date')
|
||||
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
|
||||
assert self.invoice_date <= Date.today(), (
|
||||
"Invoice date of invoice %s is in the future" % self.id)
|
||||
|
|
Loading…
Reference in New Issue