Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d7027a3
[ADD] stock_move_disable_extra: do not split moves for excess quantities
dreispt Mar 19, 2026
41e229a
[FIX] stock_move_disable_extra: use quantity instead of qty_done on s…
dreispt Mar 20, 2026
f8f8091
[FIX] stock_move_disable_extra: return empty recordset when excess ex…
dreispt Mar 20, 2026
71e0e6c
[FIX] stock_move_disable_extra: restore missing rounding variable
dreispt Mar 20, 2026
a2392f7
[FIX] stock_move_disable_extra: create separate test setup for normal…
dreispt Mar 20, 2026
b8c9d35
[REF] stock_move_disable_extra: move normal picking type to setUp
dreispt Mar 20, 2026
09ce6d7
[REF] stock_move_disable_extra: refactor tests for readability with h…
dreispt Mar 20, 2026
f532b6e
[REF] stock_move_disable_extra: inline single-statement assertion met…
dreispt Mar 20, 2026
8870a03
[REF] stock_move_disable_extra: inline all assertion methods
dreispt Mar 20, 2026
d7bc415
[REF] stock_move_disable_extra: remove duplication by using helper me…
dreispt Mar 20, 2026
fff76f4
[REF] stock_move_disable_extra: move shared setup to setUpClass
dreispt Mar 20, 2026
51d1917
[REF] stock_move_disable_extra: create picking types using copy method
dreispt Mar 20, 2026
f756221
[REF] stock_move_disable_extra: remove setUp and use only setUpClass
dreispt Mar 20, 2026
f917a46
[REF] stock_move_disable_extra: remove redundant _create_lot helper
dreispt Mar 20, 2026
9899a6e
[REF] stock_move_disable_extra: reuse single test lot created in setU…
dreispt Mar 20, 2026
0b7150b
[FIX] stock_move_disable_extra: create separate lots for each test to…
dreispt Mar 20, 2026
4842253
[REF] stock_move_disable_extra: add _create_test_lot helper method
dreispt Mar 20, 2026
513f351
[REF] stock_move_disable_extra: use automatic lot creation via lot_name
dreispt Mar 20, 2026
78b7094
[REF] stock_move_disable_extra: remove unnecessary _create_test_lot h…
dreispt Mar 20, 2026
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
95 changes: 95 additions & 0 deletions stock_move_disable_extra/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
===============================================
Stock Move - Disable Extra for Lot Preservation
===============================================

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

.. |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/17.0/stock_move_disable_extra
: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-17-0/stock-logistics-workflow-17-0-stock_move_disable_extra
: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=17.0
:alt: Try me on Runboat

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

Adds an option on Operation Types to disable extra moves when receiving
excess quantity.

Solves the problem of losing lot/serial tracking information when
validating pickings with more quantity than demanded.

**Table of contents**

.. contents::
:local:

Usage
=====

# Usage

1. Create a receipt with Operation Type that has "Disable Extra Moves"
enabled
2. Enter lot/serial numbers for products
3. Enter actual quantity received (may exceed demand)
4. Validate the picking
5. Excess quantity is processed with same lot information
6. Check the "Excess Quantity" field on the stock move for reporting

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_move_disable_extra%0Aversion:%2017.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
-------

* Open Source Integrators

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

- Open Source Integrators <https://www.opensourceintegrators.com>

- Daniel Reis <dreis@opensourceintegrators.com>

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/17.0/stock_move_disable_extra>`_ 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 stock_move_disable_extra/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2026 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
19 changes: 19 additions & 0 deletions stock_move_disable_extra/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (C) 2026 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Stock Move - Disable Extra for Lot Preservation",
"summary": "Add option to disable extra moves to preserve lot information "
"on excess quantity",
"version": "17.0.1.0.0",
"category": "Stock",
"website": "https://github.com/OCA/stock-logistics-workflow",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["stock"],
"data": [
"views/stock_picking_type_views.xml",
"views/stock_move_views.xml",
],
"installable": True,
}
5 changes: 5 additions & 0 deletions stock_move_disable_extra/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (C) 2026 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import stock_picking_type
from . import stock_move
39 changes: 39 additions & 0 deletions stock_move_disable_extra/models/stock_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (C) 2026 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models
from odoo.tools import float_compare


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

excess_quantity = fields.Float(
help="Quantity received beyond the original demand",
copy=False,
)

def _create_extra_move(self):
"""Override to check if extra moves are disabled on the picking type.
If disabled, store excess quantity and return self without creating extra moves.
"""
# Check if extra moves are disabled for this picking type
if self.picking_id and self.picking_id.picking_type_id.disable_extra_moves:
rounding = self.product_uom.rounding
if (
float_compare(
self.quantity, self.product_uom_qty, precision_rounding=rounding
)
> 0
):
excess = self.quantity - self.product_uom_qty
self.excess_quantity = excess
# Return empty recordset to prevent extra move creation
# but excess quantity is stored on the original move
return self.browse()

# No excess quantity, return self as normal
return self

# Use the original logic if extra moves are not disabled
return super()._create_extra_move()
14 changes: 14 additions & 0 deletions stock_move_disable_extra/models/stock_picking_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (C) 2026 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


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

disable_extra_moves = fields.Boolean(
help="If checked, extra moves will not be created when receiving more quantity "
"than demanded. This preserves lot/serial information but may affect "
"push rules and backorder handling.",
)
3 changes: 3 additions & 0 deletions stock_move_disable_extra/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
9 changes: 9 additions & 0 deletions stock_move_disable_extra/readme/CONFIGURATION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
1. Go to Inventory > Configuration > Operation Types
2. Select or create an Operation Type
3. Check the "Disable Extra Moves" checkbox
4. Save

When enabled:
- No extra moves are created for excess quantity
- Lot/serial information is preserved
- Excess quantity is stored in a dedicated field
2 changes: 2 additions & 0 deletions stock_move_disable_extra/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Open Source Integrators \<<https://www.opensourceintegrators.com>\>
- Daniel Reis \<<dreis@opensourceintegrators.com>\>
5 changes: 5 additions & 0 deletions stock_move_disable_extra/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Adds an option on Operation Types to disable extra moves when receiving
excess quantity.

Solves the problem of losing lot/serial tracking information when
validating pickings with more quantity than demanded.
9 changes: 9 additions & 0 deletions stock_move_disable_extra/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
\# Usage

1. Create a receipt with Operation Type that has "Disable Extra Moves"
enabled
2. Enter lot/serial numbers for products
3. Enter actual quantity received (may exceed demand)
4. Validate the picking
5. Excess quantity is processed with same lot information
6. Check the "Excess Quantity" field on the stock move for reporting
Loading
Loading