mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-28 01:14:46 +00:00
@@ -383,20 +383,20 @@ class SalesInvoice(SellingController):
|
|||||||
|
|
||||||
|
|
||||||
def get_warehouse(self):
|
def get_warehouse(self):
|
||||||
w = frappe.db.sql("""select warehouse from `tabPOS Setting`
|
user_pos_setting = frappe.db.sql("""select name, warehouse from `tabPOS Setting`
|
||||||
where ifnull(user,'') = %s and company = %s""",
|
where ifnull(user,'') = %s and company = %s""", (frappe.session['user'], self.company))
|
||||||
(frappe.session['user'], self.company))
|
warehouse = user_pos_setting[0][1] if user_pos_setting else None
|
||||||
w = w and w[0][0] or ''
|
|
||||||
if not w:
|
if not warehouse:
|
||||||
ps = frappe.db.sql("""select name, warehouse from `tabPOS Setting`
|
global_pos_setting = frappe.db.sql("""select name, warehouse from `tabPOS Setting`
|
||||||
where ifnull(user,'') = '' and company = %s""", self.company)
|
where ifnull(user,'') = '' and company = %s""", self.company)
|
||||||
if not ps:
|
|
||||||
|
if global_pos_setting:
|
||||||
|
warehouse = global_pos_setting[0][1]
|
||||||
|
elif not user_pos_setting:
|
||||||
msgprint(_("POS Setting required to make POS Entry"), raise_exception=True)
|
msgprint(_("POS Setting required to make POS Entry"), raise_exception=True)
|
||||||
elif not ps[0][1]:
|
|
||||||
msgprint(_("Warehouse required in POS Setting"))
|
return warehouse
|
||||||
else:
|
|
||||||
w = ps[0][1]
|
|
||||||
return w
|
|
||||||
|
|
||||||
def on_update(self):
|
def on_update(self):
|
||||||
if cint(self.update_stock) == 1:
|
if cint(self.update_stock) == 1:
|
||||||
|
|||||||
@@ -155,7 +155,7 @@
|
|||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"label": "Creation Document Type",
|
"label": "Creation Document Type",
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "\nPurchase Receipt\nStock Entry",
|
"options": "\nPurchase Receipt\nStock Entry\nSerial No",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
@@ -418,7 +418,7 @@
|
|||||||
"icon": "icon-barcode",
|
"icon": "icon-barcode",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"modified": "2014-05-27 03:49:19.131746",
|
"modified": "2014-06-26 12:33:49.911829",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Serial No",
|
"name": "Serial No",
|
||||||
|
|||||||
Reference in New Issue
Block a user