[IMP] stock_ux: add the transfer's scheduled date on move lines - #1005
Open
mav-adhoc wants to merge 1 commit into
Open
[IMP] stock_ux: add the transfer's scheduled date on move lines#1005mav-adhoc wants to merge 1 commit into
mav-adhoc wants to merge 1 commit into
Conversation
Collaborator
There was a problem hiding this comment.
Pull request overview
Este PR busca preservar la “fecha programada” real del traspaso (picking) en el histórico de movimientos/líneas, evitando que al validar un picking las líneas terminen agrupándose por la fecha de proceso (cuando stock.move.date es sobrescrito al hacer _action_done).
Changes:
- Agrega en
stock.move.lineel campopicking_scheduled_daterelacionado apicking_id.scheduled_date. - Expone el nuevo campo como group by en la búsqueda de líneas y como columna opcional en la lista del reporte.
- Incorpora un test que valida que la fecha del picking “sobrevive” a la validación mientras que la fecha nativa ya no lo hace.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| stock_ux/models/stock_move_line.py | Nuevo campo picking_scheduled_date relacionado al scheduled del picking. |
| stock_ux/views/stock_move_line_views.xml | Agrega group-by y columna opcional para el nuevo campo en vistas de líneas. |
| stock_ux/tests/test_move_line_picking_scheduled_date.py | Test de regresión para validar el comportamiento post-validación. |
| stock_ux/tests/init.py | Incluye el nuevo archivo de tests en el paquete. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+34
to
+39
| picking_scheduled_date = fields.Datetime( | ||
| related="picking_id.scheduled_date", | ||
| string="Transfer Scheduled Date", | ||
| help="Scheduled date of the transfer. Unlike Scheduled Date, it is not replaced by the " | ||
| "processing date once the move is done.", | ||
| ) |
The native stock.move.line.scheduled_date is related to move_id.date, which stops being the scheduled date once the move is validated: _action_done overwrites it with the processing date. So in Moves History, which lists done lines, filtering or grouping by "Scheduled Date" silently uses the effective date, and it contradicts the date shown on the transfer, which does survive the validation. Odoo will not change that on 19.0, and master removed the field altogether (odoo/odoo#276163), so instead of overriding the native field this adds a new one following picking_id.scheduled_date, available as a group by and as an optional column of the report. Nothing changes for whoever uses the native field, and lines without a transfer keep behaving as before.
mav-adhoc
force-pushed
the
19.0-h-125611-mav
branch
from
August 24, 2026 16:22
c57c5fd to
33a6720
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
stock.move.line.scheduled_dateis related tomove_id.date, andstock.move.dateonly holds the scheduled date until the move is done —_action_doneoverwrites it with the processing date, as its own help states. Moves History (Inventory > Reporting) lists done lines, so filtering, grouping or sorting by "Scheduled Date" there silently uses the effective date, and it contradicts the "Scheduled Date" of the transfer, which does survive the validation (stock.picking._compute_scheduled_dateignores done moves).Steps to reproduce
Why a new field instead of fixing the native one
I proposed changing the native field upstream in odoo/odoo#283087. Odoo declined it for 19.0 to avoid changing an existing field's value mid-version, and master then removed
stock.move.line.scheduled_datealtogether (odoo/odoo#276163,90654e4c74e,datebecomes a stored related onmove_id.date). So there is no upstream fix coming to 19.0, and overriding the nativerelatedhere would change, in every database, the value people may already be grouping by — and it would resurrect a field that no longer exists in the next version.Adding a separate field keeps both properties: nothing changes for the native one, and this one survives the upgrade because it is ours.
Changes
picking_scheduled_date, related topicking_id.scheduled_date.Version
The manifest is bumped in the PR (
19.0.1.17.0), a new field plus view changes need the module to be updated on deploy — so this one merges withnobump.Internal reference: https://www.adhoc.inc/odoo/helpdesk.ticket/125611