fix: attribute error when trying to fetch items (#18900)
This commit is contained in:
parent
0252c1478e
commit
1635967c4e
@ -99,7 +99,7 @@ class ProductionPlan(Document):
|
||||
self.get_mr_items()
|
||||
|
||||
def get_so_items(self):
|
||||
so_list = [d.sales_order for d in self.sales_orders if d.sales_order]
|
||||
so_list = [d.sales_order for d in self.get("sales_orders", []) if d.sales_order]
|
||||
if not so_list:
|
||||
msgprint(_("Please enter Sales Orders in the above table"))
|
||||
return []
|
||||
@ -134,7 +134,7 @@ class ProductionPlan(Document):
|
||||
self.calculate_total_planned_qty()
|
||||
|
||||
def get_mr_items(self):
|
||||
mr_list = [d.material_request for d in self.material_requests if d.material_request]
|
||||
mr_list = [d.material_request for d in self.get("material_requests", []) if d.material_request]
|
||||
if not mr_list:
|
||||
msgprint(_("Please enter Material Requests in the above table"))
|
||||
return []
|
||||
|
Loading…
Reference in New Issue
Block a user