mirror of
https://github.com/bringout/oca-website.git
synced 2026-04-21 03:52:00 +02:00
Initial commit: OCA Website packages (16 packages)
This commit is contained in:
commit
0578ef7638
660 changed files with 37334 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
from . import res_config_settings
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
# Copyright 2020 Trey - Antonio González <antonio@trey.es>
|
||||
# Copyright 2021 Tecnativa - Jairo Llopis
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = "res.config.settings"
|
||||
|
||||
cookiebot_dgid = fields.Char(
|
||||
string="Domain Group ID",
|
||||
related="website_id.cookiebot_dgid",
|
||||
readonly=False,
|
||||
)
|
||||
cookiebot_enabled = fields.Boolean(
|
||||
string="Cookiebot",
|
||||
related="website_id.cookiebot_enabled",
|
||||
readonly=False,
|
||||
)
|
||||
|
||||
@api.onchange("website_cookies_bar")
|
||||
def _onchange_website_cookies_bar(self):
|
||||
for record in self:
|
||||
if record.website_cookies_bar:
|
||||
record.cookiebot_enabled = False
|
||||
|
||||
@api.onchange("cookiebot_enabled")
|
||||
def _onchange_cookiebot_enabled(self):
|
||||
for record in self:
|
||||
if record.cookiebot_enabled:
|
||||
record.website_cookies_bar = False
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2021 Tecnativa - Jairo Llopis
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="res_config_settings_view_form" model="ir.ui.view">
|
||||
<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='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" />
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="cookiebot_enabled" />
|
||||
<span
|
||||
class="fa fa-lg fa-globe"
|
||||
title="Values set here are website-specific."
|
||||
groups="website.group_multi_website"
|
||||
/>
|
||||
<div class="text-muted">
|
||||
Ask for consent on cookies usage
|
||||
</div>
|
||||
<div
|
||||
class="content-group"
|
||||
attrs="{'invisible': [('cookiebot_enabled', '=', False)]}"
|
||||
id="cookiebot_fields"
|
||||
>
|
||||
<div class="mt16">
|
||||
<a
|
||||
href="https://cookiebot.com/goto/help"
|
||||
class="oe_link"
|
||||
target="_blank"
|
||||
>
|
||||
<i class="fa fa-arrow-right" />
|
||||
How to configure Cookiebot.
|
||||
</a>
|
||||
<span class="text-muted">
|
||||
Instead of step 3, paste here your Domain Group ID.
|
||||
</span>
|
||||
</div>
|
||||
<div class="row mt16">
|
||||
<label
|
||||
class="col-md-3 o_light_label"
|
||||
for="cookiebot_dgid"
|
||||
/>
|
||||
<field
|
||||
name="cookiebot_dgid"
|
||||
placeholder="00000000-0000-0000-0000-000000000000"
|
||||
attrs="{'required': [('cookiebot_enabled', '=', True)]}"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue