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

[16.0][ADD] stock_safe_scrap #2181

Open
wants to merge 1 commit 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
1 change: 1 addition & 0 deletions setup/stock_safe_scrap/odoo/addons/stock_safe_scrap
6 changes: 6 additions & 0 deletions setup/stock_safe_scrap/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,
)
108 changes: 108 additions & 0 deletions stock_safe_scrap/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
================
Stock Safe Scrap
================

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

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

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

This module will restrict scrap operations on a location where a picking
operation is in progress.

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

In common big warehouses, many users do operations at the same time.

During the picking process, one operator can do product collect and
another will do scrap processes. The first one can have collected the
products but not having validated the picking yet (just filled in the
done quantities).

If the scrap operator scrapped one quantity done by the picking
operator, quantities will be incoherent in the picking has products have
been physically collected.

We want to ensure no scrap could be done if an operation is in progress.

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

- Go to Inventory > Configuration > Settings > Operations
- Check the 'Stock Safe Scrap' box if you want to prevent scrap
operations taking place during picking operations.

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

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

* ACSONE SA/NV

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

- 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-rousseldenis| image:: https://github.com/rousseldenis.png?size=40px
:target: https://github.com/rousseldenis
:alt: rousseldenis

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

|maintainer-rousseldenis|

This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/16.0/stock_safe_scrap>`_ 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_safe_scrap/__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_safe_scrap/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2024 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Stock Safe Scrap",
"summary": """
This module allows to do scrap on locations that have no pickings in progress""",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"maintainers": ["rousseldenis"],
"depends": ["stock", "base_partition"],
"data": ["views/res_config_settings.xml"],
}
85 changes: 85 additions & 0 deletions stock_safe_scrap/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_safe_scrap
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-23 08:27+0000\n"
"PO-Revision-Date: 2024-10-23 08:27+0000\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_safe_scrap
#: model:ir.model.fields,help:stock_safe_scrap.field_res_company__stock_safe_scrap
#: model:ir.model.fields,help:stock_safe_scrap.field_res_config_settings__stock_safe_scrap
msgid ""
"Check this if you want that scrap operations are authorized on "
"locationswhere no picking operations are in progress."
msgstr "Cochez ceci si vous voulez que les opérations de rebut soient autorisées sur des emplacements où aucune opération de picking n'a lieu."

#. module: stock_safe_scrap
#: model:ir.model,name:stock_safe_scrap.model_res_company
msgid "Companies"
msgstr "Sociétés"

#. module: stock_safe_scrap
#: model:ir.model,name:stock_safe_scrap.model_res_config_settings
msgid "Config Settings"
msgstr "Paramètres de configuration"

#. module: stock_safe_scrap
#: model_terms:ir.ui.view,arch_db:stock_safe_scrap.res_config_settings_view_form
msgid ""
"If checked, the system will prevent scrap of products if some quantities are"
" currently being picked for the same product, location, lot, owner and "
"package."
msgstr "Si coché, le système empêchera la mise au rebut de produits si des quantités sont en train d'être prélevées pour les mêmes produit, emplacement, lot, propriétaire et paquet."

#. module: stock_safe_scrap
#: model:ir.model.fields,field_description:stock_safe_scrap.field_stock_scrap__in_progress_picking_ids
msgid "In Progress Picking"
msgstr "Picking en cours"

#. module: stock_safe_scrap
#: model:ir.model.fields,field_description:stock_safe_scrap.field_res_company__stock_safe_scrap
#: model:ir.model.fields,field_description:stock_safe_scrap.field_res_config_settings__stock_safe_scrap
msgid "Safe Scrap Operations"
msgstr "Opérations de rebut protégées"

#. module: stock_safe_scrap
#: model_terms:ir.ui.view,arch_db:stock_safe_scrap.res_config_settings_view_form
msgid "Safe scrap"
msgstr "Rebut protégé"

#. module: stock_safe_scrap
#: model:ir.model,name:stock_safe_scrap.model_stock_scrap
msgid "Scrap"
msgstr "Rebut"

#. module: stock_safe_scrap
#. odoo-python
#: code:addons/stock_safe_scrap/models/stock_scrap.py:0
#, python-format
msgid ""
"Some picking operations are in progress. You cannot do a scrap at the same time. \n"
"\n"
"Pickings concerned: %(picking_names)s"
msgstr ""
"Des opérations de transfert sont en cours. Vous ne pouvez pas faire une opération de rebut en même temps. \n"
"\n"
"Transferts concernés: %(picking_names)s"

#. module: stock_safe_scrap
#: model:ir.model.fields,help:stock_safe_scrap.field_stock_scrap__in_progress_picking_ids
msgid ""
"This indicates that an operation is in progress for the product and the "
"source location."
msgstr ""
"Ceci indique qu'une opération est en cours pour le produit et "
"l'emplacement source."
80 changes: 80 additions & 0 deletions stock_safe_scrap/i18n/stock_safe_scrap.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_safe_scrap
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-23 08:27+0000\n"
"PO-Revision-Date: 2024-10-23 08:27+0000\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_safe_scrap
#: model:ir.model.fields,help:stock_safe_scrap.field_res_company__stock_safe_scrap
#: model:ir.model.fields,help:stock_safe_scrap.field_res_config_settings__stock_safe_scrap
msgid ""
"Check this if you want that scrap operations are authorized on "
"locationswhere no picking operations are in progress."
msgstr ""

#. module: stock_safe_scrap
#: model:ir.model,name:stock_safe_scrap.model_res_company
msgid "Companies"
msgstr ""

#. module: stock_safe_scrap
#: model:ir.model,name:stock_safe_scrap.model_res_config_settings
msgid "Config Settings"
msgstr ""

#. module: stock_safe_scrap
#: model_terms:ir.ui.view,arch_db:stock_safe_scrap.res_config_settings_view_form
msgid ""
"If checked, the system will prevent scrap of products if some quantities are"
" currently being picked for the same product, location, lot, owner and "
"package."
msgstr ""

#. module: stock_safe_scrap
#: model:ir.model.fields,field_description:stock_safe_scrap.field_stock_scrap__in_progress_picking_ids
msgid "In Progress Picking"
msgstr ""

#. module: stock_safe_scrap
#: model:ir.model.fields,field_description:stock_safe_scrap.field_res_company__stock_safe_scrap
#: model:ir.model.fields,field_description:stock_safe_scrap.field_res_config_settings__stock_safe_scrap
msgid "Safe Scrap Operations"
msgstr ""

#. module: stock_safe_scrap
#: model_terms:ir.ui.view,arch_db:stock_safe_scrap.res_config_settings_view_form
msgid "Safe scrap"
msgstr ""

#. module: stock_safe_scrap
#: model:ir.model,name:stock_safe_scrap.model_stock_scrap
msgid "Scrap"
msgstr ""

#. module: stock_safe_scrap
#. odoo-python
#: code:addons/stock_safe_scrap/models/stock_scrap.py:0
#, python-format
msgid ""
"Some picking operations are in progress. You cannot do a scrap at the same time. \n"
"\n"
"Pickings concerned: %(picking_names)s"
msgstr ""

#. module: stock_safe_scrap
#: model:ir.model.fields,help:stock_safe_scrap.field_stock_scrap__in_progress_picking_ids
msgid ""
"This indicates that an operation is in progress for the product and the "
"source location."
msgstr ""
1 change: 1 addition & 0 deletions stock_safe_scrap/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import res_company, res_config_settings, stock_scrap
15 changes: 15 additions & 0 deletions stock_safe_scrap/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2024 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResCompany(models.Model):

_inherit = "res.company"

stock_safe_scrap = fields.Boolean(
string="Safe Scrap Operations",
help="Check this if you want that scrap operations are authorized on locations"
"where no picking operations are in progress.",
)
14 changes: 14 additions & 0 deletions stock_safe_scrap/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResConfigSettings(models.TransientModel):

_inherit = "res.config.settings"

stock_safe_scrap = fields.Boolean(
related="company_id.stock_safe_scrap",
readonly=False,
)
Loading
Loading