From 17231e39ccdd658cb1fae4b4ec81f089eda50ee3 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Fri, 21 Aug 2015 16:52:04 +0530 Subject: [PATCH 1/6] Added validation in Production Order. Operations Time made mandatory --- .../doctype/production_order/production_order.py | 11 +++++++++++ .../production_order_operation.json | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index 6a6e6ed8d2..2039d93659 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -42,6 +42,8 @@ class ProductionOrder(Document): self.validate_warehouse() self.calculate_operating_cost() self.validate_delivery_date() + self.validate_qty() + self.validate_operation_time() from erpnext.utilities.transaction_base import validate_uom_is_integer validate_uom_is_integer(self, "stock_uom", ["qty", "produced_qty"]) @@ -327,6 +329,15 @@ class ProductionOrder(Document): frappe.throw(_("Production Order cannot be raised against a Item Template"), ItemHasVariantError) validate_end_of_life(self.production_item) + + def validate_qty(self): + if not self.qty > 0: + frappe.throw(_("Quantity to Manufacture must be greater than 0.")) + + def validate_operation_time(self): + for d in self.operations: + if not d.time_in_mins > 0: + frappe.throw(_("Operation Time must be greater than 0 for Operation {0}".format(d.operation))) @frappe.whitelist() def get_item_details(item): diff --git a/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json b/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json index 86de38e0b5..57663f834c 100644 --- a/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json +++ b/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json @@ -276,7 +276,7 @@ "print_hide": 0, "read_only": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -476,7 +476,7 @@ "is_submittable": 0, "issingle": 0, "istable": 1, - "modified": "2015-08-19 12:45:53.834920", + "modified": "2015-08-21 07:17:18.185276", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Order Operation", From 12fb0d998f73471e3cf3f750685edf7ba342c8fb Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 24 Aug 2015 12:21:04 +0530 Subject: [PATCH 2/6] [fix] Customer Address and Contact report --- .../customer_addresses_and_contacts.json | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.json b/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.json index deb90b71cd..e0fba61d8c 100644 --- a/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.json +++ b/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.json @@ -1,17 +1,19 @@ { - "apply_user_permissions": 1, - "creation": "2012-10-04 18:45:27", - "docstatus": 0, - "doctype": "Report", - "idx": 1, - "is_standard": "Yes", - "modified": "2014-07-14 07:18:17.006732", - "modified_by": "Administrator", - "module": "Selling", - "name": "Customer Addresses and Contacts", - "owner": "Administrator", - "query": "SELECT\n\t`tabCustomer`.name as customer_id,\n\t`tabCustomer`.customer_name,\n\t`tabCustomer`.customer_group,\n\t`tabAddress`.address_line1,\n\t`tabAddress`.address_line2,\n\t`tabAddress`.city,\n\t`tabAddress`.state,\n\t`tabAddress`.pincode,\n\t`tabAddress`.country,\n\t`tabAddress`.is_primary_address, \n\t`tabContact`.first_name,\n\t`tabContact`.last_name,\n\t`tabContact`.phone,\n\t`tabContact`.mobile_no,\n\t`tabContact`.email_id,\n\t`tabContact`.is_primary_contact\nFROM\n\t`tabCustomer`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.customer=`tabCustomer`.name\n\t)\n\tleft join `tabContact` on (\n\t\t`tabContact`.customer=`tabCustomer`.name\n\t)\nWHERE\n\t`tabCustomer`.docstatus<2\nORDER BY\n\t`tabCustomer`.name asc", - "ref_doctype": "Customer", - "report_name": "Customer Addresses And Contacts", + "add_total_row": 0, + "apply_user_permissions": 1, + "creation": "2012-10-04 18:45:27", + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2015-08-24 11:44:00.711112", + "modified_by": "Administrator", + "module": "Selling", + "name": "Customer Addresses And Contacts", + "owner": "Administrator", + "query": "SELECT\n\t`tabCustomer`.name as \"Customer ID:Link/Customer\",\n\t`tabCustomer`.customer_name as \"Customer Name\",\n\t`tabCustomer`.customer_group as \"Customer Group:Link/Customer Group\",\n\t`tabAddress`.address_line1 as \"Address Line 1\",\n\t`tabAddress`.address_line2 as \"Address Line 2\",\n\t`tabAddress`.city as \"City\",\n\t`tabAddress`.state as \"State\",\n\t`tabAddress`.pincode as \"Postal Code\",\n\t`tabAddress`.country as \"Country\",\n\t`tabAddress`.is_primary_address as \"Is Primary Address:Check\", \n\t`tabContact`.first_name as \"First Name\",\n\t`tabContact`.last_name as \"Last Name\",\n\t`tabContact`.phone as \"Phone\",\n\t`tabContact`.mobile_no as \"Mobile No\",\n\t`tabContact`.email_id as \"Email Id\",\n\t`tabContact`.is_primary_contact as \"Is Primary Contact:Check\"\nFROM\n\t`tabCustomer`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.customer=`tabCustomer`.name\n\t)\n\tleft join `tabContact` on (\n\t\t`tabContact`.customer=`tabCustomer`.name\n\t)\nWHERE\n\t`tabCustomer`.docstatus<2\nORDER BY\n\t`tabCustomer`.name asc", + "ref_doctype": "Customer", + "report_name": "Customer Addresses And Contacts", "report_type": "Query Report" -} +} \ No newline at end of file From c8a5a2cc4acebe8b92fea60b50b5fcbba7dc4e05 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 24 Aug 2015 13:12:45 +0530 Subject: [PATCH 3/6] [hot] make_stock_entry button in purchase order --- erpnext/buying/doctype/purchase_order/purchase_order.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index a5cd6ce6c2..6ae83d0f00 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -32,7 +32,8 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend( cur_frm.add_custom_button(__('Receive'), this.make_purchase_receipt).addClass("btn-primary"); if(doc.is_subcontracted==="Yes") { - cur_frm.add_custom_button(__('Transfer Material to Supplier'), this.make_stock_entry); + cur_frm.add_custom_button(__('Transfer Material to Supplier'), + function() { me.make_stock_entry(); }); } } From d999dd1bb941c3300d28b65f8df1c2f6ec71d9d8 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 24 Aug 2015 14:23:55 +0530 Subject: [PATCH 4/6] [minor] fix setup wizard buying_items query --- erpnext/setup/page/setup_wizard/sample_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/setup/page/setup_wizard/sample_data.py b/erpnext/setup/page/setup_wizard/sample_data.py index b90cceb589..2cebc9148b 100644 --- a/erpnext/setup/page/setup_wizard/sample_data.py +++ b/erpnext/setup/page/setup_wizard/sample_data.py @@ -12,7 +12,7 @@ def make_sample_data(): to help the user get started""" selling_items = frappe.get_all("Item", filters = {"is_sales_item": 1}) - buying_items = frappe.get_all("Item", filters = {"is_sales_item": 0}) + buying_items = frappe.get_all("Item", filters = {"is_purchase_item": 1}) if selling_items: for i in range(3): From da24698cf74a3b2b248ef60d1c8e3abb9ec6b1cc Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 24 Aug 2015 14:31:07 +0530 Subject: [PATCH 5/6] [minor] in ap, ar renamed label for date as 'as on date' as it was confusing --- erpnext/accounts/report/accounts_payable/accounts_payable.js | 2 +- .../accounts/report/accounts_receivable/accounts_receivable.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js index 2c36e522a1..9034f3e3b4 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.js +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js @@ -18,7 +18,7 @@ frappe.query_reports["Accounts Payable"] = { }, { "fieldname":"report_date", - "label": __("Date"), + "label": __("As on Date"), "fieldtype": "Date", "default": get_today() }, diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js index 051328f27e..d400527116 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js @@ -18,7 +18,7 @@ frappe.query_reports["Accounts Receivable"] = { }, { "fieldname":"report_date", - "label": __("Date"), + "label": __("As on Date"), "fieldtype": "Date", "default": get_today() }, From 5c9bd5e650591b65b9c33ec733d5e5dcde239d48 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 24 Aug 2015 17:23:51 +0600 Subject: [PATCH 6/6] bumped to version 5.7.7 --- erpnext/__version__.py | 2 +- erpnext/hooks.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/__version__.py b/erpnext/__version__.py index 084a3886db..cfdd2f7fd0 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = '5.7.6' +__version__ = '5.7.7' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 3ae43fa169..2a2d7c18ef 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -27,7 +27,7 @@ blogs. """ app_icon = "icon-th" app_color = "#e74c3c" -app_version = "5.7.6" +app_version = "5.7.7" github_link = "https://github.com/frappe/erpnext" error_report_email = "support@erpnext.com" diff --git a/setup.py b/setup.py index 7d4b20bc48..9ed46de3ec 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = "5.7.6" +version = "5.7.7" with open("requirements.txt", "r") as f: install_requires = f.readlines()