On Monday, October 1, 2018 at 3:30:04 PM UTC+7, Cédric Krier wrote:
> On 2018-10-01 01:04, Markus Bala wrote:
> > But when I try using context_model, i am going to do some "save" to model.
>
> I do not understand. the context model is only used by the client.
>
> > It prompt error psycopg2, cannot execute INSERT because is
> > readonly-transaction
>
> On which kind of RPC call are you doing a save?
>
> --
> Cédric Krier - B2CK SPRL
> Email/Jabber: [email protected]
> Tel: +32 472 54 46 59
> Website: http://www.b2ck.com/
Traceback (most recent call last):
File "/trytond/wsgi.py", line 71, in dispatch_request
return endpoint(request, **request.view_args)
File "/trytond/protocols/dispatcher.py", line 41, in rpc
request, database_name, *request.rpc_params)
File "/trytond/wsgi.py", line 42, 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 172, in _dispatch
result = rpc.result(meth(inst, *c_args, **c_kwargs))
File "/trytond/model/modelview.py", line 677, in on_change
method()
File "/trytond/model/modelview.py", line 84, in wrapper
result = func(self, *args, **kwargs)
File "/trytond/model/fields/field.py", line 114, in wrapper
return func(self, *args, **kwargs)
File "/trytond/modules/tri_jda/jda.py", line 189, in on_change_lodnum
rec.save(recs)
File "/trytond/model/descriptors.py", line 33, in newfunc
return self.func(owner, *args, **kwargs)
File "/trytond/model/modelstorage.py", line 1532, in save
news = cls.create([save_values[r] for r in to_create])
File "/trytond/model/modelsql.py", line 580, in create
[insert_values], [table.id]))
File "/trytond/backend/postgresql/database.py", line 61, in execute
cursor.execute(self, sql, args)
psycopg2.InternalError: cannot execute INSERT in a read-only transaction
---------------------------------
Above is my stacktrace.
I am going to integrate with some WMS system for receiving. When user input the
PO number which is "Lodnum" then tryton "on_change" and will display the WMS
data to the list (MS SQL Server).
Background, after "on_change", I will read data from MSSQL. And insert to
Tryton postgres.
But when inserted, above error occurred.
--
You received this message because you are subscribed to the Google Groups
"tryton-dev" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tryton-dev/a7ef917a-916d-432b-b734-d85ee2ff65d5%40googlegroups.com.