Skip to content

Commit

Permalink
create variant with default_code
Browse files Browse the repository at this point in the history
this is useful when adding new variant, so new product will be created with default_code from template
  • Loading branch information
scigghia committed Feb 23, 2017
1 parent a6c2210 commit 0c509e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion addons/product/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,8 @@ def create_variant_ids(self, cr, uid, ids, context=None):
for variant_ids in all_variants:
values = {
'product_tmpl_id': tmpl_id.id,
'attribute_value_ids': [(6, 0, variant_ids)]
'attribute_value_ids': [(6, 0, variant_ids)],
'default_code': tmpl_id.default_code,
}
id = product_obj.create(cr, uid, values, context=ctx)
variants_active_ids.append(id)
Expand Down

0 comments on commit 0c509e2

Please sign in to comment.