Skip to content
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/stock_picking_putaway_recompute_cron/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,
)
95 changes: 95 additions & 0 deletions stock_picking_putaway_recompute_cron/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
====================================
Stock Picking Putaway Recompute Cron
====================================

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

.. |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/16.0/stock_picking_putaway_recompute_cron
: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-16-0/stock-logistics-workflow-16-0-stock_picking_putaway_recompute_cron
: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=16.0
:alt: Try me on Runboat

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

This module extends the functionality of stock_picking_putaway_recompute
to automate the process of recomputing putaways.

**Table of contents**

.. contents::
:local:

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

Stock movements sometimes fail to get a final destination location when
putaway rules cannot find an available or empty storage spot.

The OCA module stock_picking_putaway_recompute provides a feature to
manually trigger a putaway recomputation. This extension automates that
process by creating a scheduled job to recompute putaways periodically
and automatically, eliminating the need for manual intervention.

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

- Nicolas Delbovier [email protected] (https://www.acsone.eu/)

Other credits
-------------

The development of this module has been financially supported by:

- Acsone

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/16.0/stock_picking_putaway_recompute_cron>`_ 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_putaway_recompute_cron/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions stock_picking_putaway_recompute_cron/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Stock Picking Putaway Recompute Cron",
"summary": """Adds a cron job to recompute putaways automatically.""",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-workflow",
"depends": ["stock_picking_putaway_recompute"],
"data": [],
"demo": [],
}
11 changes: 11 additions & 0 deletions stock_picking_putaway_recompute_cron/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<odoo>
<record id="ir_cron_auto_recompute_putaways" model="ir.cron">
<field name="name">Auto Recompute Putaways for Stock Move Lines</field>
<field name="model_id" ref="stock.model_stock_move_line" />
<field name="state">code</field>
<field name="code">model.cron_auto_recompute_putaways()</field>
<field name="interval_number">5</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
</record>
</odoo>
1 change: 1 addition & 0 deletions stock_picking_putaway_recompute_cron/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_move_line
35 changes: 35 additions & 0 deletions stock_picking_putaway_recompute_cron/models/stock_move_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, models


class StockMoveLine(models.Model):
_inherit = "stock.move.line"

@api.model
def _get_putaway_recompute_domain(self):
"""
Returns the domain to filter all stock move lines that require
a putaway recomputation.
"""
domain = [
("state", "not in", ("done", "cancel")),
("can_recompute_putaways", "=", True),
("qty_done", "=", 0),
]
return domain

@api.model
def cron_auto_recompute_putaways(self):
"""
Finds all stock move lines that are candidates for putaway recomputation
and trigger putaway recomputation on them.
"""

lines_to_recompute = self.search(self._get_putaway_recompute_domain())

if lines_to_recompute:
lines_to_recompute.action_recompute_putaways()

return True
3 changes: 3 additions & 0 deletions stock_picking_putaway_recompute_cron/readme/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Stock movements sometimes fail to get a final destination location when putaway rules cannot find an available or empty storage spot.

The OCA module stock_picking_putaway_recompute provides a feature to manually trigger a putaway recomputation. This extension automates that process by creating a scheduled job to recompute putaways periodically and automatically, eliminating the need for manual intervention.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Nicolas Delbovier <[email protected]> (https://www.acsone.eu/)
3 changes: 3 additions & 0 deletions stock_picking_putaway_recompute_cron/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The development of this module has been financially supported by:

- Acsone
1 change: 1 addition & 0 deletions stock_picking_putaway_recompute_cron/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module extends the functionality of stock_picking_putaway_recompute to automate the process of recomputing putaways.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading