Merge branch 'hotfix'
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index 2812fa7..c5d9971 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -4,7 +4,7 @@
import frappe
from erpnext.hooks import regional_overrides
-__version__ = '9.2.4'
+__version__ = '9.2.5'
def get_default_company(user=None):
'''Get default company for user'''
diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.json b/erpnext/accounts/doctype/pos_profile/pos_profile.json
index 187454e..8136c98 100644
--- a/erpnext/accounts/doctype/pos_profile/pos_profile.json
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile.json
@@ -3,7 +3,7 @@
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
- "autoname": "hash",
+ "autoname": "field:pos_profile_name",
"beta": 0,
"creation": "2013-05-24 12:15:51",
"custom": 0,
@@ -17,6 +17,96 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "default": "0",
+ "fieldname": "disabled",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Disabled",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_2",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "pos_profile_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "POS Profile Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "user",
"fieldtype": "Link",
"hidden": 0,
@@ -112,9 +202,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "update_stock",
- "fieldname": "warehouse",
- "fieldtype": "Link",
+ "fieldname": "ignore_pricing_rule",
+ "fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -122,13 +211,11 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Warehouse",
+ "label": "Ignore Pricing Rule",
"length": 0,
"no_copy": 0,
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -145,8 +232,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "campaign",
- "fieldtype": "Link",
+ "fieldname": "allow_delete",
+ "fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -154,10 +241,39 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Campaign",
+ "label": "Allow Delete",
"length": 0,
"no_copy": 0,
- "options": "Campaign",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "allow_user_to_edit_rate",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Allow user to edit Rate",
+ "length": 0,
+ "no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -300,7 +416,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "currency",
+ "depends_on": "update_stock",
+ "fieldname": "warehouse",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -309,19 +426,19 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Currency",
+ "label": "Warehouse",
"length": 0,
"no_copy": 0,
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 1,
+ "reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -332,8 +449,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "ignore_pricing_rule",
- "fieldtype": "Check",
+ "fieldname": "campaign",
+ "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -341,9 +458,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Ignore Pricing Rule",
+ "label": "Campaign",
"length": 0,
"no_copy": 0,
+ "options": "Campaign",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -362,66 +480,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "allow_delete",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Allow Delete",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "allow_user_to_edit_rate",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Allow user to edit Rate",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
+ "depends_on": "",
"fieldname": "section_break_11",
"fieldtype": "Section Break",
"hidden": 0,
@@ -482,6 +541,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "section_break_14",
"fieldtype": "Section Break",
"hidden": 0,
@@ -602,6 +662,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "section_break_16",
"fieldtype": "Section Break",
"hidden": 0,
@@ -882,6 +943,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "offline_pos_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1037,6 +1099,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "section_break_19",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1046,6 +1109,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
+ "label": "Accounting",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -1066,6 +1130,38 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Currency",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"depends_on": "",
"fieldname": "write_off_account",
"fieldtype": "Link",
@@ -1160,38 +1256,6 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "taxes_and_charges",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Taxes and Charges",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "charge",
- "oldfieldtype": "Link",
- "options": "Sales Taxes and Charges Template",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
"fieldname": "column_break_23",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1309,6 +1373,38 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Taxes and Charges",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "charge",
+ "oldfieldtype": "Link",
+ "options": "Sales Taxes and Charges Template",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
}
],
"has_web_view": 0,
@@ -1322,7 +1418,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-09-01 15:55:14.890452",
+ "modified": "2017-10-27 06:45:32.957674",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",
diff --git a/erpnext/accounts/doctype/pos_profile/test_pos_profile.py b/erpnext/accounts/doctype/pos_profile/test_pos_profile.py
index 803ee8e..1e43173 100644
--- a/erpnext/accounts/doctype/pos_profile/test_pos_profile.py
+++ b/erpnext/accounts/doctype/pos_profile/test_pos_profile.py
@@ -41,6 +41,7 @@
"expense_account": "_Test Account Cost for Goods Sold - _TC",
"income_account": "Sales - _TC",
"name": "_Test POS Profile",
+ "pos_profile_name": "_Test POS Profile",
"naming_series": "_T-POS Profile-",
"selling_price_list": "_Test Price List",
"territory": "_Test Territory",
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index 6856f62..36c2365 100644
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -92,6 +92,7 @@
doc.customer_group = pos_profile.get('customer_group') or get_root('Customer Group')
doc.territory = pos_profile.get('territory') or get_root('Territory')
doc.terms = frappe.db.get_value('Terms and Conditions', pos_profile.get('tc_name'), 'terms') or doc.terms or ''
+ doc.offline_pos_name = ''
def get_root(table):
root = frappe.db.sql(""" select name from `tab%(table)s` having
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 1c4fe3d..995a333 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -70,7 +70,6 @@
self.clear_unallocated_advances("Sales Invoice Advance", "advances")
self.add_remarks()
self.validate_write_off_account()
- self.validate_duplicate_offline_pos_entry()
self.validate_account_for_change_amount()
self.validate_fixed_asset()
self.set_income_account_for_fixed_assets()
@@ -305,6 +304,7 @@
self.account_for_change_amount = frappe.db.get_value('Company', self.company, 'default_cash_account')
if pos:
+ self.pos_profile = pos.name
if not for_validate and not self.customer:
self.customer = pos.customer
self.mode_of_payment = pos.mode_of_payment
@@ -463,12 +463,6 @@
if flt(self.write_off_amount) and not self.write_off_account:
msgprint(_("Please enter Write Off Account"), raise_exception=1)
- def validate_duplicate_offline_pos_entry(self):
- if self.is_pos and self.offline_pos_name \
- and frappe.db.get_value('Sales Invoice',
- {'offline_pos_name': self.offline_pos_name, 'docstatus': 1}):
- frappe.throw(_("Duplicate offline pos sales invoice {0}").format(self.offline_pos_name))
-
def validate_account_for_change_amount(self):
if flt(self.change_amount) and not self.account_for_change_amount:
msgprint(_("Please enter Account for Change Amount"), raise_exception=1)
diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js
index c442062..6b58033 100644
--- a/erpnext/accounts/page/pos/pos.js
+++ b/erpnext/accounts/page/pos/pos.js
@@ -179,41 +179,12 @@
}
},
- dialog_actions: function () {
- var me = this;
-
- $(this.list_body).find('.list-select-all').click(function () {
- me.removed_items = [];
- $(me.list_body).find('.list-delete').prop("checked", $(this).is(":checked"))
- if ($(this).is(":checked")) {
- $.each(me.si_docs, function (index, data) {
- for (key in data) {
- me.removed_items.push(key)
- }
- })
- }
-
- me.toggle_delete_button();
- })
-
- $(this.list_body).find('.list-delete').click(function () {
- me.name = $(this).parent().parent().attr('invoice-name');
- if ($(this).is(":checked")) {
- me.removed_items.push(me.name);
- } else {
- me.removed_items.pop(me.name)
- }
-
- me.toggle_delete_button();
- })
- },
-
edit_record: function () {
var me = this;
doc_data = this.get_invoice_doc(this.si_docs);
if (doc_data) {
- this.frm.doc = doc_data[0][this.name];
+ this.frm.doc = doc_data[0][this.frm.doc.offline_pos_name];
this.set_missing_values();
this.refresh(false);
this.toggle_input_field();
@@ -226,16 +197,15 @@
this.validate_list()
this.remove_doc_from_localstorage()
this.update_localstorage();
- // this.dialog_actions();
this.toggle_delete_button();
},
validate_list: function() {
var me = this;
this.si_docs = this.get_submitted_invoice()
- $.each(this.removed_items, function(index, name){
+ $.each(this.removed_items, function(index, pos_name){
$.each(me.si_docs, function(key, data){
- if(me.si_docs[key][name] && me.si_docs[key][name].offline_pos_name == name ){
+ if(me.si_docs[key][pos_name] && me.si_docs[key][pos_name].offline_pos_name == pos_name ){
frappe.throw(__("Submitted orders can not be deleted"))
}
})
@@ -294,7 +264,7 @@
return $.grep(this.si_docs, function (data) {
for (key in data) {
- return key == me.name
+ return key == me.frm.doc.offline_pos_name;
}
})
},
@@ -348,7 +318,6 @@
create_new: function () {
var me = this;
this.frm = {}
- this.name = null;
this.load_data(true);
this.setup();
this.set_default_customer()
@@ -362,6 +331,7 @@
if (load_doc) {
this.frm.doc = JSON.parse(localStorage.getItem('doc'));
+ this.frm.doc.offline_pos_name = null;
}
$.each(this.meta, function (i, data) {
@@ -629,6 +599,7 @@
// this.list_customers.empty();
this.si_docs = this.get_doc_from_localstorage();
if (!this.si_docs.length) {
+ this.list_customers.find('.list-customers-table').html("");
return;
}
@@ -655,7 +626,7 @@
me.list_customers_btn.toggleClass("view_customer");
me.pos_bill.show();
me.list_customers_btn.show();
- me.name = $(this).parents().attr('invoice-name')
+ me.frm.doc.offline_pos_name = $(this).parents().attr('invoice-name')
me.edit_record();
})
@@ -675,11 +646,11 @@
});
$(this.wrapper).find('.list-delete').click(function () {
- me.name = $(this).parent().parent().attr('invoice-name');
+ me.frm.doc.offline_pos_name = $(this).parent().parent().attr('invoice-name');
if ($(this).is(":checked")) {
- me.removed_items.push(me.name);
+ me.removed_items.push(me.frm.doc.offline_pos_name);
} else {
- me.removed_items.pop(me.name)
+ me.removed_items.pop(me.frm.doc.offline_pos_name)
}
me.toggle_delete_button();
@@ -1435,7 +1406,7 @@
},
update_paid_amount_status: function (update_paid_amount) {
- if (this.name) {
+ if (this.frm.doc.offline_pos_name) {
update_paid_amount = update_paid_amount ? false : true;
}
@@ -1643,18 +1614,17 @@
create_invoice: function () {
var me = this;
- var invoice_data = {}
+ var invoice_data = {};
this.si_docs = this.get_doc_from_localstorage();
- if (this.name) {
- this.update_invoice()
+ if (this.frm.doc.offline_pos_name) {
+ this.update_invoice();
} else {
- this.name = $.now();
- this.frm.doc.offline_pos_name = this.name;
+ this.frm.doc.offline_pos_name = $.now();
this.frm.doc.posting_date = frappe.datetime.get_today();
this.frm.doc.posting_time = frappe.datetime.now_time();
this.frm.doc.pos_profile = this.pos_profile_data['name'];
- invoice_data[this.name] = this.frm.doc
- this.si_docs.push(invoice_data)
+ invoice_data[this.frm.doc.offline_pos_name] = this.frm.doc;
+ this.si_docs.push(invoice_data);
this.update_localstorage();
this.set_primary_action();
}
@@ -1666,12 +1636,12 @@
this.si_docs = this.get_doc_from_localstorage();
$.each(this.si_docs, function (index, data) {
for (var key in data) {
- if (key == me.name) {
+ if (key == me.frm.doc.offline_pos_name) {
me.si_docs[index][key] = me.frm.doc;
me.update_localstorage();
}
}
- })
+ });
},
update_localstorage: function () {
@@ -1710,6 +1680,8 @@
freeze_screen = this.freeze_screen || false;
if ((this.si_docs.length || this.email_queue_list || this.customers_list) && !this.freeze) {
+ this.freeze = true;
+
frappe.call({
method: "erpnext.accounts.doctype.sales_invoice.pos.make_invoice",
freeze: freeze_screen,
@@ -1720,17 +1692,19 @@
},
callback: function (r) {
if (r.message) {
+ me.freeze = false;
me.customers = r.message.synced_customers_list;
me.address = r.message.synced_address;
me.contacts = r.message.synced_contacts;
me.removed_items = r.message.invoice;
- me.removed_email = r.message.email_queue
- me.removed_customers = r.message.customers
+ me.removed_email = r.message.email_queue;
+ me.removed_customers = r.message.customers;
me.remove_doc_from_localstorage();
me.remove_email_queue_from_localstorage();
me.remove_customer_from_localstorage();
- me.prepare_customer_mapper()
- me.autocomplete_customers()
+ me.prepare_customer_mapper();
+ me.autocomplete_customers();
+ me.render_list_customers();
}
}
})
diff --git a/erpnext/accounts/page/pos/test_pos.js b/erpnext/accounts/page/pos/test_pos.js
index 8913a9e..e5524a2 100644
--- a/erpnext/accounts/page/pos/test_pos.js
+++ b/erpnext/accounts/page/pos/test_pos.js
@@ -6,6 +6,7 @@
() => {
return frappe.tests.make("POS Profile", [
{naming_series: "SINV"},
+ {pos_profile_name: "_Test POS Profile"},
{country: "India"},
{currency: "INR"},
{write_off_account: "Write Off - FT"},
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index fd7a1b4..486cd7c 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -455,3 +455,4 @@
erpnext.patches.v9_0.set_variant_item_description
erpnext.patches.v9_0.set_uoms_in_variant_field
erpnext.patches.v9_0.copy_old_fees_field_data
+erpnext.patches.v9_0.set_pos_profile_name
diff --git a/erpnext/patches/v9_0/set_pos_profile_name.py b/erpnext/patches/v9_0/set_pos_profile_name.py
new file mode 100644
index 0000000..bc6e50e
--- /dev/null
+++ b/erpnext/patches/v9_0/set_pos_profile_name.py
@@ -0,0 +1,19 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ doctype = 'POS Profile'
+ frappe.reload_doctype(doctype)
+
+ for pos in frappe.get_all(doctype):
+ doc = frappe.get_doc(doctype, pos.name)
+
+ if not doc.user: continue
+
+ doc.pos_profile_name = doc.user + ' - ' + doc.company
+ doc.save()
+
+ frappe.rename_doc(doctype, doc.name, doc.pos_profile_name, force=True)
\ No newline at end of file
diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js
index 196bb96..a0f8598 100644
--- a/erpnext/selling/page/point_of_sale/point_of_sale.js
+++ b/erpnext/selling/page/point_of_sale/point_of_sale.js
@@ -43,6 +43,7 @@
make() {
return frappe.run_serially([
+ () => frappe.dom.freeze(),
() => {
this.prepare_dom();
this.prepare_menu();
@@ -55,6 +56,7 @@
frappe.timeout(1);
this.make_items();
this.bind_events();
+ frappe.dom.unfreeze();
},
() => this.page.set_title(__('Point of Sale'))
]);
@@ -156,6 +158,7 @@
}
update_item_in_cart(item_code, field='qty', value=1) {
+ frappe.dom.freeze();
if(this.cart.exists(item_code)) {
const item = this.frm.doc.items.find(i => i.item_code === item_code);
frappe.flags.hide_serial_batch_dialog = false;
@@ -220,6 +223,7 @@
this.cart.add_item(item);
this.cart.update_taxes_and_totals();
this.cart.update_grand_total();
+ frappe.dom.unfreeze();
}
update_item_in_frm(item, field, value) {
@@ -232,8 +236,6 @@
return frappe.model.set_value(item.doctype, item.name, field, value)
.then(() => this.frm.script_manager.trigger('qty', item.doctype, item.name))
.then(() => {
- console.log(item.qty, item.amount);
-
if (field === 'qty' && item.qty === 0) {
frappe.model.clear_doc(item.doctype, item.name);
}
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index bf8eaba..844d62b 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -624,7 +624,8 @@
template_item.save()
def update_variants(self):
- if self.flags.dont_update_variants:
+ if self.flags.dont_update_variants or \
+ frappe.db.get_single_value('Item Variant Settings', 'do_not_update_variants'):
return
if self.has_variants:
updated = []
diff --git a/erpnext/stock/doctype/item_variant_settings/item_variant_settings.json b/erpnext/stock/doctype/item_variant_settings/item_variant_settings.json
index a29137c..8bdd46c 100644
--- a/erpnext/stock/doctype/item_variant_settings/item_variant_settings.json
+++ b/erpnext/stock/doctype/item_variant_settings/item_variant_settings.json
@@ -18,6 +18,66 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "section_break_3",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "If enabled then system will not update the fields of variants from the template but will copy the data of below mentioned fields while making new variant",
+ "fieldname": "do_not_update_variants",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Do not Update Variants",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "copy_fields_to_variant",
"fieldtype": "Section Break",
"hidden": 0,
@@ -84,8 +144,8 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-09-11 12:05:16.288601",
- "modified_by": "rohit@erpnext.com",
+ "modified": "2017-11-08 11:38:12.821404",
+ "modified_by": "Administrator",
"module": "Stock",
"name": "Item Variant Settings",
"name_case": "",