From 71805569abc8f2fc04cc9a1992432c09e22bce2e Mon Sep 17 00:00:00 2001 From: tocmo0nlord Date: Sat, 14 Mar 2026 08:25:13 +0000 Subject: [PATCH] feat: add date range wizard (travel) --- work_trace/wizards/wt_date_range_wizard.py | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/work_trace/wizards/wt_date_range_wizard.py b/work_trace/wizards/wt_date_range_wizard.py index 6e53b510..a1376e74 100644 --- a/work_trace/wizards/wt_date_range_wizard.py +++ b/work_trace/wizards/wt_date_range_wizard.py @@ -3,22 +3,22 @@ from odoo.exceptions import UserError class WtDateRangeWizard(models.TransientModel): - _name = 'wt.date.range.wizard' - _description = 'WorkTrace Date Range' + _name = "wt.date.range.wizard" + _description = "WorkTrace Date Range" - date_from = fields.Date(string='From', required=True) - date_to = fields.Date(string='To', required=True) + date_from = fields.Date(string="From", required=True) + date_to = fields.Date(string="To", required=True) def action_view(self): self.ensure_one() if self.date_from > self.date_to: - raise UserError(_('Start date must be before end date.')) + raise UserError(_("Start date must be before end date.")) return { - 'type': 'ir.actions.act_window', - 'name': 'Travel: %s → %s' % (self.date_from, self.date_to), - 'res_model': 'wt.location.log', - 'view_mode': 'list,form', - 'domain': [('date', '>=', self.date_from), ('date', '<=', self.date_to)], - 'context': {}, - 'target': 'current', + "type": "ir.actions.act_window", + "name": "Travel: %s to %s" % (self.date_from, self.date_to), + "res_model": "wt.location.log", + "view_mode": "list,form", + "domain": [("date", ">=", self.date_from), ("date", "<=", self.date_to)], + "context": {}, + "target": "current", }