If your date of creation of the batch is same as manufacturing date then you can just add a naming series for it. DD is available in the naming series for current day.
Test it out separately, maybe this is better solution than custom scripts.
First, apply a custom/client script.
When you select manufacturing_date then batch_date update in YYMMDD format.
frappe.ui.form.on('Batch', {
manufacturing_date(frm) {
var ymd = frm.doc.manufacturing_date;
var yy = ymd.substring(2,4);
var mm = ymd.substring(5,7);
var dd = ymd.substring(8,10);
frm.set_value('batch_date',yy+''+mm+''+dd);
}
});
Your script work well, but the field “Batch Date” only update when the field “Manufacturing Date” is updated manually and it seems to not work with automatic batch creation :