Skip to content

Commit

Permalink
Merge pull request #192 from efeone/parent_smith_warehouse_changed
Browse files Browse the repository at this point in the history
fix: Changed parent warehouse for all smiiths to All Smith Warehouse
  • Loading branch information
muhammadmp authored Nov 16, 2023
2 parents 9d14f19 + b505d2d commit c162740
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions aumms/aumms/doctype/smith/smith.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c162740

Please sign in to comment.