From 7414b6b8505e90cf72d086fa06d25fdec0e6f1e2 Mon Sep 17 00:00:00 2001 From: Luis Torres Date: Thu, 19 Oct 2023 22:36:20 +0000 Subject: [PATCH] [FIX] l10n_pe: Fixed document type domain for not sale documents In the commit 355250d062fb8dde558d21ea861b9af578545fe0 was improved the domain, to filter based in the document type, but was not considered that only is for sales documents. On the vendor bills could be used more document types, now is fixed. closes odoo/odoo#139409 X-original-commit: e4a54d9a6988812e40b9054b8b5f4308d97cbff9 Signed-off-by: Josse Colpaert --- addons/l10n_pe/models/account_move.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/l10n_pe/models/account_move.py b/addons/l10n_pe/models/account_move.py index 458e885e761..54d54f69335 100644 --- a/addons/l10n_pe/models/account_move.py +++ b/addons/l10n_pe/models/account_move.py @@ -9,10 +9,9 @@ class AccountMove(models.Model): def _get_l10n_latam_documents_domain(self): self.ensure_one() result = super()._get_l10n_latam_documents_domain() - if self.company_id.country_id.code != "PE" or not self.journal_id.l10n_latam_use_documents: + if self.company_id.country_id.code != "PE" or not self.journal_id.l10n_latam_use_documents or self.journal_id.type != "sale": return result - if self.journal_id.type == "sale": - result.append(("code", "in", ("01", "03", "07", "08", "20", "40"))) + result.append(("code", "in", ("01", "03", "07", "08", "20", "40"))) if self.partner_id.l10n_latam_identification_type_id.l10n_pe_vat_code != '6': result.append(('id', 'in', (self.env.ref('l10n_pe.document_type08b') | self.env.ref('l10n_pe.document_type02') | self.env.ref('l10n_pe.document_type07b')).ids)) return result