-
-
Notifications
You must be signed in to change notification settings - Fork 143
[DUMMY][IMP] product_pack,sale_product_pack: Allow modifiable non-detailed packs #236
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
Closed
Conversation
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
Contributor
|
Hi @pedrobaeza, |
…ntity for all components. In case you cancel the quantity for all components of the pack an error occurred, after this change we set the quantity delivery to zero.
Currently translated at 100.0% (1 of 1 strings) Translation: product-pack-18.0/product-pack-18.0-sale_stock_product_pack Translate-URL: https://translation.odoo-community.org/projects/product-pack-18-0/product-pack-18-0-sale_stock_product_pack/it/
…mo data for tests + simplification Demo data can make tests to fail in integration environments or locally modified ones, so let's remove them and use data created on the test itself. We also improve the containerization of the elements of the tests. In the same movement, we have simplified the code of the test for doing the same with less lines and in a clearer way, and change old maintainer.
Currently translated at 100.0% (1 of 1 strings) Translation: product-pack-12.0/product-pack-12.0-stock_product_pack Translate-URL: https://translation.odoo-community.org/projects/product-pack-12-0/product-pack-12-0-stock_product_pack/pt/
Currently translated at 100.0% (1 of 1 strings) Translation: product-pack-12.0/product-pack-12.0-stock_product_pack Translate-URL: https://translation.odoo-community.org/projects/product-pack-12-0/product-pack-12-0-stock_product_pack/fr/
…ines. It seems to me that it would be if a user has the maximum stock permission, can edit the lines of packs, as well as a maximum sales permission.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: product-pack-17.0/product-pack-17.0-sale_product_pack Translate-URL: https://translation.odoo-community.org/projects/product-pack-17-0/product-pack-17-0-sale_product_pack/
Adapt the module sale_product_pack to the price refactor
Resolves an issue in the "Update Prices" action for packs. When update the pricelist, ignore all the "cero" lines, this is the components of packs "Detailed: Totalized in main product" or "Detailed - Ignored". We only want to update component lines if the parent pack is "Detailed - Detailed per component". Also keep in the so line the component discount settled in the parent pack settings. Steps to replicate the bug: 1. In a Sale Order add a product "Detailed - Detailed per component" 2. Save to see all the pack components 3. Change the pricelist to one with discount 4. Call the button action "Update Prices". Before this commit The price of the parent product gets updated, but the component prices remain unchanged. Even if the same product is added again (while retaining the first instance), the component prices show discrepancies. Now, when a pricelist with discounts is applied, all line items in the Sale Order including both parent and component products are updated accordingly.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: product-pack-17.0/product-pack-17.0-sale_product_pack Translate-URL: https://translation.odoo-community.org/projects/product-pack-17-0/product-pack-17-0-sale_product_pack/
Currently translated at 100.0% (21 of 21 strings) Translation: product-pack-17.0/product-pack-17.0-sale_product_pack Translate-URL: https://translation.odoo-community.org/projects/product-pack-17-0/product-pack-17-0-sale_product_pack/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: product-pack-18.0/product-pack-18.0-sale_product_pack Translate-URL: https://translation.odoo-community.org/projects/product-pack-18-0/product-pack-18-0-sale_product_pack/
The discount formula for detailed packs has been updated to address inconsistencies when pricelists explicitly display discounts. The new formula ensures accurate representation of the combined discount by correctly factoring in both the parent pack and component discounts. Example: Parent pack discount: 5% Component A discount: 10% Component B discount: 20% The issue occurred when pricelists explicitly displayed discounts. For example, when the pricelist showed the discount percentage but did not properly calculate the combined effect of the pack discount and the component discounts, the displayed total was inconsistent. With the new formula: Component A effective discount: 100.0 - ((100.0 - 5.0) * (100.0 - 10.0) / 100.0) = 14.5% Component B effective discount: 100.0 - ((100.0 - 5.0) * (100.0 - 20.0) / 100.0) = 24.0% This ensures that when pricelists explicitly show discounts, the displayed percentage matches the calculated prices.
Currently translated at 100.0% (21 of 21 strings) Translation: product-pack-18.0/product-pack-18.0-sale_product_pack Translate-URL: https://translation.odoo-community.org/projects/product-pack-18-0/product-pack-18-0-sale_product_pack/it/
…mo data for tests + simplification Demo data can make tests to fail in integration environments or locally modified ones, so let's remove them and use data created on the test itself. We also improve the containerization of the elements of the tests. In the same movement, we have simplified the code of the test for doing the same with less lines and in a clearer way, and change old maintainer.
…acks This change extends the pack_modifiable functionality to work with non_detailed packs, allowing users to automatically expand packs into editable component lines. **Benefits:** - Minimal code changes to existing modules - No new models or complex intermediate structures needed - Users can mark a non_detailed pack as modifiable and it will automatically expand into editable detailed lines - Uses Odoo's native section collapsing (collapse_composition) to keep the interface clean and organized - Component lines can be edited individually (quantities, prices, discounts) **Use case:** When a user creates a pack with pack_type='non_detailed' and pack_modifiable=True, upon adding it to a sale order, it will automatically transform into a collapsible section with detailed lines that can be edited, providing flexibility while maintaining visual organization.
a60ee2c to
df23d49
Compare
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.
The original pr is: #234