From 5c27687f178e4d73eafa9a46e2f4d5306a07443e Mon Sep 17 00:00:00 2001 From: "Arthur Detroux (ard)" Date: Wed, 22 Mar 2023 08:25:48 +0000 Subject: [PATCH] [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 --- .../static/src/components/fields/publish_button.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/website/static/src/components/fields/publish_button.xml b/addons/website/static/src/components/fields/publish_button.xml index 79bb3df65d8..ceccdddd0f7 100644 --- a/addons/website/static/src/components/fields/publish_button.xml +++ b/addons/website/static/src/components/fields/publish_button.xml @@ -4,11 +4,11 @@
+ 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')"/> + 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')"/>