Add company cotronl on finctional fields

Grafted from changeset-cf90287a916f
This commit is contained in:
Bernat Brunet Torruella 2017-07-05 13:25:22 +02:00
parent a098da5148
commit 4844a23bc5

View file

@ -116,6 +116,7 @@ class Invoice:
SIIReport = pool.get('aeat.sii.report')
result = {}
for name in names:
result[name] = dict((i.id, None) for i in invoices)
@ -133,8 +134,9 @@ class Invoice:
if lines:
cursor.execute(*join.select(table.state, report.operation_type,
table.invoice,
where=(table.id.in_(lines)) & (table.state != None)))
table.invoice,
where=((table.id.in_(lines)) & (table.state != None) &
(table.company == report.company))))
for state, op, inv in cursor.fetchall():
if 'sii_state' in names: