Skip to Content
Menu
This question has been flagged
4 Replies
3440 Views

Hello,

I'm not sure what caused this but for now, I can't anymore access to my odoo instance.

I use Odoo10:

root@garalab:/home/makayabou# apt-cache policy odoo odoo:
Installé : 10.0.20170503
Candidat : 10.0.20170503
Table de version :
*** 10.0.20170503 0
500 http://nightly.odoo.com/10.0/nightly/deb/ ./ Packages
100 /var/lib/dpkg/status

log tells me:

2017-05-03 15:18:19,887 1430 INFO odoo werkzeug: 109.25.140.102 - - [03/May/2017 15:18:19] "GET / HTTP/1.1" 500 - 2017-05-03 15:18:19,920 1430 ERROR odoo werkzeug: Error on request:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 177, in run_wsgi
execute(self.server.app)
File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 165, in execute
application_iter = app(environ, start_response)
File "/usr/lib/python2.7/dist-packages/odoo/service/server.py", line 250, in app
return self.app(e, s)
File "/usr/lib/python2.7/dist-packages/odoo/service/wsgi_server.py", line 184, in application
return application_unproxied(environ, start_response)
File "/usr/lib/python2.7/dist-packages/odoo/service/wsgi_server.py", line 170, in application_unproxied
result = handler(environ, start_response)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 1306, in __call__
return self.dispatch(environ, start_response)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 1280, in __call__
return self.app(environ, start_wrapped)
File "/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 588, in __call__
return self.app(environ, start_response)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 1461, in dispatch
odoo.registry(db).check_signaling()
File "/usr/lib/python2.7/dist-packages/odoo/__init__.py", line 52, in registry
return modules.registry.Registry(database_name)
File "/usr/lib/python2.7/dist-packages/odoo/modules/registry.py", line 55, in __new__
return cls.new(db_name)
File "/usr/lib/python2.7/dist-packages/odoo/modules/registry.py", line 78, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/usr/lib/python2.7/dist-packages/odoo/modules/loading.py", line 280, in load_modules
loaded_modules, processed_modules = load_module_graph(cr, graph, status, perform_checks=update_module, report=report)
File "/usr/lib/python2.7/dist-packages/odoo/modules/loading.py", line 159, in load_module_graph
_load_data(cr, module_name, idref, mode, kind='demo')
File "/usr/lib/python2.7/dist-packages/odoo/modules/loading.py", line 95, in _load_data
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
File "/usr/lib/python2.7/dist-packages/odoo/tools/convert.py", line 848, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/usr/lib/python2.7/dist-packages/odoo/tools/convert.py", line 918, in convert_xml_import
obj.parse(doc.getroot(), mode=mode)
File "/usr/lib/python2.7/dist-packages/odoo/tools/convert.py", line 799, in parse
self.parse(rec, mode)
File "/usr/lib/python2.7/dist-packages/odoo/tools/convert.py", line 802, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "/usr/lib/python2.7/dist-packages/odoo/tools/convert.py", line 710, 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 "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_model.py", line 1228, in _update
record = record.create(values)
File "/usr/lib/python2.7/dist-packages/odoo/addons/base/res/res_users.py", line 790, in create
user = super(UsersView, self).create(values)
File "/usr/lib/python2.7/dist-packages/odoo/addons/base/res/res_users.py", line 636, in create
return super(UsersImplied, self).create(values)
File "/usr/lib/python2.7/dist-packages/odoo/addons/base/res/res_users.py", line 329, in create
user = super(Users, self).create(vals)
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 3830, in create
record = self.browse(self._create(old_vals))
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 3993, in _create
self._validate_fields(vals)
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 1079, in _validate_fields
check(self)
File "/usr/lib/python2.7/dist-packages/odoo/addons/base/res/res_users.py", line 285, in _check_company
raise ValidationError(_('The chosen company is not in the allowed companies for this user'))
ParseError: "La soci\xe9t\xe9 choisie n'est pas la soci\xe9t\xe9 autoris\xe9e pour cet utilisateur None" while parsing /usr/lib/python2.7/dist-packages/odoo/addons/base/base_demo.xml:40, near
<record id="user_demo" model="res.users">
<field name="partner_id" ref="base.partner_demo"/>
<field name="login">demo</field>
<field name="password">demo</field>
<field name="signature" type="xml"><span>-- <br/>+Mr Demo</span></field>
<field name="company_id" ref="main_company"/>
<field name="groups_id" eval="[(6,0,[ref('base.group_user'), ref('base.group_partner_manager')])]"/>
<field name="image" type="base64" file="base/static/img/user_demo-image.jpg"/>
</record>


Maybe that situation appeared after upgrade of odoo via Debian packaging system, or after I deleted demo user (not even sure i did it)...

It looks like it is a wrong setting for access rights, but I don't have access to Odoo GUI for changing it (error 500 on web browser and no desktop on the server) .

Is there some tweak I can use on database?


EDIT 10/05/2017 : As a workaround, how can I export my companie's data from database using comandline, in order to reimport it in a new db ?


THanks for help


Avatar
Discard

The easiest thing is to start from scratch as you are obviously using demo data. Most probably you did delete a company or a user or something else and if you can't login with the admin user, I would not waste any time.

Author

I can't start from scratch: I have datas on my instance. I think I started using Odoo with demo datas in it. After that I deleted demo user, and this could have been the cause of my problem?

Whatever, I need to fix it keeping datas, and I can't even access to login page.

Best Answer

Actually, you no need to create from scratch, Better you have to comment out the constraints from base

    @api.multi

    @api.constrains('company_id', 'company_ids')

    def _check_company(self):

        if any(user.company_ids and user.company_id not in user.company_ids for user in self):

            raise ValidationError(_('The chosen company is not in the allowed companies for this user'))

This is the thing which has raise those error, temporary you have to comment out these lines and move on.

Avatar
Discard
Author Best Answer

I finally started from scratch, as it seemed complicated to directly manage the database..

Avatar
Discard