Files
odoo_source/addons/test_website/data/test_website_data.xml
T
Romain Derie 5a81d88837 [FIX] website: delete cow view on module update
Before this commit, when a view was removed during a module update (eg: the
record was deleted from the file), its COW views would not be deleted.

This could lead to unwanted behaviors including tracebacks(1).

This commit is somehow related/an extension of b5fe23055d that handle COW view
write during module update and 2e32cc5aa3 that remove COW views during module
uninstall.

task-1931683

Note: Some existing tests had to be run post install

(1) A view doing a t-call is COW'd, then that view and its t-called view are
    removed. If the cow view is not removed, the t-call will crash (see tests
    in this commit for detailed case).

closes odoo/odoo#31295

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-05 11:04:52 +00:00

63 lines
2.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- RECORDS FOR RESET VIEWS TESTS -->
<record id="test_view" model="ir.ui.view">
<field name="name">Test View</field>
<field name="type">qweb</field>
<field name="key">test_website.test_view</field>
<field name="arch" type="xml">
<t name="Test View" priority="29" t-name="test_website.test_view">
<t t-call="website.layout">
<p>Test View</p>
<p>placeholder</p>
</t>
</t>
</field>
</record>
<record id="test_page_view" model="ir.ui.view">
<field name="name">Test Page View</field>
<field name="type">qweb</field>
<field name="key">test_website.test_page_view</field>
<field name="arch" type="xml">
<t name="Test Page View" priority="29" t-name="test_website.test_page_view">
<t t-call="website.layout">
<div id="oe_structure_test_website_page" class="oe_structure oe_empty"/>
<p>Test Page View</p>
<p>placeholder</p>
</t>
</t>
</field>
</record>
<record id="test_page" model="website.page">
<field name="website_published">True</field>
<field name="url">/test_page_view</field>
<field name="view_id" ref="test_page_view"/>
</record>
<record id="test_view_to_be_t_called" model="ir.ui.view">
<field name="name">Test View To Be t-called</field>
<field name="type">qweb</field>
<field name="key">test_website.test_view_to_be_t_called</field>
<field name="arch" type="xml">
<t name="Test View To Be t-called" priority="29" t-name="test_website.test_view_to_be_t_called">
<p>Test View To Be t-called</p>
<p>placeholder</p>
</t>
</field>
</record>
<template id="test_view_child_broken" inherit_id="test_website.test_view" active="False">
<xpath expr="//p[last()]" position="replace">
<p>Test View Child Broken</p>
<p>placeholder</p>
</xpath>
</template>
<!-- RECORDS FOR MODULE OPERATION TESTS -->
<template id="update_module_base_view">
<div>I am a base view</div>
</template>
</data>
</odoo>