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][IMP] repair_order_internal: Set dependency on "repair_type", a… #125

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions repair_order_internal/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
Repair order internal
=====================

* In repairs new menu option "Internal Repair Orders", with its new sequence
Internal Repair Order".
* In repair types new field "Internal Repair".
* In repairs new menu option "Internal Repair Orders".
* 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
Expand Down
7 changes: 3 additions & 4 deletions repair_order_internal/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Repair Order Internal",
"version": "16.0.1.0.0",
"version": "16.0.1.1.0",
"category": "Inventory/Inventory",
"license": "AGPL-3",
"author": "AvanzOSC",
"website": "https://github.com/avanzosc/mrp-repair-addons",
"depends": [
"repair",
],
"depends": ["repair", "repair_type"],
"data": [
"data/repair_order_internal_sequence.xml",
"views/repair_order_views.xml",
"views/repair_type_views.xml",
],
"installable": True,
}
8 changes: 8 additions & 0 deletions repair_order_internal/i18n/ca_ES.po
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ msgstr ""

#. module: repair_order_internal
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_order__internal_repair
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_type__internal_repair
msgid "Internal Repair"
msgstr ""

Expand All @@ -41,3 +42,10 @@ msgstr "Ordre de reparació"
#: model:ir.model,name:repair_order_internal.model_ir_sequence
msgid "Sequence"
msgstr "Seqüència"

#. module: repair_order_internal
#: model:ir.actions.act_window,name:repair_order_internal.action_not_internal_repair_order_tree
#: model:ir.ui.menu,name:repair_order_internal.menu_no_internal_repair_order_tree
msgid "Repair Orders"
msgstr ""

8 changes: 8 additions & 0 deletions repair_order_internal/i18n/en_GB.po
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ msgstr ""

#. module: repair_order_internal
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_order__internal_repair
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_type__internal_repair
msgid "Internal Repair"
msgstr ""

Expand All @@ -41,3 +42,10 @@ msgstr ""
#: model:ir.model,name:repair_order_internal.model_ir_sequence
msgid "Sequence"
msgstr ""

#. module: repair_order_internal
#: model:ir.actions.act_window,name:repair_order_internal.action_not_internal_repair_order_tree
#: model:ir.ui.menu,name:repair_order_internal.menu_no_internal_repair_order_tree
msgid "Repair Orders"
msgstr ""

8 changes: 8 additions & 0 deletions repair_order_internal/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ msgstr "Reparaciones internas"

#. module: repair_order_internal
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_order__internal_repair
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_type__internal_repair
msgid "Internal Repair"
msgstr "Reparación interna"

Expand All @@ -41,3 +42,10 @@ msgstr "Orden reparación"
#: model:ir.model,name:repair_order_internal.model_ir_sequence
msgid "Sequence"
msgstr "Secuencia"

#. module: repair_order_internal
#: model:ir.actions.act_window,name:repair_order_internal.action_not_internal_repair_order_tree
#: model:ir.ui.menu,name:repair_order_internal.menu_no_internal_repair_order_tree
msgid "Repair Orders"
msgstr "Reparaciones"

8 changes: 8 additions & 0 deletions repair_order_internal/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ msgstr ""

#. module: repair_order_internal
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_order__internal_repair
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_type__internal_repair
msgid "Internal Repair"
msgstr ""

Expand All @@ -41,3 +42,10 @@ msgstr "Ordre de réparation"
#: model:ir.model,name:repair_order_internal.model_ir_sequence
msgid "Sequence"
msgstr "Séquence"

#. module: repair_order_internal
#: model:ir.actions.act_window,name:repair_order_internal.action_not_internal_repair_order_tree
#: model:ir.ui.menu,name:repair_order_internal.menu_no_internal_repair_order_tree
msgid "Repair Orders"
msgstr ""

8 changes: 8 additions & 0 deletions repair_order_internal/i18n/repair_order_internal.pot
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ msgstr ""

#. module: repair_order_internal
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_order__internal_repair
#: model:ir.model.fields,field_description:repair_order_internal.field_repair_type__internal_repair
msgid "Internal Repair"
msgstr ""

Expand All @@ -41,3 +42,10 @@ msgstr ""
#: model:ir.model,name:repair_order_internal.model_ir_sequence
msgid "Sequence"
msgstr ""

#. module: repair_order_internal
#: model:ir.actions.act_window,name:repair_order_internal.action_not_internal_repair_order_tree
#: model:ir.ui.menu,name:repair_order_internal.menu_no_internal_repair_order_tree
msgid "Repair Orders"
msgstr ""

2 changes: 1 addition & 1 deletion repair_order_internal/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from . import repair_type
from . import repair_order
from . import ir_sequence
18 changes: 0 additions & 18 deletions repair_order_internal/models/ir_sequence.py

This file was deleted.

17 changes: 3 additions & 14 deletions repair_order_internal/models/repair_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
class RepairOrder(models.Model):
_inherit = "repair.order"

internal_repair = fields.Boolean()
internal_repair = fields.Boolean(
related="repair_type_id.internal_repair", store=True, copy=False
)

@api.onchange("internal_repair")
def onchange_internal_claim(self):
Expand All @@ -31,16 +33,3 @@ def onchange_internal_claim(self):
}
}
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)
9 changes: 9 additions & 0 deletions repair_order_internal/models/repair_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2025 Alfredo de la Fuente - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models


class RepairType(models.Model):
_inherit = "repair.type"

internal_repair = fields.Boolean(default=False, copy=False)
25 changes: 23 additions & 2 deletions repair_order_internal/views/repair_order_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<field name="inherit_id" ref="repair.view_repair_order_form" />
<field name="arch" type="xml">
<field name="partner_id" position="before">
<field name="internal_repair" invisible="1" />
<field name="internal_repair" />
</field>
</field>
</record>
Expand All @@ -25,6 +25,27 @@
<field name="view_id" ref="repair.view_repair_graph" />
</record>

<record id="action_not_internal_repair_order_tree" model="ir.actions.act_window">
<field name="name">Repair Orders</field>
<field name="context">{
'default_internal_repair': False,
}
</field>
<field name="domain">[('internal_repair', '=', False)]</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">repair.order</field>
<field name="view_mode">tree,kanban,graph,pivot,form</field>
<field name="search_view_id" ref="repair.view_repair_order_form_filter" />
</record>

<menuitem
name="Repair Orders"
id="menu_no_internal_repair_order_tree"
parent="repair.menu_repair_order"
action="action_not_internal_repair_order_tree"
sequence="1"
/>

<record id="action_internal_repair_order_tree" model="ir.actions.act_window">
<field name="name">Intenal Repair Orders</field>
<field name="context">{
Expand Down Expand Up @@ -66,6 +87,6 @@
id="menu_internal_repair_order_graph"
parent="repair.repair_menu_reporting"
action="action_internal_repair_order_graph"
sequence="2"
sequence="50"
/>
</odoo>
22 changes: 22 additions & 0 deletions repair_order_internal/views/repair_type_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record model="ir.ui.view" id="repair_type_view_form">
<field name="model">repair.type</field>
<field name="inherit_id" ref="repair_type.repair_type_view_form" />
<field name="arch" type="xml">
<field name="source_location_id" position="before">
<field name="internal_repair" />
</field>
</field>
</record>

<record model="ir.ui.view" id="repair_type_view_tree">
<field name="model">repair.type</field>
<field name="inherit_id" ref="repair_type.repair_type_view_tree" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="internal_repair" optional="show" />
</field>
</field>
</record>
</odoo>
Loading