Skip to content
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

[FIX] product_variant_configurator: returning domains in onchange doesn't work anymore #337

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

jdoutreloux
Copy link

No description provided.

@jdoutreloux jdoutreloux force-pushed the 16.0-can_t_return_domain_in_onchange branch from f6dbc01 to 364269d Compare March 7, 2024 12:08
Copy link
Contributor

@ThomasBinsfeld ThomasBinsfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix pre-commit

for rec in self:
if not rec.product_tmpl_id._origin:
# no product template: allow any product
rec.product_id_configurator_domain = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rec.product_id_configurator_domain = []
rec.product_id_configurator_domain = TRUE_DOMAIN

from odoo.osv.expression

# no product template: allow any product
rec.product_id_configurator_domain = []
else:
domain, cont = product_obj._build_attributes_domain(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
domain, cont = product_obj._build_attributes_domain(
domain, _cont = product_obj._build_attributes_domain(

Prefix unused variable with _

product = self.product_product.new(
{"name": "Test product", "product_tmpl_id": self.product_template_yes.id}
)
product.product_tmpl_id = self.product_template_empty_yes
res = product._onchange_product_tmpl_id_configurator()
# res = product._onchange_product_tmpl_id_configurator()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove or restore commented code.

@jdoutreloux jdoutreloux force-pushed the 16.0-can_t_return_domain_in_onchange branch from 364269d to f3b4572 Compare March 7, 2024 12:35
@jdoutreloux jdoutreloux marked this pull request as ready for review March 7, 2024 14:48
jdoutreloux added a commit to acsone/product-variant that referenced this pull request Mar 7, 2024
@jdoutreloux jdoutreloux force-pushed the 16.0-can_t_return_domain_in_onchange branch from f3b4572 to f0826c6 Compare March 7, 2024 15:38
@jdoutreloux jdoutreloux force-pushed the 16.0-can_t_return_domain_in_onchange branch from f0826c6 to c0cb2a2 Compare March 7, 2024 16:19
@pedrobaeza pedrobaeza added this to the 16.0 milestone Apr 2, 2024
@pedrobaeza
Copy link
Member

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-337-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit cc4bdbb into OCA:16.0 Apr 2, 2024
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 329134e. Thanks a lot for contributing to OCA. ❤️

@ThomasBinsfeld ThomasBinsfeld deleted the 16.0-can_t_return_domain_in_onchange branch April 8, 2024 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants