mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[IMP] - Chronology check depends on invoice type if journal is set to Dedicated Credit Note Sequence
This commit is contained in:
committed by
Zina Rasoamanana
parent
f0ee046b14
commit
c38dfc37e9
@@ -13,7 +13,7 @@ class AccountInvoice(models.Model):
|
||||
|
||||
@api.model
|
||||
def _prepare_previous_invoices_domain(self, invoice):
|
||||
return [
|
||||
domain = [
|
||||
('state', 'not in', ['open',
|
||||
'paid',
|
||||
'cancel',
|
||||
@@ -24,14 +24,26 @@ class AccountInvoice(models.Model):
|
||||
('date_invoice', '<', invoice.date_invoice),
|
||||
('journal_id', '=', invoice.journal_id.id),
|
||||
]
|
||||
if (
|
||||
invoice.journal_id.refund_sequence
|
||||
and invoice.journal_id.sequence_id != invoice.journal_id.refund_sequence_id
|
||||
):
|
||||
domain.append(('type', '=', invoice.type))
|
||||
return domain
|
||||
|
||||
@api.model
|
||||
def _prepare_later_invoices_domain(self, invoice):
|
||||
return [
|
||||
domain = [
|
||||
('state', 'in', ['open', 'in_payment', 'paid']),
|
||||
('date_invoice', '>', invoice.date_invoice),
|
||||
('journal_id', '=', invoice.journal_id.id),
|
||||
]
|
||||
if (
|
||||
invoice.journal_id.refund_sequence
|
||||
and invoice.journal_id.sequence_id != invoice.journal_id.refund_sequence_id
|
||||
):
|
||||
domain.append(('type', '=', invoice.type))
|
||||
return domain
|
||||
|
||||
@api.multi
|
||||
def action_move_create(self):
|
||||
|
||||
Reference in New Issue
Block a user