Merge pull request #35 from hurrinico/add_mrp_calendar_view

[ADD] module mrp_calendar_view
This commit is contained in:
Pedro M. Baeza
2015-08-10 10:00:52 +02:00
6 changed files with 174 additions and 0 deletions

View File

@@ -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 <nicola.malcontenti@agilebg.com>
* 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.

View File

@@ -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 <http://www.gnu.org/licenses/>. #
# #
#########################################################################
from . import model

View File

@@ -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 <http://www.gnu.org/licenses/>. #
# #
#########################################################################
{
'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,
}

View File

@@ -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 <http://www.gnu.org/licenses/>. #
# #
#########################################################################
from . import mrp_repair

View File

@@ -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 <http://www.gnu.org/licenses/>. #
# #
#########################################################################
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")

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_repair_order_calendar_form" model="ir.ui.view">
<field name="name">mrp.repair.calendar.form</field>
<field name="model">mrp.repair</field>
<field name="inherit_id" ref="mrp_repair.view_repair_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='guarantee_limit']" position="after">
<field name="date_repair"/>
</xpath>
<xpath expr="//field[@name='partner_id']" position="after">
<field name="user_id"/>
</xpath>
</field>
</record>
<record id="view_repair_order_calendar" model="ir.ui.view">
<field name="name">Repair Orders Calendar</field>
<field name="model">mrp.repair</field>
<field name="arch" type="xml">
<calendar string="Repair Orders Calendar" date_start="date_repair" color="user_id">
<field name="product_id"/>
<field name="partner_id"/>
</calendar>
</field>
</record>
<record id="mrp_repair.action_repair_order_tree" model="ir.actions.act_window">
<field name="view_mode">calendar,tree,form</field>
</record>
</data>
</openerp>