Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2db4b13
[8.0][ADD] sale_delivery_split_date module (#620)
tafaRU Apr 13, 2018
a2834a7
[MIG] sale_delivery_split_date: Migration to 10.0
tafaRU May 22, 2018
bc2cf8d
[FIX] sale_delivery_split_date: fix incompatible modules urls in READ…
tafaRU Jun 19, 2018
3fc57bd
[MIG] sale_delivery_split_date: Migration to 12.0
SimoRubi Aug 31, 2020
1827026
Added translation using Weblate (Catalan)
danimv5 Mar 10, 2021
c38f469
Added translation using Weblate (Spanish)
danimv5 Mar 10, 2021
7601e13
Added translation using Weblate (Portuguese (Portugal))
educasilva Apr 21, 2021
30efbb1
[IMP] sale_delivery_split_date: black, isort, prettier
fredzamoabg Aug 5, 2021
c89afcc
[MIG] sale_delivery_split_date: Migration to 14.0
fredzamoabg Jan 18, 2022
0b5584e
Update translation files
weblate Dec 28, 2022
63db4ec
[MIG] sale_delivery_split_date: Migration to 15.0
yankinmax Mar 2, 2023
8c8d382
[MIG] sale_delivery_split_date: Migration to 16.0
Mar 7, 2023
5fa6434
Update translation files
weblate Nov 17, 2023
5d2a45a
Translated using Weblate (Italian)
mymage Nov 21, 2023
c83337d
[IMP] sale_delivery_split_date: use security lead time
LauraCForgeFlow Aug 13, 2024
62f199d
[IMP] sale_delivery_split_date: pre-commit stuff
siemenv Feb 19, 2024
d2e01d0
[MIG] sale_delivery_split_date: Migration to 17.0
siemenv Feb 19, 2024
3e0015a
[UPD] Update sale_delivery_split_date.pot
Nov 18, 2024
90442aa
[BOT] post-merge updates
OCA-git-bot Nov 18, 2024
f8d1425
[IMP] sale_delivery_split_date: pre-commit auto fixes
ArnauCForgeFlow Feb 26, 2025
0833027
[MIG] sale_delivery_split_date: Migration to 18.0
ArnauCForgeFlow Feb 26, 2025
9aa43bc
[UPD] Update sale_delivery_split_date.pot
Mar 30, 2025
f448433
[BOT] post-merge updates
OCA-git-bot Mar 30, 2025
b251c21
[MIG] sale_delivery_split_date: Migrate to 19.0
Oct 14, 2025
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
99 changes: 99 additions & 0 deletions sale_delivery_split_date/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

========================
Sale Delivery Split Date
========================

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

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

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

When this module is installed, each sale order you confirm will generate
one delivery order per requested date indicated in the sale order lines.

Furthermore, the delivery orders can be searched by selecting the
scheduled date, which is now displayed in the delivery tree view.

**Table of contents**

.. contents::
:local:

Known issues / Roadmap
======================

- Incompatible with
`sale_procurement_group_by_commitment_date <https://github.com/OCA/sale-workflow/tree/12.0/sale_procurement_group_by_commitment_date>`__

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

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

* Agile Business Group

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

- Alex Comba <alex.comba@agilebg.com> (https://www.agilebg.com/)
- Carmen Rondon Regalado <crondon@archeti.com>
(https://odoo.archeti.com/)
- Tatiana Deribina <tatiana.deribina@sprintit.fi>

Other credits
-------------

The migration of this module from 18.0 to 19.0 was financially supported
by SprintIT Ltd.

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/sale-workflow <https://github.com/OCA/sale-workflow/tree/19.0/sale_delivery_split_date>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions sale_delivery_split_date/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
20 changes: 20 additions & 0 deletions sale_delivery_split_date/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2018 Alex Comba - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Sale Delivery Split Date",
"version": "19.0.1.0.0",
"summary": "Sale Deliveries split by date",
"category": "Sales Management",
"license": "AGPL-3",
"author": "Agile Business Group, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sale-workflow",
"depends": [
"sale_order_line_date",
"sale_stock_reference_by_line", # ex. sale_procurement_group_by_line
],
"data": [
"views/stock_picking.xml",
],
"installable": True,
}
36 changes: 36 additions & 0 deletions sale_delivery_split_date/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_delivery_split_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-03-10 10:45+0000\n"
"Last-Translator: Daniel Martinez Vila <daniel.martinez@qubiq.es>\n"
"Language-Team: none\n"
"Language: ca\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 4.3.2\n"

#. module: sale_delivery_split_date
#: model:ir.model,name:sale_delivery_split_date.model_sale_order_line
msgid "Sales Order Line"
msgstr "Línia de comandes de vendes"

#. module: sale_delivery_split_date
#: model_terms:ir.ui.view,arch_db:sale_delivery_split_date.view_picking_internal_search
msgid "Scheduled Date"
msgstr "Data prevista"

#~ msgid "Sale Order"
#~ msgstr "Comanda de venda"

#~ msgid "Scheduled Date (for filter purpose only)"
#~ msgstr "Data programada (només per al filtre)"

#~ msgid "Transfer"
#~ msgstr "Transferència"
36 changes: 36 additions & 0 deletions sale_delivery_split_date/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_delivery_split_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-03-10 10:45+0000\n"
"Last-Translator: Daniel Martinez Vila <daniel.martinez@qubiq.es>\n"
"Language-Team: none\n"
"Language: es\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 4.3.2\n"

#. module: sale_delivery_split_date
#: model:ir.model,name:sale_delivery_split_date.model_sale_order_line
msgid "Sales Order Line"
msgstr "Línea de pedido de venta"

#. module: sale_delivery_split_date
#: model_terms:ir.ui.view,arch_db:sale_delivery_split_date.view_picking_internal_search
msgid "Scheduled Date"
msgstr "Fecha prevista"

#~ msgid "Sale Order"
#~ msgstr "Pedido de venta"

#~ msgid "Scheduled Date (for filter purpose only)"
#~ msgstr "Fecha programada (solo para fines de filtrado)"

#~ msgid "Transfer"
#~ msgstr "Transferir"
37 changes: 37 additions & 0 deletions sale_delivery_split_date/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_delivery_split_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-31 14:57+0000\n"
"PO-Revision-Date: 2024-01-25 15:34+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: \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 4.17\n"

#. module: sale_delivery_split_date
#: model:ir.model,name:sale_delivery_split_date.model_sale_order_line
msgid "Sales Order Line"
msgstr "Riga ordine di vendita"

#. module: sale_delivery_split_date
#: model_terms:ir.ui.view,arch_db:sale_delivery_split_date.view_picking_internal_search
msgid "Scheduled Date"
msgstr "Data schedulata"

#~ msgid "Sale Order"
#~ msgstr "Ordine di vendita"

#~ msgid "Scheduled Date (for filter purpose only)"
#~ msgstr "Data pianificata (solo per i filtri)"

#~ msgid "Transfer"
#~ msgstr "Trasferimento"
36 changes: 36 additions & 0 deletions sale_delivery_split_date/i18n/pt_PT.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_delivery_split_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-04-21 20:47+0000\n"
"Last-Translator: educasilva <eduardo.silva@exo.pt>\n"
"Language-Team: none\n"
"Language: pt_PT\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 4.3.2\n"

#. module: sale_delivery_split_date
#: model:ir.model,name:sale_delivery_split_date.model_sale_order_line
msgid "Sales Order Line"
msgstr "Linha de encomendas de venda"

#. module: sale_delivery_split_date
#: model_terms:ir.ui.view,arch_db:sale_delivery_split_date.view_picking_internal_search
msgid "Scheduled Date"
msgstr "Data programada"

#~ msgid "Sale Order"
#~ msgstr "Ordem de venda"

#~ msgid "Scheduled Date (for filter purpose only)"
#~ msgstr "Data programada (apenas para fins de filtragem)"

#~ msgid "Transfer"
#~ msgstr "Transferir"
24 changes: 24 additions & 0 deletions sale_delivery_split_date/i18n/sale_delivery_split_date.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_delivery_split_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: sale_delivery_split_date
#: model:ir.model,name:sale_delivery_split_date.model_sale_order_line
msgid "Sales Order Line"
msgstr ""

#. module: sale_delivery_split_date
#: model_terms:ir.ui.view,arch_db:sale_delivery_split_date.view_picking_internal_search
msgid "Scheduled Date"
msgstr ""
3 changes: 3 additions & 0 deletions sale_delivery_split_date/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import sale_order_line
52 changes: 52 additions & 0 deletions sale_delivery_split_date/models/sale_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2018 Alex Comba - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from datetime import timedelta

from odoo import models
from odoo.tools import format_date


class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

def _prepare_reference_vals(self):
vals = super()._prepare_reference_vals()
if self._get_stock_reference_key()[0] == 24:
if self.commitment_date:
comm_date = self._get_security_lead_time_commitment_date()
vals["name"] = (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's just me, but I found it was more readable before.
Why this change? it doesn't seem like an useful diff

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my understanding, usage of "+=" for strings is considered a bad practice, bacause it might lead to unxpected errors when one of arguments is not a string, f.e. "False" as it might be with Sale Line Name

f"{vals['name']}/{format_date(self.env, comm_date.date())}"
)
return vals

def _get_stock_reference_key(self):
"""Return a key with priority to be used to regroup lines in multiple
procurement groups
"""
priority = 24
key = super()._get_stock_reference_key()
# Check priority
if key[0] < priority:
if self.commitment_date:
# group by date instead of datetime
comm_date = self._get_security_lead_time_commitment_date()
key = (priority, comm_date.date())
return key

def _prepare_procurement_values(self):
vals = super()._prepare_procurement_values()
line_com_date = self.commitment_date
if line_com_date:
comm_date = self._get_security_lead_time_commitment_date()
vals.update(
date_planned=comm_date,
date_deadline=line_com_date,
)
return vals

def _get_security_lead_time_commitment_date(self):
"""Return the commitment date with security lead time"""
return self.commitment_date - timedelta(
days=self.order_id.company_id.security_lead
)
3 changes: 3 additions & 0 deletions sale_delivery_split_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"
4 changes: 4 additions & 0 deletions sale_delivery_split_date/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Alex Comba \<<alex.comba@agilebg.com>\> (<https://www.agilebg.com/>)
- Carmen Rondon Regalado \<<crondon@archeti.com>\>
(<https://odoo.archeti.com/>)
- Tatiana Deribina \<<tatiana.deribina@sprintit.fi>\>
2 changes: 2 additions & 0 deletions sale_delivery_split_date/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The migration of this module from 18.0 to 19.0 was financially supported
by SprintIT Ltd.
5 changes: 5 additions & 0 deletions sale_delivery_split_date/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
When this module is installed, each sale order you confirm will generate
one delivery order per requested date indicated in the sale order lines.

Furthermore, the delivery orders can be searched by selecting the
scheduled date, which is now displayed in the delivery tree view.
2 changes: 2 additions & 0 deletions sale_delivery_split_date/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Incompatible with
[sale_procurement_group_by_commitment_date](https://github.com/OCA/sale-workflow/tree/12.0/sale_procurement_group_by_commitment_date)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading