From 40413f606119712ef34d35c2f60cf5e6fdd074b3 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Tue, 1 May 2018 09:54:22 -0700 Subject: [PATCH] Initial commit `maintenance_purchase_detail` for 11.0 --- maintenance_purchase_detail/README.rst | 26 +++++++++++++++++++ maintenance_purchase_detail/__init__.py | 1 + maintenance_purchase_detail/__manifest__.py | 22 ++++++++++++++++ .../models/__init__.py | 1 + .../models/maintenance.py | 13 ++++++++++ .../views/maintenance_views.xml | 20 ++++++++++++++ 6 files changed, 83 insertions(+) create mode 100644 maintenance_purchase_detail/README.rst create mode 100644 maintenance_purchase_detail/__init__.py create mode 100644 maintenance_purchase_detail/__manifest__.py create mode 100644 maintenance_purchase_detail/models/__init__.py create mode 100644 maintenance_purchase_detail/models/maintenance.py create mode 100644 maintenance_purchase_detail/views/maintenance_views.xml diff --git a/maintenance_purchase_detail/README.rst b/maintenance_purchase_detail/README.rst new file mode 100644 index 00000000..0e081b44 --- /dev/null +++ b/maintenance_purchase_detail/README.rst @@ -0,0 +1,26 @@ +*********************************** +Hibou - Maintenance Purchase Detail +*********************************** + +Record purchase date and details on Equipments. + +For more information and add-ons, visit `Hibou.io `_. + +============= +Main Features +============= + +Adds the following fields to Maintenance Equipment: + +* Purchase Date +* Purchase Condition (dropdown) +* Purchase Note + +Additionally, adds a smart button to archive Equipments. + +======= +License +======= + +Please see `LICENSE `_. +Copyright Hibou Corp. 2018 \ No newline at end of file diff --git a/maintenance_purchase_detail/__init__.py b/maintenance_purchase_detail/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/maintenance_purchase_detail/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/maintenance_purchase_detail/__manifest__.py b/maintenance_purchase_detail/__manifest__.py new file mode 100644 index 00000000..e688ea32 --- /dev/null +++ b/maintenance_purchase_detail/__manifest__.py @@ -0,0 +1,22 @@ +{ + 'name': 'Equipment Purchase Detail', + 'version': '11.0.1.0.0', + 'author': 'Hibou Corp. ', + 'category': 'Human Resources', + 'summary': 'Record purchase date and details on Equipments.', + 'description': """ +Equipment Purchase Detail +========================= + +Adds fields for purchase date, and condition on the Equipment form. +""", + 'website': 'https://hibou.io/', + 'depends': [ + 'maintenance', + ], + 'data': [ + 'views/maintenance_views.xml', + ], + 'installable': True, + 'auto_install': False, +} diff --git a/maintenance_purchase_detail/models/__init__.py b/maintenance_purchase_detail/models/__init__.py new file mode 100644 index 00000000..12bf298f --- /dev/null +++ b/maintenance_purchase_detail/models/__init__.py @@ -0,0 +1 @@ +from . import maintenance diff --git a/maintenance_purchase_detail/models/maintenance.py b/maintenance_purchase_detail/models/maintenance.py new file mode 100644 index 00000000..cdf73d09 --- /dev/null +++ b/maintenance_purchase_detail/models/maintenance.py @@ -0,0 +1,13 @@ +from odoo import api, fields, models + + +class MaintenanceEquipment(models.Model): + _inherit = 'maintenance.equipment' + + purchase_date = fields.Date(string='Purchase Date') + purchase_condition = fields.Selection([ + ('new', 'New'), + ('used', 'Used'), + ('other', 'Other'), + ], string='Purchase Condition') + purchase_note = fields.Text(string='Purchase Note') diff --git a/maintenance_purchase_detail/views/maintenance_views.xml b/maintenance_purchase_detail/views/maintenance_views.xml new file mode 100644 index 00000000..5a2a9777 --- /dev/null +++ b/maintenance_purchase_detail/views/maintenance_views.xml @@ -0,0 +1,20 @@ + + + + equipment.form.inherited + maintenance.equipment + + + + + + + + + + + + + \ No newline at end of file