From 300ae0cdf4444129f789a4b45cb4037e890951d5 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 30 Sep 2013 17:57:22 +0530 Subject: [PATCH] [fix] [minor] dont call is_pos trigger in onload of pos invoice --- accounts/doctype/sales_invoice/sales_invoice.js | 6 ++++-- accounts/doctype/sales_invoice/sales_invoice.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/accounts/doctype/sales_invoice/sales_invoice.js b/accounts/doctype/sales_invoice/sales_invoice.js index 6639e65e6c..4f8dda8fbe 100644 --- a/accounts/doctype/sales_invoice/sales_invoice.js +++ b/accounts/doctype/sales_invoice/sales_invoice.js @@ -29,8 +29,10 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte // toggle to pos view if is_pos is 1 in user_defaults if ((cint(wn.defaults.get_user_defaults("is_pos"))===1 || cur_frm.doc.is_pos) && cint(wn.defaults.get_user_defaults("fs_pos_view"))===1) { - this.frm.set_value("is_pos", 1); - this.is_pos(); + if(this.frm.doc.__islocal) { + this.frm.set_value("is_pos", 1); + this.is_pos(); + } cur_frm.cscript.toggle_pos(true); } diff --git a/accounts/doctype/sales_invoice/sales_invoice.py b/accounts/doctype/sales_invoice/sales_invoice.py index 12deed73a8..2eb9ae84cb 100644 --- a/accounts/doctype/sales_invoice/sales_invoice.py +++ b/accounts/doctype/sales_invoice/sales_invoice.py @@ -195,7 +195,7 @@ class DocType(SellingController): pos = get_pos_settings(self.doc.company) if pos: - if not for_validate: + if not for_validate and not self.doc.customer: self.doc.customer = pos.customer self.set_customer_defaults()