From 4d60c1f62eaac245ccde70373413a15f33952a0e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 26 Oct 2016 09:44:37 +0200 Subject: [PATCH] [FIX] partially revert 3e2e1d6b905c One of the behavioural divergences between "create or replace" view and DROP; CREATE turns out to be that "create or replace" can only add columns *at the end* of the view, and can not change the name or type of the view during replacement, which can break migrations. Reinstate the old drop;create as replacement is not necessary for this specific view. --- addons/crm/report/crm_opportunity_report.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/crm/report/crm_opportunity_report.py b/addons/crm/report/crm_opportunity_report.py index a44bb233592..5bf8abc1d8d 100644 --- a/addons/crm/report/crm_opportunity_report.py +++ b/addons/crm/report/crm_opportunity_report.py @@ -49,8 +49,9 @@ class OpportunityReport(models.Model): medium_id = fields.Many2one('utm.medium', string='Medium', readonly=True) def init(self): + tools.drop_view_if_exists(self._cr, 'crm_opportunity_report') self._cr.execute(""" - CREATE OR REPLACE VIEW crm_opportunity_report AS ( + CREATE VIEW crm_opportunity_report AS ( SELECT c.id, c.date_deadline,