Error in subsciption module

Hello,

having installed the subscription module, I filled in all mandatory fields and tried to create an offer. Here this message appeared:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 109, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 43, in rpc
    return methods.get(request.rpc_method, _dispatch)(
  File "/trytond/wsgi.py", line 75, in wrapper
    return func(request, *args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 200, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 196, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/modelview.py", line 753, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/trytond/model/workflow.py", line 37, in wrapper
    result = func(cls, filtered, *args, **kwargs)
  File "/trytond/modules/company/model.py", line 66, in wrapper
    result = func(cls, records, *args, **kwargs)
  File "/trytond/modules/sale_subscription/subscription.py", line 375, in quote
    cls.set_number(subscriptions)
  File "/trytond/modules/sale_subscription/subscription.py", line 282, in set_number
    company=subscription.company.id).get()
AttributeError: 'NoneType' object has no attribute 'get'

Fault: 'NoneType' object has no attribute 'get'

This is how input windows look like:


This should not happen, true?
What should I do.

EG

In sale configuration you are missing to set a sequence for subscription numbering.
Setting this sequence should fix the error.

Thank you for your quick reply.

Actually, there already was a sequence of type “subscription”, but not attributed to the company. I corrected that, restarted server and client and created a new subscription.

Same result.
):

EG

Are you sure that the traceback is exactly the same as the posted one?

Do you have more than one company? The company on the subscription tab “Other info” is the same as the set in the sequence?

:blush:
It looks very similar, but last two sections are different:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 109, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 43, in rpc
    return methods.get(request.rpc_method, _dispatch)(
  File "/trytond/wsgi.py", line 75, in wrapper
    return func(request, *args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 200, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 196, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/modelview.py", line 753, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/trytond/model/workflow.py", line 37, in wrapper
    result = func(cls, filtered, *args, **kwargs)
  File "/trytond/modules/company/model.py", line 66, in wrapper
    result = func(cls, records, *args, **kwargs)
  File "/trytond/modules/sale_subscription/subscription.py", line 375, in quote
    cls.set_number(subscriptions)
  File "/trytond/modules/sale_subscription/subscription.py", line 282, in set_number
    company=subscription.company.id).get()
AttributeError: 'NoneType' object has no attribute 'get'

Fault: 'NoneType' object has no attribute 'get'

And yes, only one company.

It’s exactly the same error as the first post.

The problem it’s clear and the same as it was: it can not find a sequence for the subscription with the company set on the subscription.

I tried to reproduce this in a fresh, minimal setup (only including sale-subscription):

  • The sequence was created automatically (and nor assigned to any company)
  • The error did not occur for me

If you have some knowladge about python programming, I suggest to add a breakpoint() just before line 375 in /trytond/modules/sale_subscription/subscription.py and try to learn what is None here.

I’m so sorry and embarrassed at the same time… ):
Due to sloppy reading I missed to pay enough attention to @pokoli 's answer, which was absolutely correct. I messed up “existence of sequence” and “sequence in sales settings” - absolutely my fault, and a silly one…

Thanks to all for taking time and paying attention.

EG

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.