[FIX] hr_timesheet_attendance: allow update of view
Add the missing drop_view_if_exists that allows the recreation of the template when updating the module closes odoo/odoo#32380 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo import api, fields, models, tools
|
||||
|
||||
|
||||
class TimesheetAttendance(models.Model):
|
||||
@@ -16,6 +16,7 @@ class TimesheetAttendance(models.Model):
|
||||
|
||||
@api.model_cr
|
||||
def init(self):
|
||||
tools.drop_view_if_exists(self.env.cr, self._table)
|
||||
self._cr.execute("""CREATE OR REPLACE VIEW %s AS (
|
||||
SELECT
|
||||
max(id) AS id,
|
||||
|
||||
Reference in New Issue
Block a user