-
-
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
16 changed files
with
249 additions
and
370 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 |
---|---|---|
|
@@ -87,6 +87,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 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 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 |
---|---|---|
|
@@ -8,11 +8,10 @@ | |
|
||
/* | ||
:Author: David Goodger ([email protected]) | ||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ | ||
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ | ||
:Copyright: This stylesheet has been placed in the public domain. | ||
Default cascading style sheet for the HTML output of Docutils. | ||
Despite the name, some widely supported CSS2 features are used. | ||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to | ||
customize this style sheet. | ||
|
@@ -275,7 +274,7 @@ | |
margin-left: 2em ; | ||
margin-right: 2em } | ||
|
||
pre.code .ln { color: gray; } /* line numbers */ | ||
pre.code .ln { color: grey; } /* line numbers */ | ||
pre.code, code { background-color: #eeeeee } | ||
pre.code .comment, code .comment { color: #5C6576 } | ||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } | ||
|
@@ -301,7 +300,7 @@ | |
span.pre { | ||
white-space: pre } | ||
|
||
span.problematic, pre.problematic { | ||
span.problematic { | ||
color: red } | ||
|
||
span.section-subtitle { | ||
|
@@ -438,14 +437,20 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2> | |
</ul> | ||
</blockquote> | ||
</li> | ||
<li><p class="first"><a class="reference external" href="https://apsl.tech">APSL-Nagarro</a>:</p> | ||
<blockquote> | ||
<ul class="simple"> | ||
<li>Antoni Marroig <<a class="reference external" href="mailto:amarroig@apsl.net">amarroig@apsl.net</a>></li> | ||
<li>Miquel Alzanillas <<a class="reference external" href="mailto:malzanillas@apsl.net">malzanillas@apsl.net</a>>></li> | ||
</ul> | ||
</blockquote> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="section" id="maintainers"> | ||
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2> | ||
<p>This module is maintained by the OCA.</p> | ||
<a class="reference external image-reference" href="https://odoo-community.org"> | ||
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /> | ||
</a> | ||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> | ||
<p>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.</p> | ||
|
Oops, something went wrong.