From 95a983eaf471f476c4e66304e0c78a5a4f235cbf Mon Sep 17 00:00:00 2001 From: docker-odoo Date: Fri, 10 May 2024 17:21:28 +0000 Subject: [PATCH] [FIX] l10n_ar_ux: Recompute the commercial partner for edit de contact form in portal Ticekt: 73707 --- l10n_ar_ux/__manifest__.py | 2 +- l10n_ar_ux/controllers/portal.py | 15 ++++++++++++++- l10n_ar_ux/views/portal_templates.xml | 10 +++++----- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/l10n_ar_ux/__manifest__.py b/l10n_ar_ux/__manifest__.py index 8711eb7b4..fcc569e49 100644 --- a/l10n_ar_ux/__manifest__.py +++ b/l10n_ar_ux/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Argentinian Accounting UX', - 'version': "16.0.1.11.0", + 'version': "16.0.1.12.0", 'category': 'Localization/Argentina', 'sequence': 14, 'author': 'ADHOC SA', diff --git a/l10n_ar_ux/controllers/portal.py b/l10n_ar_ux/controllers/portal.py index 1a0038bfd..aa69231e6 100644 --- a/l10n_ar_ux/controllers/portal.py +++ b/l10n_ar_ux/controllers/portal.py @@ -48,8 +48,21 @@ def account(self, redirect=None, **post): uid = request.session.uid partner = request.env['res.users'].browse(uid).partner_id if uid else request.env['res.partner'] partner = partner.with_context(show_address=1).sudo() + #recomputamos el commercial partner porque al editar el fomrulario perdemos ese dato + partner._compute_commercial_partner() + #Al guardar por primera vez los datos del contacto, se pierden la responsabilidad y el tipo de identificacion + if not partner.l10n_ar_afip_responsibility_type_id and post.get('l10n_ar_afip_responsibility_type_id'): + resp = int(post.get('l10n_ar_afip_responsibility_type_id')) + partner.l10n_ar_afip_responsibility_type_id = request.env['l10n_ar.afip.responsibility.type'].browse(resp) + if not partner.l10n_latam_identification_type_id and post.get('l10n_latam_identification_type_id'): + ident = int(post.get('l10n_latam_identification_type_id')) + partner.l10n_latam_identification_type_id = request.env['l10n_latam.identification.type'].browse(ident) + response.qcontext.update({ + 'responsibility_type': partner.l10n_ar_afip_responsibility_type_id.id or False, + 'identification_type': partner.l10n_latam_identification_type_id.id or False, 'identification_types': identification_types, 'afip_responsibilities': afip_responsibilities, - 'partner': partner}) + 'partner': partner, + 'partner_can_edit_vat': partner.can_edit_vat()}) return response diff --git a/l10n_ar_ux/views/portal_templates.xml b/l10n_ar_ux/views/portal_templates.xml index b9c52b57a..89ea16645 100644 --- a/l10n_ar_ux/views/portal_templates.xml +++ b/l10n_ar_ux/views/portal_templates.xml @@ -19,7 +19,7 @@ - +

@@ -27,7 +27,7 @@ +

- +

@@ -53,7 +53,7 @@