From 31df8066ba0f1ac19b32d4eac2366b901a4bb9f7 Mon Sep 17 00:00:00 2001 From: "Abdelouahab (abla)" Date: Fri, 19 Jan 2024 16:12:46 +0100 Subject: [PATCH] [FIX] website_sale: fix ribbon editing To reproduce ============= - Go to shop page - Edit the page - select a product - add a ribbon - modify the ribbon (background or text color) the ribbon is not updated Problem ======= the default ribbon are using the bootstrap class "text-bg-*" to set the background color and the text color. But the editor expects the ribbon to have a class "bg-*" and color css style. That's why when editing, the class "text-bg-*" is never removed so each time it's taken instead of the added style. Solution ======== remove the class "text-bg-*" from default ribbons and use the fields "bg_color" and "text_color" to set the background and text color opw-3674520 closes odoo/odoo#152604 X-original-commit: 2bd09b4b41b27780ec20820cac76051ae20b7f4d Signed-off-by: Antoine Vandevenne (anv) Signed-off-by: Abdelouahab Laaroussi (abla) --- addons/website_sale/data/data.xml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/addons/website_sale/data/data.xml b/addons/website_sale/data/data.xml index 10ef714e464..0859e352e22 100644 --- a/addons/website_sale/data/data.xml +++ b/addons/website_sale/data/data.xml @@ -25,22 +25,30 @@ Sale - text-bg-success o_ribbon_left + o_ribbon_left + rgb(40, 167, 69) + white Sold out - text-bg-danger o_ribbon_left + o_ribbon_left + rgb(220, 53, 69) + white Out of stock - text-bg-warning o_ribbon_left + o_ribbon_left + rgb(255, 193, 7) + black New! - text-bg-primary o_ribbon_left + o_ribbon_left + rgb(0, 123, 255) + white