Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] maintenance_request_repair: Migration to 17.0 #411

Open
wants to merge 31 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
612bce6
[12.0][ADD] Add Maintenance Request Repair
marcelsavegnago Jul 11, 2020
64bb6e0
Update maintenance_request.py
marcelsavegnago Jul 13, 2020
c7318bc
[ADD] link button to maintenances
marcelsavegnago Aug 21, 2020
f83248a
[ADD] link button to maintenances
marcelsavegnago Aug 21, 2020
5b767e9
[UPD] Update maintenance_request_repair.pot
oca-travis Sep 16, 2020
ee42791
[UPD] README.rst
OCA-git-bot Sep 16, 2020
c93647a
Update translation files
oca-transbot Nov 17, 2020
b1e0ff7
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Mar 15, 2021
1bce530
Added translation using Weblate (Italian)
mymage Jul 23, 2021
660f940
Translated using Weblate (Italian)
mymage Jul 23, 2021
27c8bcb
[IMP] maintenance_request_repair: black, isort, prettier
kaynnan Mar 15, 2023
034a540
[MIG] maintenance_request_repair: Migration to 14.0
kaynnan Mar 15, 2023
c61d812
[IMP] maintenance_request_repair: add tests
kaynnan Mar 15, 2023
c7c866e
[IMP] maintenance_request_repair: add contributing name
kaynnan Mar 15, 2023
2b61434
[UPD] Update maintenance_request_repair.pot
Mar 15, 2023
8963cbd
[UPD] README.rst
OCA-git-bot Mar 15, 2023
5be3a60
[IMP] maintenance_request_repair: black, isort, prettier
kaynnan Mar 15, 2023
46987ef
[MIG] maintenance_request_repair: Migration to 15.0
kaynnan Mar 16, 2023
b2befa1
[IMP] maintenance_request_repair: add contributing name
kaynnan Mar 16, 2023
e2e6d11
[UPD] Update maintenance_request_repair.pot
Mar 21, 2023
8abceaa
[UPD] README.rst
OCA-git-bot Mar 21, 2023
91a041c
Update translation files
weblate Mar 21, 2023
83a42ca
[MIG] maintenance_request_repair: Migration to 16.0
kaynnan Mar 21, 2023
93791d6
[UPD] Update maintenance_request_repair.pot
Jul 6, 2023
7dc9bdd
[UPD] README.rst
OCA-git-bot Jul 6, 2023
0d45f6b
Added translation using Weblate (Spanish)
Ivorra78 Jul 22, 2023
f1ae95d
Translated using Weblate (Spanish)
Ivorra78 Jul 22, 2023
9afb427
[UPD] README.rst
OCA-git-bot Sep 3, 2023
df5e5c7
Translated using Weblate (Italian)
mymage Dec 20, 2023
cde6696
[IMP] maintenance_request_repair: pre-commit auto fixes
peluko00 Jun 28, 2024
7c9e5c4
[MIG] maintenance_request_repair: Migration to 17.0
peluko00 Jun 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions maintenance_request_repair/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
==========================
Maintenance Request Repair
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4b95990a479f9ac54500dccd7fb60653d39802d8cbb4e7c800115b5b040cb878
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmaintenance-lightgray.png?logo=github
:target: https://github.com/OCA/maintenance/tree/17.0/maintenance_request_repair
:alt: OCA/maintenance
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/maintenance-17-0/maintenance-17-0-maintenance_request_repair
: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/maintenance&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This is a bridge module between Maintenance and Repair

This module contains some new features for Maintenance modules.

Maintenance Request

- Repair Order: add a field to link a specific repair order.

**Table of contents**

.. contents::
:local:

Usage
=====

Maintenance Request Repair

- Go to Repair → create a new one
- Go to Maintenance → Maintenance Requests
- Edit a Maintenance Request
- Select a Repair Order on the list

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/maintenance/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/maintenance/issues/new?body=module:%20maintenance_request_repair%0Aversion:%2017.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.

Credits
=======

Authors
-------

* Escodoo

Contributors
------------

- `Escodoo <https://www.escodoo.com.br>`__:

- Marcel Savegnago <[email protected]>
- Kaynnan Lemes <[email protected]>

- `APSL-Nagarro <https://apsl.tech>`__:

- Antoni Marroig <[email protected]>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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/maintenance <https://github.com/OCA/maintenance/tree/17.0/maintenance_request_repair>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions maintenance_request_repair/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions maintenance_request_repair/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2020 - TODAY, Escodoo
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Maintenance Request Repair",
"summary": """
This is a bridge module between Maintenance and Repair""",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"category": "Maintenance",
"author": "Escodoo,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/maintenance",
"depends": [
"maintenance",
"repair",
],
"data": [
"views/maintenance_request.xml",
"views/repair_order.xml",
],
}
43 changes: 43 additions & 0 deletions maintenance_request_repair/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * maintenance_request_repair
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-07-22 23:09+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: maintenance_request_repair
#: model:ir.model.fields,field_description:maintenance_request_repair.field_repair_order__maintenance_request_count
msgid "# Maintenances"
msgstr "# Mantenimientos"

#. module: maintenance_request_repair
#: model:ir.model,name:maintenance_request_repair.model_maintenance_request
msgid "Maintenance Request"
msgstr "Solicitud de mantenimiento"

#. module: maintenance_request_repair
#: model:ir.model.fields,field_description:maintenance_request_repair.field_repair_order__maintenance_request_ids
msgid "Maintenance Requests"
msgstr "Peticiones de mantenimiento"

#. module: maintenance_request_repair
#: model_terms:ir.ui.view,arch_db:maintenance_request_repair.repair_order_form_view
msgid "Maintenances"
msgstr "Mantenimientos"

#. module: maintenance_request_repair
#: model:ir.model,name:maintenance_request_repair.model_repair_order
#: model:ir.model.fields,field_description:maintenance_request_repair.field_maintenance_request__repair_order_id
msgid "Repair Order"
msgstr "Orden de reparación"
43 changes: 43 additions & 0 deletions maintenance_request_repair/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * maintenance_request_repair
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-12-20 15:37+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: maintenance_request_repair
#: model:ir.model.fields,field_description:maintenance_request_repair.field_repair_order__maintenance_request_count
msgid "# Maintenances"
msgstr "N° manutenzioni"

#. module: maintenance_request_repair
#: model:ir.model,name:maintenance_request_repair.model_maintenance_request
msgid "Maintenance Request"
msgstr "Richiesta manutenzione"

#. module: maintenance_request_repair
#: model:ir.model.fields,field_description:maintenance_request_repair.field_repair_order__maintenance_request_ids
msgid "Maintenance Requests"
msgstr "Richieste manutenzione"

#. module: maintenance_request_repair
#: model_terms:ir.ui.view,arch_db:maintenance_request_repair.repair_order_form_view
msgid "Maintenances"
msgstr "Manutenzioni"

#. module: maintenance_request_repair
#: model:ir.model,name:maintenance_request_repair.model_repair_order
#: model:ir.model.fields,field_description:maintenance_request_repair.field_maintenance_request__repair_order_id
msgid "Repair Order"
msgstr "Ordine di riparazione"
40 changes: 40 additions & 0 deletions maintenance_request_repair/i18n/maintenance_request_repair.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * maintenance_request_repair
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: maintenance_request_repair
#: model:ir.model.fields,field_description:maintenance_request_repair.field_repair_order__maintenance_request_count
msgid "# Maintenances"
msgstr ""

#. module: maintenance_request_repair
#: model:ir.model,name:maintenance_request_repair.model_maintenance_request
msgid "Maintenance Request"
msgstr ""

#. module: maintenance_request_repair
#: model:ir.model.fields,field_description:maintenance_request_repair.field_repair_order__maintenance_request_ids
msgid "Maintenance Requests"
msgstr ""

#. module: maintenance_request_repair
#: model_terms:ir.ui.view,arch_db:maintenance_request_repair.repair_order_form_view
msgid "Maintenances"
msgstr ""

#. module: maintenance_request_repair
#: model:ir.model,name:maintenance_request_repair.model_repair_order
#: model:ir.model.fields,field_description:maintenance_request_repair.field_maintenance_request__repair_order_id
msgid "Repair Order"
msgstr ""
44 changes: 44 additions & 0 deletions maintenance_request_repair/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * maintenance_request_repair
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-07 22:44+0000\n"
"PO-Revision-Date: 2021-03-15 06:45+0000\n"
"Last-Translator: Marcel Savegnago <[email protected]>\n"
"Language-Team: \n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.3.2\n"

#. module: maintenance_request_repair
#: model:ir.model.fields,field_description:maintenance_request_repair.field_repair_order__maintenance_request_count
msgid "# Maintenances"
msgstr "# Manutenções"

#. module: maintenance_request_repair
#: model:ir.model,name:maintenance_request_repair.model_maintenance_request
msgid "Maintenance Request"
msgstr "Solicitação de Manutenção"

#. module: maintenance_request_repair
#: model:ir.model.fields,field_description:maintenance_request_repair.field_repair_order__maintenance_request_ids
msgid "Maintenance Requests"
msgstr "Solicitações de Manutenção"

#. module: maintenance_request_repair
#: model_terms:ir.ui.view,arch_db:maintenance_request_repair.repair_order_form_view
msgid "Maintenances"
msgstr "Manutenções"

#. module: maintenance_request_repair
#: model:ir.model,name:maintenance_request_repair.model_repair_order
#: model:ir.model.fields,field_description:maintenance_request_repair.field_maintenance_request__repair_order_id
msgid "Repair Order"
msgstr "Ordem de Reparo"
2 changes: 2 additions & 0 deletions maintenance_request_repair/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import maintenance_request
from . import repair_order
10 changes: 10 additions & 0 deletions maintenance_request_repair/models/maintenance_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2020 - TODAY, Marcel Savegnago - Escodoo
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class MaintenanceRequest(models.Model):
_inherit = "maintenance.request"

repair_order_id = fields.Many2one("repair.order", "Repair Order")
46 changes: 46 additions & 0 deletions maintenance_request_repair/models/repair_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2020 - TODAY, Marcel Savegnago - Escodoo
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class RepairOrder(models.Model):
_inherit = "repair.order"

maintenance_request_ids = fields.One2many(
"maintenance.request", "repair_order_id", string="Maintenance Requests"
)

maintenance_request_count = fields.Integer(
compute="_compute_maintenance_request_count", string="# Maintenances"
)

@api.depends("maintenance_request_ids")
def _compute_maintenance_request_count(self):
for repair in self:
repair.maintenance_request_count = len(repair.maintenance_request_ids)

def action_view_maintenance_request(self):
"""This function returns an action that display existing maintenance requests
of given repair order ids. When only one found, show the maintenance request
immediately.
"""
action = self.env.ref("maintenance.hr_equipment_request_action")
result = action.read()[0]
# override the context to get rid of the default filtering on repair order
result["context"] = {"default_repair_order_id": self.id}
maintenance_request_ids = self.mapped("maintenance_request_ids")
# choose the view_mode accordingly
if not maintenance_request_ids or len(maintenance_request_ids) > 1:
result["domain"] = "[('id','in',%s)]" % (maintenance_request_ids.ids)
elif len(maintenance_request_ids) == 1:
res = self.env.ref("maintenance.hr_equipment_request_view_form", False)
form_view = [(res and res.id or False, "form")]
if "views" in result:
result["views"] = form_view + [
(state, view) for state, view in result["views"] if view != "form"
]
else:
result["views"] = form_view

Check warning on line 44 in maintenance_request_repair/models/repair_order.py

View check run for this annotation

Codecov / codecov/patch

maintenance_request_repair/models/repair_order.py#L44

Added line #L44 was not covered by tests
result["res_id"] = maintenance_request_ids.id
return result
3 changes: 3 additions & 0 deletions maintenance_request_repair/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
5 changes: 5 additions & 0 deletions maintenance_request_repair/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- [Escodoo](https://www.escodoo.com.br):
- Marcel Savegnago \<<[email protected]>\>
- Kaynnan Lemes \<<[email protected]>\>
- [APSL-Nagarro](<https://apsl.tech>):
- Antoni Marroig \<<[email protected]>\>
7 changes: 7 additions & 0 deletions maintenance_request_repair/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This is a bridge module between Maintenance and Repair

This module contains some new features for Maintenance modules.

Maintenance Request

- Repair Order: add a field to link a specific repair order.
6 changes: 6 additions & 0 deletions maintenance_request_repair/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Maintenance Request Repair

- Go to Repair → create a new one
- Go to Maintenance → Maintenance Requests
- Edit a Maintenance Request
- Select a Repair Order on the list
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading