From 2b9e256002a5148ea9d4424bf786c7c48fab5d0c Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Mon, 26 Aug 2019 10:05:01 +0530 Subject: [PATCH] fix: Rename method name --- erpnext/manufacturing/doctype/work_order/work_order.js | 4 ---- erpnext/selling/doctype/sales_order/sales_order.js | 6 +++--- erpnext/selling/doctype/sales_order/sales_order.py | 2 +- erpnext/stock/doctype/pick_list/pick_list.js | 2 +- erpnext/stock/doctype/pick_list/test_pick_list.py | 2 -- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/erpnext/manufacturing/doctype/work_order/work_order.js b/erpnext/manufacturing/doctype/work_order/work_order.js index c1f64ed0da..ce66c8fd15 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.js +++ b/erpnext/manufacturing/doctype/work_order/work_order.js @@ -264,10 +264,6 @@ frappe.ui.form.on("Work Order", { }); }, - make_pick_list() { - - }, - show_progress: function(frm) { var bars = []; var message = ''; diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 194971026d..6ffc6162d6 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -110,7 +110,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( let allow_delivery = false; if (doc.docstatus==1) { - this.frm.add_custom_button(__('Pick List'), () => this.make_pick_list(), __('Create')); + this.frm.add_custom_button(__('Pick List'), () => this.create_pick_list(), __('Create')); if(this.frm.has_perm("submit")) { if(doc.status === 'On Hold') { @@ -235,9 +235,9 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( this.order_type(doc); }, - make_pick_list() { + create_pick_list() { frappe.model.open_mapped_doc({ - method: "erpnext.selling.doctype.sales_order.sales_order.make_pick_list", + method: "erpnext.selling.doctype.sales_order.sales_order.create_pick_list", frm: this.frm }) }, diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 426b00484c..a063061107 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -1002,7 +1002,7 @@ def make_inter_company_purchase_order(source_name, target_doc=None): return make_inter_company_transaction("Sales Order", source_name, target_doc) @frappe.whitelist() -def make_pick_list(source_name, target_doc=None): +def create_pick_list(source_name, target_doc=None): def update_item_quantity(source, target, source_parent): target.qty = flt(source.qty) - flt(source.delivered_qty) target.stock_qty = (flt(source.qty) - flt(source.delivered_qty)) * flt(source.conversion_factor) diff --git a/erpnext/stock/doctype/pick_list/pick_list.js b/erpnext/stock/doctype/pick_list/pick_list.js index a0082b859c..0a78faeb2b 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.js +++ b/erpnext/stock/doctype/pick_list/pick_list.js @@ -118,7 +118,7 @@ frappe.ui.form.on('Pick List', { return; } erpnext.utils.map_current_doc({ - method: 'erpnext.selling.doctype.sales_order.sales_order.make_pick_list', + method: 'erpnext.selling.doctype.sales_order.sales_order.create_pick_list', source_doctype: 'Sales Order', target: frm, setters: { diff --git a/erpnext/stock/doctype/pick_list/test_pick_list.py b/erpnext/stock/doctype/pick_list/test_pick_list.py index df42ff1256..96b770d1de 100644 --- a/erpnext/stock/doctype/pick_list/test_pick_list.py +++ b/erpnext/stock/doctype/pick_list/test_pick_list.py @@ -7,8 +7,6 @@ import frappe import unittest # test_dependencies = ['Item', 'Sales Invoice', 'Stock Entry', 'Batch'] -from erpnext.selling.doctype.sales_order.sales_order import make_pick_list - class TestPickList(unittest.TestCase): def test_pick_list_picks_warehouse_for_each_item(self): pick_list = frappe.get_doc({