Skip to content

Commit

Permalink
fixup! improve fields' help messages
Browse files Browse the repository at this point in the history
  • Loading branch information
SilvioC2C committed Apr 17, 2024
1 parent 5dd86b5 commit 7979341
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
12 changes: 9 additions & 3 deletions stock_warehouse_calendar_orderpoint/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ class ResCompany(models.Model):
orderpoint_calendar_id = fields.Many2one(
comodel_name="resource.calendar",
string="Reordering Calendar",
help="Calendar used to compute the lead date of reordering rules",
help="Calendar used to compute the lead date of reordering rules\n"
"This value will be used as default value for new warehouses linked to this"
" company",
)
orderpoint_on_workday = fields.Boolean(
string="Schedule the lead date on workday only",
help="Postpone the lead date to the first available workday",
help="Postpone the lead date to the first available workday\n"
"This value will be used as default value for new warehouses linked to this"
" company",
)
orderpoint_on_workday_policy = fields.Selection(
[
Expand All @@ -30,6 +34,8 @@ class ResCompany(models.Model):
"* skip non-workdays: compute the order date consuming lead delay days only on"
" (eg: run action on Friday with 2 days lead delay -> skip Saturday and Sunday"
" -> start consuming lead days on Monday as first lead day -> the result is"
" Tuesday)\n",
" Tuesday)\n"
"This value will be used as default value for new warehouses linked to this"
" company",
default="skip_to_first_workday", # Retro-compatible default value
)
10 changes: 4 additions & 6 deletions stock_warehouse_calendar_orderpoint/models/stock_warehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ class StockWarehouse(models.Model):
comodel_name="resource.calendar",
string="Reordering Calendar",
default=lambda o: o._default_orderpoint_calendar_id(),
help="Calendar used to scheduled the execution of reordering rules",
help="Calendar used to compute the lead date of reordering rules",
)
orderpoint_on_workday = fields.Boolean(
string="Reordering on Workday",
default=lambda o: o._default_orderpoint_on_workday(),
help=(
"Postpone the lead date to the first available workday. "
"This is based on the Working Hours calendar."
),
help="Postpone the lead date to the first available workday based on the"
" Working Hours calendar",
)
orderpoint_on_workday_policy = fields.Selection(
[
Expand All @@ -36,7 +34,7 @@ class StockWarehouse(models.Model):
"* skip non-workdays: compute the order date consuming lead delay days only on"
" (eg: run action on Friday with 2 days lead delay -> skip Saturday and Sunday"
" -> start consuming lead days on Monday as first lead day -> the result is"
" Tuesday)\n",
" Tuesday)",
)

def _default_orderpoint_calendar_id(self):
Expand Down

0 comments on commit 7979341

Please sign in to comment.