-
- Downloads
[FIX] product: a temporal variant copy for future convenience
Reproduction: 1. Create a dynamic attribute "dyn_att" with a couple of values 2. Create a product template "dyn_prod" with those attribute values 3. Create an order for "dyn_prod", this will trigger creating a variant 4. Make sure to check Variant Grid Entry in Sales Settings 5. Open variant form view of dyn_prod and edit it to allow duplication 6. Duplicating it leads to an error Reason: copying the variant is not possible and disabled here: https://github.com/odoo/odoo/pull/38303 For future convenience, maybe it’s better to give a temporal working solution. The function _create_first_product_variant is used in the product module but only defined in its child module website_sale Fix: copy the product template, create and return its first possible variant. Added test for dynamic variant copy. change the definition place of _create_first_product_variant to module product opw-2790543 closes odoo/odoo#88075 Signed-off-by:Nicolas Lempereur (nle) <nle@odoo.com>
Showing
- addons/product/models/product.py 6 additions, 1 deletionaddons/product/models/product.py
- addons/product/models/product_template.py 12 additions, 0 deletionsaddons/product/models/product_template.py
- addons/product/tests/test_variants.py 25 additions, 0 deletionsaddons/product/tests/test_variants.py
- addons/website_sale/models/product.py 0 additions, 12 deletionsaddons/website_sale/models/product.py
Loading
Please register or sign in to comment