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

[16.0][MIG] maintenance_request_repair: Migration to 16.0 #323

Merged
merged 24 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3aa75f9
[12.0][ADD] Add Maintenance Request Repair
marcelsavegnago Jul 11, 2020
e9e582b
Update maintenance_request.py
marcelsavegnago Jul 13, 2020
79477c2
[ADD] link button to maintenances
marcelsavegnago Aug 21, 2020
49cd8b2
[ADD] link button to maintenances
marcelsavegnago Aug 21, 2020
8a47d03
[UPD] Update maintenance_request_repair.pot
oca-travis Sep 16, 2020
3095fbc
[UPD] README.rst
OCA-git-bot Sep 16, 2020
26a07da
Update translation files
oca-transbot Nov 17, 2020
dd739a2
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Mar 15, 2021
86d91c1
Added translation using Weblate (Italian)
mymage Jul 23, 2021
1937954
Translated using Weblate (Italian)
mymage Jul 23, 2021
f512634
[IMP] maintenance_request_repair: black, isort, prettier
kaynnan Mar 15, 2023
d8c2596
[MIG] maintenance_request_repair: Migration to 14.0
kaynnan Mar 15, 2023
078dd2c
[IMP] maintenance_request_repair: add tests
kaynnan Mar 15, 2023
c8faaeb
[IMP] maintenance_request_repair: add contributing name
kaynnan Mar 15, 2023
73ae4cc
[UPD] Update maintenance_request_repair.pot
Mar 15, 2023
5d98188
[UPD] README.rst
OCA-git-bot Mar 15, 2023
3dbfac9
[IMP] maintenance_request_repair: black, isort, prettier
kaynnan Mar 15, 2023
29bed5b
[MIG] maintenance_request_repair: Migration to 15.0
kaynnan Mar 16, 2023
70fe947
[IMP] maintenance_request_repair: add contributing name
kaynnan Mar 16, 2023
ec70cef
[UPD] Update maintenance_request_repair.pot
Mar 21, 2023
56197a7
[UPD] README.rst
OCA-git-bot Mar 21, 2023
e32eac5
Update translation files
weblate Mar 21, 2023
4c21d76
[IMP] maintenance_request_repair: black, isort, prettier
kaynnan Mar 21, 2023
c6fb5ab
[MIG] maintenance_request_repair: Migration to 16.0
kaynnan Mar 21, 2023
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
91 changes: 91 additions & 0 deletions maintenance_request_repair/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
==========================
Maintenance Request Repair
==========================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/15.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-15-0/maintenance-15-0-maintenance_request_repair
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/240/15.0
:alt: Try me on Runbot

|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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/maintenance/issues/new?body=module:%20maintenance_request_repair%0Aversion:%2015.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]>

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/15.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": "16.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/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: 2021-07-23 15:49+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.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 "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 "Oridine 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 15.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
11 changes: 11 additions & 0 deletions maintenance_request_repair/models/maintenance_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 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")
47 changes: 47 additions & 0 deletions maintenance_request_repair/models/repair_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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
result["res_id"] = maintenance_request_ids.id
return result
4 changes: 4 additions & 0 deletions maintenance_request_repair/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Escodoo <https://www.escodoo.com.br>`_:

* Marcel Savegnago <[email protected]>
* Kaynnan Lemes <[email protected]>
7 changes: 7 additions & 0 deletions maintenance_request_repair/readme/DESCRIPTION.rst
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.rst
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