Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: attribute error when trying to fetch items (v11) #18899

Merged

Conversation

Alchez
Copy link
Contributor

@Alchez Alchez commented Sep 3, 2019

Problem:

Frappe does not build tables as document attributes until it's actually processed first, causing the Production Plan to error out for new Plans.


Tracebacks:

Sales Orders:

Traceback (most recent call last):
  File "/home/rohan/weed/apps/erpnext/erpnext/manufacturing/doctype/production_plan/production_plan.py", line 95, in get_items
    self.get_so_items()
  File "/home/rohan/weed/apps/erpnext/erpnext/manufacturing/doctype/production_plan/production_plan.py", line 100, in get_so_items
    so_list = [d.sales_order for d in self.sales_orders if d.sales_order]
AttributeError: 'ProductionPlan' object has no attribute 'sales_orders'

Material Requests

Traceback (most recent call last):
  File "/home/rohan/weed/apps/erpnext/erpnext/manufacturing/doctype/production_plan/production_plan.py", line 97, in get_items
    self.get_mr_items()
  File "/home/rohan/weed/apps/erpnext/erpnext/manufacturing/doctype/production_plan/production_plan.py", line 135, in get_mr_items
    mr_list = [d.material_request for d in self.material_requests if d.material_request]
AttributeError: 'ProductionPlan' object has no attribute 'material_requests'

@Alchez Alchez changed the title fix: attribute error when trying to fetch items fix: attribute error when trying to fetch items (v11) Sep 3, 2019
@nabinhait nabinhait merged commit f64aaf5 into frappe:version-11-hotfix Sep 5, 2019
@Alchez Alchez deleted the v11-production-plan-items branch September 5, 2019 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants