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

[18.0][MIG] repair_picking_after_done: Migration to 18.0 #80

Open
wants to merge 23 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b8be4ca
[ADD] repair_picking_after_done : Transfer repaired move to another l…
DhavalTforgeFlow Aug 10, 2022
6952018
[IMP] repair_picking_after_done: black, isort, prettier
DavidJForgeFlow Feb 28, 2023
1b83172
[MIG] repair_picking_after_done: Migration to 15.0
DavidJForgeFlow Feb 28, 2023
37696a6
[MIG] repair_picking_after_done: Migration to 16.0
DavidJForgeFlow Feb 28, 2023
5bb45ef
[FIX] repair_picking_after_done: get picking type
AaronHForgeFlow Nov 2, 2023
84bb193
[FIX] repair_picking_after_done: field picking_id copy=False in order…
AlexPForgeFlow Nov 3, 2023
3256fe2
Added translation using Weblate (Italian)
mymage Dec 20, 2023
78c4cc8
[REF] repair_picking_after_done: adding repair_stock as dependency.
DavidJForgeFlow Aug 28, 2024
6ac9682
[IMP] repair_picking_after_done: pre-commit auto fixes
ppyczko Oct 28, 2024
986ba97
[MIG] repair_picking_after_done: Migration to 17.0
ppyczko Oct 30, 2024
52ec8d8
[IMP] repair_picking_after_done: Prevent creation of transfers exceed…
ppyczko Oct 30, 2024
6384dd2
[IMP] repair_picking_after_done: Allow backorders for stock moves lin…
ppyczko Nov 18, 2024
5ec4d5a
[UPD] Update repair_picking_after_done.pot
Nov 26, 2024
9cd57fb
[BOT] post-merge updates
OCA-git-bot Nov 26, 2024
7cd831e
Update translation files
weblate Nov 26, 2024
57dc86d
Translated using Weblate (Italian)
mymage Nov 26, 2024
eb1e5c5
[IMP] repair_picking_after_done: Implement auto-transfer functionalit…
ppyczko Dec 2, 2024
3f1a332
[UPD] Update repair_picking_after_done.pot
Dec 27, 2024
e9d0b2e
[BOT] post-merge updates
OCA-git-bot Dec 27, 2024
17c7bf0
Update translation files
weblate Dec 27, 2024
93ed7d6
Translated using Weblate (Italian)
mymage Dec 27, 2024
3e5dfc4
[IMP] repair_picking_after_done: pre-commit auto fixes
HeliconiaSolutions Jan 6, 2025
4c5d338
[MIG] repair_picking_after_done: Migration to 18.0
HeliconiaSolutions Jan 6, 2025
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
131 changes: 131 additions & 0 deletions repair_picking_after_done/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
=========================
Repair picking after done
=========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b4f02d79666355063173a84f30f0d933ccd32f5ac36b52a70932189188e546f3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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_picking_after_done
: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_picking_after_done
: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 enhances Odoo's repair process by introducing automatic
stock transfers for repaired products.

- **Automatic Transfer:** When a repair order is marked as done, a stock
transfer for the remaining repaired products is automatically created
and validated if the **auto_transfer_repair** parameter is enabled.
- **Manual Transfer:** Users can manually create stock transfers when
automatic transfer is disabled.

.. 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:

Configuration
=============

To enable automatic transfers for repaired products when a repair order
is completed:

- Navigate to Repairs → Configuration → Settings.
- Enable the **Automatic Transfer on Repair Completion** setting.

When enabled, internal transfers for repaired products are automatically
created and validated upon completing the repair order.

Usage
=====

**Manual Transfers**

1. After a repair order is marked as **Done**, a **Create Transfer**
button will appear on the repair order's form view.
2. Click the Create Transfer button to create an internal transfer for
the repaired products.
3. Specify the destination location and quantity to complete the
transfer.

**Automatic Transfers**

1. If the **auto_transfer_repair** configuration parameter is enabled,
an internal transfer is automatically created and validated when the
repair order is marked as **Done**.

Known issues / Roadmap
======================



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_picking_after_done%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
------------

- `ForgeFlow <https://forgeflow.com>`__:

- Dhaval Talpada <[email protected]>

- `APSL-Nagarro <https://www.apsl.tech>`__:

- Patryk Pyczko <[email protected]>

- ``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_picking_after_done>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions repair_picking_after_done/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import models
from . import wizards
from .hooks import post_load_hook
28 changes: 28 additions & 0 deletions repair_picking_after_done/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2021 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

{
"name": "Repair picking after done",
"version": "18.0.1.0.0",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/repair",
"summary": "Transfer repaired move to another location directly from repair order",
"category": "Repair",
"depends": [
"base_repair_config",
"repair_type",
"repair_stock",
"repair_type_product_destination",
],
"data": [
"security/ir.model.access.csv",
"views/repair.xml",
"views/res_config_settings_views.xml",
"wizards/repair_move_transfer_views.xml",
],
"installable": True,
"development_status": "Alpha",
"license": "AGPL-3",
"application": False,
"post_load": "post_load_hook",
}
25 changes: 25 additions & 0 deletions repair_picking_after_done/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2024 Patryk Pyczko (APSL-Nagarro)<[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo.addons.repair.models.stock_move import StockMove


def post_load_hook():
"""
This hook modifies the stock move splitting logic to:
- Allow splitting stock moves related to repair
orders that are marked as "done", which is prevented
by the core Odoo logic.
- This change enables the creation of backorders for
these split stock moves when the associated repair is completed.
"""

def _split_for_repair_custom(self, qty, restrict_partner_id=False):
if self.repair_id and self.repair_id.state != "done":
return []

return super(StockMove, self)._split(qty, restrict_partner_id)

if not hasattr(StockMove, "_split_original"):
StockMove._split_original = StockMove._split
StockMove._split = _split_for_repair_custom
158 changes: 158 additions & 0 deletions repair_picking_after_done/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * repair_picking_after_done
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-11 13:39+0000\n"
"PO-Revision-Date: 2024-12-11 13:39+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_picking_after_done
#: model:ir.model.fields,field_description:repair_picking_after_done.field_res_config_settings__auto_transfer_repair
msgid "Automatic Transfer on Repair Completion"
msgstr "Transferència Automàtica en Compleció de Reparació"

#. module: repair_picking_after_done
#. odoo-python
#: code:addons/repair_picking_after_done/models/repair.py:0
#, python-format
msgid ""
"Automatic transfer cannot be completed because no product is specified for "
"this repair order. Please ensure that a product is assigned to the repair "
"order before proceeding with the transfer."
msgstr ""
"La transferència automàtica no es pot completar perquè no s'ha especificat un producte per "
"aquesta ordre de reparació. Assegureu-vos que s'hagi assignat un producte a l'ordre de reparació "
"abans de continuar amb la transferència."

#. module: repair_picking_after_done
#: model_terms:ir.ui.view,arch_db:repair_picking_after_done.res_config_settings_view_form_inherit
msgid ""
"Automatically create and validate stock transfers for completed repair "
"orders."
msgstr "Crear i validar automàticament les transferències d'estoc per a ordres de reparació completes."

#. module: repair_picking_after_done
#: model:ir.model.fields,help:repair_picking_after_done.field_res_config_settings__auto_transfer_repair
msgid ""
"Automatically create and validate transfers for repair orders upon "
"completion."
msgstr "Crear i validar automàticament les transferències per a les ordres de reparació en completar-les."

#. module: repair_picking_after_done
#: model_terms:ir.ui.view,arch_db:repair_picking_after_done.view_repair_move_transfer_wizard
msgid "Cancel"
msgstr "Cancel·lar"

#. module: repair_picking_after_done
#: model:ir.model,name:repair_picking_after_done.model_res_config_settings
msgid "Config Settings"
msgstr "Paràmetres de configuració"

#. module: repair_picking_after_done
#: model_terms:ir.ui.view,arch_db:repair_picking_after_done.repair_type_form_inherit
msgid "Create Transfer"
msgstr "Crear Transferència"

#. module: repair_picking_after_done
#: model:ir.model,name:repair_picking_after_done.model_repair_move_transfer
msgid "Create an internal transfer from repaired moves"
msgstr "Crear una transferència interna a partir dels moviments reparats"

#. module: repair_picking_after_done
#: model_terms:ir.ui.view,arch_db:repair_picking_after_done.view_repair_move_transfer_wizard
msgid "Create transfer"
msgstr "Crear transferència"

#. module: repair_picking_after_done
#: model:ir.model.fields,field_description:repair_picking_after_done.field_repair_move_transfer__create_uid
msgid "Created by"
msgstr "Creat per"

#. module: repair_picking_after_done
#: model:ir.model.fields,field_description:repair_picking_after_done.field_repair_move_transfer__create_date
msgid "Created on"
msgstr "Creat el"

#. module: repair_picking_after_done
#: model:ir.model.fields,field_description:repair_picking_after_done.field_repair_move_transfer__location_dest_id
msgid "Destination location"
msgstr "Ubicació de destí"

#. module: repair_picking_after_done
#: model:ir.model.fields,field_description:repair_picking_after_done.field_repair_move_transfer__display_name
msgid "Display Name"
msgstr "Nom a mostrar"

#. module: repair_picking_after_done
#: model:ir.model.fields,field_description:repair_picking_after_done.field_repair_move_transfer__id
msgid "ID"
msgstr "ID"

#. module: repair_picking_after_done
#: model:ir.model.fields,field_description:repair_picking_after_done.field_repair_move_transfer__write_uid
msgid "Last Updated by"
msgstr "Última actualització per"

#. module: repair_picking_after_done
#: model:ir.model.fields,field_description:repair_picking_after_done.field_repair_move_transfer__write_date
msgid "Last Updated on"
msgstr "Última actualització el"

#. module: repair_picking_after_done
#: model:ir.model.fields,field_description:repair_picking_after_done.field_repair_move_transfer__quantity
msgid "Quantity to transfer"
msgstr "Quantitat a transferir"

#. module: repair_picking_after_done
#. odoo-python
#: code:addons/repair_picking_after_done/wizards/repair_move_transfer.py:0
#: code:addons/repair_picking_after_done/wizards/repair_move_transfer.py:0
#, python-format
msgid ""
"Quantity to transfer cannot exceed the remaining quantity in the repair "
"order."
msgstr ""
"La quantitat a transferir no pot excedir la quantitat restant en l'ordre de reparació."

#. module: repair_picking_after_done
#. odoo-python
#: code:addons/repair_picking_after_done/wizards/repair_move_transfer.py:0
#: code:addons/repair_picking_after_done/wizards/repair_move_transfer.py:0
#, python-format
msgid "Quantity to transfer must be greater than 0."
msgstr "La quantitat a transferir ha de ser superior a 0."

#. module: repair_picking_after_done
#: model:ir.model.fields,field_description:repair_picking_after_done.field_repair_move_transfer__remaining_quantity
msgid "Remaining Quantity to Transfer"
msgstr "Quantitat restant a transferir"

#. module: repair_picking_after_done
#: model:ir.model.fields,field_description:repair_picking_after_done.field_repair_order__remaining_quantity
msgid "Remaining quantity to be transferred"
msgstr "Quantitat restant per transferir"

#. module: repair_picking_after_done
#: model:ir.model,name:repair_picking_after_done.model_repair_order
#: model:ir.model.fields,field_description:repair_picking_after_done.field_repair_move_transfer__repair_order_id
msgid "Repair Order"
msgstr "Ordre de reparació"

#. module: repair_picking_after_done
#: model_terms:ir.ui.view,arch_db:repair_picking_after_done.view_repair_move_transfer_wizard
msgid "Transfer Repaired Moves"
msgstr "Transferir moviments reparats"

#. module: repair_picking_after_done
#: model_terms:ir.ui.view,arch_db:repair_picking_after_done.view_repair_move_transfer_wizard
msgid "or"
msgstr "o"
Loading
Loading