>> Also, is there an updated (2.5) version of the demo module ?
>
> Not yet.
I tried to update the demo module but I can't get it to work.
The tryton.cfg is ok and the module is processed but the model doesn't
seem to be registered.
Here's the code :
from trytond.model import ModelSQL, fields
__all__ = [
'Hello',
]
class Hello(ModelSQL):
"""Hello World class"""
__name__ = 'hello.hello'
name = fields.Char('Name', required=True)
string = fields.Char('String')
greeting = fields.Char('Greeting')
When starting tryton I can see that the class is registered :
./trytond -d test
[Tue Oct 02 23:14:11 2012] INFO:server:using
/home/val/tryton/trytond/etc/trytond.conf as configuration file
[Tue Oct 02 23:14:11 2012] INFO:server:initialising distributed objects services
[Tue Oct 02 23:14:11 2012] INFO:server:starting JSON-RPC protocol on
0.0.0.0:8000
[Tue Oct 02 23:14:11 2012] INFO:database:connect to "test"
[Tue Oct 02 23:14:11 2012] INFO:pool:init pool for "test"
[Tue Oct 02 23:14:11 2012] INFO:modules:ir:registering classes
[Tue Oct 02 23:14:11 2012] INFO:modules:res:registering classes
[Tue Oct 02 23:14:11 2012] INFO:modules:hello:registering classes
[Tue Oct 02 23:14:11 2012] INFO:modules:test:registering classes
[Tue Oct 02 23:14:11 2012] INFO:modules:webdav:registering classes
[Tue Oct 02 23:14:11 2012] INFO:modules:ir
[Tue Oct 02 23:14:12 2012] INFO:modules:res
[Tue Oct 02 23:14:12 2012] INFO:modules:hello
but when I try to create a hello.hello object trough jsonrpc I got a
key error on 'hello.hello' :
{u'id': 0, u'error': [u"'hello.hello'", u'Traceback (most recent call
last):\n File "/trytond/protocols/jsonrpc.py", line 123, in
_marshaled_dispatch\n response[\'result\'] =
dispatch_method(method, params)\n File
"/trytond/protocols/jsonrpc.py", line 156, in _dispatch\n res =
dispatch(*args)\n File "/trytond/protocols/dispatcher.py", line 133,
in dispatch\n obj = pool.get(object_name, type=object_type)\n File
"/trytond/pool.py", line 148, in get\n return
self._pool[self.database_name][type][name]\nKeyError:
\'hello.hello\'\n']}
Please note that I can create a res.user trough jsonrpc without problem.
What did I forgot ?
--
--
[email protected] mailing list