Skip to content

Commit

Permalink
Merge pull request #821 from OCA/17.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/field-service (17.0)
  • Loading branch information
bt-admin authored Jan 22, 2025
2 parents f42f66e + 30c39ca commit 491494e
Show file tree
Hide file tree
Showing 38 changed files with 1,458 additions and 45 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ addon | version | maintainers | summary
[fieldservice_portal](fieldservice_portal/) | 17.0.1.0.0 | [![aleuffre](https://github.com/aleuffre.png?size=30px)](https://github.com/aleuffre) [![renda-dev](https://github.com/renda-dev.png?size=30px)](https://github.com/renda-dev) | Bridge module between fieldservice and portal.
[fieldservice_project](fieldservice_project/) | 17.0.1.0.0 | | Create field service orders from a project or project task
[fieldservice_recurring](fieldservice_recurring/) | 17.0.1.2.1 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) | Manage recurring Field Service orders
[fieldservice_repair](fieldservice_repair/) | 17.0.1.0.0 | [![smangukiya](https://github.com/smangukiya.png?size=30px)](https://github.com/smangukiya) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Integrate Field Service orders with MRP repair orders
[fieldservice_repair](fieldservice_repair/) | 17.0.1.0.1 | [![smangukiya](https://github.com/smangukiya.png?size=30px)](https://github.com/smangukiya) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Integrate Field Service orders with MRP repair orders
[fieldservice_route](fieldservice_route/) | 17.0.1.0.0 | [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Organize the routes of each day.
[fieldservice_sale](fieldservice_sale/) | 17.0.1.0.0 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) | Sell field services.
[fieldservice_sale_agreement](fieldservice_sale_agreement/) | 17.0.1.0.0 | [![ivantodorovich](https://github.com/ivantodorovich.png?size=30px)](https://github.com/ivantodorovich) | Integrate Field Service with Sale Agreements
[fieldservice_sale_agreement_equipment_stock](fieldservice_sale_agreement_equipment_stock/) | 17.0.1.0.0 | [![ivantodorovich](https://github.com/ivantodorovich.png?size=30px)](https://github.com/ivantodorovich) | Integrate Field Service with Sale Agreements and Stock Equipment
[fieldservice_sale_recurring](fieldservice_sale_recurring/) | 17.0.1.0.1 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) | Sell recurring field services.
[fieldservice_sale_stock](fieldservice_sale_stock/) | 17.0.1.0.0 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) | Sell stockable items linked to field service orders.
[fieldservice_size](fieldservice_size/) | 17.0.1.0.0 | [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) | Manage Sizes for Field Service Locations and Orders
Expand Down
28 changes: 14 additions & 14 deletions fieldservice_repair/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Field Service - Repair
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d04d61cfe65125729bbbcce08a9ccf7f762e1d007f336c0c1c62f84b506fa02d
!! source digest: sha256:aa8969176f5ff602d5e83397915d53b87f6889d8c66d3b76f9dab2c97dd97ab4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -54,19 +54,19 @@ Configuration

To configure this module, you need to:

- Go to Field Service > Master Data > Equipments
- Set the product and serial number on each of your equipments
- Go to Field Service > Master Data > Equipments
- Set the product and serial number on each of your equipments

Usage
=====

To use this module, you need to:

- Go to Field Service
- Create a FSM order
- Choose the type: Repair
- Select the equipment
- Upon saving, a repair order is created and linked to the FSM order
- Go to Field Service
- Create a FSM order
- Choose the type: Repair
- Select the equipment
- Upon saving, a repair order is created and linked to the FSM order

Known issues / Roadmap
======================
Expand Down Expand Up @@ -95,18 +95,18 @@ Authors
Contributors
------------

- Sandip Mangukiya <[email protected]>
- Serpent Consulting Services Pvt. Ltd. <[email protected]>
- Marcel Savegnago - Escodoo <[email protected]>
- Freni Patel <[email protected]>
- Italo LOPES <[email protected]>
- Sandip Mangukiya <[email protected]>
- Serpent Consulting Services Pvt. Ltd. <[email protected]>
- Marcel Savegnago - Escodoo <[email protected]>
- Freni Patel <[email protected]>
- Italo LOPES <[email protected]>

Other credits
-------------

The development of this module has been financially supported by:

- Open Source Integrators <https://opensourceintegrators.com>
- Open Source Integrators <https://opensourceintegrators.com>

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion fieldservice_repair/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Field Service - Repair",
"summary": "Integrate Field Service orders with MRP repair orders",
"version": "17.0.1.0.0",
"version": "17.0.1.0.1",
"category": "Field Service",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/field-service",
Expand Down
15 changes: 15 additions & 0 deletions fieldservice_repair/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ msgstr ""
"X-Generator: Weblate 4.14.1\n"

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid ""
Expand Down Expand Up @@ -51,3 +52,17 @@ msgstr "Reparatur"
#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order__repair_id
msgid "Repair Order"
msgstr "Reparaturauftrag"

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid "The repair order will be cancelled."
msgstr ""

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid "Warning"
msgstr ""
15 changes: 15 additions & 0 deletions fieldservice_repair/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ msgstr ""
"X-Generator: Weblate 4.17\n"

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid ""
Expand Down Expand Up @@ -50,3 +51,17 @@ msgstr "Reparar"
#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order__repair_id
msgid "Repair Order"
msgstr "Orden de Reparación"

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid "The repair order will be cancelled."
msgstr ""

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid "Warning"
msgstr ""
15 changes: 15 additions & 0 deletions fieldservice_repair/i18n/es_AR.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ msgstr ""
"X-Generator: Weblate 4.3.2\n"

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid ""
Expand Down Expand Up @@ -51,6 +52,20 @@ msgstr "Reparar"
msgid "Repair Order"
msgstr "Pedido de Reparación"

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid "The repair order will be cancelled."
msgstr ""

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid "Warning"
msgstr ""

#~ msgid "Display Name"
#~ msgstr "Mostrar Nombre"

Expand Down
14 changes: 14 additions & 0 deletions fieldservice_repair/i18n/fieldservice_repair.pot
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,17 @@ msgstr ""
#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order__repair_id
msgid "Repair Order"
msgstr ""

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid "The repair order will be cancelled."
msgstr ""

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid "Warning"
msgstr ""
15 changes: 15 additions & 0 deletions fieldservice_repair/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ msgstr ""
"X-Generator: Weblate 4.17\n"

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid ""
Expand Down Expand Up @@ -51,6 +52,20 @@ msgstr "Riparazione"
msgid "Repair Order"
msgstr "Ordine di riparazione"

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid "The repair order will be cancelled."
msgstr ""

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid "Warning"
msgstr ""

#~ msgid "Display Name"
#~ msgstr "Nome visualizzato"

Expand Down
15 changes: 15 additions & 0 deletions fieldservice_repair/i18n/pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ msgstr ""
"X-Generator: Weblate 4.3.2\n"

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid ""
Expand Down Expand Up @@ -51,6 +52,20 @@ msgstr "Reparo"
msgid "Repair Order"
msgstr "Ordem de Reparo"

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid "The repair order will be cancelled."
msgstr ""

#. module: fieldservice_repair
#. odoo-python
#: code:addons/fieldservice_repair/models/fsm_order.py:0
#, python-format
msgid "Warning"
msgstr ""

#~ msgid "FSM"
#~ msgstr "FSM"

Expand Down
85 changes: 58 additions & 27 deletions fieldservice_repair/models/fsm_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,68 @@ class FSMOrder(models.Model):

repair_id = fields.Many2one("repair.order", string="Repair Order")

def _create_linked_repair_order(self):
self.ensure_one()
if self.equipment_id and self.equipment_id.current_stock_location_id:
equipment = self.equipment_id
repair_id = self.env["repair.order"].create(
{
"name": self.name or "",
"product_id": equipment.product_id.id or False,
"product_uom": equipment.product_id.uom_id.id or False,
"location_id": equipment.current_stock_location_id
and equipment.current_stock_location_id.id
or False,
"lot_id": equipment.lot_id.id or "",
"product_qty": 1,
"internal_notes": self.description,
"partner_id": self.location_id.partner_id
and self.location_id.partner_id.id
or False,
}
)
self.repair_id = repair_id
elif not self.equipment_id.current_stock_location_id:
raise ValidationError(
_(
"Cannot create Repair Order because "
"Equipment does not have a Current "
"Inventory Location."
)
)

@api.model
def create(self, vals):
# if FSM order with type repair is created then
# create a repair order
order = super().create(vals)
if order.type.internal_type == "repair":
if order.equipment_id and order.equipment_id.current_stock_location_id:
equipment = order.equipment_id
repair_id = self.env["repair.order"].create(
{
"name": order.name or "",
"product_id": equipment.product_id.id or False,
"product_uom": equipment.product_id.uom_id.id or False,
"location_id": equipment.current_stock_location_id
and equipment.current_stock_location_id.id
or False,
"lot_id": equipment.lot_id.id or "",
"product_qty": 1,
"internal_notes": order.description,
"partner_id": order.location_id.partner_id
and order.location_id.partner_id.id
or False,
}
)
order.repair_id = repair_id
elif not order.equipment_id.current_stock_location_id:
raise ValidationError(
_(
"Cannot create Repair Order because "
"Equipment does not have a Current "
"Inventory Location."
)
)
order._create_linked_repair_order()
return order

def write(self, vals):
res = super().write(vals)
if vals.get("type"):
for order in self:
# If internal_type is changed to not repair
# then cancel the repair order
if order.repair_id and order.internal_type != "repair":
order.repair_id.action_repair_cancel()
order.repair_id = False
# If internal_type is changed to repair
# then create a repair order
if not order.repair_id and order.internal_type == "repair":
order._create_linked_repair_order()
return res

@api.onchange("internal_type")
def _onchange_internal_type(self):
# If we change the type of the order to not repair,
# we should inform the user that the repair order will be canceled.
if self.repair_id and self.internal_type != "repair":
return {
"warning": {
"title": _("Warning"),
"message": _("The repair order will be cancelled."),
}
}
2 changes: 1 addition & 1 deletion fieldservice_repair/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Field Service - Repair</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d04d61cfe65125729bbbcce08a9ccf7f762e1d007f336c0c1c62f84b506fa02d
!! source digest: sha256:aa8969176f5ff602d5e83397915d53b87f6889d8c66d3b76f9dab2c97dd97ab4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/field-service/tree/17.0/fieldservice_repair"><img alt="OCA/field-service" src="https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/field-service-17-0/field-service-17-0-fieldservice_repair"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/field-service&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Odoo Repair App does not support Field Service operations for products
Expand Down
Loading

0 comments on commit 491494e

Please sign in to comment.