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
    • Artificial Intelligence
    • 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
    • Property 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
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

ValueError: Expected singleton: uom.uom() in MOs

Subscribe

Get notified when there's activity on this post

This question has been flagged
uomsingletonissue
2 Replies
458 Views
Avatar
Nutrición y Suplementos del Bajío, msarachaga@nsb.com.mx

Hi, we are using Odoo v19 Online, and we´re getting a "" error when doing the following:

  • On a MO, manually inputting the quantity to produce, for example "650 / 650 units".
  • Then clicling on "Details" of any component to modify lot number etc.

We´ve found a work around which is:

  • not inputing manually the quantity to produce (for example, leave it as 0 / 650 units"
  • editing the lot numbers (the error doesnt pop up this way)
  • clicking on "Produce all" at the end

However this will not be of use if the produced quantity is different from the planned quantity of the MO.

Full error below:

RPC_ERROR

Odoo Server Error

Occured on nsbmx.odoo.com on model mrp.production on 2026-04-02 14:25:19 GMT

Traceback (most recent call last):
File "/home/odoo/src/odoo/19.0/odoo/orm/models.py", line 5937, in ensure_one
_id, = self._ids
^^^^
ValueError: not enough values to unpack (expected 1, got 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/odoo/src/odoo/19.0/odoo/http.py", line 2298, in _serve_db
return service_model.retrying(serve_func, env=self.env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/odoo/service/model.py", line 188, in retrying
result = func()
^^^^^^
File "/home/odoo/src/odoo/19.0/odoo/http.py", line 2353, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/odoo/http.py", line 2568, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/odoo/addons/base/models/ir_http.py", line 355, in _dispatch
result = endpoint(**request.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/odoo/http.py", line 808, in route_wrapper
result = endpoint(self, *args, **params_ok)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/addons/web/controllers/dataset.py", line 32, in call_kw
return call_kw(request.env[model], method, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/odoo/service/model.py", line 97, in call_kw
result = method(recs, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/addons/web/models/models.py", line 88, in web_save
self.write(vals)
File "/home/odoo/src/odoo/19.0/addons/base_automation/models/base_automation.py", line 896, in write
write.origin(self.with_env(automations.env), vals, **kw)
File "/home/odoo/src/enterprise/19.0/project_mrp_workorder_account/models/mrp_production.py", line 11, in write
res = super().write(vals)
^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/addons/project_mrp_account/models/mrp_production.py", line 28, in write
res = super().write(vals)
^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/enterprise/19.0/mrp_workorder/models/mrp_production.py", line 37, in write
res = super().write(vals)
^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/addons/mrp_account/models/mrp_production.py", line 28, in write
res = super().write(vals)
^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/addons/mrp/models/mrp_production.py", line 1038, in write
res = super(MrpProduction, self).write(vals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/addons/mail/models/mail_thread.py", line 391, in write
result = super().write(vals)
^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/enterprise/19.0/ai_fields/models/models.py", line 57, in write
res = super().write(vals)
^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/odoo/orm/models.py", line 4469, in write
field.write(self, value)
File "/home/odoo/src/odoo/19.0/odoo/orm/fields_relational.py", line 733, in write
self.write_batch([(records, value)])
File "/home/odoo/src/odoo/19.0/odoo/orm/fields_relational.py", line 754, in write_batch
self.write_real(records_commands_list, create)
File "/home/odoo/src/odoo/19.0/odoo/orm/fields_relational.py", line 1012, in write_real
comodel.browse(command[1]).with_prefetch(prefetch_ids).write(command[2])
File "/home/odoo/src/odoo/19.0/addons/repair/models/stock_move.py", line 117, in write
res = super().write(vals)
^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/addons/sale_stock/models/stock.py", line 129, in write
res = super().write(vals)
^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/addons/stock_picking_batch/models/stock_move.py", line 30, in write
res = super().write(vals)
^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/addons/mrp/models/stock_move.py", line 303, in write
res = super().write(vals)
^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/addons/stock/models/stock_move.py", line 789, in write
res = super().write(vals)
^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/enterprise/19.0/ai_fields/models/models.py", line 57, in write
res = super().write(vals)
^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/odoo/orm/models.py", line 4501, in write
fields[0].determine_inverse(real_recs)
File "/home/odoo/src/odoo/19.0/odoo/orm/fields.py", line 1926, in determine_inverse
determine(self.inverse, records)
File "/home/odoo/src/odoo/19.0/odoo/orm/fields.py", line 81, in determine
return needle(*args)
^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/addons/stock/models/stock_move.py", line 475, in _set_quantity
_process_increase(move, delta_qty)
File "/home/odoo/src/odoo/19.0/addons/stock/models/stock_move.py", line 461, in _process_increase
move._set_quantity_done(move.quantity)
File "/home/odoo/src/odoo/19.0/addons/stock/models/stock_move.py", line 2409, in _set_quantity_done
self.move_line_ids = self._set_quantity_done_prepare_vals(qty)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/addons/stock/models/stock_move.py", line 2339, in _set_quantity_done_prepare_vals
if ml.product_id.uom_id.compare(ml_qty, qty) > 0:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/19.0/addons/uom/models/uom_uom.py", line 129, in compare
self.ensure_one()
File "/home/odoo/src/odoo/19.0/odoo/orm/models.py", line 5940, in ensure_one
raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: uom.uom()

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
RPC_ERROR
at makeErrorFromResponse (https://nsbmx.odoo.com/web/assets/0b06ec6/web.assets_web.min.js:3198:165)
at XMLHttpRequest.<anonymous> (https://nsbmx.odoo.com/web/assets/0b0
0
Avatar
Discard
Codesphere Tech

Hello,
Please update Stock App.
let me know it is not resolved
Thanks

Avatar
Ravi Durga Prasad
Best Answer

This error is not just a generic singleton issue — in MOs it is usually triggered by inconsistent or missing UoM data during quantity recomputation.

In our case (Odoo 19 Online), we can consistently reproduce it with this flow:

  • Set “Quantity to Produce” manually (e.g. 650 / 650)

  • Open component “Details”

  • Modify lot/serial → error is raised

The traceback shows it crashes during _set_quantity_done, specifically when Odoo tries to compare quantities using:

ml.product_id.uom_id.compare(...)

So the real problem is that at least one move line ends up with:

  • missing product_uom_id, or

  • inconsistent UoM vs product UoM

This aligns with how singleton errors occur in Odoo — the ORM expects a single valid record but receives an empty or invalid recordset instead (Odoo).

Temporary workaround:

  • Do NOT manually set the quantity first

  • Edit lot numbers while quantity is still 0

  • Then click “Produce All”

This avoids triggering _set_quantity_done too early.

However, the proper fix is to check:

  1. All component products have a valid UoM

  2. BOM lines use consistent UoM categories

  3. No automation/custom module is altering move lines during write()

In our case, the issue seems tied to recomputation timing rather than user input alone, so it may also be a regression in v19.

Would be useful to confirm if others are seeing this specifically when editing lot numbers after manually setting the production quantity.

0
Avatar
Discard
Avatar
Zehntech Technologies Inc.
Best Answer

Hello, 

This issue is typically related to a mismatch or inconsistency in the Unit of Measure (UoM) or stock move lines when the quantity to produce is manually updated before editing component details.

In Odoo Online (v19), this behavior is not expected and may indicate a bug or an edge-case scenario in the manufacturing flow—especially when modifying quantities prior to lot/serial assignment.

As a workaround, your current approach is correct. However, to properly handle cases where produced quantity differs from planned quantity, you may consider:

  • Adjusting quantities after assigning lot/serial numbers, or
  • Reviewing the UoM configuration for the product and its components to ensure consistency

If the issue persists, it would be advisable to report it to Odoo support, as it may require a fix on their side (especially in Online version where custom fixes are limited).

Hope this works for you! Feel free to reach out for further discussion.

Regards,

Zehntech Technologies Inc.

santosh.sekwadia@zehntech.com

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
cannot change uom
uom
Avatar
Avatar
Avatar
Avatar
4
Sep 25
4051
UOM - Unique barcode and internal reference with related scanning
uom
Avatar
1
Oct 24
3505
Error 400 Uom in e-commerce in shop/payment after form of delivery adress
uom
Avatar
0
Sep 23
2703
Multiple UoM
uom
Avatar
Avatar
1
Aug 23
4736
Buying/Selling product in different UoM
uom
Avatar
Avatar
1
Sep 21
3528
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 Svenska ภาษาไทย 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