diff --git a/mrp_workorder/models/mrp_production.py b/mrp_workorder/models/mrp_production.py index d40718ed..91510baf 100644 --- a/mrp_workorder/models/mrp_production.py +++ b/mrp_workorder/models/mrp_production.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import fields, models +from odoo import fields, models, api class MrpProduction(models.Model): @@ -12,7 +12,8 @@ class MrpProduction(models.Model): check_ids = fields.One2many('quality.check', 'production_id', string="Checks") def _split_productions(self, amounts=False, cancel_remaining_qty=False, set_consumed_qty=False): - productions = super()._split_productions(amounts=amounts, cancel_remaining_qty=cancel_remaining_qty, set_consumed_qty=set_consumed_qty) + productions = super()._split_productions(amounts=amounts, cancel_remaining_qty=cancel_remaining_qty, + set_consumed_qty=set_consumed_qty) backorders = productions[1:] if not backorders: return productions @@ -20,3 +21,4 @@ class MrpProduction(models.Model): if wo.current_quality_check_id.component_id: wo.current_quality_check_id._update_component_quantity() return productions + diff --git a/mrp_workorder/views/mrp_production_views.xml b/mrp_workorder/views/mrp_production_views.xml index a033d501..66f92243 100644 --- a/mrp_workorder/views/mrp_production_views.xml +++ b/mrp_workorder/views/mrp_production_views.xml @@ -1,41 +1,44 @@ - - - mrp.production.tree.inherit.planning - mrp.production - - - - - - - - - - - - - - + + + mrp.production.tree.inherit.planning + mrp.production + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + mrp.production.search.view.inherit.planning @@ -43,7 +46,9 @@ - [('is_planned', '=', True), ('date_planned_start', '!=', False), ('date_planned_finished', '!=', False)] + [('is_planned', '=', True), ('date_planned_start', '!=', False), + ('date_planned_finished', '!=', False)] + @@ -51,30 +56,33 @@ Unplan orders - + list code records.button_unplan() - [('bom_id', '!=', False), ('bom_id.operation_ids.workcenter_id', '=', active_id), ('date_planned_start', '!=', False), ('date_planned_finished', '!=', False)] + [('bom_id', '!=', False), ('bom_id.operation_ids.workcenter_id', '=', active_id), + ('date_planned_start', '!=', False), ('date_planned_finished', '!=', False)] + + + name="Work Orders" + sequence="2" + parent="mrp.mrp_planning_menu_root" + groups="mrp.group_mrp_routings"/> + name="Planning by Production" + sequence="1" + action="mrp.action_mrp_workorder_production" + parent="mrp_workorder_menu_planning"/> + name="Planning by Workcenter" + sequence="2" + action="mrp_workorder.action_mrp_workorder_dependencies_workcenter" + parent="mrp_workorder_menu_planning"/> diff --git a/sf_plan/views/view.xml b/sf_plan/views/view.xml index d0d3c84e..10992f4a 100644 --- a/sf_plan/views/view.xml +++ b/sf_plan/views/view.xml @@ -291,6 +291,7 @@ ir.actions.act_window mrp.production tree,form + [('picking_type_id.active', '=', True)]