Stock Picking Compute Delivery Date

stock_picking_compute_delivery_date
REPOSITORY
REPOSITORYOCA/stock-logistics-workflow
GIT
GIThttps://github.com/OCA/stock-logistics-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/stock-logistics-workflow/tree/10.0/stock_picking_compute_delivery_date
VERSION
VERSION 1.1.0
CATEGORY
CATEGORYWarehouse Management
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Camptocamp
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Camptocamp
COMMITTERS
COMMITTERSPedro M. Baeza, Stéphane Bidoul (ACSONE)
WEBSITE
WEBSITEhttp://camptocamp.com
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:19:58
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale_stock
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web_kanban
    - web
    - bus
    - web_tour
    - account
    - product
    - decimal_precision
    - report
    - analytic
    - web_planner
    - procurement
    - stock_account
    - stock
    - barcodes
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
compute_all_delivery_dates_form compute.all.delivery.dates.wizard form New
compute_delivery_date_by_product_form compute.delivery.date.by.product.wizard form New
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • do_compute(self, cr, uid, ids, context=None)
    Delegate the picking to compute delivery dates for all products. If use_new_cursor is in the context, pass it as a parameter.

New fields (0)

No new fields.

Public methods (1)
  • do_compute(self, cr, uid, ids, context=None)

New fields (0)

No new fields.

Public methods (4)
  • compute_all_delivery_dates(self, cr, uid, use_new_cursor=True, context=None)
    Loop on all products that have moves, and process them one by one. This can take a few seconds per product, so the transaction can be very long-lived and easily interrupted. To avoid that, we create a new cursor that is committed for every product. The use_new_cursor can be used in cases where multiple transactions are harmful, like for automated testing.
  • compute_delivery_dates(self, product)
    @api.model
  • compute_mto_delivery_dates(self, cr, uid, product, context=None)
  • compute_mts_delivery_dates(self, cr, uid, product, context=None)
REPOSITORY
REPOSITORYOCA/stock-logistics-workflow
GIT
GIThttps://github.com/OCA/stock-logistics-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/stock-logistics-workflow/tree/9.0/stock_picking_compute_delivery_date
VERSION
VERSION 1.1.0
CATEGORY
CATEGORYWarehouse Management
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Camptocamp
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Camptocamp
COMMITTERS
COMMITTERSPedro M. Baeza, Stéphane Bidoul (ACSONE)
WEBSITE
WEBSITEhttp://camptocamp.com
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:15:21
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale_stock
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web_kanban
    - web
    - bus
    - account
    - product
    - decimal_precision
    - report
    - analytic
    - web_tip
    - web_planner
    - procurement
    - stock_account
    - stock
    - barcodes
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
compute_all_delivery_dates_form compute.all.delivery.dates.wizard form New
compute_delivery_date_by_product_form compute.delivery.date.by.product.wizard form New
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • do_compute(self, cr, uid, ids, context=None)
    Delegate the picking to compute delivery dates for all products. If use_new_cursor is in the context, pass it as a parameter.

New fields (0)

No new fields.

Public methods (1)
  • do_compute(self, cr, uid, ids, context=None)

New fields (0)

No new fields.

Public methods (4)
  • compute_all_delivery_dates(self, cr, uid, use_new_cursor=True, context=None)
    Loop on all products that have moves, and process them one by one. This can take a few seconds per product, so the transaction can be very long-lived and easily interrupted. To avoid that, we create a new cursor that is committed for every product. The use_new_cursor can be used in cases where multiple transactions are harmful, like for automated testing.
  • compute_delivery_dates(self, product)
    @api.model
  • compute_mto_delivery_dates(self, cr, uid, product, context=None)
  • compute_mts_delivery_dates(self, cr, uid, product, context=None)
REPOSITORY
REPOSITORYOCA/stock-logistics-workflow
GIT
GIThttps://github.com/OCA/stock-logistics-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/stock-logistics-workflow/tree/8.0/stock_picking_compute_delivery_date
VERSION
VERSION 1.1.0
CATEGORY
CATEGORYWarehouse Management
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Camptocamp
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Camptocamp
COMMITTERS
COMMITTERSStéphane Bidoul, Leonardo Pistone, Stéphane Bidoul (ACSONE), OCA Transbot, oca-travis, Weblate, OCA-git-bot
WEBSITE
WEBSITEhttp://camptocamp.com
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:11:24
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale_stock
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web_kanban
    - web
    - web_kanban_sparkline
    - account_voucher
    - account
    - product
    - decimal_precision
    - report
    - analytic
    - board
    - edi
    - email_template
    - procurement
    - stock_account
    - stock
    - web_kanban_gauge
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
compute_all_delivery_dates_form compute.all.delivery.dates.wizard form New
compute_delivery_date_by_product_form compute.delivery.date.by.product.wizard form New
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • do_compute(self, cr, uid, ids, context=None)
    Delegate the picking to compute delivery dates for all products. If use_new_cursor is in the context, pass it as a parameter.

New fields (0)

No new fields.

Public methods (1)
  • do_compute(self, cr, uid, ids, context=None)

New fields (0)

No new fields.

Public methods (4)
  • compute_all_delivery_dates(self, cr, uid, use_new_cursor=True, context=None)
    Loop on all products that have moves, and process them one by one. This can take a few seconds per product, so the transaction can be very long-lived and easily interrupted. To avoid that, we create a new cursor that is committed for every product. The use_new_cursor can be used in cases where multiple transactions are harmful, like for automated testing.
  • compute_delivery_dates(self, product)
    @api.model
  • compute_mto_delivery_dates(self, cr, uid, product, context=None)
  • compute_mts_delivery_dates(self, cr, uid, product, context=None)
REPOSITORY
REPOSITORYOCA/stock-logistics-workflow
GIT
GIThttps://github.com/OCA/stock-logistics-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/stock-logistics-workflow/tree/7.0/stock_picking_compute_delivery_date
VERSION
VERSION 1.0
CATEGORY
CATEGORYWarehouse Management
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Camptocamp
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Camptocamp
COMMITTERS
COMMITTERSAlexandre Fayolle, Matthieu Dietrich, Leonardo Pistone, Rudolf Schnapka
WEBSITE
WEBSITEhttp://camptocamp.com
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:07:14
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale_stock
    - sale
    - account_voucher
    - account
    - base_setup
    - base
    - web_kanban
    - web
    - product
    - process
    - decimal_precision
    - mail
    - analytic
    - board
    - edi
    - email_template
    - stock
    - procurement
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
Stock Picking Compute Delivery Date
===================================

This module allows to recompute the delivery dates of outgoing Moves based on
the dates of incoming Moves for the same product. That means that for every
outgoing move we update the expected date based on our best guess based on the
information we have.

The method we use is different for Make to Order and Make to Stock products.

In all cases, at the end we add the security margin defined for the company.

Make to Order
=============
For every outgoing Move the system finds the corresponding incoming Move. That
is identified by the 'move_dest_id' (Destination Move) field. In the usual
case where the incoming Move is generated by a Purchase Order that in turn is
generated by the Scheduler, that field is filled automatically by OpenERP.
For that module we use only that field, so we do not need a dependency on the
Purchase module.

The date of the incoming Move, plus the Security Days defined in the Company,
is then written in the outcoming Move. The existing expected date is not used
and is overwritten.

Make to Stock
=============
For Make To Stock products, the logic is more complex.

First, for each product, the system takes the list of outgoing Moves ordered
by creation date, and the list of incoming Moves ordered by expected date.

It then loops over the outgoing Moves, and for each one, it tries to find at
what time we will have enough stock to make the delivery. That information is
based on the current stock, and on the day when we expect to receive
deliveries of the same product.

If incoming Moves run out, we stop processing the product and leave any
remaining outgoing Moves untouched. We may decide to change that logic later.

User Interface
==============
The process can be run in three ways:

* Select a few lines from the Products tree view, and from "More" click
  "Compute delivery dates for all products".
* Click Warehouse / Products / Compute all delivery dates.
* A Scheduled action is provided, initially disabled.

Possible future improvements
============================
* Behave differently when incoming Moves run out
* Use the Priority field to decide which outgoing Moves to process first (now
  only the expected date is used)

    

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
compute_all_delivery_dates_form compute.all.delivery.dates.wizard form New
compute_delivery_date_by_product_form compute.delivery.date.by.product.wizard form New
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • do_compute(self, cr, uid, ids, context=None)
    Delegate the picking to compute delivery dates for all products. If use_new_cursor is in the context, pass it as a parameter.

New fields (0)

No new fields.

Public methods (1)
  • do_compute(self, cr, uid, ids, context=None)

New fields (0)

No new fields.

Public methods (5)
  • compute_all_delivery_dates(self, cr, uid, use_new_cursor=True, context=None)
    Loop on all products that have moves, and process them one by one. This can take a few seconds per product, so the transaction can be very long-lived and easily interrupted. To avoid that, we create a new cursor that is committed for every product. The use_new_cursor can be used in cases where multiple transactions are harmful, like for automated testing.
  • compute_delivery_dates(self, cr, uid, product, context=None)
  • compute_mto_delivery_dates(self, cr, uid, product, context=None)
  • compute_mts_delivery_dates(self, cr, uid, product, context=None)
  • picking_notify(self, cr, uid, messages, context=None)