Hi everybody,
I'm trying to have the internal reference automatically set when creating new products.
Using automated actions, I used a python script that works just fine:
if not record.default_code:
seq = env['ir.sequence'].next_by_code('product.sequence')
record.write({'default_code' : seq})
The problem is that when creating variants for the product, that number is not passed to the variants. And as creating variants erases the reference of the main product, there isn't any reference anymore at all, nor for the main product, nor for the variants.
For now, I'd just like to have the reference number of the product copied to the variants when creating them.
How can it be?
Thanks
solved?