Replace self to invoice from >4.8 in date control when amount is round 0

From changeset-a67397bf91c1
This commit is contained in:
Raimon Esteve 2018-12-14 10:06:32 +01:00
parent 0727f139fe
commit 5796336dce

View file

@ -76,19 +76,19 @@ class Invoice(metaclass=PoolMeta):
domain = [
('number', '!=', None),
('type', '=', self.type),
('company', '=', self.company.id),
('type', '=', invoice.type),
('company', '=', invoice.company.id),
('move.period.fiscalyear', '=', fiscalyear.id),
['OR', [
('number', '<', self.number),
('invoice_date', '>', self.invoice_date),
('number', '<', invoice.number),
('invoice_date', '>', invoice.invoice_date),
], [
('number', '>', self.number),
('invoice_date', '<', self.invoice_date),
('number', '>', invoice.number),
('invoice_date', '<', invoice.invoice_date),
],],
]
if self.untaxed_amount >= 0:
if invoice.untaxed_amount >= 0:
domain.append(('untaxed_amount', '>=', 0))
else:
domain.append(('untaxed_amount', '<', 0))
@ -99,7 +99,7 @@ class Invoice(metaclass=PoolMeta):
])
if account_invoice_sequence_module_installed:
domain.append(('journal', '=', self.journal.id))
domain.append(('journal', '=', invoice.journal.id))
invs = Inv.search(domain, limit=5)