Movement models don't support accounts requiring a party

As there are numerous sorts of accounting movements that models help, there is a case we’d like to have which doesn’t seem to have ever worked but is quite frequent.

Namely creating a movement model involving accounts requiring a party.

Even creating a model with the company name as placeholder in the party field doesn’t work as a workaround, the error raised when trying to create a move with that model is that a value is required for the field ‘party’ blah blah blah…

Is this simply a bug to be filed, or is there a way to get to the movement form with these elements in order to fill in with the party in question along with the amounts and descriptions.


They are supported

I wanted to reproduce the problem in demo6.6, but there I can’t even get past entering the first line in the template move.
What’s curious is that the company is greyed out and blank, normally it should be able to select a company [if multiple companies available].
So I tried to create a simple move, but there gives the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python39/dist-packages/trytond/model/modelpy", line 313, in __getattr__
    return self_values[name]
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python39/dist-packages/trytond/wsgipy", line 119, in dispatch_request
    return endpoint(request, **requestview_args)
  File "/usr/local/lib/python39/dist-packages/trytond/protocols/dispatcherpy", line 49, in rpc
    return methodsget(requestrpc_method, _dispatch)(
  File "/usr/local/lib/python39/dist-packages/trytond/wsgipy", line 86, in auth_required
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python39/dist-packages/trytond/protocols/wrapperspy", line 162, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/usr/local/lib/python39/dist-packages/trytond/protocols/dispatcherpy", line 212, in _dispatch
    result = rpcresult(meth(inst, *c_args, **c_kwargs))
  File "/usr/local/lib/python39/dist-packages/trytond/model/fields/fieldpy", line 124, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python39/dist-packages/trytond/modules/account/movepy", line 183, in on_change_with_date
    today = Datetoday()
  File "/usr/local/lib/python39/dist-packages/trytond/modules/company/irpy", line 40, in today
    if companytimezone:
  File "/usr/local/lib/python39/dist-packages/trytond/model/modelstoragepy", line 1615, in __getattr__
    return super(ModelStorage, self)__getattr__(name)
  File "/usr/local/lib/python39/dist-packages/trytond/model/modelpy", line 315, in __getattr__
    raise AttributeError("'%s' Model has no attribute '%s': %s"
AttributeError: 'companycompany' Model has no attribute 'timezone': None

Fault: '' Model has no attribute 'timezone': None

looks like an environment problem for the demo server, perhaps…

Thanks, that works great.
Please add this scenario to the tests as that is the first place checked for functionality not necessarily clearly elaborated in doc/*.rst

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