From bd599b0169cc1e738986a43c3ded4028670fae94 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 22 Sep 2016 11:46:56 +0530 Subject: [PATCH 1/6] [Fix] Discount copied during making of PO from SO --- erpnext/selling/doctype/sales_order/sales_order.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index ced36791c0..0435141d53 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -553,6 +553,9 @@ def get_events(start, end, filters=None): def make_purchase_order_for_drop_shipment(source_name, for_supplier, target_doc=None): def set_missing_values(source, target): target.supplier = for_supplier + target.apply_discount_on = "" + target.additional_discount_percentage = 0.0 + target.discount_amount = 0.0 default_price_list = frappe.get_value("Supplier", for_supplier, "default_price_list") if default_price_list: From deaee7c08b9c2f31006729a097fc11d866cd45a1 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 22 Sep 2016 14:02:53 +0530 Subject: [PATCH 2/6] [Fix] Additional Discount Amount can't be refresh automatically #6199 --- erpnext/public/js/controllers/transaction.js | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 2b73cf4a05..92161e1bab 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -678,6 +678,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ me._set_values_for_item_list(r.message); if(item) me.set_gross_profit(item); if(calculate_taxes_and_totals) me.calculate_taxes_and_totals(); + if(me.frm.doc.apply_discount_on) me.frm.trigger("apply_discount_on") } } }); From 481ca832b0588c60794c7b27768c3b20d58c5007 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 22 Sep 2016 17:21:37 +0530 Subject: [PATCH 3/6] minor fix --- erpnext/accounts/page/pos/pos.js | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index f3ee7d0be4..247d5ac859 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -655,7 +655,6 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ show_items_in_item_cart: function() { var me = this; var $items = this.wrapper.find(".items").empty(); - me.frm.doc.net_total = 0.0 $.each(this.frm.doc.items|| [], function(i, d) { $(frappe.render_template("pos_bill_item", { item_code: d.item_code, From b2382c0b8e2fa177aa5deafe90463a7333d9f51c Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 22 Sep 2016 18:45:06 +0530 Subject: [PATCH 4/6] [fix] Supplier status stuck at Open forever --- erpnext/accounts/party_status.py | 1 - erpnext/patches.txt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/accounts/party_status.py b/erpnext/accounts/party_status.py index 68b48184e7..6d9efb190b 100644 --- a/erpnext/accounts/party_status.py +++ b/erpnext/accounts/party_status.py @@ -55,7 +55,6 @@ def notify_status(doc, method=None): if party.status == 'Open': # may be open elsewhere, check # default status - party.status = status update_status(party) party.update_modified() diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 303cc400ba..bd7d9a49fa 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -266,7 +266,7 @@ erpnext.patches.v6_20x.remove_fiscal_year_from_holiday_list erpnext.patches.v6_24.map_customer_address_to_shipping_address_on_po erpnext.patches.v6_27.fix_recurring_order_status erpnext.patches.v6_20x.update_product_bundle_description -erpnext.patches.v7_0.update_party_status +erpnext.patches.v7_0.update_party_status #2016-09-22 erpnext.patches.v7_0.update_item_projected erpnext.patches.v7_0.remove_features_setup erpnext.patches.v7_0.update_home_page From d03087d3abc49b58a95e2731b105247c5f581ecd Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 23 Sep 2016 11:08:02 +0530 Subject: [PATCH 5/6] Patch fixed for legacy migration --- erpnext/accounts/doctype/budget/budget.py | 3 +++ erpnext/patches/v7_0/convert_timelog_to_timesheet.py | 1 + erpnext/patches/v7_0/convert_timelogbatch_to_timesheet.py | 8 ++++---- ...atch_from_salesinvoiceitem_to_salesinvoicetimesheet.py | 2 ++ erpnext/patches/v7_0/remove_features_setup.py | 2 ++ ...etup_account_table_for_expense_claim_type_if_exists.py | 1 + erpnext/stock/doctype/warehouse/warehouse.py | 2 +- 7 files changed, 14 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/doctype/budget/budget.py b/erpnext/accounts/doctype/budget/budget.py index 529401c84b..2488dd68ca 100644 --- a/erpnext/accounts/doctype/budget/budget.py +++ b/erpnext/accounts/doctype/budget/budget.py @@ -51,6 +51,9 @@ class Budget(Document): def validate_expense_against_budget(args): args = frappe._dict(args) + if not args.cost_center: + return + if frappe.db.get_value("Account", {"name": args.account, "root_type": "Expense"}): cc_lft, cc_rgt = frappe.db.get_value("Cost Center", args.cost_center, ["lft", "rgt"]) diff --git a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py index 52433a5dba..40423c8db2 100644 --- a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py +++ b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py @@ -27,6 +27,7 @@ def execute(): time_sheet.update_cost() time_sheet.calculate_total_amounts() time_sheet.flags.ignore_validate = True + time_sheet.flags.ignore_links = True time_sheet.save(ignore_permissions=True) # To ignore validate_mandatory_fields function diff --git a/erpnext/patches/v7_0/convert_timelogbatch_to_timesheet.py b/erpnext/patches/v7_0/convert_timelogbatch_to_timesheet.py index 0eff8d4c5b..a7cb0d74ce 100644 --- a/erpnext/patches/v7_0/convert_timelogbatch_to_timesheet.py +++ b/erpnext/patches/v7_0/convert_timelogbatch_to_timesheet.py @@ -17,10 +17,10 @@ def execute(): add_timesheet_detail(time_sheet, args) time_sheet.docstatus = tlb.docstatus + time_sheet.flags.ignore_links = True time_sheet.save(ignore_permissions=True) def get_timesheet_data(data): - time_log = frappe.get_all('Time Log', fields=["*"], - filters = {'name': data.time_log})[0] - - return get_timelog_data(time_log) \ No newline at end of file + time_log = frappe.get_all('Time Log', fields=["*"], filters = {'name': data.time_log}) + if time_log: + return get_timelog_data(time_log[0]) \ No newline at end of file diff --git a/erpnext/patches/v7_0/move_timelogbatch_from_salesinvoiceitem_to_salesinvoicetimesheet.py b/erpnext/patches/v7_0/move_timelogbatch_from_salesinvoiceitem_to_salesinvoicetimesheet.py index 7f3b755428..ea7cb06dfb 100644 --- a/erpnext/patches/v7_0/move_timelogbatch_from_salesinvoiceitem_to_salesinvoicetimesheet.py +++ b/erpnext/patches/v7_0/move_timelogbatch_from_salesinvoiceitem_to_salesinvoicetimesheet.py @@ -5,6 +5,8 @@ def execute(): frappe.reload_doc('accounts', 'doctype', 'sales_invoice_payment') for time_sheet in frappe.db.sql(""" select sales_invoice, name, total_billing_amount from `tabTimesheet` where sales_invoice is not null and docstatus < 2""", as_dict=True): + if not frappe.db.exists('Sales Invoice', time_sheet.sales_invoice): + continue si_doc = frappe.get_doc('Sales Invoice', time_sheet.sales_invoice) ts = si_doc.append('timesheets',{}) ts.time_sheet = time_sheet.name diff --git a/erpnext/patches/v7_0/remove_features_setup.py b/erpnext/patches/v7_0/remove_features_setup.py index 60d19265a0..596f7a9dcf 100644 --- a/erpnext/patches/v7_0/remove_features_setup.py +++ b/erpnext/patches/v7_0/remove_features_setup.py @@ -7,6 +7,8 @@ def execute(): frappe.reload_doctype('Stock Settings') stock_settings = frappe.get_doc('Stock Settings', 'Stock Settings') stock_settings.show_barcode_field = cint(frappe.db.get_value("Features Setup", None, "fs_item_barcode")) + if not frappe.db.exists("UOM", stock_settings.stock_uom): + stock_settings.stock_uom = None stock_settings.save() create_compact_item_print_custom_field() 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 96224909ae..c5657079b3 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 @@ -16,4 +16,5 @@ def execute(): "company": frappe.db.get_value("Account", expense_claim_type.default_account, "company"), "default_account": expense_claim_type.default_account, }) + doc.flags.ignore_mandatory = True doc.save(ignore_permissions=True) \ No newline at end of file diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py index 938e73c3d2..e1fb87a6f6 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.py +++ b/erpnext/stock/doctype/warehouse/warehouse.py @@ -71,7 +71,7 @@ class Warehouse(NestedSet): "freeze_account": "No" }) ac_doc.flags.ignore_permissions = True - + ac_doc.flags.ignore_mandatory = True try: ac_doc.insert() msgprint(_("Account head {0} created").format(ac_doc.name)) From 84fa3dfac833fbd268df98a091afc89f5b8515c5 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 23 Sep 2016 12:46:01 +0600 Subject: [PATCH 6/6] bumped to version 7.0.47 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 85b7acbb56..a87d0ded9c 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.0.46' +__version__ = '7.0.47' def get_default_company(user=None): '''Get default company for user'''