Is it possible to auto-fill a document from a different document?

Hello. I have a doctype called Automobile with fields like vehicle_manufacturer, vehicle_model etc. And I have added some records to it as well. Now I created a table in my customer doctype with link to the Automobile doctype. How do I get suggestion for vehicle_manufacturer that I have recorded before and I also need to fill the other fields in as well. Is this possible?

to modify a doctype from another doctype:

doc = frappe.get_doc('Quotation', quote_name)
doc.customer = 'Some Customer' #change any field
doc.set('items', []) #clear a table
doc.append('items', {item_code:'some item code', uom:'Units', ...}) #add item to the table
doc.flags.ignore_permissions = True
doc.save()

Iā€™m not sure I understand what you want to do with the suggestion part tho.

1 Like