Why does trytond_demo.py database take lot of time?

20 views
Skip to first unread message

Dr Praveen Bhatia

unread,
Oct 1, 2016, 5:40:10 AM10/1/16
to tryton
Why does trytond_demo.py database take lot of time?
It runs correctly, but takes about 20-30 mins to complete the run. 
Is it doing lot of calculations inside?


Cédric Krier

unread,
Oct 1, 2016, 6:10:03 AM10/1/16
to tryton
It loads all the translations for all the languages.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Dr Praveen Bhatia

unread,
Oct 1, 2016, 8:35:04 AM10/1/16
to tryton


On Saturday, October 1, 2016 at 7:10:03 PM UTC+9, Cédric Krier wrote:
On 2016-10-01 02:21, Dr Praveen Bhatia wrote:
> Why does trytond_demo.py database take lot of time?
> It runs correctly, but takes about 20-30 mins to complete the run.
> Is it doing lot of calculations inside?

It loads all the translations for all the languages.




OK. Based on that I changed the code to load only English in setup_languages() as follows:
    langs = Lang.find(['code', '=', 'en_US']) # Load only US English 
    #langs = Lang.find() # Comment out Load all languages
    print ("languagues are : ", langs)


Now it is fast (about 3-4 mins) but I get following error in Tryton client when I click say Invoices. What should I change instead to have it fast. I need only one language for now. 

Error
======
Traceback (most recent call last):
  File "/trytond/wsgi.py", line 47, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 59, in rpc
    request, database_name, *request.params)
  File "/trytond/wsgi.py", line 39, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 40, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 177, in _dispatch
    obj, method = get_object_method(request, pool)
  File "/trytond/protocols/dispatcher.py", line 162, in get_object_method
    return pool.get(name, type=type), method
  File "/trytond/pool.py", line 172, in get
    return self._pool[self.database_name][type][name] 
KeyError: u'account.invoice'

Dr Praveen Bhatia

unread,
Oct 1, 2016, 10:55:13 AM10/1/16
to tryton


OK. Based on that I changed the code to load only English in setup_languages() as follows:
    langs = Lang.find(['code', '=', 'en_US']) # Load only US English 
    #langs = Lang.find() # Comment out Load all languages
    print ("languagues are : ", langs)


Now it is fast (about 3-4 mins) but I get following error in Tryton client when I click say Invoices. What should I change instead to have it fast. I need only one language for now. 

Error
======


Got it! Closing trytond and restarting trytond solved the problem. Now one iteration takes only about 4-5 minutes instead of 40 mins ! Thanks. 
 
Reply all
Reply to author
Forward
0 new messages