mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
Initial commit maintenance_purchase_detail for 11.0
This commit is contained in:
26
maintenance_purchase_detail/README.rst
Normal file
26
maintenance_purchase_detail/README.rst
Normal file
@@ -0,0 +1,26 @@
|
||||
***********************************
|
||||
Hibou - Maintenance Purchase Detail
|
||||
***********************************
|
||||
|
||||
Record purchase date and details on Equipments.
|
||||
|
||||
For more information and add-ons, visit `Hibou.io <https://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 <https://github.com/hibou-io/hibou-odoo-suite/blob/master/LICENSE>`_.
|
||||
Copyright Hibou Corp. 2018
|
||||
1
maintenance_purchase_detail/__init__.py
Normal file
1
maintenance_purchase_detail/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
||||
22
maintenance_purchase_detail/__manifest__.py
Normal file
22
maintenance_purchase_detail/__manifest__.py
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
'name': 'Equipment Purchase Detail',
|
||||
'version': '11.0.1.0.0',
|
||||
'author': 'Hibou Corp. <hello@hibou.io>',
|
||||
'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,
|
||||
}
|
||||
1
maintenance_purchase_detail/models/__init__.py
Normal file
1
maintenance_purchase_detail/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import maintenance
|
||||
13
maintenance_purchase_detail/models/maintenance.py
Normal file
13
maintenance_purchase_detail/models/maintenance.py
Normal file
@@ -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')
|
||||
20
maintenance_purchase_detail/views/maintenance_views.xml
Normal file
20
maintenance_purchase_detail/views/maintenance_views.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record model="ir.ui.view" id="hr_equipment_view_form_inherited">
|
||||
<field name="name">equipment.form.inherited</field>
|
||||
<field name="model">maintenance.equipment</field>
|
||||
<field name="inherit_id" ref="maintenance.hr_equipment_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
|
||||
<field name="active" widget="boolean_button" options="{"terminology": "archive"}"/>
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='warranty']" position="after">
|
||||
<field name="purchase_date"/>
|
||||
<field name="purchase_condition"/>
|
||||
<field name="purchase_note"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user