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

[14.0] [ADD] product_attribute_variant_rules #1435

Merged

Conversation

paradoxxxzero
Copy link

This module adds a more powerful way to describe your product attributes combinations than the default exclusions.

20231019_16h11m53s_grim

It allows to write rules like:

  • All products with blue or green color in XL size will appear only with a V neck collar
    and a short sleeve.
  • All L size products will never appear with a sailor collar.

The rules are split between a precondition a type and a postcondition.

Different attributes are ANDed and same attributes are ORed.

For instance the rule::

All products with blue or green color in XL size will appear only with a V neck collar and a short sleeve.

Will be written as

Precondition: (color: blue), (color: green), (size: XL)
Type: Only With
Postcondition: (collar: V neck), (sleeve: short)

@paradoxxxzero paradoxxxzero force-pushed the 14.0-add-product_attribute_variant_rules branch from 667ba08 to ef7040a Compare October 20, 2023 08:51
@paradoxxxzero paradoxxxzero force-pushed the 14.0-add-product_attribute_variant_rules branch from ef7040a to c91d340 Compare October 20, 2023 11:27
@sebastienbeau sebastienbeau marked this pull request as ready for review October 20, 2023 13:53
@sebastienbeau
Copy link
Member

I have rename type into rule_type (I had a issue with product_profile) and type is already a python keyword

@paradoxxxzero
Copy link
Author

I have rename type into rule_type (I had a issue with product_profile) and type is already a python keyword

That shouldn't be much of a problem except if you want to use original python type function in the class declaration scope, a lot of odoo modules have type as a field (product.template for instance). Care to share what was the issue?

@sebastienbeau
Copy link
Member

The issue is related to a bug in product_profile (not so easy to fix). The module was adding a invisible condition in the field "type" (it should not do it). So the quick fix is to rename the field, and as "type" is a python keyword, it make sense to rename it.

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 Feb 25, 2024
Copy link
Member

@sebastienbeau sebastienbeau left a comment

Choose a reason for hiding this comment

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

LGTM (code review + test) used in production

@sebastienbeau
Copy link
Member

@Kev-Roche can you review ?

@sebastienbeau sebastienbeau added needs review and removed stale PR/Issue without recent activity, it'll be soon closed automatically. labels Mar 28, 2024
@sebastienbeau
Copy link
Member

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 14.0-ocabot-merge-pr-1435-by-sebastienbeau-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit fee2171 into OCA:14.0 Jun 13, 2024
6 checks passed
@OCA-git-bot
Copy link
Contributor

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

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.

4 participants