Skip to content

Commit

Permalink
[MIG] website_cookiebot: Migration to 16.0
Browse files Browse the repository at this point in the history
TT44375
  • Loading branch information
pilarvargas-tecnativa committed Aug 22, 2023
1 parent df772a8 commit a5b521c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion website_cookiebot/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Website Cookiebot",
"summary": "Ask for cookies consent connecting with Cookiebot",
"category": "Website",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"author": "Trey (www.trey.es), Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/website",
"license": "AGPL-3",
Expand Down
12 changes: 12 additions & 0 deletions website_cookiebot/wizards/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,15 @@ class ResConfigSettings(models.TransientModel):
def _compute_cookiebot_enabled(self):
for record in self:
record.cookiebot_enabled = bool(record.cookiebot_dgid)

Check warning on line 25 in website_cookiebot/wizards/res_config_settings.py

View check run for this annotation

Codecov / codecov/patch

website_cookiebot/wizards/res_config_settings.py#L25

Added line #L25 was not covered by tests

@api.onchange("website_cookies_bar")
def _onchange_website_cookies_bar(self):
for record in self:
if record.website_cookies_bar:
record.cookiebot_enabled = False

Check warning on line 31 in website_cookiebot/wizards/res_config_settings.py

View check run for this annotation

Codecov / codecov/patch

website_cookiebot/wizards/res_config_settings.py#L31

Added line #L31 was not covered by tests

@api.onchange("cookiebot_enabled")
def _onchange_cookiebot_enabled(self):
for record in self:
if record.cookiebot_enabled:
record.website_cookies_bar = False

Check warning on line 37 in website_cookiebot/wizards/res_config_settings.py

View check run for this annotation

Codecov / codecov/patch

website_cookiebot/wizards/res_config_settings.py#L37

Added line #L37 was not covered by tests
5 changes: 1 addition & 4 deletions website_cookiebot/wizards/res_config_settings_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="website.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath
expr="//div[@id='google_analytics_dashboard_setting']"
position="after"
>
<xpath expr="//div[@id='website_cookies_bar_setting']" position="after">
<div class="col-xs-12 col-md-6 o_setting_box" id="cookiebot_setting">
<div class="o_setting_left_pane">
<field name="cookiebot_enabled" />
Expand Down

0 comments on commit a5b521c

Please sign in to comment.