[FIX] partially revert 3e2e1d6b90

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.
This commit is contained in:
Xavier Morel
2016-10-26 09:44:37 +02:00
parent 651738303a
commit 4d60c1f62e
+2 -1
View File
@@ -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,