New Batch from Purchase Receipt Item - Automatically set Supplier

When doing a Purchase Receipt Item, we create a new Batch from the Purchase Receipt Item Batch field lookup.

I’d like the Purchase Receipt Supplier to be automatically assigned to the new Batch.

I noticed there is already a field Supplier in the Batch doctype.

How could I enable this field, and automatically set its value from the Purchase Receipt Supplier when creating a new Batch ?

I tried Customize Form, then uncheck Read Only from the Batch.Supplier field, but it won’t allow me to save, giving error msg : You cannot unset ‘Read Only’ for field Supplier.

So instead, I tried to use a form custom script to enable the field like this:

I am not sure if this is a reliable solution because it will show the Supplier field only if it already have a value. So it won’t show the supplier field while in New mode.

I’m on frappecloud, so I can’t customize doctype js file directly.

Any help would be appreciated.

Thanks.