Files
odoo_source/addons/website_livechat/views/website_livechat_view.xml
T
Romain Derie 30ed4c08cc [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.

Replacing website_published by is_published will fix the behavior and has more
sense has website_published is the 'is_published' state in a website context.
In the backend, we are not in a website context.

task-1919689
2019-01-04 15:50:45 +00:00

21 lines
792 B
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="im_livechat_channel_form_view" model="ir.ui.view">
<field name="name">im_livechat.channel.form.inherit.website_livechat</field>
<field name="model">im_livechat.channel</field>
<field name="inherit_id" ref="im_livechat.im_livechat_channel_view_form"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" name="website_publish_button"
type="object" icon="fa-globe">
<field name="is_published" widget="website_button"/>
</button>
</div>
</field>
</record>
</data>
</odoo>