From fed423910ba2261160d827e70ccf55425bd5825c Mon Sep 17 00:00:00 2001 From: "Xavier Bol (xbo)" Date: Tue, 17 Oct 2023 14:59:29 +0200 Subject: [PATCH] [FIX] product,*: fix `purchase` page visibility in product form view Before this commit, when purchase app (or account) is installed, the `purchase` page in product form view is always visible even if the product displayed in the form view cannot be purchased. The reason is when `attrs` has been removed and replaced by python condition inside `readonly`, `required` and `invisible` attributes, since the purchase page had `attrs="{'invisible': ...}"` and `invisible="1"` defined in its attributes, the condition in `attrs` has completely removed when the `attrs` has been deleted. This commit fixes the issue by updating the initial invisible defined in product module to have `invisible="1 or not purchase_ok"` to keep the condition that was initially defined in `attrs`. In purchase and account module, instead of replacing `invisible="1"` by `invisible="0"`, we will just remove `1 or` to show the purchase page only if `not purchase_ok` as it was the case before. task-3506730 Part-of: odoo/odoo#135840 --- addons/account/views/product_view.xml | 2 +- addons/point_of_sale/views/product_view.xml | 2 +- addons/product/views/product_views.xml | 2 +- addons/purchase/views/product_views.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/views/product_view.xml b/addons/account/views/product_view.xml index 95439b9dff9..d48b20f92ad 100644 --- a/addons/account/views/product_view.xml +++ b/addons/account/views/product_view.xml @@ -50,7 +50,7 @@ - 0 + diff --git a/addons/point_of_sale/views/product_view.xml b/addons/point_of_sale/views/product_view.xml index 7ea1e532f25..a47aedd3211 100644 --- a/addons/point_of_sale/views/product_view.xml +++ b/addons/point_of_sale/views/product_view.xml @@ -87,7 +87,7 @@ - detailed_type == "combo" + type in ['combo', 'service'] diff --git a/addons/product/views/product_views.xml b/addons/product/views/product_views.xml index 67da7f7ff3d..fd317e70707 100644 --- a/addons/product/views/product_views.xml +++ b/addons/product/views/product_views.xml @@ -111,7 +111,7 @@ - + diff --git a/addons/purchase/views/product_views.xml b/addons/purchase/views/product_views.xml index 486d7d4f312..afa4b561ba0 100644 --- a/addons/purchase/views/product_views.xml +++ b/addons/purchase/views/product_views.xml @@ -38,7 +38,7 @@ - 0 + purchase.group_purchase_user