-
- Downloads
[FIX] mrp: create workorder without workcenter
When user not seleted 'work center' and only selecting 'Scheduled Start Date' and 'Scheduled End Date' while creating 'work_order' in 'mrp_production', this traceback raises. To reproduce the issue: 1. Install 'mrp' 2. Activate 'Work Orders' in configuration/settings 3. Go to menuitem/operation and create 'Manufacturing Orders' 4. Select any product and add a line in Work Orders 5. Give values to 'Scheduled Start Date' and 'Scheduled End Date' only. Error: A traceback appears:"ValueError: Expected singleton: resource.calendar()" On '_calculate_duration_expected' method resource_calendar_id value is getting from 'workcenter_id'. https://github.com/odoo/odoo/blob/36459d26f1adb92f92d52ce05329e8ad3e95dd91/addons/mrp/models/mrp_workorder.py#L399-L404 Therefore in the above use case, when triggering the onchnage method, because of resource_calender is dependend on 'workcenter' and when workcenter is not selected it will lead to the above traceback. Sentry-4244804815 closes odoo/odoo#124813 Signed-off-by:William Henrotin (whe) <whe@odoo.com>
Please register or sign in to comment