Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0] mrp is causing js error in stock picking: Error: KeyError: 'raw_material_production_id' #97814

Open
anajuaristi opened this issue Aug 9, 2022 · 2 comments

Comments

@anajuaristi
Copy link
Contributor

Impacted versions:[14.0]

Steps to reproduce:
Define picking operations type
type: incoming
use_existing_lots: true
Create new picking for this type
push button to assing lots on any stock_move with trazable product
try to assing an existing lot on move_line

Current behavior:
js traceback (It does not happen if show_operations in picking type is set as true. Selecting lots directly on lines without using the button goes right
Traza:
Error: KeyError: 'raw_material_production_id'
at F.getitem (http://51.255.69.39:8869/web/content/35914-95cfc77/web.assets_backend.js:354:161)
at F.getattr (http://51.255.69.39:8869/web/content/35914-95cfc77/web.assets_backend.js:355:69)
at F.getattribute (http://51.255.69.39:8869/web/content/35914-95cfc77/web.assets_backend.js:147:38)
at py.PY_getAttr (http://51.255.69.39:8869/web/content/35914-95cfc77/web.assets_backend.js:111:176)
at py.evaluate (http://51.255.69.39:8869/web/content/35914-95cfc77/web.assets_backend.js:217:11)
at py.evaluate (http://51.255.69.39:8869/web/content/35914-95cfc77/web.assets_backend.js:215:194)
at py.eval (http://51.255.69.39:8869/web/content/35914-95cfc77/web.assets_backend.js:219:284)
at http://51.255.69.39:8869/web/content/35914-95cfc77/web.assets_backend.js:362:110
at iterator (http://51.255.69.39:8869/web/content/35897-0c41bf8/web.assets_common.js:110:183)
at Function. (http://51.255.69.39:8869/web/content/35897-0c41bf8/web.assets_common.js:113:8)

Expected behavior:
Not to obtain any error but to be able to select an existing lot

CLUES TO SOLVE THE BUG:
https://github.com/odoo/odoo/blob/14.0/addons/mrp/views/stock_move_views.xml#L50

'active_mo_id': parent.raw_material_production_id, --> active_mo_id is only informed if stock_move_line comes from an MO. Otherwise is null, so we think this is causing the error.

Video/Screenshot link (optional):
image

Support ticket number submitted via odoo.com/help (optional):

@anajuaristi anajuaristi changed the title [14.0] mrp is causing js error in stock picking [14.0] mrp is causing js error in stock picking: Error: KeyError: 'raw_material_production_id' Aug 9, 2022
@mde-spring
Copy link

Same things in v15

The field raw_material_production_id is missing in the view stock.view_stock_move_operations.
By this way (from inventory, display detailed ope), the view mrp.view_stock_move_operations_raw seems not to be loaded (due to primary mode ?).

My workaround is to inherit view_stock_move_operations for adding the field.

My odoo help ticket: 2952239

@mde-spring
Copy link

mde-spring commented Aug 16, 2022

Seems corrected with PR #97071

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants