Skip to Content
Menu
This question has been flagged

Hello

During the update from Odoo 12.0 to 12.0, a critical error occurred: ImportError: cannot import name 'babel_locale_parse'

At the end of the update, the website has a 500 error and the backend part reports errors. How to fix this problem when updating all modules? Thank you in advance.


Command used on Debian 9.13

service odoo stop

cd /odoo/odoo12

./odoo-bin -r odoo -d ODOO -u all

mkdir -p /odoo/sources

cd /odoo/sources

git clone https://github.com/odoo/odoo.git -b 12.0

cp -rv odoo /odoo/odoo12

cd /odoo/odoo12

chmod -R 777 ./

chown -R odoo:odoo ./

pip3 install -r requirements.txt

service odoo stop

./odoo-bin -r odoo -d ODOO -u all   # <--- the error this occurs here


Log of error : 

2021-02-26 16:10:04,243 628 INFO ODOO odoo.tools.translate: loading /odoo/odoo12/odoo/addons/web_diagram/i18n/fr.po 

2021-02-26 16:10:04,342 628 CRITICAL ODOO odoo.modules.module: Couldn't load module web_editor 

2021-02-26 16:10:04,342 628 CRITICAL ODOO odoo.modules.module: cannot import name 'babel_locale_parse' 

2021-02-26 16:10:04,347 628 WARNING ODOO odoo.modules.loading: Transient module states were reset 

2021-02-26 16:10:04,349 628 ERROR ODOO odoo.modules.registry: Failed to load registry 

Traceback (most recent call last):

  File "/odoo/odoo12/odoo/modules/registry.py", line 86, in new

    odoo.modules.load_modules(registry._db, force_demo, status, update_module)

  File "/odoo/odoo12/odoo/modules/loading.py", line 419, in load_modules

    force, status, report, loaded_modules, update_module, models_to_check)

  File "/odoo/odoo12/odoo/modules/loading.py", line 315, in load_marked_modules

    perform_checks=perform_checks, models_to_check=models_to_check

  File "/odoo/odoo12/odoo/modules/loading.py", line 181, in load_module_graph

    load_openerp_module(package.name)

  File "/odoo/odoo12/odoo/modules/module.py", line 368, in load_openerp_module

    __import__('odoo.addons.' + module_name)

  File "/odoo/odoo12/odoo/modules/module.py", line 82, in load_module

    exec(open(modfile, 'rb').read(), new_mod.__dict__)

  File "<string>", line 5, in <module>

  File "/odoo/odoo12/odoo/addons/web_editor/models/__init__.py", line 5, in <module>

    from . import ir_qweb

  File "/odoo/odoo12/odoo/addons/web_editor/models/ir_qweb.py", line 35, in <module>

    from odoo.tools.misc import babel_locale_parse

ImportError: cannot import name 'babel_locale_parse'

2021-02-26 16:10:04,351 628 CRITICAL ODOO odoo.service.server: Failed to initialize database `ODOO`. 

Traceback (most recent call last):

  File "/odoo/odoo12/odoo/service/server.py", line 1042, in preload_registries

    registry = Registry.new(dbname, update_module=update_module)

  File "/odoo/odoo12/odoo/modules/registry.py", line 86, in new

    odoo.modules.load_modules(registry._db, force_demo, status, update_module)

  File "/odoo/odoo12/odoo/modules/loading.py", line 419, in load_modules

    force, status, report, loaded_modules, update_module, models_to_check)

  File "/odoo/odoo12/odoo/modules/loading.py", line 315, in load_marked_modules

    perform_checks=perform_checks, models_to_check=models_to_check

  File "/odoo/odoo12/odoo/modules/loading.py", line 181, in load_module_graph

    load_openerp_module(package.name)

  File "/odoo/odoo12/odoo/modules/module.py", line 368, in load_openerp_module

    __import__('odoo.addons.' + module_name)

  File "/odoo/odoo12/odoo/modules/module.py", line 82, in load_module

    exec(open(modfile, 'rb').read(), new_mod.__dict__)

  File "<string>", line 5, in <module>

  File "/odoo/odoo12/odoo/addons/web_editor/models/__init__.py", line 5, in <module>

    from . import ir_qweb

  File "/odoo/odoo12/odoo/addons/web_editor/models/ir_qweb.py", line 35, in <module>

    from odoo.tools.misc import babel_locale_parse

ImportError: cannot import name 'babel_locale_parse'

2021-02-26 16:10:04,358 628 INFO ODOO odoo.modules.loading: loading 1 modules... 



Avatar
Discard
Author Best Answer

I found the solution:

replace the command  cp -rv odoo /odoo/odoo12 -> cp -rv odoo/* /odoo/odoo12/

But there is another error

2021-03-01 13:49:23,033 499 CRITICAL ODOO odoo.service.server: Failed to initialize database `ODOO`. 
Traceback (most recent call last):
  File "/odoo/odoo12/odoo/tools/convert.py", line 758, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/odoo/odoo12/odoo/tools/convert.py", line 663, in _tag_record
    record = model.with_context(rec_context)._load_records([data], self.mode == 'update')
  File "/odoo/odoo12/odoo/models.py", line 3881, in _load_records
    data['record']._load_records_write(data['values'])
  File "/odoo/odoo12/odoo/models.py", line 3819, in _load_records_write
    self.write(values)
  File "/odoo/odoo12/addons/mail/models/res_users.py", line 157, in write
    write_res = super(res_groups_mail_channel, self).write(vals)
  File "/odoo/odoo12/odoo/addons/base/models/res_users.py", line 1008, in write
    res = super(GroupsView, self).write(values)
  File "/odoo/odoo12/odoo/addons/base/models/res_users.py", line 940, in write
    self._check_one_user_type()
  File "/odoo/odoo12/odoo/addons/base/models/res_users.py", line 113, in _check_one_user_type
    self.mapped('users')._check_one_user_type()
  File "/odoo/odoo12/addons/account/models/res_users.py", line 25, in _check_one_user_type
    raise ValidationError(_("A user cannot have both Tax B2B and Tax B2C.\n"
odoo.exceptions.ValidationError: ("A user cannot have both Tax B2B and Tax B2C.\nYou should go in General Settings, and choose to display Product Prices\neither in 'Tax-Included' or in 'Tax-Excluded' mode\n(or switch twice the mode if you are already in the desired one).", None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/odoo/odoo12/odoo/service/server.py", line 1162, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "/odoo/odoo12/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/odoo/odoo12/odoo/modules/loading.py", line 417, in load_modules
    force, status, report, loaded_modules, update_module, models_to_check)
  File "/odoo/odoo12/odoo/modules/loading.py", line 313, in load_marked_modules
    perform_checks=perform_checks, models_to_check=models_to_check
  File "/odoo/odoo12/odoo/modules/loading.py", line 222, in load_module_graph
    load_data(cr, idref, mode, kind='data', package=package, report=report)
  File "/odoo/odoo12/odoo/modules/loading.py", line 68, in load_data
    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
  File "/odoo/odoo12/odoo/tools/convert.py", line 802, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/odoo/odoo12/odoo/tools/convert.py", line 865, in convert_xml_import
    obj.parse(doc.getroot(), mode=mode)
  File "/odoo/odoo12/odoo/tools/convert.py", line 755, in parse
    self.parse(rec, mode)
  File "/odoo/odoo12/odoo/tools/convert.py", line 764, in parse
    exc_info[2]
  File "/odoo/odoo12/odoo/tools/pycompat.py", line 86, in reraise
    raise value.with_traceback(tb)
  File "/odoo/odoo12/odoo/tools/convert.py", line 758, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/odoo/odoo12/odoo/tools/convert.py", line 663, in _tag_record
    record = model.with_context(rec_context)._load_records([data], self.mode == 'update')
  File "/odoo/odoo12/odoo/models.py", line 3881, in _load_records
    data['record']._load_records_write(data['values'])
  File "/odoo/odoo12/odoo/models.py", line 3819, in _load_records_write
    self.write(values)
  File "/odoo/odoo12/addons/mail/models/res_users.py", line 157, in write
    write_res = super(res_groups_mail_channel, self).write(vals)
  File "/odoo/odoo12/odoo/addons/base/models/res_users.py", line 1008, in write
    res = super(GroupsView, self).write(values)
  File "/odoo/odoo12/odoo/addons/base/models/res_users.py", line 940, in write
    self._check_one_user_type()
  File "/odoo/odoo12/odoo/addons/base/models/res_users.py", line 113, in _check_one_user_type
    self.mapped('users')._check_one_user_type()
  File "/odoo/odoo12/addons/account/models/res_users.py", line 25, in _check_one_user_type
    raise ValidationError(_("A user cannot have both Tax B2B and Tax B2C.\n"
odoo.tools.convert.ParseError: "A user cannot have both Tax B2B and Tax B2C.
You should go in General Settings, and choose to display Product Prices
either in 'Tax-Included' or in 'Tax-Excluded' mode
(or switch twice the mode if you are already in the desired one).
None" while parsing /odoo/odoo12/addons/account/security/account_security.xml:5, near
<record id="group_account_invoice" model="res.groups">
        <field name="name">Billing</field>
        <field name="category_id" ref="base.module_category_accounting_and_finance"/>
        <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
    </record>

either :
raise ValidationError(_("A user cannot have both Tax B2B and Tax B2C.\n"
odoo.tools.convert.ParseError: "A user cannot have both Tax B2B and Tax B2C.
You should go in General Settings, and choose to display Product Prices
either in 'Tax-Included' or in 'Tax-Excluded' mode
(or switch twice the mode if you are already in the desired one)

The bug seems to be already known, but no reliable information to help me solve it. 
https://github.com/odoo/odoo/issues/37481

My solution for Mc Giver is to replace the new account module by the old one.

Do you have a real solution to debug the account module?

Avatar
Discard
Related Posts Replies Views Activity
3
Oct 20
2272
1
Jan 20
10565
1
Nov 19
5537
4
Jan 24
12184
1
Mar 15
5230