From 399d6be0a268b77bbbf41c6c3ad183d9eddd16b0 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 7 Dec 2015 11:28:43 +0100 Subject: [PATCH] [IMP] mrp_operations_time_control: OCA adaptation --- mrp_operations_time_control/README.rst | 77 +++++ mrp_operations_time_control/__init__.py | 21 +- mrp_operations_time_control/__openerp__.py | 40 +-- mrp_operations_time_control/i18n/en_US.po | 147 --------- .../models/__init__.py | 21 +- .../models/operation_time.py | 46 +-- .../static/description/icon.png | Bin 0 -> 10813 bytes .../static/description/icon.svg | 312 ++++++++++++++++++ mrp_operations_time_control/tests/__init__.py | 6 + .../tests/test_mrp_operations_time_control.py | 31 ++ .../views/operation_time_view.xml | 61 ++-- 11 files changed, 504 insertions(+), 258 deletions(-) create mode 100644 mrp_operations_time_control/README.rst delete mode 100644 mrp_operations_time_control/i18n/en_US.po create mode 100644 mrp_operations_time_control/static/description/icon.png create mode 100644 mrp_operations_time_control/static/description/icon.svg create mode 100644 mrp_operations_time_control/tests/__init__.py create mode 100644 mrp_operations_time_control/tests/test_mrp_operations_time_control.py diff --git a/mrp_operations_time_control/README.rst b/mrp_operations_time_control/README.rst new file mode 100644 index 000000000..cbd251dfe --- /dev/null +++ b/mrp_operations_time_control/README.rst @@ -0,0 +1,77 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +======================================= +Manufacturing Operations - Time control +======================================= + +This module allows to control the duration of the manufacturing +operations (work orders) through the interface controls. + +Configuration +============= + +Go to *Settings > Manufacturing* and activate "Manage routings and work orders" +for handling the features of this module. + +Usage +===== + +On *Manufacturing > Manufacturing > Manufacturing Orders* or +*Manufacturing > Manufacturing > Work Orders*, you can see the existing work +orders. In each of them, there are buttons for starting, pausing or stopping +them. Pressing these buttons, there are records that are automatically created +or modified in the tab "Machine up time" for tracking the time spent. + +You can also maintain this table by hand going to +*Manufacturing > Manufacturing > Operation Time Lines*. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/129/8.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed `feedback +`_. + +Credits +======= + +Images +------ + +* Original Odoo MRP icon +* Thanks to https://openclipart.org/detail/151831/work-bench +* Thanks to https://openclipart.org/detail/3977/stopwatch-no-shading + +Contributors +------------ + +* Mikel Arregi +* Oihane Crucelaegui +* Pedro M. Baeza +* Ana Juaristi + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/mrp_operations_time_control/__init__.py b/mrp_operations_time_control/__init__.py index 7fc7c09f9..ac746c0bd 100644 --- a/mrp_operations_time_control/__init__.py +++ b/mrp_operations_time_control/__init__.py @@ -1,19 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 Avanzosc +# © 2015 Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from . import models diff --git a/mrp_operations_time_control/__openerp__.py b/mrp_operations_time_control/__openerp__.py index 034991327..68c2cf035 100644 --- a/mrp_operations_time_control/__openerp__.py +++ b/mrp_operations_time_control/__openerp__.py @@ -1,33 +1,21 @@ - -# -*- encoding: utf-8 -*- -############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 Avanzosc +# © 2015 Pedro M. Baeza +# © 2015 Antiun Ingeniería +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { "name": "MRP Operations Time Control", - "version": "1.0", + "version": "8.0.1.1.0", "depends": [ - "base", - "mrp", "mrp_operations_extension", ], - "author": "OdooMRP team," - "AvanzOSC," - "Serv. Tecnol. Avanzados - Pedro M. Baeza", + "license": "AGPL-3", + "author": "OdooMRP team, " + "AvanzOSC, " + "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Antiun Ingeniería S.L., " + "Odoo Community Association (OCA)", "website": "http://www.odoomrp.com", "contributors": [ "Mikel Arregi ", @@ -36,14 +24,10 @@ "Ana Juaristi " ], "category": "Manufacturing", - "description": """ - Manufacturing operations time control - """, 'data': [ "views/operation_time_view.xml", "views/mrp_production_view.xml", "security/ir.model.access.csv", ], "installable": True, - "auto_install": False, } diff --git a/mrp_operations_time_control/i18n/en_US.po b/mrp_operations_time_control/i18n/en_US.po deleted file mode 100644 index c87c0dc7b..000000000 --- a/mrp_operations_time_control/i18n/en_US.po +++ /dev/null @@ -1,147 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_operations_time_control -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: odoomrp-wip (8.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-07 10:43+0000\n" -"PO-Revision-Date: 2015-09-10 16:42+0000\n" -"Last-Translator: <>\n" -"Language-Team: English (United States) (http://www.transifex.com/oca/odoomrp-wip-8-0/language/en_US/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: en_US\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: mrp_operations_time_control -#: field:operation.time.line,create_uid:0 -msgid "Created by" -msgstr "" - -#. module: mrp_operations_time_control -#: field:operation.time.line,create_date:0 -msgid "Created on" -msgstr "" - -#. module: mrp_operations_time_control -#: field:operation.time.line,end_date:0 -msgid "End Date" -msgstr "" - -#. module: mrp_operations_time_control -#: view:mrp.production.workcenter.line:mrp_operations_time_control.operation_time_tree_view -msgid "Finished" -msgstr "" - -#. module: mrp_operations_time_control -#: view:operation.time.line:mrp_operations_time_control.view_operation_time_lines_search -msgid "Group By..." -msgstr "" - -#. module: mrp_operations_time_control -#: field:operation.time.line,id:0 -msgid "ID" -msgstr "" - -#. module: mrp_operations_time_control -#: view:mrp.production:mrp_operations_time_control.mrp_production_operation_time_form_view -#: view:mrp.production.workcenter.line:mrp_operations_time_control.operation_time_form_view -msgid "Information" -msgstr "" - -#. module: mrp_operations_time_control -#: field:operation.time.line,write_uid:0 -msgid "Last Updated by" -msgstr "" - -#. module: mrp_operations_time_control -#: field:operation.time.line,write_date:0 -msgid "Last Updated on" -msgstr "" - -#. module: mrp_operations_time_control -#: model:ir.actions.act_window,name:mrp_operations_time_control.operation_time_lines_action -#: model:ir.ui.menu,name:mrp_operations_time_control.menu_operation_time_lines_action -#: field:mrp.production.workcenter.line,operation_time_lines:0 -msgid "Operation Time Lines" -msgstr "" - -#. module: mrp_operations_time_control -#: field:operation.time.line,operation_time:0 -msgid "Operation time" -msgstr "" - -#. module: mrp_operations_time_control -#: view:operation.time.line:mrp_operations_time_control.operation_time_lines_form_view -#: view:operation.time.line:mrp_operations_time_control.operation_time_lines_tree_view -msgid "Operation time lines" -msgstr "" - -#. module: mrp_operations_time_control -#: view:mrp.production.workcenter.line:mrp_operations_time_control.operation_time_tree_view -msgid "Pending" -msgstr "" - -#. module: mrp_operations_time_control -#: field:operation.time.line,production:0 -msgid "Production" -msgstr "" - -#. module: mrp_operations_time_control -#: view:operation.time.line:mrp_operations_time_control.view_operation_time_lines_search -msgid "Production Order" -msgstr "" - -#. module: mrp_operations_time_control -#: view:mrp.production.workcenter.line:mrp_operations_time_control.operation_time_tree_view -msgid "Resume" -msgstr "" - -#. module: mrp_operations_time_control -#: view:operation.time.line:mrp_operations_time_control.view_operation_time_lines_search -msgid "Search Operation Time Lines" -msgstr "" - -#. module: mrp_operations_time_control -#: view:mrp.production.workcenter.line:mrp_operations_time_control.operation_time_tree_view -msgid "Set Draft" -msgstr "" - -#. module: mrp_operations_time_control -#: view:mrp.production.workcenter.line:mrp_operations_time_control.operation_time_tree_view -msgid "Start" -msgstr "" - -#. module: mrp_operations_time_control -#: field:operation.time.line,start_date:0 -msgid "Start Date" -msgstr "" - -#. module: mrp_operations_time_control -#: view:mrp.production:mrp_operations_time_control.mrp_production_operation_time_form_view -#: view:mrp.production.workcenter.line:mrp_operations_time_control.operation_time_form_view -#: view:operation.time.line:mrp_operations_time_control.operation_time_lines_tree_view -#: field:operation.time.line,uptime:0 -msgid "Uptime" -msgstr "" - -#. module: mrp_operations_time_control -#: view:operation.time.line:mrp_operations_time_control.view_operation_time_lines_search -#: field:operation.time.line,user:0 -msgid "User" -msgstr "" - -#. module: mrp_operations_time_control -#: model:ir.model,name:mrp_operations_time_control.model_mrp_production_workcenter_line -#: view:operation.time.line:mrp_operations_time_control.view_operation_time_lines_search -msgid "Work Order" -msgstr "Work Order" - -#. module: mrp_operations_time_control -#: view:operation.time.line:mrp_operations_time_control.operation_time_lines_form_view -msgid "hours" -msgstr "" diff --git a/mrp_operations_time_control/models/__init__.py b/mrp_operations_time_control/models/__init__.py index fd411f163..557357a98 100644 --- a/mrp_operations_time_control/models/__init__.py +++ b/mrp_operations_time_control/models/__init__.py @@ -1,19 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 Avanzosc +# © 2015 Antiun Ingeniería +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from . import operation_time diff --git a/mrp_operations_time_control/models/operation_time.py b/mrp_operations_time_control/models/operation_time.py index 82c4a158b..764ec541e 100644 --- a/mrp_operations_time_control/models/operation_time.py +++ b/mrp_operations_time_control/models/operation_time.py @@ -1,20 +1,7 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 Avanzosc +# © 2015 Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import api, models, fields @@ -22,9 +9,8 @@ from openerp import api, models, fields class MrpProductionWorkcenterLine(models.Model): _inherit = 'mrp.production.workcenter.line' - operation_time_lines = fields.One2many('operation.time.line', - 'operation_time', - string='Operation Time Lines') + operation_time_lines = fields.One2many( + 'operation.time.line', 'operation_time', string='Operation Time Lines') def _create_operation_line(self): self.env['operation.time.line'].create({ @@ -35,22 +21,26 @@ class MrpProductionWorkcenterLine(models.Model): def _write_end_date_operation_line(self): self.operation_time_lines[-1].end_date = fields.Datetime.now() + @api.multi def action_start_working(self): result = super(MrpProductionWorkcenterLine, self).action_start_working() self._create_operation_line() return result + @api.multi def action_pause(self): result = super(MrpProductionWorkcenterLine, self).action_pause() self._write_end_date_operation_line() return result + @api.multi def action_resume(self): result = super(MrpProductionWorkcenterLine, self).action_resume() self._create_operation_line() return result + @api.multi def action_done(self): result = super(MrpProductionWorkcenterLine, self).action_done() self._write_end_date_operation_line() @@ -58,7 +48,6 @@ class MrpProductionWorkcenterLine(models.Model): class OperationTimeLine(models.Model): - _name = 'operation.time.line' _rec_name = 'operation_time' @@ -68,19 +57,18 @@ class OperationTimeLine(models.Model): start_date = fields.Datetime(string='Start Date') end_date = fields.Datetime(string='End Date') operation_time = fields.Many2one('mrp.production.workcenter.line') - uptime = fields.Float(string='Machine up time', compute='operation_uptime', - store=True, digits=(12, 6)) - production = fields.Many2one('mrp.production', - related='operation_time.production_id', - string='Production', store=True) + uptime = fields.Float( + string='Machine up time', compute='_compute_uptime', store=True, + digits=(12, 6)) + production = fields.Many2one( + 'mrp.production', related='operation_time.production_id', + string='Production', store=True) user = fields.Many2one('res.users', string='User', default=_default_user) @api.one @api.depends('start_date', 'end_date') - def operation_uptime(self): + def _compute_uptime(self): if self.end_date and self.start_date: timedelta = fields.Datetime.from_string(self.end_date) - \ fields.Datetime.from_string(self.start_date) self.uptime = timedelta.total_seconds() / 3600. - else: - self.uptime = 0 diff --git a/mrp_operations_time_control/static/description/icon.png b/mrp_operations_time_control/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..abca09104e72d6ff15d3ca16c52cf8e3831949f7 GIT binary patch literal 10813 zcmWk!1y~ea6y2qp1*E${T9)qa5)~9_k?!t}RT`vgX#{DOZUm)Ex{>ad{^#HQX6D=d z=FPkBy>rh!_s)Z9YbxPlQDA{UAY2t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?uaHAF|{{*u)E8vBQh*k zV=j+D@a^^ImE|%(+#h&*dlLm|G0!*xB2k*IO9;^4GTGFC69fPuvCd(+#jT{gDA`r7 zLO6aU@qnE#X!S_F(MD4Z&;GUZ8HygHk)R=T51w0-Y z-`I3pef)6wnT5XS6HwM!@;UgC9@S|)RX;Ra@jmHoqvPN|Hf?B z=G|f%KCYp6qCrHxykeLXsW>p^_egFMj_=>?^hpavkBas}7v51!hQZw5EPxVT>tDFi%RNYDI&#UcY? zo8zr4*D*#Zo?Nf*-T&mCf%gnl;$HDURSVyd+Ivi9rOlj;0T zMMdFvcRu_3`@r)GzJGsdkJt5r3ia5q-N$|Qg;{9W3kzQN1xu#sfhw4BE{uMXPbvA+ z-X!&F7?ZAQzAoJt2B#?VL{81i(G}X&nj$S6kki4B#*9CI{xpJa;!Ol;P~1Rqk+N`f zV<6kFOvoJoV@AjSf|L!sk&rHAk58xfVF*$e>Hq1u!I$uFFZRq<40Clp{>fq46;c+tfjl;Jluz!s)CWK6?pBy>S5`&?L`%H3j`YIgrwH`+C zOi@lr>tp)e2*??Tw?pZvsh;e-qz(68frMlTO!_CQ#p^*Q;Wm#_p9krL(a99AmfX0b z6lvsTKie*x_^A8iR;|Sr_k)3=WPSk+j<_G<*BJDQs_c>Q{tKIFaY@Km<&_OL(OKM{ ftS7lkq-T6tVzg!NQC8? literal 0 HcmV?d00001 diff --git a/mrp_operations_time_control/static/description/icon.svg b/mrp_operations_time_control/static/description/icon.svg new file mode 100644 index 000000000..ad7dfef1a --- /dev/null +++ b/mrp_operations_time_control/static/description/icon.svg @@ -0,0 +1,312 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mrp_operations_time_control/tests/__init__.py b/mrp_operations_time_control/tests/__init__.py new file mode 100644 index 000000000..12c05261b --- /dev/null +++ b/mrp_operations_time_control/tests/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# © 2015 Pedro M. Baeza +# © 2015 Antiun Ingeniería +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import test_mrp_operations_time_control diff --git a/mrp_operations_time_control/tests/test_mrp_operations_time_control.py b/mrp_operations_time_control/tests/test_mrp_operations_time_control.py new file mode 100644 index 000000000..eb56bfc88 --- /dev/null +++ b/mrp_operations_time_control/tests/test_mrp_operations_time_control.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# © 2015 Pedro M. Baeza +# © 2015 Antiun Ingeniería +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from openerp.tests import common +import time + + +class TestMrpOperationsTimeControl(common.TransactionCase): + def setUp(self): + super(TestMrpOperationsTimeControl, self).setUp() + self.production = self.env.ref( + 'mrp_operations_extension.mrp_production_opeext') + self.production.signal_workflow('button_confirm') + self.production.force_production() + self.workorder = self.production.workcenter_lines[0] + + def test_operations_time(self): + self.assertFalse(self.workorder.operation_time_lines) + self.workorder.action_start_working() + self.assertTrue(self.workorder.operation_time_lines) + time.sleep(1) + self.workorder.action_pause() + self.assertEqual(len(self.workorder.operation_time_lines), 1) + self.assertTrue(self.workorder.operation_time_lines[0].uptime) + self.workorder.action_resume() + time.sleep(1) + self.workorder.action_done() + self.assertEqual(len(self.workorder.operation_time_lines), 2) + self.assertTrue(self.workorder.operation_time_lines[1].uptime) diff --git a/mrp_operations_time_control/views/operation_time_view.xml b/mrp_operations_time_control/views/operation_time_view.xml index 3087798a3..9a6df5e2f 100644 --- a/mrp_operations_time_control/views/operation_time_view.xml +++ b/mrp_operations_time_control/views/operation_time_view.xml @@ -8,12 +8,18 @@ - - - + + + @@ -40,16 +46,31 @@ ref="mrp_operations.mrp_production_workcenter_tree_view_inherit" /> -