From 033ed00c56b760a3abf12a69de441fc95649ef64 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 11 Aug 2016 16:37:29 +0530 Subject: [PATCH 1/8] [POS] fixed issue of negative stock --- erpnext/accounts/doctype/sales_invoice/pos.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py index 53144cbf2b..8f9db21901 100644 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -222,6 +222,7 @@ def submit_invoice(si_doc, name): def save_invoice(e, si_doc, name): if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}): + si_doc.docstatus = 0 si_doc.flags.ignore_mandatory = True si_doc.insert() make_scheduler_log(e, si_doc.name) From 6a23016f90cc2f736b1ed864e36dfc2ff8e4274e Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Thu, 11 Aug 2016 17:28:21 +0530 Subject: [PATCH 2/8] Added image feild to guardian --- .../schools/doctype/guardian/guardian.json | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/erpnext/schools/doctype/guardian/guardian.json b/erpnext/schools/doctype/guardian/guardian.json index 89e4bd0309..390a52f0e0 100644 --- a/erpnext/schools/doctype/guardian/guardian.json +++ b/erpnext/schools/doctype/guardian/guardian.json @@ -91,14 +91,14 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "fieldname": "mobile_nuber", + "fieldname": "mobile_number", "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, - "label": "Mobile Nuber", + "label": "Mobile Number", "length": 0, "no_copy": 0, "permlevel": 0, @@ -116,8 +116,8 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "fieldname": "section_break_5", - "fieldtype": "Section Break", + "fieldname": "column_break_3", + "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -136,6 +136,31 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "image", + "fieldtype": "Attach Image", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Image", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -166,6 +191,7 @@ "hide_heading": 0, "hide_toolbar": 0, "idx": 0, + "image_field": "image", "image_view": 0, "in_create": 0, "in_dialog": 0, @@ -173,7 +199,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-07-25 07:20:11.458757", + "modified": "2016-08-11 07:57:21.708354", "modified_by": "Administrator", "module": "Schools", "name": "Guardian", From c917423b0137f45d4b7ecbd56eb2f563fa7a6ab3 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Thu, 11 Aug 2016 18:22:45 +0530 Subject: [PATCH 3/8] Fixed typo in quotation, added image feild in Program Enrollment --- .../program_enrollment.json | 30 ++++++++++++++++- .../selling/doctype/quotation/quotation.json | 32 +++---------------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/erpnext/schools/doctype/program_enrollment/program_enrollment.json b/erpnext/schools/doctype/program_enrollment/program_enrollment.json index 6977a24e85..c7c5eed839 100644 --- a/erpnext/schools/doctype/program_enrollment/program_enrollment.json +++ b/erpnext/schools/doctype/program_enrollment/program_enrollment.json @@ -9,6 +9,7 @@ "docstatus": 0, "doctype": "DocType", "document_type": "Document", + "editable_grid": 0, "fields": [ { "allow_on_submit": 0, @@ -239,11 +240,38 @@ "search_index": 0, "set_only_once": 0, "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "image", + "fieldtype": "Attach Image", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Image", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 } ], "hide_heading": 0, "hide_toolbar": 0, "idx": 0, + "image_field": "image", + "image_view": 0, "in_create": 0, "in_dialog": 0, "is_submittable": 1, @@ -251,7 +279,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-07-18 10:30:50.243271", + "modified": "2016-08-11 08:50:24.317353", "modified_by": "Administrator", "module": "Schools", "name": "Program Enrollment", diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index c53c6b60f5..64a5245e18 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -5,10 +5,12 @@ "autoname": "naming_series:", "beta": 0, "creation": "2013-05-24 19:29:08", - "custom": 0, + "custom": 0, + "default_print_format": "test123", "docstatus": 0, "doctype": "DocType", "document_type": "Document", + "editable_grid": 1, "fields": [ { "allow_on_submit": 0, @@ -35,30 +37,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "column_break0", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, - "width": "50%" - }, { "allow_on_submit": 1, "bold": 0, @@ -207,7 +185,7 @@ "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, - "label": "Custome Name", + "label": "Customer Name", "length": 0, "no_copy": 0, "permlevel": 0, @@ -2133,7 +2111,7 @@ "istable": 0, "max_attachments": 1, "menu_index": 0, - "modified": "2016-07-05 16:44:01.301063", + "modified": "2016-08-11 08:52:09.666306", "modified_by": "Administrator", "module": "Selling", "name": "Quotation", From 987009bf35c15363f4c24b0c94cdac5a494edbb0 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Fri, 12 Aug 2016 16:44:00 +0530 Subject: [PATCH 4/8] Update quotation.json --- erpnext/selling/doctype/quotation/quotation.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index 64a5245e18..53bd725f60 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -6,7 +6,6 @@ "beta": 0, "creation": "2013-05-24 19:29:08", "custom": 0, - "default_print_format": "test123", "docstatus": 0, "doctype": "DocType", "document_type": "Document", @@ -2291,4 +2290,4 @@ "timeline_field": "customer", "title_field": "title", "track_seen": 0 -} \ No newline at end of file +} From de08639d492af457ac5e89782c88758fc18caa35 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 16 Aug 2016 10:01:38 +0530 Subject: [PATCH 5/8] [minor] fixes to patches while moving from v5 --- erpnext/patches.txt | 4 ++-- erpnext/patches/v5_0/rename_table_fieldnames.py | 1 + erpnext/patches/v7_0/rename_advance_table_fields.py | 11 +++++++---- ..._account_table_for_expense_claim_type_if_exists.py | 5 ++++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index fd1fc74e91..ef9f4da5ab 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -22,6 +22,7 @@ execute:frappe.reload_doc('accounts', 'doctype', 'pos_setting') # 2014-01-29 execute:frappe.reload_doc('selling', 'doctype', 'customer') # 2014-01-29 execute:frappe.reload_doc('buying', 'doctype', 'supplier') # 2014-01-29 execute:frappe.reload_doc('accounts', 'doctype', 'asset_category') +execute:frappe.reload_doc('accounts', 'doctype', 'pricing_rule') execute:frappe.reload_doctype('Item') erpnext.patches.v4_0.map_charge_to_taxes_and_charges execute:frappe.reload_doc('support', 'doctype', 'newsletter') # 2014-01-31 @@ -103,7 +104,6 @@ erpnext.patches.v5_0.update_frozen_accounts_permission_role erpnext.patches.v5_0.update_dn_against_doc_fields execute:frappe.db.sql("update `tabMaterial Request` set material_request_type = 'Material Transfer' where material_request_type = 'Transfer'") execute:frappe.reload_doc('stock', 'doctype', 'item') -execute:frappe.db.sql("update `tabItem` i set apply_warehouse_wise_reorder_level=1, re_order_level=0, re_order_qty=0 where exists(select name from `tabItem Reorder` where parent=i.name)") erpnext.patches.v5_0.set_default_company_in_bom execute:frappe.reload_doc('crm', 'doctype', 'lead') execute:frappe.reload_doc('crm', 'doctype', 'opportunity') @@ -235,6 +235,7 @@ execute:frappe.delete_doc_if_exists("DocType", "Shopping Cart Taxes and Charges erpnext.patches.v6_4.set_user_in_contact erpnext.patches.v6_4.make_image_thumbnail #2015-10-20 erpnext.patches.v6_5.show_in_website_for_template_item +erpnext.patches.v7_0.create_budget_record erpnext.patches.v6_4.fix_expense_included_in_valuation execute:frappe.delete_doc_if_exists("Report", "Item-wise Last Purchase Rate") erpnext.patches.v6_6.fix_website_image @@ -269,7 +270,6 @@ erpnext.patches.v7_0.update_party_status erpnext.patches.v7_0.update_item_projected erpnext.patches.v7_0.remove_features_setup erpnext.patches.v7_0.update_home_page -erpnext.patches.v7_0.create_budget_record execute:frappe.delete_doc_if_exists("Page", "financial-analytics") erpnext.patches.v7_0.update_project_in_gl_entry execute:frappe.db.sql('update tabQuotation set status="Cancelled" where docstatus=2') diff --git a/erpnext/patches/v5_0/rename_table_fieldnames.py b/erpnext/patches/v5_0/rename_table_fieldnames.py index d9af7b8402..e6667deb77 100644 --- a/erpnext/patches/v5_0/rename_table_fieldnames.py +++ b/erpnext/patches/v5_0/rename_table_fieldnames.py @@ -219,6 +219,7 @@ def execute(): frappe.reload_doc("manufacturing", "doctype", "production_order_operation") frappe.reload_doc("manufacturing", "doctype", "workstation_working_hour") frappe.reload_doc("stock", "doctype", "item_variant") + frappe.reload_doc("hr", "doctype", "salary_detail") frappe.reload_doc("accounts", "doctype", "party_account") frappe.reload_doc("accounts", "doctype", "fiscal_year_company") diff --git a/erpnext/patches/v7_0/rename_advance_table_fields.py b/erpnext/patches/v7_0/rename_advance_table_fields.py index ba8b2daf5c..34d81343e2 100644 --- a/erpnext/patches/v7_0/rename_advance_table_fields.py +++ b/erpnext/patches/v7_0/rename_advance_table_fields.py @@ -8,8 +8,11 @@ from frappe.model.utils.rename_field import rename_field def execute(): for dt in ("Sales Invoice Advance", "Purchase Invoice Advance"): frappe.reload_doctype(dt) - + frappe.db.sql("update `tab{0}` set reference_type = 'Journal Entry'".format(dt)) - - rename_field(dt, "journal_entry", "reference_name") - rename_field(dt, "jv_detail_no", "reference_row") \ No newline at end of file + + if frappe.get_meta(dt).has_field('journal_entry'): + rename_field(dt, "journal_entry", "reference_name") + + if frappe.get_meta(dt).has_field('jv_detail_no'): + rename_field(dt, "jv_detail_no", "reference_row") \ No newline at end of file diff --git a/erpnext/patches/v7_0/setup_account_table_for_expense_claim_type_if_exists.py b/erpnext/patches/v7_0/setup_account_table_for_expense_claim_type_if_exists.py index 2c07e30adf..a067e71ed0 100644 --- a/erpnext/patches/v7_0/setup_account_table_for_expense_claim_type_if_exists.py +++ b/erpnext/patches/v7_0/setup_account_table_for_expense_claim_type_if_exists.py @@ -4,7 +4,10 @@ import frappe def execute(): frappe.reload_doc("hr", "doctype", "expense_claim_type") frappe.reload_doc("hr", "doctype", "expense_claim_account") - + + if not frappe.db.has_column('Expense Claim Type', 'default_account'): + return + for expense_claim_type in frappe.get_all("Expense Claim Type", fields=["name", "default_account"]): if expense_claim_type.default_account: doc = frappe.get_doc("Expense Claim Type", expense_claim_type.name) From 9cd356c7f0aadc5f2e0ee89b442b42a8b47abff2 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 11 Aug 2016 16:54:30 +0530 Subject: [PATCH 6/8] [POS] Fixed print qty decimal issue --- erpnext/accounts/doctype/sales_invoice/pos.py | 2 ++ erpnext/accounts/page/pos/pos.js | 2 ++ .../accounts/print_format/point_of_sale/point_of_sale.json | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py index 8f9db21901..33032bf1e9 100644 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -181,6 +181,8 @@ def make_invoice(doc_list): si_doc.update(doc) submit_invoice(si_doc, name) name_list.append(name) + else: + name_list.append(name) return name_list diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 64168b2f4b..0d3e0193d5 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -804,6 +804,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ this.update_invoice() }else{ this.name = $.now(); + this.frm.doc.posting_date = frappe.datetime.get_today(); + this.frm.doc.posting_time = frappe.datetime.now_time(); invoice_data[this.name] = this.frm.doc this.si_docs.push(invoice_data) this.update_localstorage(); diff --git a/erpnext/accounts/print_format/point_of_sale/point_of_sale.json b/erpnext/accounts/print_format/point_of_sale/point_of_sale.json index 645fce6fe6..605c0326b3 100644 --- a/erpnext/accounts/print_format/point_of_sale/point_of_sale.json +++ b/erpnext/accounts/print_format/point_of_sale/point_of_sale.json @@ -6,9 +6,9 @@ "docstatus": 0, "doctype": "Print Format", "font": "Default", - "html": "\n\n

\n\t{{ company }}
\n\t{{ __(\"Invoice\") }}
\n

\n

\n\t{{ __(\"Date\") }}: {{ dateutil.global_date_format(posting_date) }}
\n

\n\n
\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n\t\n\t\t{% for item in items %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% endfor %}\n\t\n
{{ __(\"Item\") }}{{ __(\"Qty\") }}{{ __(\"Amount\") }}
\n\t\t\t\t{{ item.item_name }}\n\t\t\t{{ item.qty }}
@ {{ format_currency(item.rate, currency) }}
{{ format_currency(item.amount, currency) }}
\n\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% endif %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t
\n\t\t\t\t{{ row.description }}\n\t\t\t\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t
\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t
\n\t\t\t\t{{ __(\"Grand Total\") }}\n\t\t\t\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t
\n\n\n
\n

{{ __(\"Thank you, please visit again.\") }}

", + "html": "\n\n

\n\t{{ company }}
\n\t{{ __(\"Invoice\") }}
\n

\n

\n\t{{ __(\"Date\") }}: {{ dateutil.global_date_format(posting_date) }}
\n

\n\n
\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n\t\n\t\t{% for item in items %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% endfor %}\n\t\n
{{ __(\"Item\") }}{{ __(\"Qty\") }}{{ __(\"Amount\") }}
\n\t\t\t\t{{ item.item_name }}\n\t\t\t{{ format_number(item.qty, precision(\"difference\")) }}
@ {{ format_currency(item.rate, currency) }}
{{ format_currency(item.amount, currency) }}
\n\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% endif %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t
\n\t\t\t\t{{ row.description }}\n\t\t\t\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t
\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t
\n\t\t\t\t{{ __(\"Grand Total\") }}\n\t\t\t\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t
\n\n\n
\n

{{ __(\"Thank you, please visit again.\") }}

", "idx": 0, - "modified": "2016-05-21 00:25:20.359074", + "modified": "2016-08-11 07:23:04.530676", "modified_by": "Administrator", "name": "Point of Sale", "owner": "Administrator", From 39bc4b2a4cc6bdf5c4a9faa79d52f344300f2691 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 16 Aug 2016 15:18:20 +0530 Subject: [PATCH 7/8] Ignore overlap validation while creating timesheet from existing time logs --- .../v7_0/convert_timelog_to_timesheet.py | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py index cb16466dae..072ba13cd0 100644 --- a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py +++ b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py @@ -1,19 +1,23 @@ import frappe - -from erpnext.manufacturing.doctype.production_order.production_order import make_timesheet, add_timesheet_detail +from erpnext.manufacturing.doctype.production_order.production_order \ + import make_timesheet, add_timesheet_detail +from erpnext.projects.doctype.timesheet.timesheet import OverlapError def execute(): frappe.reload_doc('projects', 'doctype', 'timesheet') - for data in frappe.get_all('Time Log', fields=["*"], - filters = [["docstatus", "<", "2"]]): - time_sheet = make_timesheet(data.production_order) - args = get_timelog_data(data) - add_timesheet_detail(time_sheet, args) - time_sheet.docstatus = data.docstatus - time_sheet.note = data.note - time_sheet.company = frappe.db.get_single_value('Global Defaults', 'default_company') - time_sheet.save(ignore_permissions=True) + for data in frappe.get_all('Time Log', fields=["*"], filters = [["docstatus", "<", "2"]]): + try: + time_sheet = make_timesheet(data.production_order) + args = get_timelog_data(data) + add_timesheet_detail(time_sheet, args) + time_sheet.docstatus = data.docstatus + time_sheet.note = data.note + time_sheet.company = frappe.db.get_single_value('Global Defaults', 'default_company') + time_sheet.save(ignore_permissions=True) + except OverlapError: + time_sheet.flags.ignore_validate = True + time_sheet.save(ignore_permissions=True) def get_timelog_data(data): return { From 91d6544958b99204eeb503a5df75935f21a8ecf0 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 16 Aug 2016 15:55:33 +0600 Subject: [PATCH 8/8] bumped to version 7.0.28 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 9dcd02912f..c433ddb33c 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.0.27' +__version__ = '7.0.28' def get_default_company(user=None): '''Get default company for user'''