Skip to content

Commit

Permalink
[FIX] l10n_ar_ux: Recompute the commercial partner for edit de contac…
Browse files Browse the repository at this point in the history
…t form in portal

Ticekt: 73707
  • Loading branch information
mem-adhoc committed May 28, 2024
1 parent 86c5560 commit 05f00ea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion l10n_ar_ux/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
5 changes: 4 additions & 1 deletion l10n_ar_ux/controllers/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ 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()
response.qcontext.update({
'identification_types': identification_types,
'afip_responsibilities': afip_responsibilities,
'partner': partner})
'partner': partner,
'partner_can_edit_vat': partner.can_edit_vat()})
return response
6 changes: 3 additions & 3 deletions l10n_ar_ux/views/portal_templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<label class="control-label" for="l10n_latam_identification_type_id">Document Type</label>
<input name="commercial_partner_id" class="form-control" t-att-value="partner.commercial_partner_id.id" type='hidden'/>
<t t-set="document_type" t-value="partner.commercial_partner_id.l10n_latam_identification_type_id"/>
<t t-if="document_type">
<t t-if="not partner_can_edit_vat">
<p class="form-control" t-out="document_type.name" readonly="1" title="Changing your document type is not allowed. Please contact us directly for this operation."/>
<input name="l10n_latam_identification_type_id" class="form-control" t-att-value="document_type.id" type='hidden'/>
</t>
Expand All @@ -38,14 +38,14 @@
<!-- Add document number -->
<div t-attf-class="form-group #{error.get('vat') and 'o_has_error' or ''} col-xl-6">
<label class="col-form-label" for="vat">Document Number</label>
<input type="text" name="vat" t-attf-class="form-control #{error.get('vat') and 'is-invalid' or ''}" t-att-value="partner.commercial_partner_id.vat or vat" t-att-readonly="'1' if partner.commercial_partner_id.vat else None" t-att-title="'Changing your document number is not allowed. Please contact us directly for this operation.' if partner.commercial_partner_id.vat else None"/>
<input type="text" name="vat" t-attf-class="form-control #{error.get('vat') and 'is-invalid' or ''}" t-att-value="partner.commercial_partner_id.vat or vat" t-att-readonly="'1' if not partner_can_edit_vat else None" t-att-title="'Changing your document number is not allowed. Please contact us directly for this operation.' if partner.commercial_partner_id.vat else None"/>
</div>

<!-- Add AFIP Responsibility -->
<div t-attf-class="form-group #{error.get('l10n_ar_afip_responsibility_type_id') and 'has-error' or ''} col-xl-6">
<label class="control-label" for="l10n_ar_afip_responsibility_type_id">AFIP Responsibility</label>
<t t-set="afip_responsibility" t-value="partner.commercial_partner_id.l10n_ar_afip_responsibility_type_id"/>
<t t-if="afip_responsibility">
<t t-if="not partner_can_edit_vat">
<p class="form-control" t-out="afip_responsibility.name" readonly="1" title="Changing your document type is not allowed. Please contact us directly for this operation."/>
<input name="l10n_ar_afip_responsibility_type_id" class="form-control" t-att-value="afip_responsibility.id" type='hidden'/>
</t>
Expand Down

0 comments on commit 05f00ea

Please sign in to comment.