Files
odoo_source/addons/website_event/views/website_pages_views.xml
T
xO-Tx f23399db1d [IMP] website, *: add website content kanban views
*: website_event, website_forum, website_hr_recruitment,
   website_sale, website_slides

The website content list views should act as a page manager (click on
a record redirects to iframe, "CREATE" and "Publish / Unpublish"
buttons, ...).

The goal of this commit is to add a kanban version of these views for
key app models ('website.page', 'blog.post',...) since the same code
can now be used for list and kanban controllers / renderers since [1].
It is especially important in mobile where the kanban views are nicer
than list views by default.

[1]: https://github.com/odoo/odoo/commit/ed09db19c372da8d8be541f365117d1ce8e965ba

task-2889981

closes odoo/odoo#101174

Related: odoo/enterprise#31821
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-09-27 14:54:40 +02:00

88 lines
3.3 KiB
XML

<?xml version="1.0"?>
<odoo>
<record id="event_pages_tree_view" model="ir.ui.view">
<field name="name">Event Pages Tree</field>
<field name="model">event.event</field>
<field name="priority">99</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="event.view_event_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="js_class">website_pages_list</attribute>
<attribute name="type">object</attribute>
<attribute name="action">open_website_url</attribute>
</xpath>
<field name="address_id" position="attributes">
<attribute name="optional">hide</attribute>
</field>
<field name="date_end" position="attributes">
<attribute name="optional">hide</attribute>
</field>
<field name="seats_used" position="attributes">
<attribute name="optional">hide</attribute>
</field>
<field name="name" position="after">
<field name="website_url"/>
</field>
<field name="stage_id" position="before">
<field name="is_seo_optimized"/>
<field name="is_published"/>
<field name="website_id" position="move"/>
</field>
</field>
</record>
<record id="event_pages_kanban_view" model="ir.ui.view">
<field name="name">Event Pages Kanban</field>
<field name="model">event.event</field>
<field name="priority">99</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="event.view_event_kanban"/>
<field name="arch" type="xml">
<xpath expr="//kanban" position="attributes">
<attribute name="js_class">website_pages_kanban</attribute>
<attribute name="type">object</attribute>
<attribute name="action">open_website_url</attribute>
</xpath>
<xpath expr="//kanban" position="inside">
<field name="website_url" invisible="1"/>
</xpath>
<xpath expr="//div[hasclass('o_kanban_record_title')]" position="inside">
<div class="text-muted" t-if="record.website_id.value" groups="website.group_multi_website">
<i class="fa fa-globe me-1" title="Website"/>
<field name="website_id"/>
</div>
</xpath>
<xpath expr="//div[hasclass('o_kanban_record_bottom')]" position="after">
<div class="border-top mt-2 pt-2">
<field name="is_published" widget="boolean_toggle"/>
<t t-if="record.is_published.raw_value">Published</t>
<t t-else="">Not Published</t>
</div>
</xpath>
</field>
</record>
<record id="action_event_pages_list" model="ir.actions.act_window">
<field name="name">Event Pages</field>
<field name="res_model">event.event</field>
<field name="view_mode">tree,kanban</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('event_pages_tree_view')}),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('event_pages_kanban_view')}),
]"/>
<field name="context">{'create_action': 'website_event.event_event_action_add'}</field>
</record>
<menuitem id="menu_event_pages"
parent="website.menu_content"
sequence="40"
name="Events"
action="action_event_pages_list"/>
</odoo>