diff --git a/erpnext/accounts/custom/address.py b/erpnext/accounts/custom/address.py index a6d08d8ff61..a28402eaef4 100644 --- a/erpnext/accounts/custom/address.py +++ b/erpnext/accounts/custom/address.py @@ -31,7 +31,10 @@ class ERPNextAddress(Address): After Address is updated, update the related 'Primary Address' on Customer. """ address_display = get_address_display(self.as_dict()) - filters = { "customer_primary_address": self.name } + filters = { + "customer_primary_address": self.name + } + customers = frappe.db.get_all("Customer", filters=filters, as_list=True) for customer_name in customers: frappe.db.set_value("Customer", customer_name[0], "primary_address", address_display) diff --git a/erpnext/patches/v13_0/delete_old_purchase_reports.py b/erpnext/patches/v13_0/delete_old_purchase_reports.py index 86e55ef782f..57620d3e986 100644 --- a/erpnext/patches/v13_0/delete_old_purchase_reports.py +++ b/erpnext/patches/v13_0/delete_old_purchase_reports.py @@ -6,9 +6,6 @@ from __future__ import unicode_literals import frappe from erpnext.accounts.utils import check_and_delete_linked_reports -from erpnext.accounts.utils import check_and_delete_linked_reports - - def execute(): reports_to_delete = ["Requested Items To Be Ordered", "Purchase Order Items To Be Received or Billed","Purchase Order Items To Be Received", diff --git a/erpnext/patches/v13_0/delete_old_sales_reports.py b/erpnext/patches/v13_0/delete_old_sales_reports.py index 98d635980ae..905a42c0c4c 100644 --- a/erpnext/patches/v13_0/delete_old_sales_reports.py +++ b/erpnext/patches/v13_0/delete_old_sales_reports.py @@ -6,9 +6,6 @@ from __future__ import unicode_literals import frappe from erpnext.accounts.utils import check_and_delete_linked_reports -from erpnext.accounts.utils import check_and_delete_linked_reports - - def execute(): reports_to_delete = ["Ordered Items To Be Delivered", "Ordered Items To Be Billed"] diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py index 9155f45184f..a20c70a6dac 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.py +++ b/erpnext/projects/doctype/timesheet/timesheet.py @@ -235,7 +235,7 @@ def get_projectwise_timesheet_data(project=None, parent=None, from_time=None, to tsd.activity_type as activity_type, tsd.description as description, ts.currency as currency, - tsd.project_name as project_name + tsd.project_name as project_name FROM `tabTimesheet Detail` tsd diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 87bef798a7c..df98b681106 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -1595,30 +1595,6 @@ class StockEntry(StockController): if material_request and material_request not in material_requests: material_requests.append(material_request) frappe.db.set_value('Material Request', material_request, 'transfer_status', status) - - def update_items_for_process_loss(self): - process_loss_dict = {} - for d in self.get("items"): - if not d.is_process_loss: - continue - - scrap_warehouse = frappe.db.get_single_value("Manufacturing Settings", "default_scrap_warehouse") - if scrap_warehouse is not None: - d.t_warehouse = scrap_warehouse - d.is_scrap_item = 0 - - if d.item_code not in process_loss_dict: - process_loss_dict[d.item_code] = [flt(0), flt(0)] - process_loss_dict[d.item_code][0] += flt(d.transfer_qty) - process_loss_dict[d.item_code][1] += flt(d.qty) - - for d in self.get("items"): - if not d.is_finished_item or d.item_code not in process_loss_dict: - continue - # Assumption: 1 finished item has 1 row. - d.transfer_qty -= process_loss_dict[d.item_code][0] - d.qty -= process_loss_dict[d.item_code][1] - def update_items_for_process_loss(self): process_loss_dict = {}