-
- Downloads
[FIX] product: archiving last variant must archive product template
Behavior prior to this fix: When archiving the last variant on a template, the product template stays active (contrary to the comment indicating that `toggle_active` will archive the related product.template if there is only one active `product.product`). Behavior after the fix: When archiving the last variant on a template, the product template is archived. When un-archiving that variant, the product template is unarchived as well, without un-archiving the other variants. Note: this is a remake of a fix implemented in 77e5472c, as that fix did not correctly count the inactive variants. opw-2349862 closes odoo/odoo#60635 X-original-commit: 01160ee5 Signed-off-by:Nicolas Galler <nicocrm@users.noreply.github.com>
Showing
- addons/product/models/product.py 11 additions, 5 deletionsaddons/product/models/product.py
- addons/product/models/product_template.py 1 addition, 1 deletionaddons/product/models/product_template.py
- addons/product/tests/test_variants.py 25 additions, 0 deletionsaddons/product/tests/test_variants.py
Please register or sign in to comment