Barcode Field Issue:/barcode.js

When I set Barcode no in Barcode field by code.then Barcode bar not printing on Print format.when i put barcode no manully in barcode field then it print in print format.
Barcode js is not calling when i set by code.how can i reslove this issue.how to call js in python or any other solution?