From a51b32b7e013ca6e1bbb5f31c956f07c11111c89 Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Thu, 31 Mar 2022 14:19:53 +0530 Subject: [PATCH] fix: merge conflicts --- .../doctype/purchase_invoice/purchase_invoice.py | 12 ------------ erpnext/controllers/accounts_controller.py | 14 -------------- 2 files changed, 26 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 716bda0d33e..8500d57f44b 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -245,26 +245,14 @@ class PurchaseInvoice(BuyingController): def validate_warehouse(self, for_validate=True): if self.update_stock and for_validate: -<<<<<<< HEAD -<<<<<<< HEAD - for d in self.get("items"): - if not d.warehouse: -======= stock_items = self.get_stock_items() for d in self.get("items"): if not d.warehouse and d.item_code in stock_items: ->>>>>>> 6528218ac3 (perf: skip warehouse validation for non-stock items) frappe.throw( _( "Warehouse required at Row No {0}, please set default warehouse for the item {1} for the company {2}" ).format(d.idx, d.item_code, self.company) ) -======= - for d in self.get('items'): - if not d.warehouse and not d.is_fixed_asset: - frappe.throw(_("Row No {0}: Warehouse is required. Please set a Default Warehouse for Item {1} and Company {2}"). - format(d.idx, d.item_code, self.company), exc=WarehouseMissingError) ->>>>>>> 136466d255 (fix(asset): do not validate warehouse on asset purchase) super(PurchaseInvoice, self).validate_warehouse() diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index f06ced36373..61db921f9cc 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -1268,23 +1268,9 @@ class AccountsController(TransactionBase): stock_items = [] item_codes = list(set(item.item_code for item in self.get("items"))) if item_codes: -<<<<<<< HEAD - stock_items = [ - r[0] - for r in frappe.db.sql( - """ - select name from `tabItem` - where name in (%s) and is_stock_item=1 - """ - % (", ".join((["%s"] * len(item_codes))),), - item_codes, - ) - ] -======= stock_items = frappe.db.get_values( "Item", {"name": ["in", item_codes], "is_stock_item": 1}, pluck="name", cache=True ) ->>>>>>> 199a6da960 (perf: skip warehouse validation for non-stock items) return stock_items