Skip to Content
Menu
This question has been flagged

Hi all,

I encountered an issue where I receive an error "Stock.move" error when creating a manufacturing order with by product. 


Objective:
What I wanted to do is when a chicken arrives, I can manufacture it into "chicken salad" and "chicken fillet". After some research, I found that it can be done by using the by product MRP function.

Problem:

I created the product, BOM and the manufacturing order. However, when I click produce in the manufacturing order, the following error occurred. I tried to start a new DB instance with no other plugin installed but problem still occurs. 


Really appreciate if the community can provide some assistance on solving the error. Thanks.

Environment: Bitnami Odoo 12.0-20181218
VM: Google Cloud Platform

Error Code:

Odoo Server Error
Traceback (most recent call last):
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/http.py", line 654, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/http.py", line 312, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/http.py", line 696, in dispatch
    result = self._call_function(**self.params)
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/http.py", line 344, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/http.py", line 337, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/http.py", line 939, in __call__
    return self.method(*args, **kw)
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/http.py", line 517, in response_wrap
    response = f(*args, **kw)
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/addons/web/controllers/main.py", line 966, in call_button
    action = self._call_kw(model, method, args, {})
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/addons/web/controllers/main.py", line 954, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/api.py", line 749, in call_kw
    return _call_kw_multi(method, model, args, kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/api.py", line 736, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/addons/mrp/wizard/mrp_product_produce.py", line 65, in do_produce
    self.check_finished_move_lots()
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/addons/mrp_byproduct/models/mrp_production.py", line 85, in check_finished_move_lots
    return super(MrpProductProduce, self).check_finished_move_lots()
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/addons/mrp/wizard/mrp_product_produce.py", line 76, in check_finished_move_lots
    if produce_move and produce_move.product_id.tracking != 'none':
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/fields.py", line 968, in __get__
    record.ensure_one()
  File "/opt/bitnami/apps/odoo/lib/odoo-12.0.post20181218-py3.7.egg/odoo/models.py", line 4653, in ensure_one
    raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: stock.move(21, 24)
Avatar
Discard
Author Best Answer

Thanks!

Avatar
Discard
Best Answer

Hi,

Have you added any custom code or module into your database? if so it might be causing the issue. If you haven't used any custom modules or code, try to reproduce the same issue in Odoo runbot.

The singleton error can be fixed by iterating over the self or by using the self.ensure_one.


Thanks


Avatar
Discard
Related Posts Replies Views Activity
1
Sep 21
2278
3
May 24
490
2
Jan 24
12900
0
Mar 15
3653
1
Jan 24
563