From fedf38fb7460b096c50e1f6863390b4a015589d0 Mon Sep 17 00:00:00 2001 From: Nicola Malcontenti Date: Fri, 31 Jul 2015 09:13:01 +0200 Subject: [PATCH] [ADD] Add module mrp_calendar_view --- mrp_calendar_view/README.rst | 29 ++++++++++++++++++ mrp_calendar_view/__init__.py | 22 ++++++++++++++ mrp_calendar_view/__openerp__.py | 33 ++++++++++++++++++++ mrp_calendar_view/model/__init__.py | 22 ++++++++++++++ mrp_calendar_view/model/mrp_repair.py | 33 ++++++++++++++++++++ mrp_calendar_view/view/mrp_repair_view.xml | 35 ++++++++++++++++++++++ 6 files changed, 174 insertions(+) create mode 100644 mrp_calendar_view/README.rst create mode 100644 mrp_calendar_view/__init__.py create mode 100644 mrp_calendar_view/__openerp__.py create mode 100644 mrp_calendar_view/model/__init__.py create mode 100644 mrp_calendar_view/model/mrp_repair.py create mode 100644 mrp_calendar_view/view/mrp_repair_view.xml diff --git a/mrp_calendar_view/README.rst b/mrp_calendar_view/README.rst new file mode 100644 index 000000000..1b5025644 --- /dev/null +++ b/mrp_calendar_view/README.rst @@ -0,0 +1,29 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License + +MRP Calendar View +================= + +This Module adds a calendar view for the repair orders + +Credits +======= + +Contributors +------------ + +* Nicola Malcontenti +* Odoo Community Association + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://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 http://odoo-community.org. diff --git a/mrp_calendar_view/__init__.py b/mrp_calendar_view/__init__.py new file mode 100644 index 000000000..7832e0626 --- /dev/null +++ b/mrp_calendar_view/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +######################################################################### +# # +# Copyright (C) 2015 Agile Business Group # +# # +# 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 Affero General Public Licensefor more details. # +# # +# You should have received a copy of the # +# GNU Affero General Public License # +# along with this program. If not, see . # +# # +######################################################################### + +from . import model diff --git a/mrp_calendar_view/__openerp__.py b/mrp_calendar_view/__openerp__.py new file mode 100644 index 000000000..28804dad4 --- /dev/null +++ b/mrp_calendar_view/__openerp__.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +######################################################################### +# # +# Copyright (C) 2015 Agile Business Group # +# # +# 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 Affero General Public Licensefor more details. # +# # +# You should have received a copy of the # +# GNU Affero General Public License # +# along with this program. If not, see . # +# # +######################################################################### + + +{ + 'name': 'MRP Calendar View', + 'version': '1.0', + 'category': 'Manufacturing', + 'author': "Agile Business Group, Odoo Community Association (OCA)", + 'website': 'http://www.agilebg.com', + 'license': 'AGPL-3', + 'depends': ['mrp_repair'], + 'data': ['view/mrp_repair_view.xml'], + 'installable': True, +} diff --git a/mrp_calendar_view/model/__init__.py b/mrp_calendar_view/model/__init__.py new file mode 100644 index 000000000..7850985d6 --- /dev/null +++ b/mrp_calendar_view/model/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +######################################################################### +# # +# Copyright (C) 2015 Agile Business Group # +# # +# 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 Affero General Public Licensefor more details. # +# # +# You should have received a copy of the # +# GNU Affero General Public License # +# along with this program. If not, see . # +# # +######################################################################### + +from . import mrp_repair diff --git a/mrp_calendar_view/model/mrp_repair.py b/mrp_calendar_view/model/mrp_repair.py new file mode 100644 index 000000000..728a7d69b --- /dev/null +++ b/mrp_calendar_view/model/mrp_repair.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +######################################################################### +# # +# Copyright (C) 2015 Agile Business Group # +# # +# 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 Affero General Public Licensefor more details. # +# # +# You should have received a copy of the # +# GNU Affero General Public License # +# along with this program. If not, see . # +# # +######################################################################### + +from openerp import fields, models + + +class mrp_repair(models.Model): + _inherit = 'mrp.repair' + + user_id = fields.Many2one('res.users', 'User', + default=lambda self: self.env.user, + help="Person in charge for the repair") + date_repair = fields.Datetime('Repair Date', default=fields.Datetime.now, + help="Date of the repair, this field" + "and user_id defines the calendar") diff --git a/mrp_calendar_view/view/mrp_repair_view.xml b/mrp_calendar_view/view/mrp_repair_view.xml new file mode 100644 index 000000000..dad94cb69 --- /dev/null +++ b/mrp_calendar_view/view/mrp_repair_view.xml @@ -0,0 +1,35 @@ + + + + + + mrp.repair.calendar.form + mrp.repair + + + + + + + + + + + + + Repair Orders Calendar + mrp.repair + + + + + + + + + + calendar,tree,form + + + +