OCA / product-configurator

Advanced Product Configurator (from the original Pledra project https://github.com/pledra/odoo-product-configurator)
GNU Affero General Public License v3.0
33 stars 78 forks source link

[14.0][ADD] product_configurator_restriction_policy #41

Closed patrickrwilson closed 3 years ago

patrickrwilson commented 3 years ago

This adds an optional way to process the restrictions.

patrickrwilson commented 3 years ago

@dreispt pre-commit is complaining that the method is too complex. I've simplified it but still doesn't like it. I'm not sure why, ideas?

product_configurator_restriction_policy/models/product_config.py:11:5: C901 'ProductConfigSession.values_available' is too complex (17)

dreispt commented 3 years ago

The strategy I would use is to break parts of the big function into smaller helper functions.

dreispt commented 3 years ago

Usually, when you feel the urge to add a code comment, that's often a code smell indication that you could extract the following code into its own function.

patrickrwilson commented 3 years ago

@bizzappdev @dreispt ready for your review. Thank you both for your help.

bizzappdev commented 3 years ago

Code LGTM. some love to test cases will be really great.

patrickrwilson commented 3 years ago

Code LGTM. some love to test cases will be really great.

Yeah, we need to work on test cases for all of these, including the core ones which is coming later.

dreispt commented 3 years ago

Ping @patrickrwilson

dreispt commented 3 years ago

/ocabot merge nobump

OCA-git-bot commented 3 years ago

Hey, thanks for contributing! Proceeding to merge this for you. Prepared branch 14.0-ocabot-merge-pr-41-by-dreispt-bump-nobump, awaiting test results.

OCA-git-bot commented 3 years ago

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