[IMP] hr_maintenance, maintenance, l10n_ch, l10n_generic_coa, l10n_il: equipments renamed equipment
Modules: - hr_maintenance; - maintenance; - l10n_ch; - l10n_generic_coa - l10n_il. The plural of "equipment" is "equipment" and not "equipments" changes in the enterprise version: odoo/enterprise#31498 Remark: Runbot test log: Two fields (equipment_count, equipment_ids) of maintenance.equipment.category() have the same label: Equipment. [Modules: maintenance and maintenance] Two fields (equipment_count, equipment_ids) of hr.employee() have the same label: Equipment. [Modules: hr_maintenance and hr_maintenance] Using "Equipment Count" to differentiate them opw-2981186 closes odoo/odoo#100558 Signed-off-by: Adrien Widart <awt@odoo.com>
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
'description': """
|
||||
Bridge between HR and Maintenance.""",
|
||||
'depends': ['hr', 'maintenance'],
|
||||
'summary': 'Equipments, Assets, Internal Hardware, Allocation Tracking',
|
||||
'summary': 'Equipment, Assets, Internal Hardware, Allocation Tracking',
|
||||
'data': [
|
||||
'security/equipment.xml',
|
||||
'views/maintenance_views.xml',
|
||||
|
||||
@@ -4,8 +4,8 @@ from odoo import api, models, fields
|
||||
class Users(models.Model):
|
||||
_inherit = 'res.users'
|
||||
|
||||
equipment_ids = fields.One2many('maintenance.equipment', 'owner_user_id', string="Managed Equipments")
|
||||
equipment_count = fields.Integer(related='employee_id.equipment_count', string="Assigned Equipments")
|
||||
equipment_ids = fields.One2many('maintenance.equipment', 'owner_user_id', string="Managed Equipment")
|
||||
equipment_count = fields.Integer(related='employee_id.equipment_count', string="Assigned Equipment")
|
||||
|
||||
@property
|
||||
def SELF_READABLE_FIELDS(self):
|
||||
@@ -16,7 +16,7 @@ class Employee(models.Model):
|
||||
_inherit = 'hr.employee'
|
||||
|
||||
equipment_ids = fields.One2many('maintenance.equipment', 'employee_id')
|
||||
equipment_count = fields.Integer('Equipments', compute='_compute_equipment_count')
|
||||
equipment_count = fields.Integer('Equipment Count', compute='_compute_equipment_count')
|
||||
|
||||
@api.depends('equipment_ids')
|
||||
def _compute_equipment_count(self):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<!-- HR officers and HR managers are allowed to manage equipments -->
|
||||
<!-- HR officers and HR managers are allowed to manage equipment -->
|
||||
<record id="hr.group_hr_user" model="res.groups">
|
||||
<field name="implied_ids" eval="[(4, ref('maintenance.group_equipment_manager'))]"/>
|
||||
</record>
|
||||
|
||||
@@ -56,8 +56,8 @@
|
||||
"ch_coa_1549","Accumulated depreciation on tools","1549","asset_current","l10n_ch.l10nch_chart_template","False"
|
||||
"ch_coa_1550","Warehouse","1550","asset_current","l10n_ch.l10nch_chart_template","False"
|
||||
"ch_coa_1559","Accumulated depreciation on warehouse","1559","asset_current","l10n_ch.l10nch_chart_template","False"
|
||||
"ch_coa_1570","Equipments and Facilities","1570","asset_current","l10n_ch.l10nch_chart_template","False"
|
||||
"ch_coa_1579","Accumulated depreciation on Equipments and Facilities","1579","asset_current","l10n_ch.l10nch_chart_template","False"
|
||||
"ch_coa_1570","Equipment and Facilities","1570","asset_current","l10n_ch.l10nch_chart_template","False"
|
||||
"ch_coa_1579","Accumulated depreciation on Equipment and Facilities","1579","asset_current","l10n_ch.l10nch_chart_template","False"
|
||||
"ch_coa_1590","Other movable tangible assets","1590","asset_current","l10n_ch.l10nch_chart_template","False"
|
||||
"ch_coa_1599","Accumulated depreciation on Other movable tangible assets","1599","asset_current","l10n_ch.l10nch_chart_template","False"
|
||||
"ch_coa_1600","Real Estate","1600","asset_current","l10n_ch.l10nch_chart_template","False"
|
||||
|
||||
|
@@ -24,7 +24,7 @@
|
||||
"other_income","Other Income","4500","income_other","l10n_generic_coa.configurable_chart_template","","False"
|
||||
"cost_of_goods_sold","Cost of Goods Sold","5000","expense_direct_cost","l10n_generic_coa.configurable_chart_template","account.account_tag_operating","False"
|
||||
"expense","Expenses","6000","expense","l10n_generic_coa.configurable_chart_template","account.account_tag_operating","False"
|
||||
"expense_invest","Purchase of Equipments","6110","expense","l10n_generic_coa.configurable_chart_template","account.account_tag_investing","False"
|
||||
"expense_invest","Purchase of Equipment","6110","expense","l10n_generic_coa.configurable_chart_template","account.account_tag_investing","False"
|
||||
"expense_rent","Rent","6120","expense","l10n_generic_coa.configurable_chart_template","account.account_tag_investing","False"
|
||||
"expense_finance","Bank Fees","6200","expense","l10n_generic_coa.configurable_chart_template","account.account_tag_financing","False"
|
||||
"expense_salary","Salary Expenses","6300","expense","l10n_generic_coa.configurable_chart_template","account.account_tag_operating","False"
|
||||
|
||||
|
@@ -65,7 +65,7 @@ il_account_201000,201000,Cost of Goods Sold,expense_direct_cost,FALSE,account.ac
|
||||
il_account_211000,211000,Cost of Services Sold,expense_direct_cost,FALSE,account.account_tag_operating,il_chart_template
|
||||
il_account_212000,212000,Customer discounts,expense,FALSE,account.account_tag_operating,il_chart_template
|
||||
il_account_212100,212100,Salary Expenses,expense,FALSE,account.account_tag_operating,il_chart_template
|
||||
il_account_212200,212200,Purchase of Equipments,expense,FALSE,account.account_tag_investing,il_chart_template
|
||||
il_account_212200,212200,Purchase of Equipment,expense,FALSE,account.account_tag_investing,il_chart_template
|
||||
il_account_212300,212300,Bank Fees,expense,FALSE,account.account_tag_financing,il_chart_template
|
||||
il_account_213000,213000,Customer returns,expense_direct_cost,FALSE,account.account_tag_operating,il_chart_template
|
||||
il_account_214000,214000,Vendor returns,expense_direct_cost,FALSE,account.account_tag_operating,il_chart_template
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
"p10071","Prepaid Insurance","10071","asset_current","l10n_in.indian_chart_template_standard","","False"
|
||||
"p1011","Buildings","1011","asset_fixed","l10n_in.indian_chart_template_standard","","False"
|
||||
"p1012","Land","1012","asset_fixed","l10n_in.indian_chart_template_standard","","False"
|
||||
"p1013","Equipments","1013","asset_fixed","l10n_in.indian_chart_template_standard","","False"
|
||||
"p1013","Equipment","1013","asset_fixed","l10n_in.indian_chart_template_standard","","False"
|
||||
"p1014","Vehicle","1014","asset_fixed","l10n_in.indian_chart_template_standard","","False"
|
||||
"p1015","Computer/Laptops (Assets)","1015","asset_fixed","l10n_in.indian_chart_template_standard","","False"
|
||||
"p1016","Furniture","1016","asset_fixed","l10n_in.indian_chart_template_standard","","False"
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
'sequence': 100,
|
||||
'category': 'Manufacturing/Maintenance',
|
||||
'description': """
|
||||
Track equipments and maintenance requests""",
|
||||
Track equipment and maintenance requests""",
|
||||
'depends': ['mail'],
|
||||
'summary': 'Track equipment and manage maintenance requests',
|
||||
'website': 'https://www.odoo.com/app/maintenance',
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<field name="technician_user_id" ref="base.user_admin"/>
|
||||
</record>
|
||||
|
||||
<!-- Equipments -->
|
||||
<!-- Equipment -->
|
||||
<record id="equipment_monitor1" model="maintenance.equipment">
|
||||
<field name="name">Samsung Monitor 15"</field>
|
||||
<field name="category_id" ref="equipment_monitor"/>
|
||||
|
||||
@@ -42,8 +42,8 @@ class MaintenanceEquipmentCategory(models.Model):
|
||||
technician_user_id = fields.Many2one('res.users', 'Responsible', tracking=True, default=lambda self: self.env.uid)
|
||||
color = fields.Integer('Color Index')
|
||||
note = fields.Html('Comments', translate=True)
|
||||
equipment_ids = fields.One2many('maintenance.equipment', 'category_id', string='Equipments', copy=False)
|
||||
equipment_count = fields.Integer(string="Equipment", compute='_compute_equipment_count')
|
||||
equipment_ids = fields.One2many('maintenance.equipment', 'category_id', string='Equipment', copy=False)
|
||||
equipment_count = fields.Integer(string="Equipment Count", compute='_compute_equipment_count')
|
||||
maintenance_ids = fields.One2many('maintenance.request', 'category_id', copy=False)
|
||||
maintenance_count = fields.Integer(string="Maintenance Count", compute='_compute_maintenance_count')
|
||||
alias_id = fields.Many2one(
|
||||
@@ -68,7 +68,7 @@ class MaintenanceEquipmentCategory(models.Model):
|
||||
def _unlink_except_contains_maintenance_requests(self):
|
||||
for category in self:
|
||||
if category.equipment_ids or category.maintenance_ids:
|
||||
raise UserError(_("You cannot delete an equipment category containing equipments or maintenance requests."))
|
||||
raise UserError(_("You cannot delete an equipment category containing equipment or maintenance requests."))
|
||||
|
||||
def _alias_get_creation_values(self):
|
||||
values = super(MaintenanceEquipmentCategory, self)._alias_get_creation_values()
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="category_id" ref="base.module_category_manufacturing_maintenance"/>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
|
||||
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
|
||||
<field name="comment">The user will be able to manage equipments.</field>
|
||||
<field name="comment">The user will be able to manage equipment.</field>
|
||||
</record>
|
||||
|
||||
<data noupdate="1">
|
||||
@@ -20,7 +20,7 @@
|
||||
</record>
|
||||
|
||||
<record id="equipment_rule_user" model="ir.rule">
|
||||
<field name="name">Users are allowed to access equipments they follow</field>
|
||||
<field name="name">Users are allowed to access equipment they follow</field>
|
||||
<field name="model_id" ref="model_maintenance_equipment"/>
|
||||
<field name="domain_force">[('message_partner_ids', 'in', [user.partner_id.id])]</field>
|
||||
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
|
||||
@@ -34,7 +34,7 @@
|
||||
</record>
|
||||
|
||||
<record id="equipment_rule_admin_user" model="ir.rule">
|
||||
<field name="name">Equipments administrator</field>
|
||||
<field name="name">Equipment administrator</field>
|
||||
<field name="model_id" ref="model_maintenance_equipment"/>
|
||||
<field name="domain_force">[(1, '=', 1)]</field>
|
||||
<field name="groups" eval="[(4, ref('group_equipment_manager'))]"/>
|
||||
|
||||
@@ -127,7 +127,7 @@ class TestEquipmentMulticompany(TransactionCase):
|
||||
'company_id': company_b.id,
|
||||
'owner_user_id': equipment_manager.id,
|
||||
})
|
||||
# Now there are total 2 equipments created and can view by equipment_manager user
|
||||
# Now there are total 2 equipment created and can view by equipment_manager user
|
||||
self.assertEqual(Equipment.with_user(equipment_manager).with_context(allowed_company_ids=cids).search_count([]), 2)
|
||||
|
||||
# And there is total 1 equipment can be view by Normal User ( Which user is followers)
|
||||
|
||||
@@ -336,7 +336,7 @@
|
||||
<field name="name">equipment.form</field>
|
||||
<field name="model">maintenance.equipment</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Equipments">
|
||||
<form string="Equipment">
|
||||
<sheet>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<div class="oe_button_box" name="button_box">
|
||||
@@ -514,7 +514,7 @@
|
||||
('name', 'ilike', self), ('model', 'ilike', self), ('serial_no', 'ilike', self), ('partner_ref', 'ilike', self)]"/>
|
||||
<field string="Category" name="category_id"/>
|
||||
<field name="owner_user_id"/>
|
||||
<filter string="My Equipments" name="my" domain="[('owner_user_id', '=', uid)]"/>
|
||||
<filter string="My Equipment" name="my" domain="[('owner_user_id', '=', uid)]"/>
|
||||
<filter string="Assigned" name="assigned" domain="[('owner_user_id', '!=', False)]"/>
|
||||
<filter string="Unassigned" name="available" domain="[('owner_user_id', '=', False)]"/>
|
||||
<separator/>
|
||||
@@ -542,7 +542,7 @@
|
||||
</record>
|
||||
|
||||
<record id="hr_equipment_action" model="ir.actions.act_window">
|
||||
<field name="name">Equipments</field>
|
||||
<field name="name">Equipment</field>
|
||||
<field name="res_model">maintenance.equipment</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="view_id" ref="hr_equipment_view_kanban"/>
|
||||
@@ -550,7 +550,7 @@
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Add a new equipment
|
||||
</p><p>
|
||||
Track equipments and link it to an employee or department.
|
||||
Track equipment and link it to an employee or department.
|
||||
You will be able to manage allocations, issues and maintenance of your equipment.
|
||||
</p>
|
||||
</field>
|
||||
@@ -558,7 +558,7 @@
|
||||
|
||||
<!-- equiment : actions -->
|
||||
<record id="hr_equipment_action_from_category_form" model="ir.actions.act_window">
|
||||
<field name="name">Equipments</field>
|
||||
<field name="name">Equipment</field>
|
||||
<field name="res_model">maintenance.equipment</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="search_view_id" ref="hr_equipment_view_search"/>
|
||||
@@ -571,7 +571,7 @@
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Add a new equipment
|
||||
</p><p>
|
||||
Track equipments and link it to an employee or department.
|
||||
Track equipment and link it to an employee or department.
|
||||
You will be able to manage allocations, issues and maintenance of your equipment.
|
||||
</p>
|
||||
</field>
|
||||
@@ -670,7 +670,7 @@
|
||||
<div class="row mt4">
|
||||
<div class="col-6">
|
||||
<span class="badge rounded-pill">
|
||||
<strong>Equipments:</strong> <field name="equipment_count"/>
|
||||
<strong>Equipment:</strong> <field name="equipment_count"/>
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
@@ -1006,7 +1006,7 @@
|
||||
|
||||
<menuitem
|
||||
id="menu_equipment_form"
|
||||
name="Equipments"
|
||||
name="Equipment"
|
||||
parent="menu_maintenance_title"
|
||||
action="hr_equipment_action"
|
||||
groups="group_equipment_manager,base.group_user"
|
||||
|
||||
Reference in New Issue
Block a user