Skip to content

[16.0][ADD] shopfloor_reception_product_dimension/mobile #1005

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

Open
wants to merge 4 commits into
base: 16.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
6 changes: 6 additions & 0 deletions setup/shopfloor_reception_product_dimension/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,
)
6 changes: 6 additions & 0 deletions setup/shopfloor_reception_product_dimension_mobile/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,
)
88 changes: 88 additions & 0 deletions shopfloor_reception_product_dimension/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
=======================================
Shopfloor Reception Packaging Dimension
=======================================

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

.. |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%2Fwms-lightgray.png?logo=github
:target: https://github.com/OCA/wms/tree/16.0/shopfloor_reception_product_dimension
:alt: OCA/wms
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/wms-16-0/wms-16-0-shopfloor_reception_product_dimension
: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/wms&target_branch=16.0
:alt: Try me on Runboat

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

This module adds an option to the reception scenario. When activated.
Before setting the quantity for the reception, if there is product
received with missing information, the user will be presented with a
screen proposing to update the missing information.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/wms/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/wms/issues/new?body=module:%20shopfloor_reception_product_dimension%0Aversion:%2016.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
-------

* Camptocamp

Contributors
------------

- Thierry Ducrest [email protected]
- Denis Roussel [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.

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

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

|maintainer-TDu|

This module is part of the `OCA/wms <https://github.com/OCA/wms/tree/16.0/shopfloor_reception_product_dimension>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions shopfloor_reception_product_dimension/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .hooks import post_init_hook, uninstall_hook
from . import models
from . import services
from . import actions
20 changes: 20 additions & 0 deletions shopfloor_reception_product_dimension/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "Shopfloor Reception Packaging Dimension",
"summary": "Collect Packaging Dimension from the Reception scenario",
"version": "16.0.1.0.0",
"development_status": "Beta",
"category": "Inventory",
"website": "https://github.com/OCA/wms",
"author": "Camptocamp, Odoo Community Association (OCA)",
"maintainers": ["TDu"],
"license": "AGPL-3",
"installable": True,
"depends": [
"shopfloor_reception",
"product_dimension",
"shopfloor_product_dimension",
],
"data": ["views/shopfloor_menu.xml"],
"post_init_hook": "post_init_hook",
"uninstall_hook": "uninstall_hook",
}
1 change: 1 addition & 0 deletions shopfloor_reception_product_dimension/actions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import message
23 changes: 23 additions & 0 deletions shopfloor_reception_product_dimension/actions/message.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2020 Camptocamp SA (http://www.camptocamp.com)
# Copyright 2023 Michael Tietz (MT Software) <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging

from odoo import _

from odoo.addons.component.core import Component

_logger = logging.getLogger(__name__)


class MessageAction(Component):
_inherit = "shopfloor.message.action"

def product_dimension_updated(self, product):
return {
"message_type": "success",
"body": _(
"Product '%(product_name)s' dimension updated.",
product_name=product.name,
),
}
40 changes: 40 additions & 0 deletions shopfloor_reception_product_dimension/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2023 Camptocamp SA (http://www.camptocamp.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import json
import logging

from odoo import SUPERUSER_ID, api

from odoo.addons.shopfloor_base.utils import purge_endpoints, register_new_services

from .services.reception import Reception as Service

_logger = logging.getLogger(__file__)


def post_init_hook(cr, registry):
_logger.info("Add set product dimension option on reception scenario")
env = api.Environment(cr, SUPERUSER_ID, {})
scenario = env.ref("shopfloor_reception.scenario_reception")
options = scenario.options
options.update({"set_product_dimension": True})
scenario.options_edit = json.dumps(options)
# The service imported is extending an existing component
# As it is a simple python import the odoo inheritance is not working
# So it needs to be fix
Service._usage = "reception"
Service._name = "shopfloor.reception"
register_new_services(env, Service)


def uninstall_hook(cr, registry):
_logger.info("Remove set product dimension option on reception scenario")
env = api.Environment(cr, SUPERUSER_ID, {})
scenario = env.ref("shopfloor_reception.scenario_reception")
options = scenario.options
if "set_product_dimension" in options.keys():
options.pop("set_product_dimension")
scenario.options_edit = json.dumps(options)
Service._usage = "reception"
purge_endpoints(env, Service._usage, endpoint="set_product_dimension")
56 changes: 56 additions & 0 deletions shopfloor_reception_product_dimension/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * shopfloor_reception_packaging_dimension
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-12 17:37+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: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__id
msgid "ID"
msgstr "ID"

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,help:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension
msgid ""
"If for the product being processed, its related packaging dimension are not "
"set, ask to fill them up."
msgstr ""
"Se per il prodotto che deve essere lavorato, non è impostata la dimensione "
"dell'imballo, chiede di compilarla."

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model,name:shopfloor_reception_packaging_dimension.model_shopfloor_menu
msgid "Menu displayed in the scanner application"
msgstr "Menu visualizzato nell'applicazione di scansione"

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension_is_possible
msgid "Set Packaging Dimension Is Possible"
msgstr "È possibile impostare la dimensione dell'imballo"

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension
msgid "Set packaging dimension"
msgstr "Imposta dimensione imballo"
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * shopfloor_reception_packaging_dimension
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.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: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__display_name
msgid "Display Name"
msgstr ""

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__id
msgid "ID"
msgstr ""

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,help:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension
msgid ""
"If for the product being processed, its related packaging dimension are not "
"set, ask to fill them up."
msgstr ""

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu____last_update
msgid "Last Modified on"
msgstr ""

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model,name:shopfloor_reception_packaging_dimension.model_shopfloor_menu
msgid "Menu displayed in the scanner application"
msgstr ""

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension_is_possible
msgid "Set Packaging Dimension Is Possible"
msgstr ""

#. module: shopfloor_reception_packaging_dimension
#: model:ir.model.fields,field_description:shopfloor_reception_packaging_dimension.field_shopfloor_menu__set_packaging_dimension
msgid "Set packaging dimension"
msgstr ""
1 change: 1 addition & 0 deletions shopfloor_reception_product_dimension/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import shopfloor_menu
25 changes: 25 additions & 0 deletions shopfloor_reception_product_dimension/models/shopfloor_menu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2023 Camptocamp SA (http://www.camptocamp.com)
# Copyright 2025 ACSONE SA/NV (https://acsone.eu)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models


class ShopfloorMenu(models.Model):
_inherit = "shopfloor.menu"

set_product_dimension_is_possible = fields.Boolean(
compute="_compute_set_product_dimension_is_possible"
)
set_product_dimension = fields.Boolean(
string="Set product dimension",
default=False,
help="If for the product being processed, its related "
"dimensions are not set, ask to fill them up.",
)

@api.depends("scenario_id")
def _compute_set_product_dimension_is_possible(self):
for menu in self:
menu.set_product_dimension_is_possible = menu.scenario_id.has_option(
"set_product_dimension"
)
2 changes: 2 additions & 0 deletions shopfloor_reception_product_dimension/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Thierry Ducrest <[email protected]>
- Denis Roussel <[email protected]>
3 changes: 3 additions & 0 deletions shopfloor_reception_product_dimension/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module adds an option to the reception scenario.
When activated. Before setting the quantity for the reception, if there is product received with
missing information, the user will be presented with a screen proposing to update the missing information.
1 change: 1 addition & 0 deletions shopfloor_reception_product_dimension/services/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import reception
Loading
Loading