19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:43 +01:00
parent 4607ccbd2e
commit 825ff6514e
487 changed files with 184979 additions and 195262 deletions

View file

@ -1,13 +1,12 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from psycopg2 import sql
from odoo import tools
from odoo import api, fields, models
from odoo import fields, models
from odoo.tools.sql import drop_view_if_exists, SQL
class FleetReport(models.Model):
_name = "fleet.vehicle.cost.report"
class FleetVehicleCostReport(models.Model):
_name = 'fleet.vehicle.cost.report'
_description = "Fleet Analysis Report"
_auto = False
_order = 'date_start desc'
@ -148,9 +147,5 @@ FROM (
contract_costs cc)
) c
"""
tools.drop_view_if_exists(self.env.cr, self._table)
self.env.cr.execute(
sql.SQL("""CREATE or REPLACE VIEW {} as ({})""").format(
sql.Identifier(self._table),
sql.SQL(query)
))
drop_view_if_exists(self.env.cr, self._table)
self.env.cr.execute(SQL("""CREATE or REPLACE VIEW %s as (%s)""", SQL.identifier(self._table), SQL(query)))