diff --git a/cor_custom/models/analytic.py b/cor_custom/models/analytic.py index e4436d1..d369386 100755 --- a/cor_custom/models/analytic.py +++ b/cor_custom/models/analytic.py @@ -14,8 +14,8 @@ import dateutil.parser class AccountAnalyticLine(models.Model): _inherit = 'account.analytic.line' - start_time = fields.Float(string='Start Time', digits=(16, 2)) - end_time = fields.Float(string='End Time', digits=(16, 2)) + #start_time = fields.Float(string='Start Time', digits=(16, 2)) + #end_time = fields.Float(string='End Time', digits=(16, 2)) unit_amount = fields.Float('Duration', default=0.0) parent_project = fields.Many2one('project.project', related='project_id.parent_project', string='Parent Project') @@ -90,7 +90,7 @@ class AccountAnalyticLine(models.Model): self.task_id = False return result - _sql_constraints = [ + """_sql_constraints = [ ('check_start_time_lower_than_24', 'CHECK(start_time <= 24)', 'You cannot have a start hour greater than 24'), ('check_start_time_positive', 'CHECK(start_time >= 0)', 'Start hour must be a positive number'), ('check_end_time_lower_than_24', 'CHECK(end_time <= 24)', 'You cannot have a end hour greater than 24'), @@ -110,7 +110,7 @@ class AccountAnalyticLine(models.Model): res = self.end_time - self.start_time if res <= 0: raise ValidationError(_("End time cannot be earlier than Start time")) - self.unit_amount = res + self.unit_amount = res""" @api.onchange('start_datetime', 'end_datetime') def _onchange_start_end_date_time(self): @@ -155,7 +155,7 @@ class AccountAnalyticLine(models.Model): ttask = res['datas'][index][taskindex] if type(ttask) == bool: res['datas'][index][taskindex] = '' - if fields_name.get('start_time') is not None: + """if fields_name.get('start_time') is not None: starttimeindex = fields_name.get('start_time') starttime = float(res['datas'][index][starttimeindex]) if starttime: @@ -166,7 +166,7 @@ class AccountAnalyticLine(models.Model): endtime = float(res['datas'][index][endtimeindex]) if endtime: end_time = tools.format_duration(endtime) - res['datas'][index][endtimeindex] = end_time + res['datas'][index][endtimeindex] = end_time""" if fields_name.get('unit_amount') is not None: durationindex = fields_name.get('unit_amount') duration = res['datas'][index][durationindex] and float(res['datas'][index][durationindex]) diff --git a/cor_custom/models/project_hours.py b/cor_custom/models/project_hours.py index 62ea634..9464a02 100755 --- a/cor_custom/models/project_hours.py +++ b/cor_custom/models/project_hours.py @@ -77,7 +77,7 @@ class ProjectConsultantHrs(models.Model): val.budgeted_hours = 0 @api.depends('project_id', 'start_date', 'end_date', 'project_id.timesheet_ids', 'project_id.timesheet_ids.date', 'project_id.timesheet_ids.project_id', - 'project_id.timesheet_ids.employee_id', 'project_id.timesheet_ids.start_time', 'project_id.timesheet_ids.end_time', 'project_id.timesheet_ids.unit_amount') + 'project_id.timesheet_ids.employee_id', 'project_id.timesheet_ids.start_datetime', 'project_id.timesheet_ids.end_datetime', 'project_id.timesheet_ids.unit_amount') def _compute_actual_calc(self): Timesheet = self.env['account.analytic.line'] for val in self: diff --git a/cor_custom/views/analytic_view.xml b/cor_custom/views/analytic_view.xml index 8493301..0ba5947 100755 --- a/cor_custom/views/analytic_view.xml +++ b/cor_custom/views/analytic_view.xml @@ -184,6 +184,21 @@ + + account.analytic.line.search + account.analytic.line + + + + + + + + + + + + account.analytic.line.calendar account.analytic.line