From b9fe14631de57f8dbcb6ec11517cea8b37f0e25f Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Sat, 30 Sep 2017 10:46:29 +0530 Subject: [PATCH 1/5] [fix] healthcare setup --- erpnext/setup/setup_wizard/healthcare.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/erpnext/setup/setup_wizard/healthcare.py b/erpnext/setup/setup_wizard/healthcare.py index ebc644e87b..43a02371f4 100644 --- a/erpnext/setup/setup_wizard/healthcare.py +++ b/erpnext/setup/setup_wizard/healthcare.py @@ -191,21 +191,21 @@ def create_healthcare_item_groups(): def create_lab_test_items(): records = [ {"doctype": "Item", "item_code": "MCH", "item_name": "MCH", "item_group": "Laboratory", - "stock_uom": "Unit", "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}, + "stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}, {"doctype": "Item", "item_code": "LDL", "item_name": "LDL", "item_group": "Laboratory", - "stock_uom": "Unit", "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}, + "stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}, {"doctype": "Item", "item_code": "GTT", "item_name": "GTT", "item_group": "Laboratory", - "stock_uom": "Unit", "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}, + "stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}, {"doctype": "Item", "item_code": "HDL", "item_name": "HDL", "item_group": "Laboratory", - "stock_uom": "Unit", "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}, + "stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}, {"doctype": "Item", "item_code": "BILT", "item_name": "BILT", "item_group": "Laboratory", - "stock_uom": "Unit", "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}, + "stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}, {"doctype": "Item", "item_code": "BILD", "item_name": "BILD", "item_group": "Laboratory", - "stock_uom": "Unit", "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}, + "stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}, {"doctype": "Item", "item_code": "BP", "item_name": "BP", "item_group": "Laboratory", - "stock_uom": "Unit", "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}, + "stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}, {"doctype": "Item", "item_code": "BS", "item_name": "BS", "item_group": "Laboratory", - "stock_uom": "Unit", "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1} + "stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1} ] insert_record(records) From 5b58e489a8d29ad7242d8b9bba0da292d85d19b6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 2 Oct 2017 11:36:10 +0530 Subject: [PATCH 2/5] Fixes for uom in get_item_details (#10986) --- erpnext/controllers/accounts_controller.py | 3 --- erpnext/stock/get_item_details.py | 11 ++++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index d04143d77d..a9677b0e8d 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -187,9 +187,6 @@ class AccountsController(TransactionBase): if stock_qty != len(get_serial_nos(item.get('serial_no'))): item.set(fieldname, value) - elif fieldname == "conversion_factor" and not item.get("conversion_factor"): - item.set(fieldname, value) - if ret.get("pricing_rule"): # if user changed the discount percentage then set user's discount percentage ? item.set("discount_percentage", ret.get("discount_percentage")) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 72a83c6c1b..539e8a5667 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -164,6 +164,15 @@ def get_basic_details(args, item): warehouse = user_default_warehouse or item.default_warehouse or args.warehouse + #Set the UOM to the Default Sales UOM or Default Purchase UOM if configured in the Item Master + if not args.uom: + if args.get('doctype') in ['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice']: + args.uom = item.sales_uom if item.sales_uom else item.stock_uom + elif args.get('doctype') in ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']: + args.uom = item.purchase_uom if item.purchase_uom else item.stock_uom + else: + args.uom = item.stock_uom + out = frappe._dict({ "item_code": item.name, "item_name": item.item_name, @@ -178,7 +187,7 @@ def get_basic_details(args, item): "batch_no": None, "item_tax_rate": json.dumps(dict(([d.tax_type, d.tax_rate] for d in item.get("taxes")))), - "uom": item.stock_uom, + "uom": args.uom, "min_order_qty": flt(item.min_order_qty) if args.doctype == "Material Request" else "", "qty": args.qty or 1.0, "stock_qty": args.qty or 1.0, From cb48404bd24e552d0b8041815966171b354e896f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 2 Oct 2017 11:37:18 +0530 Subject: [PATCH 3/5] Revert "Fixes for uom in get_item_details (#10986)" (#11009) This reverts commit 5b58e489a8d29ad7242d8b9bba0da292d85d19b6. --- erpnext/controllers/accounts_controller.py | 3 +++ erpnext/stock/get_item_details.py | 11 +---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index a9677b0e8d..d04143d77d 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -187,6 +187,9 @@ class AccountsController(TransactionBase): if stock_qty != len(get_serial_nos(item.get('serial_no'))): item.set(fieldname, value) + elif fieldname == "conversion_factor" and not item.get("conversion_factor"): + item.set(fieldname, value) + if ret.get("pricing_rule"): # if user changed the discount percentage then set user's discount percentage ? item.set("discount_percentage", ret.get("discount_percentage")) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 539e8a5667..72a83c6c1b 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -164,15 +164,6 @@ def get_basic_details(args, item): warehouse = user_default_warehouse or item.default_warehouse or args.warehouse - #Set the UOM to the Default Sales UOM or Default Purchase UOM if configured in the Item Master - if not args.uom: - if args.get('doctype') in ['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice']: - args.uom = item.sales_uom if item.sales_uom else item.stock_uom - elif args.get('doctype') in ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']: - args.uom = item.purchase_uom if item.purchase_uom else item.stock_uom - else: - args.uom = item.stock_uom - out = frappe._dict({ "item_code": item.name, "item_name": item.item_name, @@ -187,7 +178,7 @@ def get_basic_details(args, item): "batch_no": None, "item_tax_rate": json.dumps(dict(([d.tax_type, d.tax_rate] for d in item.get("taxes")))), - "uom": args.uom, + "uom": item.stock_uom, "min_order_qty": flt(item.min_order_qty) if args.doctype == "Material Request" else "", "qty": args.qty or 1.0, "stock_qty": args.qty or 1.0, From 9b98d7fa148c696ec370227b5b817d40f369cc61 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 2 Oct 2017 11:38:40 +0530 Subject: [PATCH 4/5] Gst doctype roles (#10984) * Removed default permission from GST doctypes * default permission from GST doctypes --- .../doctype/gst_hsn_code/gst_hsn_code.json | 27 +++---------------- .../doctype/gst_settings/gst_settings.json | 27 +++---------------- erpnext/regional/india/setup.py | 1 - 3 files changed, 6 insertions(+), 49 deletions(-) diff --git a/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.json b/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.json index 7b3a8d6b72..2a2145c7f7 100644 --- a/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.json +++ b/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.json @@ -84,34 +84,13 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-08-31 14:38:52.220743", - "modified_by": "ewdszx@ed.ews", + "modified": "2017-09-29 14:38:52.220743", + "modified_by": "Administrator", "module": "Regional", "name": "GST HSN Code", "name_case": "", "owner": "Administrator", - "permissions": [ - { - "amend": 0, - "apply_user_permissions": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 0, - "write": 1 - } - ], + "permissions": [], "quick_entry": 1, "read_only": 0, "read_only_onload": 0, diff --git a/erpnext/regional/doctype/gst_settings/gst_settings.json b/erpnext/regional/doctype/gst_settings/gst_settings.json index 04065e29df..67084b45f8 100644 --- a/erpnext/regional/doctype/gst_settings/gst_settings.json +++ b/erpnext/regional/doctype/gst_settings/gst_settings.json @@ -83,34 +83,13 @@ "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2017-08-31 14:39:15.625952", - "modified_by": "ewdszx@ed.ews", + "modified": "2017-09-29 14:39:15.625952", + "modified_by": "Administrator", "module": "Regional", "name": "GST Settings", "name_case": "", "owner": "Administrator", - "permissions": [ - { - "amend": 0, - "apply_user_permissions": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 0, - "role": "System Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 0, - "write": 1 - } - ], + "permissions": [], "quick_entry": 1, "read_only": 0, "read_only_onload": 0, diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py index fb40e32e37..2165023161 100644 --- a/erpnext/regional/india/setup.py +++ b/erpnext/regional/india/setup.py @@ -72,7 +72,6 @@ def add_custom_roles_for_reports(): def add_permissions(): for doctype in ('GST HSN Code', 'GST Settings'): - add_permission(doctype, 'Accounts Manager', 0) add_permission(doctype, 'All', 0) def add_print_formats(): From def308a4332cc58bcd4aceca0d1dbd3999fed8c5 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 2 Oct 2017 12:38:59 +0600 Subject: [PATCH 5/5] bumped to version 9.0.5 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index fa3fcc2cce..c589e35977 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -4,7 +4,7 @@ import inspect import frappe from erpnext.hooks import regional_overrides -__version__ = '9.0.4' +__version__ = '9.0.5' def get_default_company(user=None): '''Get default company for user'''