From e87a076f1d2da5f0691e10f7b7da84a6f41bad13 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 5 Oct 2017 12:20:20 +0530 Subject: [PATCH] Update link in the pos for offline and online mode from pos settings (#11061) --- .../accounts/doctype/pos_settings/pos_settings.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/pos_settings/pos_settings.py b/erpnext/accounts/doctype/pos_settings/pos_settings.py index 736d36eea9..13a50042fb 100644 --- a/erpnext/accounts/doctype/pos_settings/pos_settings.py +++ b/erpnext/accounts/doctype/pos_settings/pos_settings.py @@ -3,7 +3,17 @@ # For license information, please see license.txt from __future__ import unicode_literals +import frappe from frappe.model.document import Document class POSSettings(Document): - pass \ No newline at end of file + def validate(self): + self.set_link_for_pos() + + def set_link_for_pos(self): + link = 'pos' if self.use_pos_in_offline_mode else 'point-of-sale' + desktop_icon = frappe.db.get_value('Desktop Icon', + {'standard': 1, 'module_name': 'POS'}, 'name') + + if desktop_icon: + frappe.db.set_value('Desktop Icon', desktop_icon, 'link', link) \ No newline at end of file