diff options
| author | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2020-07-02 10:54:43 +0000 |
|---|---|---|
| committer | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2020-07-02 13:03:08 +0000 |
| commit | a100c4c33600bf2451eebeeef328e39cd452553f (patch) | |
| tree | a4b69d556cc993139c9251f82d6580a30b60b8f1 /addons/l10n_cl | |
| parent | 2761a2a12756dcc84ebb00d3ad5db05917d30ea0 (diff) | |
[FIX] l10n_cl: Correct document type domain
Create an invoice, fill document type
"(61) Nota de Crédito Electrònica". Save.
Action will be blocked by a warning: document type is invalid.
Some options in the document type should not be shown as they can not be
used in the customer invoices and customer credit note.
opw-2286623
closes odoo/odoo#53987
X-original-commit: 3b9738a394c4944b0c859f68f561e50d14b92942
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/l10n_cl')
| -rw-r--r-- | addons/l10n_cl/models/account_move.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/l10n_cl/models/account_move.py b/addons/l10n_cl/models/account_move.py index 249e155fca7..152d48e272e 100644 --- a/addons/l10n_cl/models/account_move.py +++ b/addons/l10n_cl/models/account_move.py @@ -2,6 +2,7 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.exceptions import ValidationError from odoo import models, fields, api, _ +from odoo.osv import expression class AccountMove(models.Model): @@ -37,7 +38,7 @@ class AccountMove(models.Model): 'base.cl') or self.partner_id.l10n_cl_sii_taxpayer_type == '4': partner_domain += [('code', 'in', [])] document_type_ids = self.env['l10n_latam.document.type'].search(partner_domain).ids - domain = [('id', 'in', document_type_ids)] + domain = expression.AND([domain, [('id', 'in', document_type_ids)]]) return domain def _check_document_types_post(self): |
