forked from avanzosc/mrp-repair-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][ADD] repair_order_internal: In repairs new menu option "Intern…
…al Repair Orders".
- Loading branch information
1 parent
c518729
commit e7f1fb9
Showing
15 changed files
with
419 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
===================== | ||
Repair order internal | ||
===================== | ||
|
||
* In repairs new menu option "Internal Repair Orders", with its new sequence | ||
Internal Repair Order". | ||
* For normal repair orders, customers will only be able to pick up contacts that | ||
are not from the company. | ||
* For internal repair orders, clients will only be able to take contacts that | ||
are from the company. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/avanzosc/mrp-repair-addons/issues>`_. In case of trouble, | ||
please check there if your issue has already been reported. If you spotted | ||
it first, help us smash it by providing detailed and welcomed feedback. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Ana Juaristi <anajuaristi@avanzosc.es> | ||
* Alfredo de la Fuente <alfredodelafuente@avanzosc.es> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2024 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
{ | ||
"name": "Repair Order Internal", | ||
"version": "16.0.1.0.0", | ||
"category": "Inventory/Inventory", | ||
"license": "AGPL-3", | ||
"author": "AvanzOSC", | ||
"website": "https://github.com/avanzosc/mrp-repair-addons", | ||
"depends": [ | ||
"repair", | ||
], | ||
"data": [ | ||
"data/repair_order_internal_sequence.xml", | ||
"views/repair_order_views.xml", | ||
], | ||
"installable": True, | ||
} |
8 changes: 8 additions & 0 deletions
8
repair_order_internal/data/repair_order_internal_sequence.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<odoo noupdate="1"> | ||
<record id="sequence_internal_repair_order" model="ir.sequence"> | ||
<field name="name">Internal Repair Order</field> | ||
<field name="code">repair.order.internal</field> | ||
<field eval="4" name="padding" /> | ||
<field name="prefix">RI/</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
# * repair_order_internal | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-09-30 10:52+0000\n" | ||
"PO-Revision-Date: 2024-09-30 10:52+0000\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: repair_order_internal | ||
#: model:ir.actions.act_window,name:repair_order_internal.action_internal_repair_order_graph | ||
#: model:ir.actions.act_window,name:repair_order_internal.action_internal_repair_order_tree | ||
msgid "Intenal Repair Orders" | ||
msgstr "" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_order__internal_repair | ||
msgid "Internal Repair" | ||
msgstr "" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.ui.menu,name:repair_order_internal.menu_internal_repair_order_graph | ||
#: model:ir.ui.menu,name:repair_order_internal.menu_internal_repair_order_tree | ||
msgid "Internal Repair Orders" | ||
msgstr "" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model,name:repair_order_internal.model_repair_order | ||
msgid "Repair Order" | ||
msgstr "Ordre de reparació" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model,name:repair_order_internal.model_ir_sequence | ||
msgid "Sequence" | ||
msgstr "Seqüència" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
# * repair_order_internal | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-09-30 10:52+0000\n" | ||
"PO-Revision-Date: 2024-09-30 10:52+0000\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: repair_order_internal | ||
#: model:ir.actions.act_window,name:repair_order_internal.action_internal_repair_order_graph | ||
#: model:ir.actions.act_window,name:repair_order_internal.action_internal_repair_order_tree | ||
msgid "Intenal Repair Orders" | ||
msgstr "" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_order__internal_repair | ||
msgid "Internal Repair" | ||
msgstr "" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.ui.menu,name:repair_order_internal.menu_internal_repair_order_graph | ||
#: model:ir.ui.menu,name:repair_order_internal.menu_internal_repair_order_tree | ||
msgid "Internal Repair Orders" | ||
msgstr "" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model,name:repair_order_internal.model_repair_order | ||
msgid "Repair Order" | ||
msgstr "" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model,name:repair_order_internal.model_ir_sequence | ||
msgid "Sequence" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
# * repair_order_internal | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-09-30 10:53+0000\n" | ||
"PO-Revision-Date: 2024-09-30 10:53+0000\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: repair_order_internal | ||
#: model:ir.actions.act_window,name:repair_order_internal.action_internal_repair_order_graph | ||
#: model:ir.actions.act_window,name:repair_order_internal.action_internal_repair_order_tree | ||
msgid "Intenal Repair Orders" | ||
msgstr "Reparaciones internas" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_order__internal_repair | ||
msgid "Internal Repair" | ||
msgstr "Reparación interna" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.ui.menu,name:repair_order_internal.menu_internal_repair_order_graph | ||
#: model:ir.ui.menu,name:repair_order_internal.menu_internal_repair_order_tree | ||
msgid "Internal Repair Orders" | ||
msgstr "Reparaciones internas" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model,name:repair_order_internal.model_repair_order | ||
msgid "Repair Order" | ||
msgstr "Orden reparación" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model,name:repair_order_internal.model_ir_sequence | ||
msgid "Sequence" | ||
msgstr "Secuencia" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
# * repair_order_internal | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-09-30 10:52+0000\n" | ||
"PO-Revision-Date: 2024-09-30 10:52+0000\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: repair_order_internal | ||
#: model:ir.actions.act_window,name:repair_order_internal.action_internal_repair_order_graph | ||
#: model:ir.actions.act_window,name:repair_order_internal.action_internal_repair_order_tree | ||
msgid "Intenal Repair Orders" | ||
msgstr "" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_order__internal_repair | ||
msgid "Internal Repair" | ||
msgstr "" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.ui.menu,name:repair_order_internal.menu_internal_repair_order_graph | ||
#: model:ir.ui.menu,name:repair_order_internal.menu_internal_repair_order_tree | ||
msgid "Internal Repair Orders" | ||
msgstr "" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model,name:repair_order_internal.model_repair_order | ||
msgid "Repair Order" | ||
msgstr "Ordre de réparation" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model,name:repair_order_internal.model_ir_sequence | ||
msgid "Sequence" | ||
msgstr "Séquence" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
# * repair_order_internal | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-09-30 10:51+0000\n" | ||
"PO-Revision-Date: 2024-09-30 10:51+0000\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: repair_order_internal | ||
#: model:ir.actions.act_window,name:repair_order_internal.action_internal_repair_order_graph | ||
#: model:ir.actions.act_window,name:repair_order_internal.action_internal_repair_order_tree | ||
msgid "Intenal Repair Orders" | ||
msgstr "" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_order__internal_repair | ||
msgid "Internal Repair" | ||
msgstr "" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.ui.menu,name:repair_order_internal.menu_internal_repair_order_graph | ||
#: model:ir.ui.menu,name:repair_order_internal.menu_internal_repair_order_tree | ||
msgid "Internal Repair Orders" | ||
msgstr "" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model,name:repair_order_internal.model_repair_order | ||
msgid "Repair Order" | ||
msgstr "" | ||
|
||
#. module: repair_order_internal | ||
#: model:ir.model,name:repair_order_internal.model_ir_sequence | ||
msgid "Sequence" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import repair_order | ||
from . import ir_sequence |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2024 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from odoo import api, models | ||
|
||
|
||
class IrSequence(models.Model): | ||
_inherit = "ir.sequence" | ||
|
||
@api.model | ||
def next_by_code(self, sequence_code, sequence_date=None): | ||
if ( | ||
sequence_code == "repair.order" | ||
and "with_internal_repair_order_sequence" in self.env.context | ||
): | ||
return super().next_by_code( | ||
"repair.order.internal", sequence_date=sequence_date | ||
) | ||
return super().next_by_code(sequence_code, sequence_date=sequence_date) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright 2024 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from odoo import api, fields, models | ||
|
||
|
||
class RepairOrder(models.Model): | ||
_inherit = "repair.order" | ||
|
||
internal_repair = fields.Boolean() | ||
|
||
@api.onchange("internal_repair") | ||
def onchange_internal_claim(self): | ||
domain = {} | ||
if self.internal_repair: | ||
domain = { | ||
"domain": { | ||
"partner_id": [ | ||
"|", | ||
("id", "=", self.env.company.id), | ||
("parent_id", "=", self.env.company.id), | ||
] | ||
} | ||
} | ||
else: | ||
domain = { | ||
"domain": { | ||
"partner_id": [ | ||
("id", "!=", self.env.company.id), | ||
("parent_id", "!=", self.env.company.id), | ||
] | ||
} | ||
} | ||
return domain | ||
|
||
@api.model_create_multi | ||
def create(self, vals_list): | ||
found = False | ||
for vals in vals_list: | ||
if "internal_repair" in vals and vals.get("internal_repair", False): | ||
found = True | ||
if not found: | ||
return super().create(vals_list) | ||
else: | ||
return super( | ||
RepairOrder, self.with_context(with_internal_repair_order_sequence=True) | ||
).create(vals_list) |
Oops, something went wrong.