Hi everybody,
I am currently working on a testing setup for a chart of accounts. I am stuck at a point with proteus, where I request some help. I try to set the default accounts in the financial configuration with Proteus, but keep getting the following error, but in every object involved the missing field is set (from my point of view).
>>>Config = Model.get(‘account.configuration’)
>>>Defaultaccount = Model.get(‘account.configuration.default_account’)
>>>Account = Model.get(‘account.account’)
>>>config, = Config.find()
>>>recdef = Defaultaccount()
>>>recdef.company = get_company()
>>>account = Account.find([(‘code’, ‘=’, ‘1200’)], limit=1)[0]
>>>recdef.default_account_receivable = account
>>>account.company
proteus.Model.get(‘company.company’)(1)
>>>get_cfg().context[‘company’]
1
>>>config.default_account_receivable = recdef
>>>config.save()
Traceback (most recent call last):
File "/Users/jakobfischer/Entwicklung/gf_verification_database/populate_veridb.py", line 550, in start_console
from IPython import embed # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'IPython'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Users/jakobfischer/Entwicklung/tryton74/lib/python3.13/site-packages/proteus/__init__.py", line 102, in newfunc
return self.func(owner, [instance], *args, **kwargs)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jakobfischer/Entwicklung/tryton74/lib/python3.13/site-packages/proteus/__init__.py", line 866, in save
proxy.write(*values)
~~~~~~~~~~~^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/xmlrpc/client.py", line 1096, in __call__
return self.__send(self.__name, args)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/xmlrpc/client.py", line 1435, in __request
response = self.__transport.request(
self.__host,
...<2 lines>...
verbose=self.__verbose
)
File "/opt/homebrew/Cellar/python@3.13/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/xmlrpc/client.py", line 1140, in request
return self.single_request(host, handler, request_body, verbose)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/xmlrpc/client.py", line 1156, in single_request
return self.parse_response(resp)
~~~~~~~~~~~~~~~~~~~^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/xmlrpc/client.py", line 1325, in parse_response
return u.close()
~~~~~~~^^
File "/opt/homebrew/Cellar/python@3.13/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/xmlrpc/client.py", line 642, in close
raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault 1: 'A value is required for field "Company" in "Account". - '>
I can configure this very account by hand in the client, but get the error when using Proteus. As you can see, the company of each object is set, but I still get the error.
Thanks for your help Jakob