i am using following code to call two function but always only second function calls.
in this code customally.customally.sales_order_custom.calculate_total_weight
is calling only
doc_events = { "Sales Order": { "validate":"customally.customally.sales_order_custom.instructions", "validate":"customally.customally.sales_order_custom.calculate_total_weight" } }
There are the functions.
`def calculate_total_weight(doc,method):
import frappe
frappe.errprint("calculate works")
from frappe.utils import flt
total_weight=0.0;
for d in doc.items:
d.weight =flt(d.weight_per_unit2) * (d.qty)
total_weight += d.weight
doc.total_weight=total_weight
def instructions(doc,method):
import frappe
frappe.errprint(“instructions works”)
doc.instructions2 =“
This is a text instrucntions”`