Merge branch 'hotfix'

This commit is contained in:
mbauskar 2017-10-05 13:36:49 +05:30
commit 671c6610de
4 changed files with 20 additions and 4 deletions

View File

@ -4,7 +4,7 @@ import inspect
import frappe import frappe
from erpnext.hooks import regional_overrides from erpnext.hooks import regional_overrides
__version__ = '9.1.0' __version__ = '9.1.1'
def get_default_company(user=None): def get_default_company(user=None):
'''Get default company for user''' '''Get default company for user'''

View File

@ -3,7 +3,17 @@
# For license information, please see license.txt # For license information, please see license.txt
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe
from frappe.model.document import Document from frappe.model.document import Document
class POSSettings(Document): class POSSettings(Document):
pass 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)

View File

@ -315,11 +315,16 @@ def get_data():
"name": "Payment Gateway Account", "name": "Payment Gateway Account",
"description": _("Setup Gateway accounts.") "description": _("Setup Gateway accounts.")
}, },
{
"type": "doctype",
"name": "POS Settings",
"description": _("Setup mode of POS (Online / Offline)")
},
{ {
"type": "doctype", "type": "doctype",
"name": "POS Profile", "name": "POS Profile",
"label": _("Point-of-Sale Profile"), "label": _("Point-of-Sale Profile"),
"description": _("Rules to calculate shipping amount for a sale") "description": _("Setup default values for POS Invoices")
}, },
{ {
"type": "doctype", "type": "doctype",

View File

@ -49,11 +49,12 @@ erpnext.pos.PointOfSale = class PointOfSale {
this.set_online_status(); this.set_online_status();
}, },
() => this.setup_pos_profile(), () => this.setup_pos_profile(),
() => this.make_new_invoice(),
() => { () => {
frappe.timeout(1);
this.make_items(); this.make_items();
this.bind_events(); this.bind_events();
}, },
() => this.make_new_invoice(),
() => this.page.set_title(__('Point of Sale')) () => this.page.set_title(__('Point of Sale'))
]); ]);
} }