Skip to content
Merged
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
88 changes: 88 additions & 0 deletions repair_stock/README.rst
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.
1 change: 1 addition & 0 deletions repair_stock/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions repair_stock/__manifest__.py
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",
}
34 changes: 34 additions & 0 deletions repair_stock/i18n/it.po
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"
31 changes: 31 additions & 0 deletions repair_stock/i18n/repair_stock.pot
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 ""
5 changes: 5 additions & 0 deletions repair_stock/models/__init__.py
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
39 changes: 39 additions & 0 deletions repair_stock/models/repair.py
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"))
19 changes: 19 additions & 0 deletions repair_stock/models/stock_move.py
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,
)
15 changes: 15 additions & 0 deletions repair_stock/models/stock_rule.py
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
3 changes: 3 additions & 0 deletions repair_stock/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions repair_stock/readme/CONTRIBUTORS.md
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>`_
3 changes: 3 additions & 0 deletions repair_stock/readme/DESCRIPTION.md
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.
Binary file added repair_stock/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading