Error when connecting from tryton4 to trytond4

148 views
Skip to first unread message

Marko Randjelovic

unread,
Jul 21, 2016, 3:30:04 AM7/21/16
to tryton
Hi,

When I tried to connect from tryton4 client to trytond4, I've got this two errors. First error is occuring twice (it occurs again after i press 'Close' and after I press 'Close' again it occurs the second error. Tryton 3.8 was working fine.



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 201, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/res/user.py", line 359, in get_preferences
    preferences = cls._get_preferences(user, context_only=context_only)
  File "/trytond/modules/company/company.py", line 165, in _get_preferences
    context_only=context_only)
  File "/trytond/res/user.py", line 336, in _get_preferences
    res[field] = getattr(user, field)
  File "/trytond/model/fields/field.py", line 234, in __get__
    return inst.__getattr__(self.name)
  File "/trytond/model/modelstorage.py", line 1352, in __getattr__
    read_data = self.read(list(ids), ffields.keys())
  File "/trytond/modules/company/company.py", line 214, in read
    result = super(User, cls).read(ids, fields_names=fields_names)
  File "/trytond/model/modelsql.py", line 762, in read
    getter_results = field.get(ids, cls, field_list, values=result)
  File "/trytond/model/fields/function.py", line 92, in get
    return dict((name, call(name)) for name in names)
  File "/trytond/model/fields/function.py", line 92, in <genexpr>
    return dict((name, call(name)) for name in names)
  File "/trytond/model/fields/function.py", line 86, in call
    return dict((r.id, method(r, name)) for r in records)
  File "/trytond/model/fields/function.py", line 86, in <genexpr>
    return dict((r.id, method(r, name)) for r in records)
  File "/trytond/res/user.py", line 172, in get_pyson_menu
    Action.get_action_values(self.menu.type, [self.menu.id])[0])
  File "/trytond/ir/action.py", line 97, in get_action_values
    return Action.read(action_ids, list(columns))
  File "/trytond/model/modelsql.py", line 692, in read
    order_by=history_order, limit=history_limit))
OperationalError: no such column: a.context_model



Traceback (most recent call last):
  File "/home/mr/training/tryton4/tryton/common/common.py", line 1287, in process
    self.callback(return_)
  File "/home/mr/training/tryton4/tryton/gui/main.py", line 859, in _set_preferences
    self.global_search_entry.set_placeholder_text(_('Search'))
AttributeError: 'NoneType' object has no attribute 'set_placeholder_text'



Regards,
Marko

Sergi Almacellas Abellana

unread,
Jul 21, 2016, 3:59:22 AM7/21/16
to try...@googlegroups.com
El 20/07/16 a les 13:26, Marko Randjelovic ha escrit:
It seems that your database is not sync with the running code, so you
must upgrade all the modules in the database using:

trytond-admin -d <db> --all -c <config_file>

Where <db> is the name or your database and <config_file> the
configuration file you are using to run trytond.

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Marko Randjelovic

unread,
Jul 22, 2016, 1:00:06 AM7/22/16
to tryton

In meantime I was using tryton 3.8 and imported all modules. When I run your command I get:

(venv) mr@debian:~/training/trytond4$ bin/trytond-admin -d test4 --all -c ../trytond4.conf

Traceback (most recent call last):
  File "bin/trytond-admin", line 21, in <module>
    admin.run(options)
  File "/home/mr/training/trytond4/trytond/admin.py", line 48, in run
    Pool(db_name).init(update=options.update, lang=lang)
  File "/home/mr/training/trytond4/trytond/pool.py", line 155, in init
    lang=lang)
  File "/home/mr/training/trytond4/trytond/modules/__init__.py", line 429, in load_modules
    _load_modules()
  File "/home/mr/training/trytond4/trytond/modules/__init__.py", line 396, in _load_modules
    graph = create_graph(module_list)[0]
  File "/home/mr/training/trytond4/trytond/modules/__init__.py", line 191, in create_graph
    - set((p[0] for p in packages))))
Exception: Missing dependencies: [u'purchase_request']



When I try to import purchase_request:

(venv) mr@debian:~/training/trytond4$ bin/trytond-admin -d test4 -c ../trytond4.conf --all -u purchase_request
5083 3530041120512 [2016-07-21 17:53:37,199] ERROR trytond.convert Error while parsing xml file:
In tag record: model ir.action.act_window with id act_purchase_request_form.

Traceback (most recent call last):
  File "/home/mr/training/trytond4/trytond/convert.py", line 447, in parse_xmlstream
    self.sax_parser.parse(source)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 304, in end_element
    self._cont_handler.endElement(name)
  File "/home/mr/training/trytond4/trytond/convert.py", line 507, in endElement
    self.taghandler = self.taghandler.endElement(name)
  File "/home/mr/training/trytond4/trytond/convert.py", line 289, in endElement
    self.model.__name__, self.values, self.xml_id)
  File "/home/mr/training/trytond4/trytond/convert.py", line 693, in import_record
    self.create_records(model, [values], [fs_id])
  File "/home/mr/training/trytond4/trytond/convert.py", line 699, in create_records
    records = Model.create(vlist)
  File "/home/mr/training/trytond4/trytond/ir/action.py", line 324, in create
    record, = super(ActionMixin, cls).create([values])
  File "/home/mr/training/trytond4/trytond/model/modelsql.py", line 595, in create
    field.set(cls, fname, *fargs)
  File "/home/mr/training/trytond4/trytond/model/fields/function.py", line 109, in set
    setter(Model.browse(ids), name, value)
  File "/home/mr/training/trytond4/trytond/ir/action.py", line 285, in set_action
    Action.write([r.action for r in records], {
  File "/home/mr/training/trytond4/trytond/model/fields/field.py", line 234, in __get__
    return inst.__getattr__(self.name)
  File "/home/mr/training/trytond4/trytond/model/modelstorage.py", line 1352, in __getattr__
    read_data = self.read(list(ids), ffields.keys())
  File "/home/mr/training/trytond4/trytond/model/modelsql.py", line 692, in read

    order_by=history_order, limit=history_limit))
OperationalError: no such column: a.context_model
Traceback (most recent call last):
  File "bin/trytond-admin", line 21, in <module>
    admin.run(options)
  File "/home/mr/training/trytond4/trytond/admin.py", line 48, in run
    Pool(db_name).init(update=options.update, lang=lang)
  File "/home/mr/training/trytond4/trytond/pool.py", line 155, in init
    lang=lang)
  File "/home/mr/training/trytond4/trytond/modules/__init__.py", line 429, in load_modules
    _load_modules()
  File "/home/mr/training/trytond4/trytond/modules/__init__.py", line 398, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/home/mr/training/trytond4/trytond/modules/__init__.py", line 251, in load_module_graph
    tryton_parser.parse_xmlstream(fp)
  File "/home/mr/training/trytond4/trytond/convert.py", line 447, in parse_xmlstream
    self.sax_parser.parse(source)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 304, in end_element
    self._cont_handler.endElement(name)
  File "/home/mr/training/trytond4/trytond/convert.py", line 507, in endElement
    self.taghandler = self.taghandler.endElement(name)
  File "/home/mr/training/trytond4/trytond/convert.py", line 289, in endElement
    self.model.__name__, self.values, self.xml_id)
  File "/home/mr/training/trytond4/trytond/convert.py", line 693, in import_record
    self.create_records(model, [values], [fs_id])
  File "/home/mr/training/trytond4/trytond/convert.py", line 699, in create_records
    records = Model.create(vlist)
  File "/home/mr/training/trytond4/trytond/ir/action.py", line 324, in create
    record, = super(ActionMixin, cls).create([values])
  File "/home/mr/training/trytond4/trytond/model/modelsql.py", line 595, in create
    field.set(cls, fname, *fargs)
  File "/home/mr/training/trytond4/trytond/model/fields/function.py", line 109, in set
    setter(Model.browse(ids), name, value)
  File "/home/mr/training/trytond4/trytond/ir/action.py", line 285, in set_action
    Action.write([r.action for r in records], {
  File "/home/mr/training/trytond4/trytond/model/fields/field.py", line 234, in __get__
    return inst.__getattr__(self.name)
  File "/home/mr/training/trytond4/trytond/model/modelstorage.py", line 1352, in __getattr__
    read_data = self.read(list(ids), ffields.keys())
  File "/home/mr/training/trytond4/trytond/model/modelsql.py", line 692, in read
    order_by=history_order, limit=history_limit))
sqlite3.OperationalError: no such column: a.context_model

 

Sergi Almacellas Abellana

unread,
Jul 22, 2016, 3:14:22 AM7/22/16
to try...@googlegroups.com
El 21/07/16 a les 22:04, Marko Randjelovic ha escrit:
> > return inst.__getattr__(self.name <http://self.name>)
> > File "/trytond/model/modelstorage.py", line 1352, in __getattr__
> > read_data = self.read(list(ids), ffields.keys())
> > File "/trytond/modules/company/company.py", line 214, in read
> > result = super(User, cls).read(ids, fields_names=fields_names)
> > File "/trytond/model/modelsql.py", line 762, in read
> > getter_results = field.get(ids, cls, field_list, values=result)
> > File "/trytond/model/fields/function.py", line 92, in get
> > return dict((name, call(name)) for name in names)
> > File "/trytond/model/fields/function.py", line 92, in <genexpr>
> > return dict((name, call(name)) for name in names)
> > File "/trytond/model/fields/function.py", line 86, in call
> > return dict((r.id <http://r.id>, method(r, name)) for r in
> records)
> > File "/trytond/model/fields/function.py", line 86, in <genexpr>
> > return dict((r.id <http://r.id>, method(r, name)) for r in
> records)
> > File "/trytond/res/user.py", line 172, in get_pyson_menu
> > Action.get_action_values(self.menu.type, [self.menu.id
> <http://self.menu.id>])[0])
You have to explicity install purchase request as is a new dependency on
version 4.0. So the command will be:

trytond-admin -d <db> -c <config_file> -u purchase_request --all

Cédric Krier

unread,
Jul 22, 2016, 3:25:03 AM7/22/16
to tryton
On 2016-07-21 13:04, Marko Randjelovic wrote:
> In meantime I was using tryton 3.8 and imported all modules. When I run
> your command I get:
>
> (venv) mr@debian:~/training/trytond4$ bin/trytond-admin -d test4 --all -c
> ../trytond4.conf

There is a tricky behaviour with the command line parser, the option
'--all' should be after the '-u' options otherwise it is wiped off.

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

Marko Randjelovic

unread,
Jul 23, 2016, 2:40:07 PM7/23/16
to tryton


On Friday, July 22, 2016 at 9:25:03 AM UTC+2, Cédric Krier wrote:
On 2016-07-21 13:04, Marko Randjelovic wrote:
> In meantime I was using tryton 3.8 and imported all modules. When I run
> your command I get:
>
> (venv) mr@debian:~/training/trytond4$ bin/trytond-admin -d test4 --all -c
> ../trytond4.conf

There is a tricky behaviour with the command line parser, the option
'--all' should be after the '-u' options otherwise it is wiped off.


I swapped the options, but few minutes again got error:

(venv) mr@debian:~/training/trytond4$ bin/trytond-admin -d test4 -c ../trytond4.conf -u purchase_request --all

Traceback (most recent call last):
  File "bin/trytond-admin", line 21, in <module>
    admin.run(options)
  File "/home/mr/training/trytond4/trytond/admin.py", line 48, in run
    Pool(db_name).init(update=options.update, lang=lang)
  File "/home/mr/training/trytond4/trytond/pool.py", line 155, in init
    lang=lang)
  File "/home/mr/training/trytond4/trytond/modules/__init__.py", line 429, in load_modules
    _load_modules()
  File "/home/mr/training/trytond4/trytond/modules/__init__.py", line 398, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/home/mr/training/trytond4/trytond/modules/__init__.py", line 237, in load_module_graph
    cls.__register__(module)
  File "/home/mr/training/trytond4/trytond/modules/sale_opportunity/opportunity.py", line 118, in __register__
    super(SaleOpportunity, cls).__register__(module_name)
  File "/home/mr/training/trytond4/trytond/model/modelsql.py", line 143, in __register__
    history_table.index_action('id', action='add')
  File "/home/mr/training/trytond4/trytond/backend/sqlite/table.py", line 258, in index_action
    ')')
sqlite3.OperationalError: index sale_opportunity__history_id_index already exists

Regards,
Marko
 

Cédric Krier

unread,
Jul 23, 2016, 3:00:04 PM7/23/16
to tryton
On 2016-07-23 10:12, Marko Randjelovic wrote:
> sqlite3.OperationalError: index sale_opportunity__history_id_index already
> exists

It seems the table has already an index but with a different name. You
should fix that manually.

Marko Randjelovic

unread,
Jul 25, 2016, 6:35:04 PM7/25/16
to tryton


On Saturday, July 23, 2016 at 9:00:04 PM UTC+2, Cédric Krier wrote:
On 2016-07-23 10:12, Marko Randjelovic wrote:
> sqlite3.OperationalError: index sale_opportunity__history_id_index already
> exists

It seems the table has already an index but with a different name. You
should fix that manually.

After manually deleting index (drop index sale_opportunity__history_id_index;) the command

bin/trytond-admin -d test4 -c ../trytond4.conf -u purchase_request --all

was successfull. However, when connecting from tryton client, again an error about missing dependency purchase_request:


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/protocols/dispatcher.py", line 70, in login
    session = security.login(database_name, user, password)
  File "/trytond/security.py", line 24, in login
    pool = _get_pool(dbname)
  File "/trytond/security.py", line 18, in _get_pool
    pool.init()
  File "/trytond/pool.py", line 155, in init
    lang=lang)
  File "/trytond/modules/__init__.py", line 434, in load_modules
    _load_modules()
  File "/trytond/modules/__init__.py", line 396, in _load_modules
    graph = create_graph(module_list)[0]
  File "/trytond/modules/__init__.py", line 191, in create_graph

    - set((p[0] for p in packages))))
Exception: Missing dependencies: [u'purchase_request']

There is tables purchase_request in the database, just it's empty.

Regards
 

Sergi Almacellas Abellana

unread,
Jul 27, 2016, 7:48:38 AM7/27/16
to try...@googlegroups.com
El 25/07/16 a les 21:54, Marko Randjelovic ha escrit:
>
> There is tables purchase_request in the database, just it's empty.

Which is the state of the purchase_request row in ir_module table?

It should be installed. Otherwise perform the -u purchase_request
another time to install it.
Reply all
Reply to author
Forward
0 new messages