From b505d2daa9e262159faa40a64e539a7e79727d70 Mon Sep 17 00:00:00 2001 From: nidh-eesh Date: Thu, 16 Nov 2023 11:55:43 +0530 Subject: [PATCH] fix: Changed parent warehouse for all smiiths to All Smith Warehouse --- aumms/aumms/doctype/smith/smith.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/aumms/aumms/doctype/smith/smith.py b/aumms/aumms/doctype/smith/smith.py index 57d917d6..1d76d6c0 100644 --- a/aumms/aumms/doctype/smith/smith.py +++ b/aumms/aumms/doctype/smith/smith.py @@ -26,18 +26,8 @@ def create_smith_warehouse(self): # creating a new warehouse new_warehouse.warehouse_name = req_warehouse_name - if self.is_head_of_smith: - new_warehouse.is_group = 1 - new_warehouse.parent_warehouse = get_all_smith_warehouse() - else: - head_of_smith = frappe.db.exists('Smith', {'employee':self.head_of_smith}) - if not head_of_smith: - frappe.throw(_(f'Smith not found for {self.head_of_smith}')) - head_of_smith_warehouse = frappe.db.get_value('Smith', head_of_smith, 'warehouse') - if not head_of_smith_warehouse: - frappe.throw(_(f'No Warehouse found for Head of Smith {head_of_smith}')) - new_warehouse.parent_warehouse = head_of_smith_warehouse - + new_warehouse.is_group = 0 + new_warehouse.parent_warehouse = get_all_smith_warehouse() new_warehouse.save(ignore_permissions=True) self.warehouse = new_warehouse.name