Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

ImportError: cannot import name 'babel_locale_parse'

Subscribe

Get notified when there's activity on this post

This question has been flagged
pythonerrorimporterror_updating12.0
1 Reply
9840 Views
Avatar
brendan.l@athenadistribution.com

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... 



0
Avatar
Discard
Avatar
brendan.l@athenadistribution.com
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?

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
error when starting odoo v12 server
error 12.0
Avatar
Avatar
3
Oct 20
4118
Cannot import date field Solved
import 12.0
Avatar
Avatar
1
Jan 20
13055
Odoo12 babel error Solved
error import
Avatar
Avatar
1
Nov 19
8000
unicode decode error Solved
python error
Avatar
Avatar
Avatar
Avatar
4
Jan 24
14761
Bug following a contact import : column res_partner_bank.active doesn't exist
error import
Avatar
Avatar
1
Mar 15
5253
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now