Skip to content
Draft
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
91 changes: 91 additions & 0 deletions stock_picking_batch_creation_group_reservation_rate/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
===================================================
Stock Picking Batch Creation Group Reservation Rate
===================================================

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

.. |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/18.0/stock_picking_batch_creation_group_reservation_rate
: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-18-0/stock-logistics-workflow-18-0-stock_picking_batch_creation_group_reservation_rate
: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=18.0
:alt: Try me on Runboat

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

This module allows to select a reservation rate range in criteria for
batch creation

**Table of contents**

.. contents::
:local:

Usage
=====

- Go to Inventory > Operations > Jobs > Make Picking Batch
- Fill in a reservation rate range you want to filter pickings in batch

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_batch_creation_group_reservation_rate%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
-------

* ACSONE SA/NV

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

- Denis Roussel denis.roussel@acsone.eu

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-workflow <https://github.com/OCA/stock-logistics-workflow/tree/18.0/stock_picking_batch_creation_group_reservation_rate>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models, wizards
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Stock Picking Batch Creation Group Reservation Rate",
"summary": """This module allows to select a reservation rate range
in criteria for batch creation""",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"maintainers": ["rousseldenis"],
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-workflow",
"depends": ["stock_picking_batch_creation", "stock_picking_group_reservation_rate"],
"data": ["views/picking_batch_abstract.xml"],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import picking_batch_abstract
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError


class MakePickingBatchAbstract(models.AbstractModel):
_inherit = "make.picking.batch.abstract"

group_reservation_rate = fields.Boolean(
help="Check this if you want to use reservation rate range"
)
group_reservation_rate_min = fields.Float(default=0.0)
group_reservation_rate_max = fields.Float(default=100.0)

additional_group_reservation_rate = fields.Boolean(
help="Check this if you want to use reservation rate range"
)
additional_group_reservation_rate_min = fields.Float(default=0.0)
additional_group_reservation_rate_max = fields.Float(default=100.0)

@api.constrains("group_reservation_rate_max", "group_reservation_rate_min")
def _check_group_reservation_rate(self):
for batch in self:
if batch.group_reservation_rate and (
batch.group_reservation_rate_max < batch.group_reservation_rate_min
):
raise ValidationError(
_(
"The maximum reservation rate should not be below the minimum "
"reservation rate!"
)
)
if (
batch.group_reservation_rate_min < 0
or batch.group_reservation_rate_min > 100
):
raise ValidationError(
_("The minimum reservation rate should be between 0 and 100!")
)
if (
batch.group_reservation_rate_max < 0
or batch.group_reservation_rate_max > 100
):
raise ValidationError(
_("The maximum reservation rate should be between 0 and 100!")
)

@api.constrains(
"additional_group_reservation_rate_max", "additional_group_reservation_rate_min"
)
def _check_additional_group_reservation_rate(self):
for batch in self:
if batch.additional_group_reservation_rate and (
batch.additional_group_reservation_rate_max
< batch.additional_group_reservation_rate_min
):
raise ValidationError(
_(
"The maximum additional reservation rate should not be below "
"the minimum additional reservation rate!"
)
)
if (
batch.additional_group_reservation_rate_min < 0
or batch.additional_group_reservation_rate_min > 100
):
raise ValidationError(
_(
"The minimum additional reservation rate should be between "
"0 and 100!"
)
)
if (
batch.additional_group_reservation_rate_max < 0
or batch.additional_group_reservation_rate_max > 100
):
raise ValidationError(
_(
"The maximum additional reservation rate should be between "
"0 and 100!"
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Denis Roussel <denis.roussel@acsone.eu>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allows to select a reservation rate range in criteria for batch creation
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Go to Inventory > Operations > Jobs > Make Picking Batch
- Fill in a reservation rate range you want to filter pickings in batch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading