odoo/odoo#174950

Created by Bugfix, Yolann Sabaux (yosa)
Merged at 240cc9b7b523c3a284a0115a734b74f612316397

Statuses:

Linked pull requests
label
odoo-dev:16.0-opw-3993305-credit_note_document_ecuador-yosa
head
b4c011e9fa867b8bd5659b6dbffe6e5c3a84446e
merged
1 year ago by Accounting, Antoine Dupuis (andu)
odoo/odoo odoo/enterprise
16.0 #174950 #67589
17.0 #177597 #68775
saas-17.1 #177954 #68940
saas-17.2 #177974 #68949
saas-17.4 #178315 #69117
18.0 #181450 #70673
saas-18.1 #191668 #76129
saas-18.2 #197975 #79484
saas-18.3
saas-18.4
19.0
master #178433 #69158

[FIX] l10n_latam_invoice_document: prevent blocking foreign document …

…number

Steps to reproduce:
[l10n_ec]
- Create a credit note from the Bill journal
- Set a foreign customer
- Set a customized document number

Issue:
An error will be raised saying that the format is not correct

But, as defined by VBE, "If a Credit Note is created from a Vendor Bill and the partner_id != "EC", [we should] allow the user to allocate any number without following the EC format."

Solution:
When we call _format_document_number we don't have any information about the initial move. Instead of using a context or adding new fields, we add a hook in which we can specify certain conditions to bypass the document check/formatting for localisations.

opw-3993305