Skip to content

Commit f17df65

Browse files
committed
[FIX] fieldservice: request_early default to current_time
Fixes an issue where the default was snapshot at installation time This is a regression, the issue was first fixes on #872 Commit 3431b49 Which was partially reverted on #950 Commit 090eb57
1 parent 868c114 commit f17df65

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fieldservice/models/fsm_order.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ def _default_team_id(self):
3838
return team
3939
raise ValidationError(_("You must create an FSM team first."))
4040

41+
def _default_request_early(self):
42+
return fields.Datetime.now().replace(second=0)
43+
4144
@api.depends("date_start", "date_end")
4245
def _compute_duration(self):
4346
for rec in self:
@@ -114,7 +117,8 @@ def _track_subtype(self, init_values):
114117
)
115118
location_directions = fields.Html()
116119
request_early = fields.Datetime(
117-
string="Earliest Request Date", default=datetime.now()
120+
string="Earliest Request Date",
121+
default=lambda self: self._default_request_early(),
118122
)
119123
color = fields.Integer("Color Index")
120124
company_id = fields.Many2one(

0 commit comments

Comments
 (0)