Skip to content

Commit

Permalink
[MIG] hr_personal_equipment_request: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HeliconiaSolutions committed Dec 13, 2024
1 parent 97c71d9 commit e82cf4e
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 61 deletions.
16 changes: 8 additions & 8 deletions hr_personal_equipment_request/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Hr Personal Equipment Request
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr-lightgray.png?logo=github
:target: https://github.com/OCA/hr/tree/17.0/hr_personal_equipment_request
:target: https://github.com/OCA/hr/tree/18.0/hr_personal_equipment_request
:alt: OCA/hr
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/hr-17-0/hr-17-0-hr_personal_equipment_request
:target: https://translation.odoo-community.org/projects/hr-18-0/hr-18-0-hr_personal_equipment_request
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -72,7 +72,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/hr/issues/new?body=module:%20hr_personal_equipment_request%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/hr/issues/new?body=module:%20hr_personal_equipment_request%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand All @@ -87,10 +87,10 @@ Authors
Contributors
------------

- Alba Riera <alba.riera@creublanca.es>
- `APSL <https://apsl.tech>`__:
- Alba Riera <alba.riera@creublanca.es>
- `APSL <https://apsl.tech>`__:

- Antoni Marroig <amarroig@apsl.net>
- Antoni Marroig <amarroig@apsl.net>

Maintainers
-----------
Expand All @@ -105,6 +105,6 @@ 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.

This module is part of the `OCA/hr <https://github.com/OCA/hr/tree/17.0/hr_personal_equipment_request>`_ project on GitHub.
This module is part of the `OCA/hr <https://github.com/OCA/hr/tree/18.0/hr_personal_equipment_request>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion hr_personal_equipment_request/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Hr Personal Equipment Request",
"summary": """
This addon allows to manage employee personal equipment""",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"author": "Creu Blanca, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/hr",
Expand Down
4 changes: 2 additions & 2 deletions hr_personal_equipment_request/models/hr_employee.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def action_open_equipment_request(self):
"name": _("Equipment Request"),
"type": "ir.actions.act_window",
"res_model": "hr.personal.equipment.request",
"view_mode": "tree,form",
"view_mode": "list,form",
"context": {"group_by": "state"},
"domain": [("id", "in", self.equipment_request_ids.ids)],
}
Expand All @@ -50,6 +50,6 @@ def action_open_personal_equipment(self):
"type": "ir.actions.act_window",
"res_model": "hr.personal.equipment",
"context": {"group_by": "state"},
"view_mode": "tree,form",
"view_mode": "list,form",
"domain": [("id", "in", self.personal_equipment_ids.ids)],
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ def action_open_personal_equipment(self):
"name": _("Allocations"),
"type": "ir.actions.act_window",
"res_model": "hr.personal.equipment",
"view_mode": "tree,form",
"view_mode": "list,form",
"domain": [("id", "in", self.line_ids.ids)],
}
3 changes: 2 additions & 1 deletion hr_personal_equipment_request/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Alba Riera \<<alba.riera@creublanca.es>\>
- [APSL](https://apsl.tech):
- Antoni Marroig \<<amarroig@apsl.net>\>
- Antoni Marroig \<<amarroig@apsl.net>\>
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`_
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,42 @@ class TestHRPersonalEquipmentRequest(TransactionCase):
def setUpClass(cls):
super().setUpClass()
cls.product_personal_equipment_1 = cls.env["product.template"].create(
{
"name": "Product Test Personal Equipment 1",
"is_personal_equipment": True,
"uom_id": cls.env.ref("uom.product_uom_unit").id,
}
[
{
"name": "Product Test Personal Equipment 1",
"is_personal_equipment": True,
"uom_id": cls.env.ref("uom.product_uom_unit").id,
}
]
)
cls.product_personal_equipment_2 = cls.env["product.template"].create(
{
"name": "Product Test Personal Equipment 2",
"is_personal_equipment": True,
"uom_id": cls.env.ref("uom.product_uom_unit").id,
}
[
{
"name": "Product Test Personal Equipment 2",
"is_personal_equipment": True,
"uom_id": cls.env.ref("uom.product_uom_unit").id,
}
]
)
cls.user = (
cls.env["res.users"]
.sudo()
.create(
{
"name": "Test User",
"login": "user@test.com",
"email": "user@test.com",
"groups_id": [
(4, cls.env.ref("base.group_user").id),
(4, cls.env.ref("hr.group_hr_user").id),
],
}
[
{
"name": "Test User",
"login": "user@test.com",
"email": "user@test.com",
"groups_id": [
(4, cls.env.ref("base.group_user").id),
(4, cls.env.ref("hr.group_hr_user").id),
],
}
]
)
)
cls.employee = cls.env["hr.employee"].create(
{"name": "Employee Test", "user_id": cls.user.id}
[{"name": "Employee Test", "user_id": cls.user.id}]
)

lines = [
Expand All @@ -59,11 +65,13 @@ def setUpClass(cls):
cls.env["hr.personal.equipment.request"]
.with_user(cls.user.id)
.create(
{
"name": "Personal Equipment Request Test",
"employee_id": cls.employee.id,
"line_ids": [(0, 0, line) for line in lines],
}
[
{
"name": "Personal Equipment Request Test",
"employee_id": cls.employee.id,
"line_ids": [(0, 0, line) for line in lines],
}
]
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
<page string="Personal Equipment">
<field
name="line_ids"
mode="tree,form"
mode="list,form"
readonly="state != 'draft'"
>
<tree editable="bottom" name="equipment_lines">
<list editable="bottom" name="equipment_lines">
<field name="product_id" />
<field name="quantity" />
<field name="product_uom_id" />
Expand All @@ -70,7 +70,7 @@
<field name="state" readonly="1" />
<field name="equipment_request_id" invisible="1" />
<field name="employee_id" invisible="1" />
</tree>
</list>
<form>
<header>
<button
Expand Down Expand Up @@ -110,11 +110,7 @@
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="activity_ids" widget="mail_activity" />
<field name="message_ids" widget="mail_thread" />
</div>
<chatter />
</form>
</field>
</record>
Expand All @@ -139,27 +135,27 @@
</search>
</field>
</record>
<record model="ir.ui.view" id="hr_personal_equipment_request_tree_view">
<record model="ir.ui.view" id="hr_personal_equipment_request_list_view">
<field
name="name"
>hr.personal.equipment.request.tree (in hr_personal_equipment_request)</field>
>hr.personal.equipment.request.list (in hr_personal_equipment_request)</field>
<field name="model">hr.personal.equipment.request</field>
<field name="arch" type="xml">
<tree
<list
decoration-success="state=='accepted'"
decoration-muted="state=='cancelled'"
>
<field name="name" />
<field name="employee_id" groups="hr.group_hr_user" />
<field name="create_date" />
<field name="state" />
</tree>
</list>
</field>
</record>
<record model="ir.actions.act_window" id="hr_personal_equipment_request_act_window">
<field name="name">Personal Equipment Request</field>
<field name="res_model">hr.personal.equipment.request</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field name="domain">[]</field>
<field
name="context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,17 @@
/>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="activity_ids" widget="mail_activity" />
<field name="message_ids" widget="mail_thread" />
</div>
<chatter />
</form>
</field>
</record>
<record model="ir.ui.view" id="hr_personal_equipment_tree_view">
<record model="ir.ui.view" id="hr_personal_equipment_list_view">
<field
name="name"
>hr.personal.equipment.tree (in hr_personal_equipment_request)</field>
>hr.personal.equipment.list (in hr_personal_equipment_request)</field>
<field name="model">hr.personal.equipment</field>
<field name="arch" type="xml">
<tree
<list
create="0"
decoration-info="state=='accepted'"
decoration-success="state=='valid'"
Expand All @@ -92,7 +88,7 @@
<field name="start_date" />
<field name="state" />
<field name="equipment_request_id" invisible="1" />
</tree>
</list>
</field>
</record>
<record model="ir.ui.view" id="hr_personal_equipment_search_view">
Expand Down Expand Up @@ -149,7 +145,7 @@
<record model="ir.actions.act_window" id="hr_personal_equipment_act_window">
<field name="name">Allocations</field>
<field name="res_model">hr.personal.equipment</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field name="domain">[]</field>
<field name="context">{'search_default_filter_valid_state':1}</field>
</record>
Expand Down

0 comments on commit e82cf4e

Please sign in to comment.