odoo/odoo#178433

Created by fw-bot
Merged at f60c0935019dbfb276aaf610280f3db22ebee2ba

Statuses:

Linked pull requests
label
odoo-dev:master-16.0-opw-3993305-credit_note_document_ecuador-yosa-F9gl-fw
head
933ad30c57cad41971996044df66b3621e55a1b2
merged
7 months ago by Bugfix, Yolann Sabaux (yosa)
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

[FW][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

Forward-Port-Of: #178315
Forward-Port-Of: #174950