8000 Prevent domain field evaluation from failing when: (1) the domain is … by joao-jeronimo · Pull Request #2316 · OCA/web · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Prevent domain field evaluation from failing when: (1) the domain is … #2316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 13.0
Choose a base branch
from

Conversation

joao-jeronimo
Copy link
@joao-jeronimo joao-jeronimo commented Oct 11, 2022

I have some code like this:

# In Python:
class AccountPaymentOrder(models.Model):
    _inherit = "account.payment.order"
    json_allowed_journals_domain = fields.Char(related="payment_mode_id.json_allowed_journals_domain")
<!-- In XML: -->
<xpath expr="//field[@name='journal_id']" position="attributes">
    <attribute name="domain">json_allowed_journals_domain</attribute>
</xpath>

And form loading was failing when creating a new record, because the field payment_mode_id was not yet set.

This pull request fixes this:
Prevent domain field evaluation from failing when: (1) the domain is given
by a related field and (2) the path to the target field is not yet
traversable. In this cases, reading the field from javascript code will
yield false. This fix makes the frontend assume a "[]" domain whenever the
field refered to in domain="" attribute contains a false value.

…given

by a related field and (2) the path to the target field is not yet
traversable. In this cases, reading the field from javascript code will
yield false. This fix makes the frontend assume a "[]" domain whenever the
field refered to in domain="" attribute contains a false value.
@oca-clabot
Copy link

Hey @joao-jeronimo, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: https://odoo-community.org/page/cla
Here is a list of the users:

Appreciation of efforts,
OCA CLAbot

Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jun 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0