-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] repair_type: Migration to 17.0
- Loading branch information
Showing
20 changed files
with
280 additions
and
432 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 |
---|---|---|
|
@@ -28,8 +28,10 @@ Repair Type | |
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module adds the type to a repair order. If we select a type on a | ||
Repair Order, Odoo will automatically fill some fields of the order. | ||
This module adds the source location from removing and recycling | ||
components. If we select the both locations on stock picking type when | ||
you select that in a Repair Order, Odoo will automatically set that in | ||
stock moves for that components. | ||
|
||
.. IMPORTANT:: | ||
This is an alpha version, the data model and design can change at any time without warning. | ||
|
@@ -41,26 +43,13 @@ Repair Order, Odoo will automatically fill some fields of the order. | |
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
No configuration needed for this module. | ||
|
||
Usage | ||
===== | ||
|
||
Go to Configuration>Repair Types and create a new repair type. | ||
Afterwards selecting a type on a Repair Order will automatically fill | ||
some fields. | ||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
Possible improvements for future versions: | ||
|
||
- Destination Location of the product to repair is not used currently, | ||
so that's why is invisible. We still save the field for future new | ||
module implementations. | ||
Set stock picking type for repairs and select source locations for | ||
removing and recycling components. Afterwards selecting that stock | ||
picking type on a Repair Order will automatically put that source | ||
location on stock moves of that components. | ||
|
||
Bug Tracker | ||
=========== | ||
|
@@ -87,6 +76,11 @@ Contributors | |
|
||
- Bernat Puig <[email protected]> | ||
|
||
- `APSL-Nagarro <https://apsl.tech>`__: | ||
|
||
- Antoni Marroig <[email protected]> | ||
- Miquel Alzanillas <[email protected]>> | ||
|
||
Maintainers | ||
----------- | ||
|
||
|
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
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,54 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * repair_type | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 17.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-06-27 13:31+0000\n" | ||
"PO-Revision-Date: 2024-06-27 13:31+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_type | ||
#: model:ir.model.fields,field_description:repair_type.field_stock_picking_type__default_recycle_location_src_id | ||
msgid "Default Recycle Source Location" | ||
msgstr "Ubicación de origen por defecto para reciclaje" | ||
|
||
#. module: repair_type | ||
#: model:ir.model.fields,field_description:repair_type.field_stock_picking_type__default_remove_location_src_id | ||
msgid "Default Remove Source Location" | ||
msgstr "Ubicación de origen por defecto para eliminar" | ||
|
||
#. module: repair_type | ||
#: model:ir.model,name:repair_type.model_stock_picking_type | ||
msgid "Picking Type" | ||
msgstr "Tipo de recolección" | ||
|
||
#. module: repair_type | ||
#: model:ir.model,name:repair_type.model_stock_move | ||
msgid "Stock Move" | ||
msgstr "Movimiento de stock" | ||
|
||
#. module: repair_type | ||
#: model:ir.model.fields,help:repair_type.field_stock_picking_type__default_recycle_location_src_id | ||
msgid "" | ||
"This is the default recycle source location when you create a repair order " | ||
"with this operation type." | ||
msgstr "" | ||
"Esta es la ubicación de origen por defecto para el reciclaje cuando cree " | ||
"una orden de reparación con este tipo de operación." | ||
|
||
#. module: repair_type | ||
#: model:ir.model.fields,help:repair_type.field_stock_picking_type__default_remove_location_src_id | ||
msgid "" | ||
"This is the default remove source location when you create a repair order " | ||
"with this operation type." | ||
msgstr "" | ||
"Esta es la ubicación de origen por defecto para eleminar cuando cree una " | ||
"orden de reparación con este tipo de operación." |
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,35 @@ | ||
# Copyright (C) 2024 APSL-Nagarro Antoni Marroig | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) | ||
|
||
from openupgradelib import openupgrade | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
INSERT INTO stock_picking_type | ||
(create_date, default_location_dest_id, default_remove_location_dest_id, | ||
name, default_recycle_location_dest_id, sequence_id, sequence, | ||
sequence_code, default_location_src_id, default_remove_location_src_id) | ||
SELECT create_date, destination_location_add_part_id, | ||
destination_location_remove_part_id, name, refurbish_location_dest_id, | ||
sequence_id, sequence_number_next, sequence_prefix, | ||
source_location_add_part_id, source_location_remove_part_id | ||
FROM repair_type; | ||
""", | ||
) | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
ALTER TABLE repair_order | ||
DROP COLUMN repair_type_id; | ||
""", | ||
) | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
DROP TABLE repair_type; | ||
""", | ||
) |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from . import repair | ||
from . import repair_type | ||
from . import stock_move | ||
from . import stock_picking_type |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
# Copyright (C) 2024 APSL-Nagarro Antoni Marroig | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) | ||
|
||
from odoo import models | ||
|
||
|
||
class StockMove(models.Model): | ||
_inherit = "stock.move" | ||
|
||
def _get_repair_locations(self, repair_line_type, repair_id=False): | ||
res = super()._get_repair_locations(repair_line_type, repair_id) | ||
if not repair_id: | ||
if ( | ||
repair_line_type == "remove" | ||
and self.repair_id.picking_type_id.default_remove_location_src_id | ||
): | ||
res = ( | ||
self.repair_id.picking_type_id.default_remove_location_src_id, | ||
res[1], | ||
) | ||
elif ( | ||
repair_line_type == "recycle" | ||
and self.repair_id.picking_type_id.default_recycle_location_src_id | ||
): | ||
res = ( | ||
self.repair_id.picking_type_id.default_recycle_location_src_id, | ||
res[1], | ||
) | ||
return res |
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,21 @@ | ||
# Copyright (C) 2024 APSL-Nagarro Antoni Marroig | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class PickingType(models.Model): | ||
_inherit = "stock.picking.type" | ||
|
||
default_remove_location_src_id = fields.Many2one( | ||
"stock.location", | ||
"Default Remove Source Location", | ||
help="This is the default remove source location when you create a repair " | ||
"order with this operation type.", | ||
) | ||
default_recycle_location_src_id = fields.Many2one( | ||
"stock.location", | ||
"Default Recycle Source Location", | ||
help="This is the default recycle source location when you create a repair " | ||
"order with this operation type.", | ||
) |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
- [ForgeFlow](https://forgeflow.com): | ||
|
||
> - Bernat Puig \<<[email protected]>\> | ||
- [APSL-Nagarro](https://apsl.tech): | ||
|
||
> - Antoni Marroig \<<[email protected]>\> | ||
> - Miquel Alzanillas \<<[email protected]>>\> |
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
This module adds the type to a repair order. If we select a type on a | ||
Repair Order, Odoo will automatically fill some fields of the order. | ||
This module adds the source location from removing and recycling components. If we select the both locations on stock picking type when you select that in a Repair Order, Odoo will automatically set that in stock moves for that components. |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
Go to Configuration\>Repair Types and create a new repair type. | ||
Afterwards selecting a type on a Repair Order will automatically fill | ||
some fields. | ||
Set stock picking type for repairs and select source locations for removing and recycling components. | ||
Afterwards selecting that stock picking type on a Repair Order will automatically put that source location on stock moves of that components. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.