From e4a0239a7a26274961fe46872a1c8e8f3ac614e4 Mon Sep 17 00:00:00 2001 From: agaldona Date: Mon, 14 Dec 2015 08:28:20 +0100 Subject: [PATCH] [IMP] mrp_operations_time_control: new requirement. Enable to finish an operation in pause state. The ending date will not be updated. --- mrp_operations_time_control/README.rst | 1 + mrp_operations_time_control/__openerp__.py | 2 ++ .../data/mrp_production_workcenter_line_workflow.xml | 10 ++++++++++ mrp_operations_time_control/models/operation_time.py | 3 ++- .../views/operation_time_view.xml | 3 +++ 5 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 mrp_operations_time_control/data/mrp_production_workcenter_line_workflow.xml diff --git a/mrp_operations_time_control/README.rst b/mrp_operations_time_control/README.rst index cbd251dfe..23971fa36 100644 --- a/mrp_operations_time_control/README.rst +++ b/mrp_operations_time_control/README.rst @@ -58,6 +58,7 @@ Contributors * Mikel Arregi * Oihane Crucelaegui +* Ainara Galdona * Pedro M. Baeza * Ana Juaristi diff --git a/mrp_operations_time_control/__openerp__.py b/mrp_operations_time_control/__openerp__.py index 68c2cf035..862b149f5 100644 --- a/mrp_operations_time_control/__openerp__.py +++ b/mrp_operations_time_control/__openerp__.py @@ -20,6 +20,7 @@ "contributors": [ "Mikel Arregi ", "Oihane Crucelaegui ", + "Ainara Galdona ", "Pedro M. Baeza ", "Ana Juaristi " ], @@ -28,6 +29,7 @@ "views/operation_time_view.xml", "views/mrp_production_view.xml", "security/ir.model.access.csv", + "data/mrp_production_workcenter_line_workflow.xml" ], "installable": True, } diff --git a/mrp_operations_time_control/data/mrp_production_workcenter_line_workflow.xml b/mrp_operations_time_control/data/mrp_production_workcenter_line_workflow.xml new file mode 100644 index 000000000..6ba5c20df --- /dev/null +++ b/mrp_operations_time_control/data/mrp_production_workcenter_line_workflow.xml @@ -0,0 +1,10 @@ + + + + + + + button_done + + + diff --git a/mrp_operations_time_control/models/operation_time.py b/mrp_operations_time_control/models/operation_time.py index 764ec541e..193b4813c 100644 --- a/mrp_operations_time_control/models/operation_time.py +++ b/mrp_operations_time_control/models/operation_time.py @@ -42,8 +42,9 @@ class MrpProductionWorkcenterLine(models.Model): @api.multi def action_done(self): + not_paused_records = self.filtered(lambda x: x.state != 'pause') result = super(MrpProductionWorkcenterLine, self).action_done() - self._write_end_date_operation_line() + not_paused_records._write_end_date_operation_line() return result diff --git a/mrp_operations_time_control/views/operation_time_view.xml b/mrp_operations_time_control/views/operation_time_view.xml index 9a6df5e2f..d6c0103b4 100644 --- a/mrp_operations_time_control/views/operation_time_view.xml +++ b/mrp_operations_time_control/views/operation_time_view.xml @@ -36,6 +36,9 @@ +