fix invoice sii_state, take care only sended lines
This commit is contained in:
parent
32f14eb8f2
commit
79868c6f66
|
@ -97,14 +97,15 @@ class Invoice:
|
|||
table = SIILines.__table__()
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute(*table.select(Max(table.id), table.invoice,
|
||||
where=table.invoice.in_([x.id for x in invoices]),
|
||||
where=(table.invoice.in_([x.id for x in invoices]) &
|
||||
(table.state != None)),
|
||||
group_by=table.invoice))
|
||||
|
||||
lines = [a[0] for a in cursor.fetchall()]
|
||||
|
||||
if lines:
|
||||
cursor.execute(*table.select(table.state, table.invoice,
|
||||
where=table.id.in_(lines)))
|
||||
where=(table.id.in_(lines)) & (table.state != None)))
|
||||
|
||||
for state, inv in cursor.fetchall():
|
||||
result['sii_state'][inv] = state
|
||||
|
|
Loading…
Reference in New Issue