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
110 changes: 110 additions & 0 deletions purchase_order_line_original_date/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=================================
Purchase Order Line Original Date
=================================

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

.. |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/license-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%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/19.0/purchase_order_line_original_date
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/purchase-workflow-19-0/purchase-workflow-19-0-purchase_order_line_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/purchase-workflow&target_branch=19.0
:alt: Try me on Runboat

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

This module adds the *Original Expected Arrival* to Purchase Order
lines. This is useful for past analysis and vendor performance reports.

In standard Odoo, once a PO is confirmed with expected arrivals on its
lines, this dates 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 original expected arrivals that can be used to
compute the real delay in the receipt from your supplier.

**Table of contents**

.. contents::
:local:

Usage
=====

1. Create a new PO and assign an expected arrival to its lines.
2. Confirm the PO.
3. Change the expected arrival of some lines.
4. Original expected arrival is kept unchanged.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-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/purchase-workflow/issues/new?body=module:%20purchase_order_line_original_date%0Aversion:%2019.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

- `SolusiAglis <https://solusiaglis.co.id>`__:

- Hudson Amadeus Leonardy

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/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/19.0/purchase_order_line_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 purchase_order_line_original_date/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions purchase_order_line_original_date/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

{
"name": "Purchase Order Line Original Date",
"summary": "adds the Original Expected Arrival to PO lines.",
"version": "19.0.1.0.0",
"category": "Purchase Management",
"maintainers": ["LoisRForgeFlow"],
"website": "https://github.com/OCA/purchase-workflow",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"license": "LGPL-3",
"installable": True,
"depends": ["purchase"],
"data": [
"views/purchase_order_line_views.xml",
"views/purchase_order_views.xml",
],
}
43 changes: 43 additions & 0 deletions purchase_order_line_original_date/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_line_original_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-08-19 16:27+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.10.4\n"

#. module: purchase_order_line_original_date
#: model:ir.model.fields,field_description:purchase_order_line_original_date.field_purchase_order__original_date_planned
#: model:ir.model.fields,field_description:purchase_order_line_original_date.field_purchase_order_line__original_date_planned
msgid "Original Expected Arrival"
msgstr "Arrivo atteso originale"

#. module: purchase_order_line_original_date
#: model:ir.model.fields,help:purchase_order_line_original_date.field_purchase_order__original_date_planned
msgid "Original Expected Arrival promised by vendor at PO confirmation."
msgstr "Arrivo atteso originale promesso dal fornitore alla conferma OA."

#. module: purchase_order_line_original_date
#: model:ir.model.fields,help:purchase_order_line_original_date.field_purchase_order_line__original_date_planned
msgid "Original expected arrival at PO confirmation."
msgstr "Arrivo atteso originale alla conferma OA."

#. module: purchase_order_line_original_date
#: model:ir.model,name:purchase_order_line_original_date.model_purchase_order
msgid "Purchase Order"
msgstr "Ordine di acquisto"

#. module: purchase_order_line_original_date
#: model:ir.model,name:purchase_order_line_original_date.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Riga ordine di acquisto"
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_line_original_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.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: purchase_order_line_original_date
#: model:ir.model.fields,field_description:purchase_order_line_original_date.field_purchase_order__original_date_planned
#: model:ir.model.fields,field_description:purchase_order_line_original_date.field_purchase_order_line__original_date_planned
msgid "Original Expected Arrival"
msgstr ""

#. module: purchase_order_line_original_date
#: model:ir.model.fields,help:purchase_order_line_original_date.field_purchase_order__original_date_planned
msgid "Original Expected Arrival promised by vendor at PO confirmation."
msgstr ""

#. module: purchase_order_line_original_date
#: model:ir.model.fields,help:purchase_order_line_original_date.field_purchase_order_line__original_date_planned
msgid "Original expected arrival at PO confirmation."
msgstr ""

#. module: purchase_order_line_original_date
#: model:ir.model,name:purchase_order_line_original_date.model_purchase_order
msgid "Purchase Order"
msgstr ""

#. module: purchase_order_line_original_date
#: model:ir.model,name:purchase_order_line_original_date.model_purchase_order_line
msgid "Purchase Order Line"
msgstr ""
2 changes: 2 additions & 0 deletions purchase_order_line_original_date/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import purchase_order_line
from . import purchase_order
34 changes: 34 additions & 0 deletions purchase_order_line_original_date/models/purchase_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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 PurchaseOrder(models.Model):
_inherit = "purchase.order"

original_date_planned = fields.Datetime(
string="Original Expected Arrival",
compute="_compute_original_date_planned",
store=True,
readonly=True,
tracking=True,
help="Original Expected Arrival promised by vendor at PO confirmation.",
)

@api.depends("order_line.original_date_planned")
def _compute_original_date_planned(self):
for order in self:
dates_list = order.order_line.filtered(
lambda x: not x.display_type and x.original_date_planned
).mapped("original_date_planned")
if dates_list:
order.original_date_planned = fields.Datetime.to_string(min(dates_list))
else:
order.original_date_planned = False

def button_confirm(self):
res = super().button_confirm()
for pol in self.mapped("order_line"):
pol.original_date_planned = pol.date_planned
return res
15 changes: 15 additions & 0 deletions purchase_order_line_original_date/models/purchase_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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 PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"

original_date_planned = fields.Datetime(
string="Original Expected Arrival",
readonly=True,
copy=False,
help="Original expected arrival at PO confirmation.",
)
3 changes: 3 additions & 0 deletions purchase_order_line_original_date/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
7 changes: 7 additions & 0 deletions purchase_order_line_original_date/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- [ForgeFlow](https://www.forgeflow.com):

> - Lois Rilo Antelo

- [SolusiAglis](https://solusiaglis.co.id):

> - Hudson Amadeus Leonardy
9 changes: 9 additions & 0 deletions purchase_order_line_original_date/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This module adds the *Original Expected Arrival* to Purchase Order lines.
This is useful for past analysis and vendor performance reports.

In standard Odoo, once a PO is confirmed with expected arrivals on its
lines, this dates 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 original expected arrivals that can be used to compute
the real delay in the receipt from your supplier.
4 changes: 4 additions & 0 deletions purchase_order_line_original_date/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1. Create a new PO and assign an expected arrival to its lines.
2. Confirm the PO.
3. Change the expected arrival of some lines.
4. Original expected arrival 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