AttributeError: 'str' object has no attribute 'company'

i try to pass the data to this method and i get this error
image
this is my code


this the first code of it
Uncaught TypeError: erpnext.utils.make_payment_voucher is not a function

@manal_erpnext add this

import json
doc=json.loads(doc)
pv.company=doc.company

thx @Jeel
this code worked with me

data = json.loads(doc)
pv.company = data.get('company')
2 Likes