Files
odoo_source/addons/website_event/views/event_views.xml
T
Romain Derie d73c4e583a [FIX] website_*: prevent record to be unpublished on website change
Before this commit, when changing the website field in a record form view,
the is_published field would be force to false, ending unpublishing the record
if it was published.

That behavior was coming from the fact that is_published field is missing from
the form view. Thus, onchange on website is triggering a recompute server side
without is_published as the JS framework is not sending the field.
The ORM is then fallbacking on default Boolean value (False) for is_published
when sending back the onchange result.

This would only appear on object with 'website.published.multi.mixin' and with
website_id in the form view.

task-1919689

closes odoo/odoo#29707
2018-12-21 13:47:58 +00:00

76 lines
3.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="event_type_view_form_inherit_website" model="ir.ui.view">
<field name="name">event.type.view.form.inherit.website</field>
<field name="model">event.type</field>
<field name="inherit_id" ref="event.view_event_type_form"/>
<field name="arch" type="xml">
<div name="event_type_visibility_seats" position="after">
<div class="col-12 col-lg-6 o_setting_box" name="event_type_visibility_website">
<div class="o_setting_left_pane">
<field name="website_menu"/>
</div>
<div class="o_setting_right_pane">
<label for="website_menu"/>
<div class="row">
<div class="col-lg-8 mt16 text-muted">
Check this option to have menus for your event on the
website: registrations, schedule, map, ...
</div>
</div>
</div>
</div>
</div>
</field>
</record>
<record id="event_event_view_form_inherit_website" model="ir.ui.view">
<field name="name">event.event.view.form.inherit.website</field>
<field name="model">event.event</field>
<field name="inherit_id" ref="event.view_event_form"/>
<field name="arch" type="xml">
<field name="organizer_id" position="before">
<field name="website_id" options="{'no_create': True}" groups="website.group_multi_website"/>
</field>
<button name="toggle_active" position="before">
<field name="website_url" invisible="1"/>
<button name="website_publish_button"
type="object"
class="oe_stat_button"
icon="fa-globe">
<field name="website_published" widget="website_button"/>
<field name="is_published" invisible="1"/>
</button>
</button>
<label for="is_online" position="after">
<field name="website_menu"/>
<label for="website_menu" string="Website Menu"/>
</label>
<xpath expr="//button[@name='button_done']" position="before">
<button name="action_open_badge_editor"
type="object"
states="confirm"
string="Preview Badges"
class="oe_highlight"/>
<button name="action_open_badge_editor"
type="object"
states="done"
string="Preview Badges"/>
</xpath>
</field>
</record>
<record id="event_event_view_list_inherit_website" model="ir.ui.view">
<field name="name">event.event.view.list.inherit.website</field>
<field name="model">event.event</field>
<field name="inherit_id" ref="event.view_event_tree"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="website_id" groups="website.group_multi_website"/>
</field>
</field>
</record>
</odoo>