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

Deleting COA then install inventory causing error

Subscribe

Get notified when there's activity on this post

This question has been flagged
InventoryAccountingCOA
2 Replies
2323 Views
Avatar
Aryono

Hello Odooers,


When I tried to install Inventory on sh, it fail and error occurs.

After several trial and error on my local build, I found out the cause of that error: delete unused COA's.

I confirmed that on clean build and new database. here are the steps:

1. create new database (v17)

2. install accounting

3. delete all but required COA (I know its required, by the popup when I try to delete it)

4. install inventory/upgrading account


My questions are: 

1. how to delete unused COA's safely?

2. did COA's should not be deleted at all, even on a new database?

3. how to fix the error without abandoning current build/creating new database?


Thank you in advance



2024-06-23 14:53:20,571 4674 ERROR odoodb odoo.modules.registry: Failed to load registry 
Traceback (most recent call last):
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/tools/cache.py", line 99, in lookup
    r = d[key]
        ~^^^^^
  File "", line 2, in __getitem__
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/tools/func.py", line 87, in locked
    return func(inst, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/tools/lru.py", line 34, in __getitem__
    a = self.d[obj]
        ~~~~~~^^^^^
KeyError: ('ir.model.data', , 'account.1_stock_in')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/modules/registry.py", line 113, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/modules/loading.py", line 480, in load_modules
    processed_modules += load_marked_modules(env, graph,
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/modules/loading.py", line 364, in load_marked_modules
    loaded, processed = load_module_graph(
                        ^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/modules/loading.py", line 245, in load_module_graph
    getattr(py_module, post_init)(env)
  File "/Users/aryono/WebProjects/odoo/odoo/addons/stock_account/__init__.py", line 41, in _configure_journals
    ChartTemplate._post_load_data(template_code, company, template_data)
  File "/Users/aryono/WebProjects/odoo/odoo/addons/stock_account/models/account_chart_template.py", line 26, in _post_load_data
    self.env['ir.property']._set_default(fname, 'product.category', self.ref(value).id, company=company)
                                                                    ^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/addons/account/models/chart_template.py", line 1038, in ref
    or self.env.ref(f"account.{self.env.company.parent_ids[0].id}_{xmlid}", raise_if_not_found)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/api.py", line 580, in ref
    res_model, res_id = self['ir.model.data']._xmlid_to_res_model_res_id(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/addons/base/models/ir_model.py", line 2187, in _xmlid_to_res_model_res_id
    return self._xmlid_lookup(xmlid)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "", line 2, in _xmlid_lookup
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/tools/cache.py", line 104, in lookup
    value = d[key] = self.method(*args, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/addons/base/models/ir_model.py", line 2180, in _xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: account.1_stock_in
2024-06-23 14:53:20,578 4674 INFO odoodb odoo.modules.loading: loading 1 modules...
2024-06-23 14:53:20,583 4674 INFO odoodb odoo.modules.loading: 1 modules loaded in 0.00s, 0 queries (+0 extra)
2024-06-23 14:53:20,588 4674 INFO odoodb odoo.modules.loading: loading 74 modules...
2024-06-23 14:53:20,611 4674 INFO odoodb odoo.modules.loading: 74 modules loaded in 0.02s, 0 queries (+0 extra)
2024-06-23 14:53:20,676 4674 INFO odoodb odoo.modules.loading: Modules loaded.
2024-06-23 14:53:20,678 4674 INFO odoodb odoo.modules.registry: Registry loaded in 0.104s
2024-06-23 14:53:20,679 4674 ERROR odoodb odoo.http: Exception during request handling.
Traceback (most recent call last):
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/tools/cache.py", line 99, in lookup
    r = d[key]
        ~^^^^^
  File "", line 2, in __getitem__
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/tools/func.py", line 87, in locked
    return func(inst, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/tools/lru.py", line 34, in __getitem__
    a = self.d[obj]
        ~~~~~~^^^^^
KeyError: ('ir.model.data', , 'account.1_stock_in')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/http.py", line 2189, in __call__
    response = request._serve_db()
               ^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/http.py", line 1764, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
             ^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/http.py", line 1791, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/http.py", line 1995, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/addons/base/models/ir_http.py", line 222, in _dispatch
    result = endpoint(**request.params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/http.py", line 741, in route_wrapper
    result = endpoint(self, *args, **params_ok)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/addons/web/controllers/dataset.py", line 28, in call_button
    action = self._call_kw(model, method, args, kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/addons/web/controllers/dataset.py", line 20, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/api.py", line 468, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/api.py", line 453, in _call_kw_multi
    result = method(recs, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "", line 2, in button_immediate_install
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/addons/base/models/ir_module.py", line 75, in check_and_log
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/addons/base/models/ir_module.py", line 466, in button_immediate_install
    return self._button_immediate_function(self.env.registry[self._name].button_install)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/addons/base/models/ir_module.py", line 590, in _button_immediate_function
    registry = modules.registry.Registry.new(self._cr.dbname, update_module=True)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "", line 2, in new
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/tools/func.py", line 87, in locked
    return func(inst, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/modules/registry.py", line 113, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/modules/loading.py", line 480, in load_modules
    processed_modules += load_marked_modules(env, graph,
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/modules/loading.py", line 364, in load_marked_modules
    loaded, processed = load_module_graph(
                        ^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/modules/loading.py", line 245, in load_module_graph
    getattr(py_module, post_init)(env)
  File "/Users/aryono/WebProjects/odoo/odoo/addons/stock_account/__init__.py", line 41, in _configure_journals
    ChartTemplate._post_load_data(template_code, company, template_data)
  File "/Users/aryono/WebProjects/odoo/odoo/addons/stock_account/models/account_chart_template.py", line 26, in _post_load_data
    self.env['ir.property']._set_default(fname, 'product.category', self.ref(value).id, company=company)
                                                                    ^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/addons/account/models/chart_template.py", line 1038, in ref
    or self.env.ref(f"account.{self.env.company.parent_ids[0].id}_{xmlid}", raise_if_not_found)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/api.py", line 580, in ref
    res_model, res_id = self['ir.model.data']._xmlid_to_res_model_res_id(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/addons/base/models/ir_model.py", line 2187, in _xmlid_to_res_model_res_id
    return self._xmlid_lookup(xmlid)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "", line 2, in _xmlid_lookup
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/tools/cache.py", line 104, in lookup
    value = d[key] = self.method(*args, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/addons/base/models/ir_model.py", line 2180, in _xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: account.1_stock_in
2024-06-23 14:53:20,680 4674 INFO odoodb werkzeug: 127.0.0.1 - - [23/Jun/2024 14:53:20] "POST /web/dataset/call_button HTTP/1.1" 200 - 8919 1.876 1.893
2024-06-23 14:53:37,801 4674 INFO odoodb odoo.addons.base.models.ir_cron: Starting job `Procurement: run scheduler`.
2024-06-23 14:53:37,809 4674 ERROR odoodb odoo.addons.base.models.ir_cron: Call from cron Procurement: run scheduler for server action #349 failed in Job #28
Traceback (most recent call last):
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/addons/base/models/ir_cron.py", line 393, in _callback
    self.env['ir.actions.server'].browse(server_action_id).run()
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/addons/base/models/ir_actions.py", line 917, in run
    self.env[model_name].check_access_rights("write")
    ~~~~~~~~^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/api.py", line 534, in __getitem__
    return self.registry[model_name](self, (), ())
           ~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/Users/aryono/WebProjects/odoo/odoo/odoo/modules/registry.py", line 213, in __getitem__
    return self.models[model_name]
           ~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'procurement.group'
0
Avatar
Discard
Hemangi Rupareliya(rupareliyahemangi145@gmail.com)

Hello Aryono,

Did you find any solution for this? I am facing same error when installing POS module after installing CRM module.

Lars Aam

Just a guess: When you install Inventory it creates Product categories where there are default accounts for income and expense. The accounts depends on your fiscal localization.
If you deleted these, it might be the reason for the error. Strange that the error message mention key error as 'procurement.group'. There is no direct relation to product categories from that model, but relations to manufacturing and stock moves. That might be the reason behind. Stock moves create accounting entries, and the account come from Product categories.

A safer way to put accounts you do not need out of use, is to flag as 'Deprecated'. It is recommended.

Avatar
Aryono
Author Best Answer

ok, posted, here is the link

https://github.com/odoo/odoo/issues/170471

0
Avatar
Discard
Aryono
Author

Hi Hemangi Rupareliya,
as my project not live yet, I really considering nuking everything and starts over

Hi Lars Aam, thank you for answering.
ok, from now on, I will mark unused COAs to deprecated.
Would be nice if Odoo fix this and give warning for unsafe COA deletion.

Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

Hi,
Can you report the same with detailed steps to reproduce in: https://github.com/odoo/odoo/issues  so that odoo can look into it and fix it.

Thanks

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
Switch COA in running company Solved
Accounting COA
Avatar
Avatar
2
Nov 24
1551
Inventory Adjustments in Loss Account Solved
Inventory Accounting
Avatar
Avatar
Avatar
11
Feb 23
11124
Automatic expense of inventory items when moved to another internal location Solved
Inventory Accounting Automation COGS
Avatar
Avatar
Avatar
3
Aug 24
3354
Quant's editing is restricted, you can't do this operation.
Inventory
Avatar
Avatar
Avatar
2
Nov 25
689
How to attach specific locations to products
Inventory
Avatar
Avatar
Avatar
2
Aug 25
1552
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