-
-
Notifications
You must be signed in to change notification settings - Fork 61
[18.0][MIG] repair_stock: Migration to 18.0 #77
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b87c82a
[ADD] repair_stock
DavidJForgeFlow 431d0dc
[IMP] repair_stock: pre-commit stuff
DavidJForgeFlow d06a00c
[MIG] repair_stock: Migration to 16.0
DavidJForgeFlow 40273c7
Added translation using Weblate (Italian)
mymage 23b8418
[IMP] repair_stock: pre-commit auto fixes
ppyczko 7eac940
[MIG] repair_stock: Migration to 17.0
ppyczko 848d6e0
[UPD] Update repair_stock.pot
4ad398a
[BOT] post-merge updates
OCA-git-bot 688abfd
[MIG] repair_stock: Migration to 18.0
BhaveshHeliconia dd5b56c
[IMP] repair_stock: use a non conflicting field for auxiliar transfers
LoisRForgeFlow b36c161
[IMP] repair_stock: bump dev status
LoisRForgeFlow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,88 @@ | ||
| ============ | ||
| Repair Stock | ||
| ============ | ||
|
|
||
| .. | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! This file is generated by oca-gen-addon-readme !! | ||
| !! changes will be overwritten. !! | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! source digest: sha256:cc3de3e745ecbbd30f3259192e016829c5bd1ec38202226ca147c4f986ae21af | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
|
||
| .. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png | ||
| :target: https://odoo-community.org/page/development-status | ||
| :alt: Alpha | ||
| .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
| :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
| :alt: License: AGPL-3 | ||
| .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frepair-lightgray.png?logo=github | ||
| :target: https://github.com/OCA/repair/tree/18.0/repair_stock | ||
| :alt: OCA/repair | ||
| .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
| :target: https://translation.odoo-community.org/projects/repair-18-0/repair-18-0-repair_stock | ||
| :alt: Translate me on Weblate | ||
| .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
| :target: https://runboat.odoo-community.org/builds?repo=OCA/repair&target_branch=18.0 | ||
| :alt: Try me on Runboat | ||
|
|
||
| |badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
|
||
| This module acts as a base for the stock related modules for repairs. It | ||
| adds some common features that may be overriding between them, as the | ||
| compute for the pickings or the smart button for the transfers. | ||
|
|
||
| .. IMPORTANT:: | ||
| This is an alpha version, the data model and design can change at any time without warning. | ||
| Only for development or testing purpose, do not use in production. | ||
| `More details on development status <https://odoo-community.org/page/development-status>`_ | ||
|
|
||
| **Table of contents** | ||
|
|
||
| .. contents:: | ||
| :local: | ||
|
|
||
| Bug Tracker | ||
| =========== | ||
|
|
||
| Bugs are tracked on `GitHub Issues <https://github.com/OCA/repair/issues>`_. | ||
| In case of trouble, please check there if your issue has already been reported. | ||
| If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
| `feedback <https://github.com/OCA/repair/issues/new?body=module:%20repair_stock%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
|
||
| Do not contact contributors directly about support or help with technical issues. | ||
|
|
||
| Credits | ||
| ======= | ||
|
|
||
| Authors | ||
| ------- | ||
|
|
||
| * ForgeFlow | ||
|
|
||
| Contributors | ||
| ------------ | ||
|
|
||
| - David Jimenez <david.jimenez@forgeflow.com> | ||
| - `APSL-Nagarro <https://www.apsl.tech>`__: | ||
|
|
||
| - Patryk Pyczko <ppyczko@apsl.net> | ||
|
|
||
| - ``Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>``\ \_ | ||
|
|
||
| Maintainers | ||
| ----------- | ||
|
|
||
| This module is maintained by the OCA. | ||
|
|
||
| .. image:: https://odoo-community.org/logo.png | ||
| :alt: Odoo Community Association | ||
| :target: https://odoo-community.org | ||
|
|
||
| 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. | ||
|
|
||
| This module is part of the `OCA/repair <https://github.com/OCA/repair/tree/18.0/repair_stock>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains hidden or 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 hidden or 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,16 @@ | ||
| # Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com) | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
|
||
| { | ||
| "name": "Repair Stock", | ||
| "version": "18.0.1.0.0", | ||
| "author": "ForgeFlow, Odoo Community Association (OCA)", | ||
| "category": "Repair", | ||
| "website": "https://github.com/OCA/repair", | ||
| "depends": ["repair"], | ||
| "data": [ | ||
| "views/repair_order_view.xml", | ||
| ], | ||
| "license": "AGPL-3", | ||
| "development_status": "Production/Stable", | ||
| } |
This file contains hidden or 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,34 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * repair_stock | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 16.0\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "PO-Revision-Date: 2024-08-31 11:06+0000\n" | ||
| "Last-Translator: mymage <stefano.consolaro@mymage.it>\n" | ||
| "Language-Team: none\n" | ||
| "Language: it\n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: \n" | ||
| "Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
| "X-Generator: Weblate 5.6.2\n" | ||
|
|
||
| #. module: repair_stock | ||
| #: model:ir.model,name:repair_stock.model_repair_order | ||
| msgid "Repair Order" | ||
| msgstr "Ordine di riparazione" | ||
|
|
||
| #. module: repair_stock | ||
| #: model:ir.model.fields,field_description:repair_stock.field_repair_order__picking_count | ||
| #: model:ir.model.fields,field_description:repair_stock.field_repair_order__picking_ids | ||
| #: model_terms:ir.ui.view,arch_db:repair_stock.view_repair_order_form_repair_stock_move_inherited | ||
| msgid "Transfers" | ||
| msgstr "Trasferimenti" | ||
|
|
||
| #. module: repair_stock | ||
| #: model_terms:ir.ui.view,arch_db:repair_stock.view_repair_order_form_repair_stock_move_inherited | ||
| msgid "Transfers associated with this repair order" | ||
| msgstr "Trasferimenti associati a questo ordine di riparazione" |
This file contains hidden or 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,31 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * repair_stock | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 17.0\n" | ||
| "Report-Msgid-Bugs-To: \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_stock | ||
| #: model:ir.model,name:repair_stock.model_repair_order | ||
| msgid "Repair Order" | ||
| msgstr "" | ||
|
|
||
| #. module: repair_stock | ||
| #: model:ir.model.fields,field_description:repair_stock.field_repair_order__picking_count | ||
| #: model:ir.model.fields,field_description:repair_stock.field_repair_order__picking_ids | ||
| #: model_terms:ir.ui.view,arch_db:repair_stock.view_repair_order_form_repair_stock_move_inherited | ||
| msgid "Transfers" | ||
| msgstr "" | ||
|
|
||
| #. module: repair_stock | ||
| #: model_terms:ir.ui.view,arch_db:repair_stock.view_repair_order_form_repair_stock_move_inherited | ||
| msgid "Transfers associated with this repair order" | ||
| msgstr "" |
This file contains hidden or 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,5 @@ | ||
| # Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com) | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
| from . import repair | ||
| from . import stock_move | ||
| from . import stock_rule |
This file contains hidden or 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,39 @@ | ||
| # Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com) | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
|
||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class RepairOrder(models.Model): | ||
| _inherit = "repair.order" | ||
|
|
||
| picking_ids = fields.Many2many( | ||
| comodel_name="stock.picking", | ||
| compute="_compute_picking_ids", | ||
| copy=False, | ||
| string="Transfers", | ||
| ) | ||
| picking_count = fields.Integer( | ||
| string="Transfers Count", copy=False, compute="_compute_picking_ids" | ||
| ) | ||
|
|
||
| def action_view_pickings(self): | ||
| self.ensure_one() | ||
| action = self.env["ir.actions.actions"]._for_xml_id( | ||
| "stock.action_picking_tree_all" | ||
| ) | ||
| action["domain"] = [("id", "in", self.picking_ids.ids)] | ||
| return action | ||
|
|
||
| def _compute_picking_ids(self): | ||
| for order in self: | ||
| # TODO: migration note: `repair_id` should not be used here | ||
| # in v18, use `related_repair_id` instead while migrating | ||
| # modules depending on this. | ||
| moves = self.env["stock.move"].search( | ||
| [ | ||
| ("related_repair_id", "=", order.id), | ||
| ] | ||
| ) | ||
| order.picking_ids = moves.mapped("picking_id") | ||
| order.picking_count = len(moves.mapped("picking_id")) | ||
This file contains hidden or 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,19 @@ | ||
| # Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com) | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
|
||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class StockMove(models.Model): | ||
| _inherit = "stock.move" | ||
|
|
||
| # `repair_id` is reserved to the stock.moves directly related | ||
| # to the execution of the repair order and has associated logic | ||
| # in odoo core code (like assigning the picking type) | ||
| # To avoid unexpected behaviors, we use `related_repair_id` to | ||
| # signal auxiliar stock moves that are not directly related to | ||
| # repair execution. | ||
| related_repair_id = fields.Many2one( | ||
| comodel_name="repair.order", | ||
| readonly=True, | ||
| ) |
This file contains hidden or 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,15 @@ | ||
| # Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com) | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
|
||
| from odoo import models | ||
|
|
||
|
|
||
| class StockRule(models.Model): | ||
| _inherit = "stock.rule" | ||
|
|
||
| def _get_custom_move_fields(self): | ||
| move_fields = super()._get_custom_move_fields() | ||
| move_fields += [ | ||
| "related_repair_id", | ||
| ] | ||
| return move_fields |
This file contains hidden or 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,3 @@ | ||
| [build-system] | ||
| requires = ["whool"] | ||
| build-backend = "whool.buildapi" |
This file contains hidden or 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,4 @@ | ||
| - David Jimenez \<<david.jimenez@forgeflow.com>\> | ||
| - [APSL-Nagarro](https://www.apsl.tech): | ||
| - Patryk Pyczko \<<ppyczko@apsl.net>\> | ||
| - `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`_ |
This file contains hidden or 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,3 @@ | ||
| This module acts as a base for the stock related modules for repairs. It | ||
| adds some common features that may be overriding between them, as the | ||
| compute for the pickings or the smart button for the transfers. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.