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

[17.0][MIG] repair_picking_after_done: Migration to 17.0 #65

Open
wants to merge 11 commits into
base: 17.0
Choose a base branch
from
Open
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
105 changes: 105 additions & 0 deletions repair_picking_after_done/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
=========================
Repair picking after done
=========================

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

.. |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/17.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-17-0/repair-17-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=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds the functionality to create transfer of repaired move
once repair order is done.

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

No configuration needed for this module.

Usage
=====

After repair order is done, You will be able to see button "Transfer" on
repair order's form view. You will be able to create internal transfer
between repair location to any destination location.

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:%2017.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]>

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/17.0/repair_picking_after_done>`_ project on GitHub.

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

{
"name": "Repair picking after done",
"version": "17.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": ["repair_type", "repair_stock"],
"data": [
"security/ir.model.access.csv",
"views/repair.xml",
"wizards/repair_move_transfer_views.xml",
],
"installable": True,
"development_status": "Alpha",
"license": "AGPL-3",
"application": False,
}
117 changes: 117 additions & 0 deletions repair_picking_after_done/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * repair_picking_after_done
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-12-20 15:36+0000\n"
"Last-Translator: mymage <[email protected]>\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 4.17\n"

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

#. module: repair_picking_after_done
#: model_terms:ir.ui.view,arch_db:repair_picking_after_done.repair_type_form_inherit
msgid "Create Transfer"
msgstr "Crea trasferimento"

#. 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 "Crea un trasferimento interno da movimenti di riparazione"

#. 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 "Crea trasferimento"

#. 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 "Creato da"

#. 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 "Creato il"

#. 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 "Ubicazione di destinazione"

#. 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 "Nome visualizzato"

#. 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____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. 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 "Ultimo aggiornamento di"

#. 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 "Ultimo aggiornamento il"

#. 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 "Quantità da trasferire"

#. module: repair_picking_after_done
#. odoo-python
#: 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 quantità da trasferire deve essere maggiore di 0."

#. 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 "Quantità rimanente da trasferire"

#. 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 "Ordine di riparazione"

#. 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 "Movimenti trasferimenti di riparazione"

#. 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"

#~ msgid "<span class=\"o_stat_text\">Transfers</span>"
#~ msgstr "<span class=\"o_stat_text\">Trasferimenti</span>"

#, python-format
#~ msgid "Transfers"
#~ msgstr "Trasferimenti"
107 changes: 107 additions & 0 deletions repair_picking_after_done/i18n/repair_picking_after_done.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * repair_picking_after_done
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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_picking_after_done
#: model_terms:ir.ui.view,arch_db:repair_picking_after_done.view_repair_move_transfer_wizard
msgid "Cancel"
msgstr ""

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

#. 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 ""

#. 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 ""

#. 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 ""

#. 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 ""

#. 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 ""

#. 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 ""

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

#. module: repair_picking_after_done
#: model:ir.model.fields,field_description:repair_picking_after_done.field_repair_move_transfer____last_update
msgid "Last Modified on"
msgstr ""

#. 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 ""

#. 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 ""

#. 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 ""

#. module: repair_picking_after_done
#. odoo-python
#: code:addons/repair_picking_after_done/wizards/repair_move_transfer.py:0
#, python-format
msgid "Quantity to transfer must be greater than 0."
msgstr ""

#. 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 ""

#. 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 ""

#. 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 ""

#. module: repair_picking_after_done
#: model_terms:ir.ui.view,arch_db:repair_picking_after_done.view_repair_move_transfer_wizard
msgid "or"
msgstr ""
1 change: 1 addition & 0 deletions repair_picking_after_done/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import repair
40 changes: 40 additions & 0 deletions repair_picking_after_done/models/repair.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (C) 2022 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)

from odoo import fields, models


class Repair(models.Model):
_inherit = "repair.order"

remaining_quantity = fields.Float(
"Remaining quantity to be transferred", compute="_compute_remaining_quantity"
)

def _compute_remaining_quantity(self):
for rec in self:
remaining_quantity = rec.product_qty
if rec.picking_ids:
stock_moves = rec.picking_ids.mapped("move_ids").filtered(
lambda x: x.state != "cancel"
)
remaining_quantity = rec.product_qty - sum(
stock_moves.mapped("product_uom_qty")
)
rec.remaining_quantity = remaining_quantity

def action_transfer_done_moves(self):
self.ensure_one()
return {

Check warning on line 28 in repair_picking_after_done/models/repair.py

View check run for this annotation

Codecov / codecov/patch

repair_picking_after_done/models/repair.py#L27-L28

Added lines #L27 - L28 were not covered by tests
"name": "Transfer repair moves",
"type": "ir.actions.act_window",
"view_type": "form",
"view_mode": "form",
"res_model": "repair.move.transfer",
"context": {
"default_repair_order_id": self.id,
"default_quantity": self.remaining_quantity,
"default_remaining_quantity": self.remaining_quantity,
},
"target": "new",
}
Loading
Loading