Skip to Content
Menu
This question has been flagged
1 Reply
1507 Views

Hi,
Anyone know how Can I copy the product with following steps:
In Action there is option called "Roll Number" if I click on this wizard gets open, through wizard I will take default code by user and submit and with this default code new product should get generate with changes..

I am facing difficulty in getting product Id while submitting default code with wizard.

could anyone suggest something on this?

Avatar
Discard
Best Answer

Hi,

In the  wizard you can try to get the id of the product from the context like this,

product_id = self.env.context.get('active_id')


From the the above you will get the id of the product, then you can fetch the product using, self.env['product.product'].browse(product_id)


Thanks

Avatar
Discard
Author

Hello Niyas,

Thanks for the reply, I tried in this way but not worked. So I have changed flow.