Skip to content

Commit

Permalink
[IMP] oxigen_maintenance: Add IT Fields
Browse files Browse the repository at this point in the history
  • Loading branch information
etobella committed Sep 20, 2023
1 parent 704d4dc commit cc72caf
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 0 deletions.
3 changes: 3 additions & 0 deletions oxigen_maintenance/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
"data": [
"data/maintenance_data.xml",
"security/security.xml",
"security/ir.model.access.csv",
"views/maintenance_equipment_operating_system.xml",
"views/stock_location_views.xml",
"views/maintenance_equipment_views.xml",
"views/maintenance_plan_views.xml",
"views/maintenance_request_views.xml",
"views/contract_contract.xml",
"views/maintenance_team_views.xml",
],
"demo": ["demo/data.xml"],
}
1 change: 1 addition & 0 deletions oxigen_maintenance/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
from . import stock_location
from . import contract_contract
from . import maintenance_team
from . import maintenance_equipment_operating_system
10 changes: 10 additions & 0 deletions oxigen_maintenance/models/maintenance_equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ class MaintenanceEquipment(models.Model):
my_team_equipment = fields.Boolean(
search="_search_my_team_equipment", compute="_compute_my_team_equipment"
)
# Specific fields only for IT
imei_1 = fields.Char(groups="oxigen_maintenance.group_maintenance_it")
imei_2 = fields.Char(groups="oxigen_maintenance.group_maintenance_it")
mac_address = fields.Char(groups="oxigen_maintenance.group_maintenance_it")
operating_system_id = fields.Many2one(
"maintenance.equipment.operating.system",
groups="oxigen_maintenance.group_maintenance_it",
)
it_phone = fields.Char(groups="oxigen_maintenance.group_maintenance_it")
icc_code = fields.Char(groups="oxigen_maintenance.group_maintenance_it")

def _search_my_team_equipment(self, operator, value):
if operator != "=" or not value:
Expand Down
4 changes: 4 additions & 0 deletions oxigen_maintenance/security/security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record>
<record id="group_maintenance_it" model="res.groups">
<field name="name">Maintenance IT Fields</field>
<field name="category_id" ref="base.module_category_hidden" />
</record>
</data>
<data noupdate="1">
<record id="only_subscribe_base_user" model="ir.rule">
Expand Down
26 changes: 26 additions & 0 deletions oxigen_maintenance/views/maintenance_equipment_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
<field name="arch" type="xml">
<xpath expr="//field[@name='owner_user_id']" position="after">
<field name="stock_location_id" />
<field name="imei_1" />
<field name="imei_2" />
<field name="mac_address" />
<field name="operating_system_id" />
<field name="it_phone" />
<field name="icc_code" />
</xpath>
</field>
</record>
Expand All @@ -26,6 +32,26 @@
<field name="employee_id" />
<field name="contract_ids" />
</xpath>
<notebook position="inside">
<page
name="it_data"
string="IT Data"
groups="oxigen_maintenance.group_maintenance_it"
>
<group>
<group>
<field name="mac_address" />
<field name="operating_system_id" />
</group>
<group>
<field name="imei_1" />
<field name="imei_2" />
<field name="it_phone" />
<field name="icc_code" />
</group>
</group>
</page>
</notebook>
</field>
</record>

Expand Down

0 comments on commit cc72caf

Please sign in to comment.