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

Error in Subscription customization #15888

Open
fproldan opened this issue Nov 1, 2018 · 3 comments

Comments

@fproldan
Copy link
Contributor

@fproldan fproldan commented Nov 1, 2018

Hello.

An error was thrown when I try to add a custom field en Subscription DoctType

Traceback (most recent call last):
  File "/home/erp/erpnext/apps/frappe/frappe/app.py", line 61, in application
    response = frappe.handler.handle()
  File "/home/erp/erpnext/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/erp/erpnext/apps/frappe/frappe/handler.py", line 56, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/erp/erpnext/apps/frappe/frappe/__init__.py", line 1007, in call
    return fn(*args, **newargs)
  File "/home/erp/erpnext/apps/frappe/frappe/handler.py", line 84, in runserverobj
    frappe.desk.form.run_method.runserverobj(method, docs=docs, dt=dt, dn=dn, arg=arg, args=args)
  File "/home/erp/erpnext/apps/frappe/frappe/desk/form/run_method.py", line 36, in runserverobj
    r = doc.run_method(method)
  File "/home/erp/erpnext/apps/frappe/frappe/model/document.py", line 772, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/erp/erpnext/apps/frappe/frappe/model/document.py", line 1048, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/erp/erpnext/apps/frappe/frappe/model/document.py", line 1031, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/erp/erpnext/apps/frappe/frappe/model/document.py", line 766, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/erp/erpnext/apps/frappe/frappe/custom/doctype/customize_form/customize_form.py", line 147, in save_customization
    self.update_custom_fields()
  File "/home/erp/erpnext/apps/frappe/frappe/custom/doctype/customize_form/customize_form.py", line 227, in update_custom_fields
    self.add_custom_field(df, i)
  File "/home/erp/erpnext/apps/frappe/frappe/custom/doctype/customize_form/customize_form.py", line 246, in add_custom_field
    d.insert()
  File "/home/erp/erpnext/apps/frappe/frappe/model/document.py", line 222, in insert
    self.run_before_save_methods()
  File "/home/erp/erpnext/apps/frappe/frappe/model/document.py", line 876, in run_before_save_methods
    self.run_method("validate")
  File "/home/erp/erpnext/apps/frappe/frappe/model/document.py", line 772, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/erp/erpnext/apps/frappe/frappe/model/document.py", line 1048, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/erp/erpnext/apps/frappe/frappe/model/document.py", line 1031, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/erp/erpnext/apps/frappe/frappe/model/document.py", line 766, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/erp/erpnext/apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 53, in validate
    check_if_fieldname_conflicts_with_methods(self.dt, self.fieldname)
  File "/home/erp/erpnext/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 885, in check_if_fieldname_conflicts_with_methods
    method_list = [method for method in dir(doc) if isinstance(method, str) and callable(getattr(doc, method))]
  File "/home/erp/erpnext/apps/erpnext/erpnext/accounts/doctype/subscription/subscription.py", line 321, in is_postpaid_to_invoice
    not self.has_outstanding_invoice()
  File "/home/erp/erpnext/apps/erpnext/erpnext/accounts/doctype/subscription/subscription.py", line 392, in has_outstanding_invoice
    current_invoice = self.get_current_invoice()
  File "/home/erp/erpnext/apps/erpnext/erpnext/accounts/doctype/subscription/subscription.py", line 191, in get_current_invoice
    if len(self.invoices):
AttributeError: 'Subscription' object has no attribute 'invoices'

Thanks

@kennethsequeira

This comment has been minimized.

Copy link
Contributor

@kennethsequeira kennethsequeira commented Nov 3, 2018

What version are you on?

@fproldan

This comment has been minimized.

Copy link
Contributor Author

@fproldan fproldan commented Nov 4, 2018

ERPNext: v11.0.3-beta.4 () (staging)
Frappe Framework: v11.0.3-beta.18 () (staging)

@kennethsequeira

This comment has been minimized.

Copy link
Contributor

@kennethsequeira kennethsequeira commented Nov 6, 2018

Have you tried upgrading to the latest and then adding the field?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.