[FIX] l10n_ar_website_sale_ux: fix AR responsibility field hidden for new customers#461
Closed
JrAdhoc wants to merge 1 commit into
Closed
[FIX] l10n_ar_website_sale_ux: fix AR responsibility field hidden for new customers#461JrAdhoc wants to merge 1 commit into
JrAdhoc wants to merge 1 commit into
Conversation
… new customers - Replace t-if attribute (instead of adding to it) so res_company is not evaluated in QWeb context where it may be absent for some users. - Remove 'and responsibility' condition that hid the div when partner had no responsibility set, preventing new customers from filling a mandatory field and completing checkout. - Add a second xpath to guard responsibility.name in the read-only branch against a bool False value.
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the AR-specific responsibility section in the portal address form to avoid missing-context errors and to safely render when the partner has no responsibility set.
Changes:
- Replace
res_companyusage withrequest.env.companyin the AR billing block condition. - Guard
responsibility.namerendering to avoid failures whenresponsibilityis falsy. - Expand/clarify the intent via an updated XML comment.
zaoral
approved these changes
Jun 12, 2026
zaoral
left a comment
Contributor
There was a problem hiding this comment.
thank you for the PR @JrAdhoc!
@roboadhoc bump r+
roboadhoc
pushed a commit
that referenced
this pull request
Jun 12, 2026
… new customers - Replace t-if attribute (instead of adding to it) so res_company is not evaluated in QWeb context where it may be absent for some users. - Remove 'and responsibility' condition that hid the div when partner had no responsibility set, preventing new customers from filling a mandatory field and completing checkout. - Add a second xpath to guard responsibility.name in the read-only branch against a bool False value. closes #461 Signed-off-by: Katherine Zaoral - kz (#l10n) <kz@adhoc.com.ar>
roboadhoc
added a commit
that referenced
this pull request
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
When a new customer (no ARCA responsibility type set) reached the billing address step in the website checkout, the ARCA Responsibility field was hidden and could not be filled in. Since the field is mandatory for AR companies, the checkout would fail.
Root cause
PR #452 added
and responsibilityto the outert-ifcondition as a workaround for anAttributeError: 'bool' object has no attribute 'name'in a client's database. This condition hides the entire div when the partner has no responsibility set (empty recordset = falsy), creating a catch-22: the field is mandatory, but it's hidden so it can never be filled.Additionally, the
add/separatorapproach used in #452 keptres_company.country_id.code == 'AR'in the evaluated expression, which is the original variable that may not be available in QWeb context for all users (fixed correctly in #450 by switching torequest.env.company).Fix
Two changes in the same template:
Restore the
t-ifreplacement approach (as in [ADD] l10n_ar_website_sale_ux: add portal address templates for company checkout fix #450): set the attribute directly instead of appending, sores_companyis no longer evaluated and the div is visible for all billing forms in AR companies regardless of whether responsibility is already set.Guard
responsibility.namein the read-only branch: add a safe expressionresponsibility and responsibility.name or ''on thet-elseparagraph to handle cases whereresponsibilityis a boolFalseinstead of a recordset.Test plan