fix: pass ignore_mandatory flags

This commit is contained in:
Rucha Mahabal 2020-04-08 10:04:10 +05:30
parent b95a794e51
commit 8844e95667
2 changed files with 4 additions and 2 deletions

View File

@ -134,7 +134,8 @@ def invoice_appointment(appointment_doc):
payment.amount = appointment_doc.paid_amount
sales_invoice.set_missing_values(for_validate=True)
sales_invoice.save(ignore_permissions=True, ignore_mandatory=True)
sales_invoice.flags.ignore_mandatory = True
sales_invoice.save(ignore_permissions=True)
sales_invoice.submit()
frappe.msgprint(_('Sales Invoice {0} created as paid'.format(sales_invoice.name)), alert=True)
frappe.db.set_value('Patient Appointment', appointment_doc.name, 'invoiced', 1)

View File

@ -25,7 +25,8 @@ def insert_vital_signs_to_medical_record(doc):
medical_record.reference_doctype = 'Vital Signs'
medical_record.reference_name = doc.name
medical_record.reference_owner = doc.owner
medical_record.save(ignore_permissions=True, ignore_mandatory=True)
medical_record.flags.ignore_mandatory = True
medical_record.save(ignore_permissions=True)
def delete_vital_signs_from_medical_record(doc):
medical_record = frappe.db.get_value('Patient Medical Record', {'reference_name': doc.name})