Item Variant procedure

Hi all,
When I create Item variants by “Make → Multiple Variants” button, all the filed that I need in the variant configure in “Item Variant Settings” form. All its work fine here.

Then I open each Variant and update the Barcode field with the Item Code (just copy & paste). Where I modify the code so that the Item Code will copy in the Barcode field during creation of Variants?


I try the below custom script, but no luck:


Hi, is your field name barcode?
You have to give


Yes, this is standard Barcode field in Item DocType. kindly check my above first post for detail.

I think that code does not trigger when Multiple Variants button executed.


Can anybody guide me to find the code of MAKE → MULTIPLE VARIANTS button in ITEM doctype.


I have done that task by the below workaround:
In class Item(WebsiteGenerator) of file I insert code in def autoname(self):

self.barcode = self.item_code

I appreciate, if someone guides me a better way to do this task.