[FIX] website: display correct value on website_publish_button
Following the refactor done in [1], it is no longer possible to use the `value` prop. Instead, the field should explicitly use `props.record.data[props.name]`. However, while [1] tried to adapt all the existing fields, `website_publish_button` was forgotten. This commit adapts website_publish_button. Steps to reproduce: - Install website_sale - Go to the website app - In the configuration menu select Shipping Methods - Chose one of the shipping method - Try to toggle the "Unpublished/Published" button => The value does not update properly [1]: https://github.com/odoo/odoo/commit/688986f888f2fe2371d58b74ded81315ba6bb353 task-3223146 closes odoo/odoo#117833 X-original-commit: ddadbeed4700e537f7758746298fec43de997b21 Signed-off-by: Guillaume-gdi <gdi@odoo.com>
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
<t t-name="website.PublishField" owl="1">
|
||||
<div class="o_stat_info">
|
||||
<span class="o_stat_text o_hover"
|
||||
t-att-class="props.value ? 'text-danger' : 'text-success'"
|
||||
t-esc="props.value ? env._t('Unpublish') : env._t('Publish')"/>
|
||||
t-att-class="props.record.data[props.name] ? 'text-danger' : 'text-success'"
|
||||
t-esc="props.record.data[props.name] ? env._t('Unpublish') : env._t('Publish')"/>
|
||||
<span class="o_stat_text o_not_hover"
|
||||
t-att-class="props.value ? 'text-success' : 'text-danger'"
|
||||
t-esc="props.value ? env._t('Published') : env._t('Unpublished')"/>
|
||||
t-att-class="props.record.data[props.name] ? 'text-success' : 'text-danger'"
|
||||
t-esc="props.record.data[props.name] ? env._t('Published') : env._t('Unpublished')"/>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user