diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 292353db60e..e0ce4fb7892 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.0.3' +__version__ = '7.0.4' def get_default_company(user=None): '''Get default company for user''' diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index cb57ff406fc..a89f40e0ba7 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -69,13 +69,13 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ var me = this; // navigator.onLine this.connection_status = false; - this.page.set_indicator("Offline", "grey") + this.page.set_indicator(__("Offline"), "grey") frappe.call({ method:"frappe.handler.ping", callback: function(r){ if(r.message){ me.connection_status = true; - me.page.set_indicator("Online", "green") + me.page.set_indicator(__("Online"), "green") } } }) @@ -278,7 +278,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ "fieldtype": "Data", "label": "Item", "fieldname": "pos_item", - "placeholder": "Search Item" + "placeholder": __("Search Item") }, parent: this.wrapper.find(".search-area"), only_input: true, diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py index 37b13c3e2de..8d30247acf5 100644 --- a/erpnext/controllers/sales_and_purchase_return.py +++ b/erpnext/controllers/sales_and_purchase_return.py @@ -167,9 +167,7 @@ def make_return_doc(doctype, source_name, target_doc=None): target_doc.qty = -1* source_doc.qty if doctype == "Purchase Receipt": target_doc.received_qty = -1* source_doc.qty - target_doc.prevdoc_doctype = source_doc.prevdoc_doctype - target_doc.prevdoc_docname = source_doc.prevdoc_docname - target_doc.prevdoc_detail_docname = source_doc.prevdoc_detail_docname + target_doc.purchase_order = source_doc.purchase_order elif doctype == "Purchase Invoice": target_doc.received_qty = -1* source_doc.qty target_doc.purchase_order = source_doc.purchase_order diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 09ff7772734..3e31d5ec20d 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -301,3 +301,5 @@ execute:frappe.delete_doc_if_exists("DocType", "Payment Tool Detail") erpnext.patches.v7_0.setup_account_table_for_expense_claim_type_if_exists erpnext.patches.v7_0.migrate_schools_to_erpnext erpnext.patches.v7_0.remove_administrator_role_in_doctypes +erpnext.patches.v7_0.rename_fee_amount_to_fee_component +erpnext.patches.v7_0.calculate_total_costing_amount diff --git a/erpnext/patches/v7_0/calculate_total_costing_amount.py b/erpnext/patches/v7_0/calculate_total_costing_amount.py new file mode 100644 index 00000000000..f4269040748 --- /dev/null +++ b/erpnext/patches/v7_0/calculate_total_costing_amount.py @@ -0,0 +1,14 @@ +import frappe +from frappe.utils import flt + +def execute(): + frappe.reload_doc('projects', 'doctype', 'timesheet') + + for data in frappe.get_all('Timesheet', fields=["name, total_costing_amount"], + filters = [["docstatus", "<", "2"]]): + if flt(data.total_costing_amount) == 0.0: + ts = frappe.get_doc('Timesheet', data.name) + ts.update_cost() + ts.calculate_total_amounts() + ts.flags.ignore_validate_update_after_submit = True + ts.save() diff --git a/erpnext/patches/v7_0/rename_fee_amount_to_fee_component.py b/erpnext/patches/v7_0/rename_fee_amount_to_fee_component.py new file mode 100644 index 00000000000..662a260753c --- /dev/null +++ b/erpnext/patches/v7_0/rename_fee_amount_to_fee_component.py @@ -0,0 +1,15 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe + +from frappe.model.utils.rename_field import rename_field + +def execute(): + frappe.rename_doc("DocType", "Fee Amount", "Fee Component") + for dt in ("Fees", "Fee Structure"): + frappe.reload_doctype(dt) + rename_field(dt, "amount", "components") + + \ No newline at end of file diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js index f816defe60b..f3dfefa7d0c 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.js +++ b/erpnext/projects/doctype/timesheet/timesheet.js @@ -5,11 +5,11 @@ cur_frm.add_fetch('employee', 'employee_name', 'employee_name'); frappe.ui.form.on("Timesheet", { setup: function(frm) { frm.get_field('time_logs').grid.editable_fields = [ - {fieldname: 'billable', columns: 2}, + {fieldname: 'billable', columns: 1}, {fieldname: 'activity_type', columns: 2}, - {fieldname: 'from_time', columns: 2}, - {fieldname: 'hours', columns: 2}, - {fieldname: 'to_time', columns: 2}, + {fieldname: 'from_time', columns: 3}, + {fieldname: 'hours', columns: 1}, + {fieldname: 'project', columns: 3} ]; frm.fields_dict.employee.get_query = function() { @@ -22,7 +22,8 @@ frappe.ui.form.on("Timesheet", { child = locals[cdt][cdn]; return{ filters: { - 'project': child.project + 'project': child.project, + 'status': ["!=", "Closed"] } } } @@ -37,8 +38,7 @@ frappe.ui.form.on("Timesheet", { refresh: function(frm) { if(frm.doc.docstatus==1) { - if(!frm.doc.sales_invoice && frm.doc.total_billing_amount > 0 - && !frm.doc.production_order){ + if(!frm.doc.sales_invoice && frm.doc.total_billing_amount > 0){ frm.add_custom_button(__("Make Sales Invoice"), function() { frm.trigger("make_invoice") }, "icon-file-alt"); } @@ -147,13 +147,16 @@ var calculate_time_and_amount = function(frm) { var tl = frm.doc.time_logs || []; total_hr = 0; total_billing_amount = 0; + total_costing_amount = 0; for(var i=0; i self.max_strength: diff --git a/erpnext/schools/doctype/student_group/test_records.json b/erpnext/schools/doctype/student_group/test_records.json index 23186caf4dd..a14f670d8e1 100644 --- a/erpnext/schools/doctype/student_group/test_records.json +++ b/erpnext/schools/doctype/student_group/test_records.json @@ -1,13 +1,11 @@ [ { - "group_name": "_Test Student Group", "program": "_Test Program", "course": "_Test Course", "academic_year": "2014-2015", "academic_term": "_Test Academic Term" }, { - "group_name": "_Test Student Group 1", "program": "_Test Program", "course": "_Test Course 2", "academic_year": "2014-2015", diff --git a/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.json b/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.json index 3291d830198..dd011c3c38a 100644 --- a/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.json +++ b/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.json @@ -176,7 +176,7 @@ "label": "Courses", "length": 0, "no_copy": 0, - "options": "SG Creation Tool Course", + "options": "Student Group Creation Tool Course", "permlevel": 0, "precision": "", "print_hide": 0, @@ -199,7 +199,7 @@ "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2016-07-25 01:23:31.192112", + "modified": "2016-07-25 06:40:46.107131", "modified_by": "Administrator", "module": "Schools", "name": "Student Group Creation Tool", diff --git a/erpnext/schools/doctype/sg_creation_tool_course/__init__.py b/erpnext/schools/doctype/student_group_creation_tool_course/__init__.py similarity index 100% rename from erpnext/schools/doctype/sg_creation_tool_course/__init__.py rename to erpnext/schools/doctype/student_group_creation_tool_course/__init__.py diff --git a/erpnext/schools/doctype/sg_creation_tool_course/sg_creation_tool_course.json b/erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json similarity index 96% rename from erpnext/schools/doctype/sg_creation_tool_course/sg_creation_tool_course.json rename to erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json index 8814f883afd..88466b60ab5 100644 --- a/erpnext/schools/doctype/sg_creation_tool_course/sg_creation_tool_course.json +++ b/erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json @@ -147,10 +147,10 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-07-21 12:31:41.252860", - "modified_by": "r@r.com", + "modified": "2016-07-25 06:40:49.000588", + "modified_by": "Administrator", "module": "Schools", - "name": "SG Creation Tool Course", + "name": "Student Group Creation Tool Course", "name_case": "", "owner": "Administrator", "permissions": [], diff --git a/erpnext/schools/doctype/sg_creation_tool_course/sg_creation_tool_course.py b/erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py similarity index 60% rename from erpnext/schools/doctype/sg_creation_tool_course/sg_creation_tool_course.py rename to erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py index 4024c69f1c0..b3411ea7c55 100644 --- a/erpnext/schools/doctype/sg_creation_tool_course/sg_creation_tool_course.py +++ b/erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2015, Frappe and contributors +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document -class SGCreationToolCourse(Document): +class StudentGroupCreationToolCourse(Document): pass diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 65fb42066fe..00538cd4c9e 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -32,6 +32,9 @@ class Company(Document): self.validate_currency() def validate_abbr(self): + if not self.abbr: + self.abbr = ''.join([c[0] for c in self.company_name.split()]).upper() + self.abbr = self.abbr.strip() if self.get('__islocal') and len(self.abbr) > 5: @@ -66,7 +69,7 @@ class Company(Document): if not frappe.local.flags.ignore_chart_of_accounts: self.create_default_accounts() self.create_default_warehouses() - + self.install_country_fixtures() if not frappe.db.get_value("Cost Center", {"is_group": 0, "company": self.name}): @@ -92,7 +95,7 @@ class Company(Document): {"warehouse_name": _("Stores"), "is_group": 0}, {"warehouse_name": _("Work In Progress"), "is_group": 0}, {"warehouse_name": _("Finished Goods"), "is_group": 0}]: - + if not frappe.db.exists("Warehouse", "{0} - {1}".format(wh_detail["warehouse_name"], self.abbr)): stock_group = frappe.db.get_value("Account", {"account_type": "Stock", "is_group": 1, "company": self.name}) @@ -203,9 +206,9 @@ class Company(Document): rec = frappe.db.sql("SELECT name from `tabGL Entry` where company = %s", self.name) if not rec: frappe.db.sql("""delete from `tabBudget Account` - where exists(select name from tabBudget + where exists(select name from tabBudget where name=`tabBudget Account`.parent and company = %s)""", self.name) - + for doctype in ["Account", "Cost Center", "Budget", "Party Account"]: frappe.db.sql("delete from `tab{0}` where company = %s".format(doctype), self.name)