frappe / webshop

Open Source eCommerce Platform
GNU General Public License v3.0
92 stars 98 forks source link

AttributeError: 'Quotation' object has no attribute 'customer' #114

Closed khoran closed 3 days ago

khoran commented 4 months ago

When I click "Request for Quote" on a cart with some items, I get an "uncaught server exception: There was an error building this page". The stack trace is:

Traceback (most recent call last):
  File "apps/frappe/frappe/website/serve.py", line 20, in get_response
    response = renderer_instance.render()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
    html = self.get_html()
           ^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/utils.py", line 523, in cache_html_decorator
    html = func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 95, in get_html
    self.update_context()
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 163, in update_context
    data = self.run_pymodule_method("get_context")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 223, in run_pymodule_method
    return method(self.context)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/webshop/webshop/templates/pages/order.py", line 43, in get_context
    "Customer", context.doc.customer, "loyalty_program"
                ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Quotation' object has no attribute 'customer'

I found the issue being discussed recently in this forum: https://discuss.frappe.io/t/attributeerror-quotation-object-has-no-attribute-customer-in-v14-3-1/97342/2

The fix suggested there is to change context.doc.customer to context.doc.customer_name on line 43 of webshopt/templates/pages/order.py. I also found I needed to make the same change on line 53. After making these changes everything has been working well for me. Thank you.

GeoCommander commented 4 months ago

image

I replicated this error and can conform it exists.

0xhaval commented 3 months ago

Kindly, we need to solve this issue image

0xCCY commented 3 months ago

Bump for attention, this is a critical bug that blocks quotation workflow.

Nihantra-Patel commented 2 months ago

PR already raised: https://github.com/frappe/webshop/pull/139

Rebaz-balisani commented 1 month ago

I updated my erpnext today and yet the issue not resolved image