I’m creating an employee from Employee visa process doctype and sending all the values to Employee doctype, i want to send attached files to Employee doctype.
Inserting values to Employee doctype:
emp = frappe.get_doc({“doctype”: “Employee”,
“employee_name”: self.employee_name,
“salary”: self.salary,
“passport_number”: self.passport_number,
“gender”: self.gender,
“offer_date”: self.offer_letter_date,
“nationality”: self.nationality,
“date_of_birth”: self.date_of_birth,
“date_of_joining”: self.date_of_joining,
“payroll_period”:self.payroll_period,
“scheduled_confirmation_date”: self.offer_letter_date,
“nationality”: self.nationality,
“shift”: self.shift}).insert()
Inserting attached files:
In Employee doctype there is a table named Employee documents, attachments will be added in employee documents table.
Sample code, how i thought it should be done but its not working.
attach = frappe.get_doc({“doctype”: “Employee Documents”,
“attachment”: self.offer_letter_attachment}).update()