diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 7e94a34634..958957ca77 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.0.40' +__version__ = '7.0.41' def get_default_company(user=None): '''Get default company for user''' diff --git a/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json b/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json index 64417481ff..4dd08b67f6 100644 --- a/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json +++ b/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json @@ -171,7 +171,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_list_view": 0, + "in_list_view": 1, "label": "Allocated", "length": 0, "no_copy": 0, diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 234f9623f7..f3ee7d0be4 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -614,6 +614,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ this.child.batch_no = this.item_batch_no[this.child.item_code]; this.child.serial_no = (this.item_serial_no[this.child.item_code] ? this.item_serial_no[this.child.item_code][0] : ''); + this.child.item_tax_rate = this.items[0].taxes; }, update_paid_amount_status: function(update_paid_amount){ diff --git a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py index a176a8f349..89af095754 100644 --- a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py +++ b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py @@ -4,8 +4,10 @@ from erpnext.manufacturing.doctype.production_order.production_order \ def execute(): frappe.reload_doc('projects', 'doctype', 'timesheet') + if not frappe.db.table_exists("Time Log"): + return - for data in frappe.get_all('Time Log', fields=["*"], filters = [["docstatus", "<", "2"]]): + for data in frappe.db.sql("select * from `tabTime Log` where where docstatus < 2", as_dict=1): if data.task: company = frappe.db.get_value("Task", data.task, "company") elif data.production_order: diff --git a/erpnext/patches/v7_0/migrate_mode_of_payments_v6_to_v7.py b/erpnext/patches/v7_0/migrate_mode_of_payments_v6_to_v7.py index 03f0afba18..8de92b7f59 100644 --- a/erpnext/patches/v7_0/migrate_mode_of_payments_v6_to_v7.py +++ b/erpnext/patches/v7_0/migrate_mode_of_payments_v6_to_v7.py @@ -4,11 +4,14 @@ import frappe def execute(): frappe.reload_doc('accounts', 'doctype', 'sales_invoice_timesheet') frappe.reload_doc('accounts', 'doctype', 'sales_invoice_payment') - + frappe.reload_doc('accounts', 'doctype', 'mode_of_payment') + + count = 0 for data in frappe.db.sql("""select name, mode_of_payment, cash_bank_account, paid_amount, company - from `tabSales Invoice` - where is_pos = 1 and docstatus < 2 - and cash_bank_account is not null and cash_bank_account != ''""", as_dict=1): + from `tabSales Invoice` si + where si.is_pos = 1 and si.docstatus < 2 + and si.cash_bank_account is not null and si.cash_bank_account != '' + and not exists(select name from `tabSales Invoice Payment` where parent=si.name)""", as_dict=1): if not data.mode_of_payment and not frappe.db.exists("Mode of Payment", "Cash"): mop = frappe.new_doc("Mode of Payment") @@ -17,13 +20,19 @@ def execute(): mop.save() si_doc = frappe.get_doc('Sales Invoice', data.name) - si_doc.append('payments', { + row = si_doc.append('payments', { 'mode_of_payment': data.mode_of_payment or 'Cash', 'account': data.cash_bank_account, 'type': frappe.db.get_value('Mode of Payment', data.mode_of_payment, 'type') or 'Cash', 'amount': data.paid_amount }) - + row.db_update() + si_doc.set_paid_amount() - si_doc.flags.ignore_validate_update_after_submit = True - si_doc.save() \ No newline at end of file + si_doc.db_set("paid_amount", si_doc.paid_amount) + si_doc.db_set("base_paid_amount", si_doc.base_paid_amount) + + count +=1 + + if count % 200 == 0: + frappe.db.commit() \ No newline at end of file