Skip to content

Commit

Permalink
Merge PR OCA#1633 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by dreispt
  • Loading branch information
OCA-git-bot committed Aug 29, 2024
2 parents 03b829c + 5a5e9e0 commit d40725f
Show file tree
Hide file tree
Showing 16 changed files with 741 additions and 0 deletions.
100 changes: 100 additions & 0 deletions stock_picking_origin_reference/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
==============================
Stock Picking Origin Reference
==============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8bb2f3d46f99b4facb606cf903e01be17aefff2f81dda8d2dbd6eef7bbcb4759
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |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%2Fstock--logistics--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_picking_origin_reference
:alt: OCA/stock-logistics-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-17-0/stock-logistics-workflow-17-0-stock_picking_origin_reference
: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/stock-logistics-workflow&target_branch=17.0
:alt: Try me on Runboat

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

The Source Document contains a text referencing to the Odoo document
from which the transfer has been created. This module replaces the
Source Document field for a field with the same label which is clickable
and redirects the user to the document.

If there is an existing Odoo document with the same name as the value in
the Source Document, the Odoo field is hidden, and the new field is
shown by default. Otherwise, it's left as it is.

It also adds the base strucuture in order to reference documents from
different Odoo models.

**Table of contents**

.. contents::
:local:

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

By just installing this module, the stock_picking_origin_reference_sale
and stock_picking_origin_reference_purchase modules are auto-installed,
if you have corresponding *extension* modules installed, such as sale
and purchase respectively.

These two modules together with this one, will enable the navigation to
Sales Orders, Purchase Orders and Transfers. All possible referenced
models used in Odoo by default.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-workflow/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/stock-logistics-workflow/issues/new?body=module:%20stock_picking_origin_reference%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 S.L.

- Guillem Casassas <guillem.casassas@forgeflow.com>

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/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_picking_origin_reference>`_ 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 stock_picking_origin_reference/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions stock_picking_origin_reference/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2023-2024 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Stock Picking Origin Reference",
"summary": "Add clickable button to the Transfer Source Document.",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"website": "https://github.com/OCA/stock-logistics-workflow",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"category": "Warehouse Management",
"depends": ["stock"],
"data": ["views/stock_picking_views.xml"],
"installable": True,
"application": False,
}
27 changes: 27 additions & 0 deletions stock_picking_origin_reference/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_origin_reference
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-24 10:33+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 4.17\n"

#. module: stock_picking_origin_reference
#: model:ir.model.fields,field_description:stock_picking_origin_reference.field_stock_picking__origin_reference
msgid "Source Document"
msgstr "Documento di origine"

#. module: stock_picking_origin_reference
#: model:ir.model,name:stock_picking_origin_reference.model_stock_picking
msgid "Transfer"
msgstr "Trasferimento"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_origin_reference
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.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: stock_picking_origin_reference
#: model:ir.model.fields,field_description:stock_picking_origin_reference.field_stock_picking__origin_reference
msgid "Source Document"
msgstr ""

#. module: stock_picking_origin_reference
#: model:ir.model,name:stock_picking_origin_reference.model_stock_picking
msgid "Transfer"
msgstr ""
1 change: 1 addition & 0 deletions stock_picking_origin_reference/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_picking
29 changes: 29 additions & 0 deletions stock_picking_origin_reference/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2023-2024 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models


class StockPicking(models.Model):
_inherit = "stock.picking"

origin_reference = fields.Reference(
selection="_selection_origin_reference",
compute="_compute_origin_reference",
string="Source Document",
)

def _selection_origin_reference(self):
return [("stock.picking", "Transfer")]

@api.model
def _get_depends_compute_origin_reference(self):
return ["origin"]

@api.depends(lambda x: x._get_depends_compute_origin_reference())
def _compute_origin_reference(self):
for picking in self:
origin_reference = False
rel_picking = self.search([("name", "=", picking.origin)], limit=1)
if rel_picking:
origin_reference = f"{self._name},{rel_picking.id}"
picking.origin_reference = origin_reference
3 changes: 3 additions & 0 deletions stock_picking_origin_reference/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
8 changes: 8 additions & 0 deletions stock_picking_origin_reference/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
By just installing this module, the stock_picking_origin_reference_sale
and stock_picking_origin_reference_purchase modules are auto-installed,
if you have corresponding *extension* modules installed, such as sale
and purchase respectively.

These two modules together with this one, will enable the navigation to
Sales Orders, Purchase Orders and Transfers. All possible referenced
models used in Odoo by default.
2 changes: 2 additions & 0 deletions stock_picking_origin_reference/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- ForgeFlow S.L.
- Guillem Casassas \<<guillem.casassas@forgeflow.com>\>
11 changes: 11 additions & 0 deletions stock_picking_origin_reference/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The Source Document contains a text referencing to the Odoo document
from which the transfer has been created. This module replaces the
Source Document field for a field with the same label which is clickable
and redirects the user to the document.

If there is an existing Odoo document with the same name as the value in
the Source Document, the Odoo field is hidden, and the new field is
shown by default. Otherwise, it's left as it is.

It also adds the base strucuture in order to reference documents from
different Odoo models.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d40725f

Please sign in to comment.