Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.9k views
in Technique[技术] by (71.8m points)

setting child table values in frappe.route_options() [ERPNext]

Now we added a custom button in sales order which will create anew 'job order" and copy some fields from sales order into our new 'job order' we wrote this custom script to copy fields but couldn't copy items from sales order into 'job order item' how to work around that?

frappe.ui.form.on('Sales Order', {
refresh: function(frm) {
    if (frm.doc.docstatus==1) {

      if(cur_frm.has_perm("submit")) {
          frm.add_custom_button(__('Job Order'), function() {
               frappe.route_options = {
            customer: cur_frm.doc.customer,
            sales_order: cur_frm.doc.name,
            'customer_address':frm.doc.customer_address,
          'contact_mobile':frm.doc.contact_mobile,
          'contact_person':frm.doc.contact_person,
          job_order_item:frm.doc.items
          
          };
          frappe.set_route('Form', 'Job Order', 'New Job Order');
        }, __('Create'));
   // }
        }}}})

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...