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_move_original_date/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,
)
101 changes: 101 additions & 0 deletions stock_move_original_date/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
==================================
Stock Move Original Scheduled Date
==================================

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

.. |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-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-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_move_original_date
: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_move_original_date
: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 adds the *Original Date Scheduled* to stock moves. This is useful for
past analysis and warehouse performance reports.

In standard Odoo, once a transfer is confirmed with an scheduled date, this date
can still change to reflect changes in the planning (e.g. you receive a
notification from your supplier that goods will arrive a couple of days later).
In such situation you lost precious information of the originally planned date
that can be used to compute the real delay in the receipt from your supplier.

**Table of contents**

.. contents::
:local:

Usage
=====

#. Create a new transfer and assign an scheduled date.
#. Mark the transfer as to-do.
#. Change the scheduled date.
#. Original scheduled date is kept unchanged.

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_original_date%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
~~~~~~~

* ForgeFlow

Contributors
~~~~~~~~~~~~

* `ForgeFlow <https://www.forgeflow.com>`_:

* Lois Rilo Antelo

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

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

|maintainer-LoisRForgeFlow|

This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_move_original_date>`_ 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_move_original_date/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions stock_move_original_date/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

{
"name": "Stock Move Original Scheduled Date",
"summary": "adds the Original Date Scheduled to stock moves.",
"version": "16.0.1.0.0",
"category": "Warehouse Management",
"maintainers": ["LoisRForgeFlow"],
"website": "https://github.com/OCA/stock-logistics-workflow",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"license": "LGPL-3",
"installable": True,
"depends": ["stock"],
"data": ["views/stock_move_views.xml", "views/stock_picking_views.xml"],
}
48 changes: 48 additions & 0 deletions stock_move_original_date/i18n/ja.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_move_original_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-03-10 05:19+0000\n"
"PO-Revision-Date: 2026-03-10 05:19+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_move_original_date
#: model:ir.model.fields,field_description:stock_move_original_date.field_stock_move__original_date
msgid "Original Date Scheduled"
msgstr "当初計画日"

#. module: stock_move_original_date
#: model:ir.model.fields,field_description:stock_move_original_date.field_stock_picking__original_scheduled_date
msgid "Original Scheduled Date"
msgstr "当初計画日"

#. module: stock_move_original_date
#: model:ir.model.fields,help:stock_move_original_date.field_stock_picking__original_scheduled_date
msgid ""
"Original Scheduled date for the first part of the shipment to be processed "
"at transfer confirmation."
msgstr "出荷の最初の部分が処理される当初の予定日時。"

#. module: stock_move_original_date
#: model:ir.model.fields,help:stock_move_original_date.field_stock_move__original_date
msgid "Original Scheduled date on the confirmation of the stock move."
msgstr "在庫移動の確認された時点での当初の予定日時。"

#. module: stock_move_original_date
#: model:ir.model,name:stock_move_original_date.model_stock_move
msgid "Stock Move"
msgstr "在庫移動"

#. module: stock_move_original_date
#: model:ir.model,name:stock_move_original_date.model_stock_picking
msgid "Transfer"
msgstr "運送"
46 changes: 46 additions & 0 deletions stock_move_original_date/i18n/stock_move_original_date.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_move_original_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \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_move_original_date
#: model:ir.model.fields,field_description:stock_move_original_date.field_stock_move__original_date
msgid "Original Date Scheduled"
msgstr ""

#. module: stock_move_original_date
#: model:ir.model.fields,field_description:stock_move_original_date.field_stock_picking__original_scheduled_date
msgid "Original Scheduled Date"
msgstr ""

#. module: stock_move_original_date
#: model:ir.model.fields,help:stock_move_original_date.field_stock_picking__original_scheduled_date
msgid ""
"Original Scheduled date for the first part of the shipment to be processed "
"at transfer confirmation."
msgstr ""

#. module: stock_move_original_date
#: model:ir.model.fields,help:stock_move_original_date.field_stock_move__original_date
msgid "Original Scheduled date on the confirmation of the stock move."
msgstr ""

#. module: stock_move_original_date
#: model:ir.model,name:stock_move_original_date.model_stock_move
msgid "Stock Move"
msgstr ""

#. module: stock_move_original_date
#: model:ir.model,name:stock_move_original_date.model_stock_picking
msgid "Transfer"
msgstr ""
2 changes: 2 additions & 0 deletions stock_move_original_date/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import stock_move
from . import stock_picking
21 changes: 21 additions & 0 deletions stock_move_original_date/models/stock_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from odoo import fields, models


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

original_date = fields.Datetime(
string="Original Date Scheduled",
readonly=True,
copy=False,
help="Original Scheduled date on the confirmation of the stock move.",
)

def _action_confirm(self, merge=True, merge_into=False):
moves = super()._action_confirm(merge=merge, merge_into=merge_into)
for move in moves:
move.original_date = move.date
return moves
32 changes: 32 additions & 0 deletions stock_move_original_date/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from odoo import api, fields, models


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

original_scheduled_date = fields.Datetime(
compute="_compute_original_scheduled_date",
store=True,
readonly=True,
tracking=True,
help="Original Scheduled date for the first part of the "
"shipment to be processed at transfer confirmation.",
)

@api.depends("move_ids.state", "move_ids.original_date", "move_type")
def _compute_original_scheduled_date(self):
for picking in self:
raw_moves_dates = picking.move_ids.filtered(
lambda move: move.state != "cancel"
).mapped("original_date")
moves_dates = []
for md in raw_moves_dates:
if md:
moves_dates.append(md)
if picking.move_type == "direct":
picking.original_scheduled_date = moves_dates and min(moves_dates)
else:
picking.original_scheduled_date = moves_dates and max(moves_dates)
3 changes: 3 additions & 0 deletions stock_move_original_date/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `ForgeFlow <https://www.forgeflow.com>`_:

* Lois Rilo Antelo
8 changes: 8 additions & 0 deletions stock_move_original_date/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This module adds the *Original Date Scheduled* to stock moves. This is useful for
past analysis and warehouse performance reports.

In standard Odoo, once a transfer is confirmed with an scheduled date, this date
can still change to reflect changes in the planning (e.g. you receive a
notification from your supplier that goods will arrive a couple of days later).
In such situation you lost precious information of the originally planned date
that can be used to compute the real delay in the receipt from your supplier.
4 changes: 4 additions & 0 deletions stock_move_original_date/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#. Create a new transfer and assign an scheduled date.
#. Mark the transfer as to-do.
#. Change the scheduled date.
#. Original scheduled date is kept unchanged.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading