Skip to Content
Menu
This question has been flagged

I wanted to test some modification I have done to Odoo V11 code (very simple changes). For this I have Odoo running on my development PC with all dependencies from requirements.txt inside a python virtual env. 

To run the database, instead of installing one on my PC, i choosed for simplicity to run postgresql from a Docker container. This it the command I use to start postgresql 9.5 server from docker:

docker run --name odoo-db -e POSTGRES_PASSWORD=mypassword -e POSTGRES_USER=odoo -d -p 5432:5432 postgres:9.5

For reference, this is my Odoo server configuration file (~/.odoorc):

[options]
admin_passwd = myadminpasswd
addons_path = /home/antoine/rnx/odoo/addons,/home/antoine/rnx/odoo-enterprise
csv_internal_sep = ,
db_host = localhost
db_password = mypassword
db_port = 5432
db_user = odoo

I can then start the Odoo server locally and create a new database without trouble using this postgresql server inside the docker container. But when I try to install an Odoo application , the following exception(s) is raised:

2017-11-06 07:55:03,488 3729 INFO test odoo.modules.loading: loading account_bank_statement_import/account_import_tip_data.xml 2017-11-06 07:55:03,491 3729 INFO test odoo.modules.loading: loading account_bank_statement_import/wizard/journal_creation.xml 2017-11-06 07:55:03,806 3729 INFO test odoo.modules.registry: module account_extension: creating or updating database tables 2017-11-06 07:55:03,820 3729 INFO test odoo.modules.loading: loading account_extension/views/account_report_menu_invisible.xml 2017-11-06 07:55:03,833 3729 ERROR test odoo.sql_db: bad query: b'INSERT INTO "ir_ui_menu" ("id", "active", "sequence", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval(\'ir_ui_menu_id_seq\'), false, 10, 1, 1, (now() at time zone \'UTC\'), (now() at time zone \'UTC\')) RETURNING id'
ERROR: null value in column "name" violates not-null constraint DETAIL: Failing row contains (145, null, null, null, f, 10, null, null, null, 1, 2017-11-06 07:55:03.812547, 1, 2017-11-06 07:55:03.812547).
2017-11-06 07:55:03,833 3729 ERROR test odoo.modules.registry: Failed to load registry Traceback (most recent call last):
  File "/home/antoine/rnx/odoo/odoo/tools/convert.py", line 741, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/home/antoine/rnx/odoo/odoo/tools/convert.py", line 651, in _tag_record
    id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
  File "/home/antoine/rnx/odoo/odoo/addons/base/ir/ir_model.py", line 1467, in _update
    record = record.create(values)
  File "/home/antoine/rnx/odoo/odoo/addons/base/ir/ir_ui_menu.py", line 150, in create
    return super(IrUiMenu, self).create(values)
  File "/home/antoine/rnx/odoo/odoo/models.py", line 3275, in create
    record = self.browse(self._create(old_vals))
  File "/home/antoine/rnx/odoo/odoo/models.py", line 3368, in _create
    cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
  File "/home/antoine/rnx/odoo/odoo/sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/home/antoine/rnx/odoo/odoo/sql_db.py", line 232, in execute
    res = self._obj.execute(query, params)
psycopg2.IntegrityError: null value in column "name" violates not-null constraint DETAIL: Failing row contains (145, null, null, null, f, 10, null, null, null, 1, 2017-11-06 07:55:03.812547, 1, 2017-11-06 07:55:03.812547).
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/antoine/rnx/odoo/odoo/modules/registry.py", line 84, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/home/antoine/rnx/odoo/odoo/modules/loading.py", line 343, in load_modules
    loaded_modules, update_module)
  File "/home/antoine/rnx/odoo/odoo/modules/loading.py", line 242, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/home/antoine/rnx/odoo/odoo/modules/loading.py", line 156, in load_module_graph
    _load_data(cr, module_name, idref, mode, kind='data')
  File "/home/antoine/rnx/odoo/odoo/modules/loading.py", line 94, in _load_data
    tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
  File "/home/antoine/rnx/odoo/odoo/tools/convert.py", line 788, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/home/antoine/rnx/odoo/odoo/tools/convert.py", line 849, in convert_xml_import
    obj.parse(doc.getroot(), mode=mode)
  File "/home/antoine/rnx/odoo/odoo/tools/convert.py", line 748, in parse
    exc_info[2]
  File "/home/antoine/rnx/odoo/odoo/tools/pycompat.py", line 86, in reraise
    raise value.with_traceback(tb)
  File "/home/antoine/rnx/odoo/odoo/tools/convert.py", line 741, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/home/antoine/rnx/odoo/odoo/tools/convert.py", line 651, in _tag_record
    id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
  File "/home/antoine/rnx/odoo/odoo/addons/base/ir/ir_model.py", line 1467, in _update
    record = record.create(values)
  File "/home/antoine/rnx/odoo/odoo/addons/base/ir/ir_ui_menu.py", line 150, in create
    return super(IrUiMenu, self).create(values)
  File "/home/antoine/rnx/odoo/odoo/models.py", line 3275, in create
    record = self.browse(self._create(old_vals))
  File "/home/antoine/rnx/odoo/odoo/models.py", line 3368, in _create
    cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
  File "/home/antoine/rnx/odoo/odoo/sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/home/antoine/rnx/odoo/odoo/sql_db.py", line 232, in execute
    res = self._obj.execute(query, params)
odoo.tools.convert.ParseError: "null value in column "name" violates not-null constraint DETAIL: Failing row contains (145, null, null, null, f, 10, null, null, null, 1, 2017-11-06 07:55:03.812547, 1, 2017-11-06 07:55:03.812547).
" while parsing /home/antoine/rnx/odoo-enterprise/account_extension/views/account_report_menu_invisible.xml:5, near
<record id="account.menu_account_report_tree_hierarchy" model="ir.ui.menu">
        <field name="active" eval="False"/>
    </record>
2017-11-06 07:55:03,848 3729 ERROR test odoo.http: Exception during JSON request handling.
Traceback (most recent call last):
  File "/home/antoine/rnx/odoo/odoo/tools/convert.py", line 741, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/home/antoine/rnx/odoo/odoo/tools/convert.py", line 651, in _tag_record
    id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
  File "/home/antoine/rnx/odoo/odoo/addons/base/ir/ir_model.py", line 1467, in _update
    record = record.create(values)
  File "/home/antoine/rnx/odoo/odoo/addons/base/ir/ir_ui_menu.py", line 150, in create
    return super(IrUiMenu, self).create(values)
  File "/home/antoine/rnx/odoo/odoo/models.py", line 3275, in create
    record = self.browse(self._create(old_vals))
  File "/home/antoine/rnx/odoo/odoo/models.py", line 3368, in _create
    cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
  File "/home/antoine/rnx/odoo/odoo/sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/home/antoine/rnx/odoo/odoo/sql_db.py", line 232, in execute
    res = self._obj.execute(query, params)
psycopg2.IntegrityError: null value in column "name" violates not-null constraint DETAIL: Failing row contains (145, null, null, null, f, 10, null, null, null, 1, 2017-11-06 07:55:03.812547, 1, 2017-11-06 07:55:03.812547).
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/antoine/rnx/odoo/odoo/http.py", line 646, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/antoine/rnx/odoo/odoo/http.py", line 307, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/home/antoine/rnx/odoo/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/home/antoine/rnx/odoo/odoo/http.py", line 683, in dispatch
    result = self._call_function(**self.params)
  File "/home/antoine/rnx/odoo/odoo/http.py", line 339, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/antoine/rnx/odoo/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/antoine/rnx/odoo/odoo/http.py", line 332, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/antoine/rnx/odoo/odoo/http.py", line 927, in __call__
    return self.method(*args, **kw)
  File "/home/antoine/rnx/odoo/odoo/http.py", line 512, in response_wrap
    response = f(*args, **kw)
  File "/home/antoine/rnx/odoo/addons/web/controllers/main.py", line 924, in call_button
    action = self._call_kw(model, method, args, {})
  File "/home/antoine/rnx/odoo/addons/web/controllers/main.py", line 912, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/antoine/rnx/odoo/odoo/api.py", line 689, in call_kw
    return call_kw_multi(method, model, args, kwargs)
  File "/home/antoine/rnx/odoo/odoo/api.py", line 680, in call_kw_multi
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-39>", line 2, in button_immediate_install
  File "/home/antoine/rnx/odoo/odoo/addons/base/module/module.py", line 71, in check_and_log
    return method(self, *args, **kwargs)
  File "/home/antoine/rnx/odoo/odoo/addons/base/module/module.py", line 438, in button_immediate_install
    return self._button_immediate_function(type(self).button_install)
  File "/home/antoine/rnx/odoo/odoo/addons/base/module/module.py", line 531, in _button_immediate_function
    modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "/home/antoine/rnx/odoo/odoo/modules/registry.py", line 84, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/home/antoine/rnx/odoo/odoo/modules/loading.py", line 343, in load_modules
    loaded_modules, update_module)
  File "/home/antoine/rnx/odoo/odoo/modules/loading.py", line 242, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/home/antoine/rnx/odoo/odoo/modules/loading.py", line 156, in load_module_graph
    _load_data(cr, module_name, idref, mode, kind='data')
  File "/home/antoine/rnx/odoo/odoo/modules/loading.py", line 94, in _load_data
    tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
  File "/home/antoine/rnx/odoo/odoo/tools/convert.py", line 788, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/home/antoine/rnx/odoo/odoo/tools/convert.py", line 849, in convert_xml_import
    obj.parse(doc.getroot(), mode=mode)
  File "/home/antoine/rnx/odoo/odoo/tools/convert.py", line 748, in parse
    exc_info[2]
  File "/home/antoine/rnx/odoo/odoo/tools/pycompat.py", line 86, in reraise
    raise value.with_traceback(tb)
  File "/home/antoine/rnx/odoo/odoo/tools/convert.py", line 741, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/home/antoine/rnx/odoo/odoo/tools/convert.py", line 651, in _tag_record
    id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
  File "/home/antoine/rnx/odoo/odoo/addons/base/ir/ir_model.py", line 1467, in _update
    record = record.create(values)
  File "/home/antoine/rnx/odoo/odoo/addons/base/ir/ir_ui_menu.py", line 150, in create
    return super(IrUiMenu, self).create(values)
  File "/home/antoine/rnx/odoo/odoo/models.py", line 3275, in create
    record = self.browse(self._create(old_vals))
  File "/home/antoine/rnx/odoo/odoo/models.py", line 3368, in _create
    cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
  File "/home/antoine/rnx/odoo/odoo/sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/home/antoine/rnx/odoo/odoo/sql_db.py", line 232, in execute
    res = self._obj.execute(query, params)
odoo.tools.convert.ParseError: "null value in column "name" violates not-null constraint DETAIL: Failing row contains (145, null, null, null, f, 10, null, null, null, 1, 2017-11-06 07:55:03.812547, 1, 2017-11-06 07:55:03.812547).
" while parsing /home/antoine/rnx/odoo-enterprise/account_extension/views/account_report_menu_invisible.xml:5, near
<record id="account.menu_account_report_tree_hierarchy" model="ir.ui.menu">
        <field name="active" eval="False"/>
    </record>


IThis does not occur if i run the same codebase against the postgresql server installed from ubuntu 16.04.


I don'k know well posgresql, but it looks like the query does not pass the DB consistency checks. It's sounds to me like something is miss-configured with the server from the Docker image. Can someone tell me what to change in the server ?


Avatar
Discard
Related Posts Replies Views Activity
2
Nov 23
1589
1
Jul 23
4329
4
Feb 22
21717
1
Sep 20
4771
0
Jun 19
2082