mirror of
https://github.com/NaN-tic/trytond-account_invoice_consecutive.git
synced 2023-12-13 20:50:10 +01:00
Replace self to invoice from >4.8 in date control when amount is round 0
From changeset-a67397bf91c1
This commit is contained in:
parent
0727f139fe
commit
5796336dce
1 changed files with 8 additions and 8 deletions
16
invoice.py
16
invoice.py
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue