Skip to content
Snippets Groups Projects
Commit a72bb463 authored by Jinjiu Liu's avatar Jinjiu Liu
Browse files

[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: default avatarNicolas Lempereur (nle) <nle@odoo.com>
parent 27ab2421
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment