Skip to content

Commit

Permalink
Merge PR #335 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by rafaelbn
  • Loading branch information
OCA-git-bot committed Jul 31, 2024
2 parents 04a2e36 + 40b4233 commit 512b2d3
Show file tree
Hide file tree
Showing 23 changed files with 934 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/stock_picking_report_product_sticker/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
100 changes: 100 additions & 0 deletions stock_picking_report_product_sticker/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
======================================
Stock Picking Report - Product Sticker
======================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0f26f8c5829d171015747e7f0ef2ef426fe9627c9bea856a5060adddd5753db4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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--reporting-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-reporting/tree/15.0/stock_picking_report_product_sticker
:alt: OCA/stock-logistics-reporting
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-reporting-15-0/stock-logistics-reporting-15-0-stock_picking_report_product_sticker
: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-reporting&target_branch=15.0
:alt: Try me on Runboat

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

This module allows you to display the Product Stickers in the Delivery Slip reports.

**Table of contents**

.. contents::
:local:

Installation
============

You must install the ``product_sticker`` module from
[Product Attribute](https://github.com/OCA/product-attribute) repository.

Usage
=====

To use this module, you need to:

#. You must go to the Picking Type that you want to show the Product Stickers
and choose the desired position of the stickers on the field *Show Product Stickers*.
#. You can also change the position or disable it on each Picking by hand if you wish.
Regardless if your Picking Type has Show Stickers enabled or not.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-reporting/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-reporting/issues/new?body=module:%20stock_picking_report_product_sticker%0Aversion:%2015.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
~~~~~~~

* Moduon

Contributors
~~~~~~~~~~~~

* Eduardo de Miguel (`Moduon <https://www.moduon.team/>`__)

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.

.. |maintainer-Shide| image:: https://github.com/Shide.png?size=40px
:target: https://github.com/Shide
:alt: Shide

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-Shide|

This module is part of the `OCA/stock-logistics-reporting <https://github.com/OCA/stock-logistics-reporting/tree/15.0/stock_picking_report_product_sticker>`_ 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_report_product_sticker/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
23 changes: 23 additions & 0 deletions stock_picking_report_product_sticker/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2023 Moduon Team S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0)

{
"name": "Stock Picking Report - Product Sticker",
"version": "16.0.1.0.0",
"author": "Moduon, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/stock-logistics-reporting",
"category": "Stock",
"depends": [
"product_sticker",
"stock",
],
"data": [
"views/stock_picking_type_views.xml",
"views/stock_picking_views.xml",
"report/report_deliveryslip.xml",
"data/menus.xml",
],
"maintainers": ["Shide", "rafaelbn"],
"installable": True,
}
12 changes: 12 additions & 0 deletions stock_picking_report_product_sticker/data/menus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2023 Moduon Team S.L.
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) -->
<odoo>
<menuitem
id="menu_stock_picking_report_product_sticker"
name="Product Stickers"
parent="stock.menu_product_in_config_stock"
sequence="6"
action="product_sticker.action_product_sticker"
/>
</odoo>
70 changes: 70 additions & 0 deletions stock_picking_report_product_sticker/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_report_product_sticker
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-03-31 10:48+0000\n"
"PO-Revision-Date: 2023-10-28 16:00+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: stock_picking_report_product_sticker
#: model:ir.model.fields.selection,name:stock_picking_report_product_sticker.selection__stock_picking__show_product_stickers__bottom_left
#: model:ir.model.fields.selection,name:stock_picking_report_product_sticker.selection__stock_picking_type__show_product_stickers__bottom_left
msgid "Bottom (left)"
msgstr "Abajo (izquierda)"

#. module: stock_picking_report_product_sticker
#: model:ir.model.fields,help:stock_picking_report_product_sticker.field_stock_picking_type__show_product_stickers
msgid "Display Product Stickers on chosen position inside the report."
msgstr ""
"Mostrar Pegatinas de Producto en la posición elegida dentro del informe."

#. module: stock_picking_report_product_sticker
#: model:ir.model,name:stock_picking_report_product_sticker.model_stock_picking_type
msgid "Picking Type"
msgstr "Tipo de albarán"

#. module: stock_picking_report_product_sticker
#: model:ir.ui.menu,name:stock_picking_report_product_sticker.menu_stock_picking_report_product_sticker
msgid "Product Stickers"
msgstr "Pegatinas de producto"

#. module: stock_picking_report_product_sticker
#: model:ir.model.fields,field_description:stock_picking_report_product_sticker.field_stock_picking__show_product_stickers
#: model:ir.model.fields,field_description:stock_picking_report_product_sticker.field_stock_picking_type__show_product_stickers
msgid "Show Product Stickers"
msgstr "Mostrar pegatinas de productos"

#. module: stock_picking_report_product_sticker
#: model:ir.model.fields,help:stock_picking_report_product_sticker.field_stock_picking__show_product_stickers
msgid "Show Product Stickers on pickings of this type."
msgstr "Mostrar Pegatinas de productos en los albaranes de este tipo."

#. module: stock_picking_report_product_sticker
#: model:ir.model.fields,field_description:stock_picking_report_product_sticker.field_stock_picking__sticker_ids
msgid "Stickers"
msgstr "Pegatinas"

#. module: stock_picking_report_product_sticker
#: model:ir.model.fields.selection,name:stock_picking_report_product_sticker.selection__stock_picking__show_product_stickers__top_right
#: model:ir.model.fields.selection,name:stock_picking_report_product_sticker.selection__stock_picking_type__show_product_stickers__top_right
msgid "Top (right)"
msgstr "Arriba (derecha)"

#. module: stock_picking_report_product_sticker
#: model:ir.model,name:stock_picking_report_product_sticker.model_stock_picking
msgid "Transfer"
msgstr "Albarán"

#~ msgid "Position of the stickers inside the report."
#~ msgstr "Posición de las pegatinas de producto dentro del informe."
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_report_product_sticker
#
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_report_product_sticker
#: model:ir.model.fields.selection,name:stock_picking_report_product_sticker.selection__stock_picking__show_product_stickers__bottom_left
#: model:ir.model.fields.selection,name:stock_picking_report_product_sticker.selection__stock_picking_type__show_product_stickers__bottom_left
msgid "Bottom (left)"
msgstr ""

#. module: stock_picking_report_product_sticker
#: model:ir.model.fields,help:stock_picking_report_product_sticker.field_stock_picking_type__show_product_stickers
msgid "Display Product Stickers on chosen position inside the report."
msgstr ""

#. module: stock_picking_report_product_sticker
#: model:ir.model,name:stock_picking_report_product_sticker.model_stock_picking_type
msgid "Picking Type"
msgstr ""

#. module: stock_picking_report_product_sticker
#: model:ir.ui.menu,name:stock_picking_report_product_sticker.menu_stock_picking_report_product_sticker
msgid "Product Stickers"
msgstr ""

#. module: stock_picking_report_product_sticker
#: model:ir.model.fields,field_description:stock_picking_report_product_sticker.field_stock_picking__show_product_stickers
#: model:ir.model.fields,field_description:stock_picking_report_product_sticker.field_stock_picking_type__show_product_stickers
msgid "Show Product Stickers"
msgstr ""

#. module: stock_picking_report_product_sticker
#: model:ir.model.fields,help:stock_picking_report_product_sticker.field_stock_picking__show_product_stickers
msgid "Show Product Stickers on pickings of this type."
msgstr ""

#. module: stock_picking_report_product_sticker
#: model:ir.model.fields,field_description:stock_picking_report_product_sticker.field_stock_picking__sticker_ids
msgid "Stickers"
msgstr ""

#. module: stock_picking_report_product_sticker
#: model:ir.model.fields.selection,name:stock_picking_report_product_sticker.selection__stock_picking__show_product_stickers__top_right
#: model:ir.model.fields.selection,name:stock_picking_report_product_sticker.selection__stock_picking_type__show_product_stickers__top_right
msgid "Top (right)"
msgstr ""

#. module: stock_picking_report_product_sticker
#: model:ir.model,name:stock_picking_report_product_sticker.model_stock_picking
msgid "Transfer"
msgstr ""
2 changes: 2 additions & 0 deletions stock_picking_report_product_sticker/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import stock_picking_type
from . import stock_picking
42 changes: 42 additions & 0 deletions stock_picking_report_product_sticker/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2023 Moduon Team S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0)

from odoo import api, fields, models

from .stock_picking_type import REPORT_STICKER_POSITIONS


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

show_product_stickers = fields.Selection(
selection=REPORT_STICKER_POSITIONS,
compute="_compute_show_product_stickers",
store=True,
readonly=False,
help="Show Product Stickers on pickings of this type.",
)
sticker_ids = fields.Many2many(
comodel_name="product.sticker",
string="Stickers",
compute="_compute_sticker_ids",
store=False,
)

@api.depends("picking_type_id")
def _compute_show_product_stickers(self):
for picking in self:
picking.show_product_stickers = (
picking.picking_type_id.show_product_stickers
)

@api.depends("show_product_stickers", "move_line_ids.product_id")
def _compute_sticker_ids(self):
self.sticker_ids = False
for picking in self:
if not picking.show_product_stickers:
continue
products = picking.move_line_ids.product_id
stickers = products.get_product_stickers()
if stickers:
picking.sticker_ids = stickers
18 changes: 18 additions & 0 deletions stock_picking_report_product_sticker/models/stock_picking_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2023 Moduon Team S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0)

from odoo import fields, models

REPORT_STICKER_POSITIONS = [
("top_right", "Top (right)"),
("bottom_left", "Bottom (left)"),
]


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

show_product_stickers = fields.Selection(
selection=REPORT_STICKER_POSITIONS,
help="Display Product Stickers on chosen position inside the report.",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Eduardo de Miguel (`Moduon <https://www.moduon.team/>`__)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allows you to display the Product Stickers in the Delivery Slip reports.
2 changes: 2 additions & 0 deletions stock_picking_report_product_sticker/readme/INSTALL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
You must install the ``product_sticker`` module from
[Product Attribute](https://github.com/OCA/product-attribute) repository.
6 changes: 6 additions & 0 deletions stock_picking_report_product_sticker/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
To use this module, you need to:

#. You must go to the Picking Type that you want to show the Product Stickers
and choose the desired position of the stickers on the field *Show Product Stickers*.
#. You can also change the position or disable it on each Picking by hand if you wish.
Regardless if your Picking Type has Show Stickers enabled or not.
Loading

0 comments on commit 512b2d3

Please sign in to comment.