Hello,
I have a button which call a subprocess inside the method, that subprocess is a python script which update the received record on the database. (using psycopg2)
I tried to re instance after the subprocess.check_output() like:
updated_invoice = Pool().get(‘account_invoice’)
But I see the old record (without the information added by the script), ¿Is there any way yo tell the ORM to refresh or query again the db?
PD: If I click the button again, the record has the new information, I guess it’s because tryton is using a new transaction
Thanks in advance.
Which seems to work, but from tryton I get this error, I know I’m very close :
Traceback (most recent call last):
File “/trytond/wsgi.py”, line 80, in dispatch_request
return endpoint(request, **request.view_args)
File “/trytond/protocols/dispatcher.py”, line 46, in rpc
request, database_name, *request.rpc_params)
File “/trytond/wsgi.py”, line 51, in auth_required
return wrapped(*args, **kwargs)
File “/trytond/protocols/wrappers.py”, line 122, in wrapper
return func(request, pool, *args, **kwargs)
File “/trytond/protocols/dispatcher.py”, line 205, in _dispatch
security.reset(pool.database_name, session, context=context)
File “/trytond/security.py”, line 134, in reset
with Transaction().start(dbname, 0, context=context):
File “/trytond/transaction.py”, line 86, in start
assert self.user is None
AssertionError