odoo/enterprise#78940
Created by fw-bot
- label
- odoo-dev:saas-17.4-17.0-opw-4452747-create_new_finished_lot_mo-lase-410027-fw
- head
- 53868b68e1a191abc9366aa74c347a60c23009e0
odoo/odoo | odoo/enterprise | |
---|---|---|
17.0 | #193965 | #77265 |
saas-17.2 | #196663 | #78632 |
saas-17.4 | #197155 #197112 | #78966 #78940 |
18.0 | #197372 | #79109 |
saas-18.1 | #197516 | #79189 |
saas-18.2 | #200538 | #80861 |
master | #200771 | #80973 |
[FW][FIX] quality_mrp_workorder: allow finished lot production via quality checks
Steps to reproduce:
- Create a storable product FP tracked by SN with a BOM:
- 1 Operation: - instruction: Register Production type (per product)
- 1 x Comp (storable product in stock)
- Create and confirm an MO for one unit of FP.
- Go to the shopfoor app > open the instruction of your operation
- Type a non-existing serial number in the search bar > Create "new_sn"
> This opens a form view of the stock.lot model - Save and close the new stock.lot
> Invalid operation: You are not allowed to create or edit a lot or serial number for the components with the operation type
> "Manufacturing". To change this, go on the operation type and tick the box "Create New Lots/Serial Numbers for
> Components"
Expected behavior:
The invalid operation should not be raised as the "required" option concerns only componenets and not final products.
Cause of the issue:
Creating a stock lot will first launch a call of the _check_create
: https://github.com/odoo/odoo/blob/c25d71f14fa168807f07cd88bed805d15db8add5/addons/stock/models/stock_lot.py#L150-L153 However, since this check does not verifies that the product for which we create the lot is indeed related to a component of the MO it will raise the invalid operation even for final products: https://github.com/odoo/odoo/blob/c25d71f14fa168807f07cd88bed805d15db8add5/addons/mrp/models/stock_lot.py#L11-L17
Issue 2:
Currently, the quickCreate
("Create sn_name") option of the lot field of te "register production" dialog calls a name_create
that will set an error message in the logs as the product_id required field can not be provided neither in the vals or the context of the name_create
. You then fall back on the same form dialog than the "Create and edit". The quickCreate
option should therefore just be disabled.
Community: odoo/odoo#193965
opw-4452747
Forward-Port-Of: #77265