Skip to content

Commit

Permalink
[IMP][remove_odoo_enterprise] Hide block title if all the elements of…
Browse files Browse the repository at this point in the history
… the block are hidden
  • Loading branch information
MTantin committed Oct 10, 2023
1 parent 29cb9a9 commit d28384c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions remove_odoo_enterprise/models/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,12 @@ def get_views(self, views, options=None):
for item in doc.xpath(query):
item.attrib["class"] = "d-none"

for container in doc.xpath("//div[contains(@class, 'o_settings_container')]"):
if len(container.xpath("div[not(contains(@class, 'd-none'))]")) == 0:
prev_el = container.getprevious()
if prev_el is not None and prev_el.tag == 'h2':
prev_el.attrib["class"] = "d-none"
container.attrib["class"] = "d-none"

ret_val["views"]["form"]["arch"] = etree.tostring(doc)
return ret_val

0 comments on commit d28384c

Please sign in to comment.