Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13.0] Add module sale_cutoff_time_weekday_delivery #1107

3 changes: 3 additions & 0 deletions sale_partner_cutoff_delivery_window/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
from . import models
16 changes: 16 additions & 0 deletions sale_partner_cutoff_delivery_window/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
{
"name": "Sale Partner Cutoff Delivery Window",
"summary": "Schedule delivery orders according to cutoff and window preferences",
"version": "13.0.1.0.0",
"development_status": "Alpha",
"category": "Warehouse Management",
"website": "https://github.com/OCA/sale-workflow",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["sale_cutoff_time_delivery", "sale_partner_delivery_window"],
"auto_install": True,
}
1 change: 1 addition & 0 deletions sale_partner_cutoff_delivery_window/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale_order_line
25 changes: 25 additions & 0 deletions sale_partner_cutoff_delivery_window/models/sale_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
from odoo import models


class SaleOrderLine(models.Model):

_inherit = "sale.order.line"

def _prepare_procurement_values_time_windows(self, date_planned):
new_date_planned = super()._prepare_procurement_values_time_windows(
date_planned
)
if new_date_planned:
# if we had a new datetime proposed by a delivery time window,
# apply the warehouse/partner cutoff time
cutoff_datetime = self._prepare_procurement_values_cutoff_time(
new_date_planned,
# the correct day has already been computed, only change
# the cut-off time
keep_same_day=True,
)
if cutoff_datetime:
return cutoff_datetime
return new_date_planned
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Akim Juillerat <akim.juillerat@camptocamp.com>
3 changes: 3 additions & 0 deletions sale_partner_cutoff_delivery_window/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module adds some unittests to ensure Method Resolution Order of
`sale.order.line._prepare_procurement_values` for modules
`sale_cutoff_time_delivery` and `sale_partner_delivery_window` is correct.
1 change: 1 addition & 0 deletions sale_partner_cutoff_delivery_window/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_cutoff_delivery_window
Loading