Skip to content

Commit

Permalink
[IMP] stock_release_channel_process_end_time: Rename configuration pa…
Browse files Browse the repository at this point in the history
…rameter
  • Loading branch information
rousseldenis committed Sep 28, 2023
1 parent da2138b commit 049175d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright 2023 Trobz
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models, SUPERUSER_ID, _
from odoo.exceptions import UserError
from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'

update_scheduled_date = fields.Boolean(
help="Will update scheduled date of picking based on process end date(time).",
config_parameter='stock_release_channel_process_end_time.update_scheduled_date'
)
_inherit = "res.config.settings"

stock_release_use_channel_end_date = fields.Boolean(
help="Will update scheduled date of picking based on process end date "
"instead of release date + delay.",
config_parameter="stock_release_channel_process_end_time."
"stock_release_use_channel_end_date",
)
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ def _after_release_set_expected_date(self):
enabled_update_scheduled_date = bool(
self.env["ir.config_parameter"]
.sudo()
.get_param("stock_release_channel_process_end_time.update_scheduled_date")
.get_param(
"stock_release_channel_process_end_time.stock_release_use_channel_end_date"
)
)
res = super()._after_release_set_expected_date()
for rec in self:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def test_channel_end_date_manual(self):
@freeze_time("2023-01-27 10:00:00")
def test_picking_scheduled_date(self):
self.env["ir.config_parameter"].sudo().set_param(
"stock_release_channel_process_end_time.update_scheduled_date", True
"stock_release_channel_process_end_time.stock_release_use_channel_end_date",
True,
)
# Remove existing jobs as some already exists to assign pickings to channel
jobs_before = self.env["queue.job"].search([])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
<field name="inherit_id" ref="stock.res_config_settings_view_form" />
<field name="arch" type="xml">
<div id="annual_inventory_date" position="after">
<div class="col-12 col-lg-6 o_setting_box"
id="update_scheduled_date" groups='stock.group_stock_manager'>
<div
class="col-12 col-lg-6 o_setting_box"
id="stock_release_use_channel_end_date"
groups='stock.group_stock_manager'
>
<div class="o_setting_left_pane">
<field name="update_scheduled_date"/>
<field name="stock_release_use_channel_end_date" />
</div>
<div class="o_setting_right_pane">
<label for="update_scheduled_date"/>
<label for="stock_release_use_channel_end_date" />
<div class="text-muted" id="update_scheduled_date">
Allow to update scheduled date follow process end date/time on stock release channel.
</div>
Expand Down

0 comments on commit 049175d

Please sign in to comment.