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

Title: Bug: get_quotation_url Throws AttributeError: 'NoneType' object has no attribute 'get' if no address is set for organisation #581

Open
melgo-tb opened this issue Feb 5, 2025 · 0 comments

Comments

@melgo-tb
Copy link

melgo-tb commented Feb 5, 2025

Description

When clicking the Create Quotation button from the Deals page, an AttributeError occurs if the organization address is not set. This happens in the get_quotation_url function inside erpnext_crm_settings.py, where get_organization_address(organization) returns None, causing an attempt to access .get("name") on a NoneType object.

AttributeError: 'NoneType' object has no attribute 'get'
address = get_organization_address(organization).get("name") if organization else None

Steps to Reproduce:

  1. Open the Deals page in Frappe CRM.
  2. Click Create Quotation when the organization does not have an address set.
  3. The system throws an AttributeError, breaking the workflow.

Proposed Fix:

Modify the line to check for None before accessing .get("name"):

address = get_organization_address(organization)
address_name = address.get("name") if address else None
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

No branches or pull requests

1 participant