[16.0][REF] sale_quotation: refactor the quotation mechanism. - #1594
Closed
nicolas-delbovier-acsone wants to merge 3 commits into
Closed
[16.0][REF] sale_quotation: refactor the quotation mechanism.#1594nicolas-delbovier-acsone wants to merge 3 commits into
nicolas-delbovier-acsone wants to merge 3 commits into
Conversation
* Extracts the shop_order_mode of products in a new module * Enables to choose a combined shop order mode (quotation or direct sale) * Adds a migration script to translate the products and templates order mode infos from the old to the new fields
nicolas-delbovier-acsone
marked this pull request as draft
May 16, 2025 14:56
lmignon
approved these changes
May 28, 2025
lmignon
marked this pull request as ready for review
May 28, 2025 12:20
sebastienbeau
requested changes
Jun 2, 2025
|
|
||
| # if product order mode goes from unabled to disabled on variants, put back all variants | ||
| # to the value of the template | ||
| @api.model |
Contributor
There was a problem hiding this comment.
Instead of hacking the write, we could add this field in the dependency of the compute on the variant and set the value of the template on the variante ?
Comment on lines
+27
to
+33
| @api.depends("product_tmpl_id.shop_order_mode") | ||
| def _compute_shop_order_mode(self): | ||
| for product in self: | ||
| if product.product_tmpl_id: | ||
| product.shop_order_mode = product.product_tmpl_id.shop_order_mode | ||
| else: | ||
| product.shop_order_mode = False |
Contributor
There was a problem hiding this comment.
With this you should not need to hack the write anymore
Suggested change
| @api.depends("product_tmpl_id.shop_order_mode") | |
| def _compute_shop_order_mode(self): | |
| for product in self: | |
| if product.product_tmpl_id: | |
| product.shop_order_mode = product.product_tmpl_id.shop_order_mode | |
| else: | |
| product.shop_order_mode = False | |
| @api.depends( | |
| "product_tmpl_id.shop_order_mode", | |
| "product_tmpl_id.is_shop_order_mode_unabled_on_variant" | |
| ) | |
| def _compute_shop_order_mode(self): | |
| for product in self: | |
| if product.product_tmpl_id: | |
| if product_tmpl_id.is_shop_order_mode_unabled_on_variant: | |
| product.shop_order_mode = product.product_tmpl_id.shop_order_mode | |
| else: | |
| product.shop_order_mode = False |
Collaborator
|
included into #1597 |
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.
Following up on the work in #1573 and addressing feedback from @lmignon, this PR: