IRC logs of #tryton for Tuesday, 2013-10-01

chat.freenode.net #tryton log beginning Tue Oct 1 00:00:01 CEST 2013
2013-10-01 08:13 -!- priyankarani(~priyanka@122.177.45.77) has left #tryton
2013-10-01 13:43 <guillemBarba> cedk: it's possible to serve an instance method by RPC?
2013-10-01 13:45 <cedk> guillemBarba: yes
2013-10-01 13:45 <cedk> guillemBarba: see http://doc.tryton.org/2.8/trytond/doc/ref/rpc.html?highlight=rpc#trytond.rpc.RPC.instantiate
2013-10-01 13:52 <guillemBarba> cedk: I'm looking that but it doesn't works :-(
2013-10-01 13:53 <cedk> guillemBarba: I can tell you it works, it is used in many places for on_change, buttons
2013-10-01 13:55 <guillemBarba> cedk: http://pastebin.com/eh4v4PFU
2013-10-01 13:55 <guillemBarba> cedk: now, I'm trying with classmethod. Now, I pastebin the instancemethod version
2013-10-01 13:58 <guillemBarba> cedk: and the version with instance method: http://pastebin.com/6CM38Mvv
2013-10-01 14:02 <cedk> guillemBarba: remove the decorator first
2013-10-01 14:04 <guillemBarba> cedk: error only in pastebin, it is removed
2013-10-01 14:04 <cedk> guillemBarba: in proteus all methods are classmethod
2013-10-01 14:05 <guillemBarba> cedk: the proteus call must be FileFormat.export_file(ff, models) ?? almost if export_file is an instance method?
2013-10-01 14:06 <guillemBarba> cedk: "almost" no, "even" :-/
2013-10-01 14:07 <cedk> guillemBarba: with ids instead of instance
2013-10-01 14:09 <guillemBarba> cedk: all params must be IDs => in Tryton method 'self' could be an instance but 'models' must to be list of ID. right?
2013-10-01 14:13 <cedk> guillemBarba: yes
2013-10-01 14:13 <cedk> guillemBarba: proteus needs some love for buttons and rpc calls
2013-10-01 14:17 <guillemBarba> cedk: thanks!! it works!
2013-10-01 14:20 <guillemBarba> cedk: I understand the limitation. Trytond can't know the type of other instance attributes to could instantiate them. It should require that RPC() defines the type of fields...
2013-10-01 14:21 <guillemBarba> cedk: It would be great to have an explanation about this limitation in http://doc.tryton.org/2.8/trytond/doc/ref/rpc.html?highlight=rpc#trytond.rpc.RPC.instantiate I will do a codereview
2013-10-01 14:43 <jeancavallo> cedk: Hi. I am wondering if it would be possible to call _update_mptt once for each model just before committing ?
2013-10-01 14:45 <jeancavallo> cedk: I update 100+ records on the same tree in the same transaction, and each time I save one, _update_mptt is rather long
2013-10-01 15:16 <cedk> jeancavallo: save all at once
2013-10-01 16:20 <pokoli>
2013-10-01 17:08 <pokoli>
2013-10-01 18:21 -!- vcardon(~vcardon@LNeuilly-152-23-15-185.w193-252.abo.wanadoo.fr) has left #tryton
2013-10-01 19:45 -!- priyankarani(~priyanka@123.63.112.78) has left #tryton

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!