@ -0,0 +1,49 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
||||
|
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
||||
|
:alt: License: AGPL-3 |
||||
|
|
||||
|
Website GDPR In Odoo |
||||
|
==================== |
||||
|
This module allows customers to manage personal data and information. |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
* No additional configuration is needed. |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
Affero General Public License, v3.0 (AGPL v3). |
||||
|
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developers : (V16) Yadhukrishnan, |
||||
|
(V17) Safa Faheem PE, |
||||
|
(V18) Aysha Shalin |
||||
|
Contact: odoo@cyrosys.com |
||||
|
|
||||
|
Contacts |
||||
|
-------- |
||||
|
* Mail Contact : odoo@cybrosys.com |
||||
|
* Website : https://cybrosys.com |
||||
|
|
||||
|
Bug Tracker |
||||
|
----------- |
||||
|
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
||||
|
|
||||
|
Maintainer |
||||
|
========== |
||||
|
.. image:: https://cybrosys.com/images/logo.png |
||||
|
:target: https://cybrosys.com |
||||
|
|
||||
|
This module is maintained by Cybrosys Technologies. |
||||
|
|
||||
|
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Aysha Shalin (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC |
||||
|
# LICENSE (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from . import controllers |
||||
|
from . import models |
@ -0,0 +1,58 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Aysha Shalin (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC |
||||
|
# LICENSE (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
{ |
||||
|
"name": "Website GDPR In Odoo", |
||||
|
"version": "18.0.1.0.0", |
||||
|
"category": "Website", |
||||
|
"summary": """General Data Protection Regulation is implemented On Odoo 18 |
||||
|
Enterprise Edition.""", |
||||
|
"description": """This module allows customers to manage personal data and |
||||
|
information. Customer have the access to download and delete their |
||||
|
information like names,emails, phone numbers, biometric information, |
||||
|
location data, financial data etc.""", |
||||
|
"author": "Cybrosys Techno Solutions", |
||||
|
"company": "Cybrosys Techno Solutions", |
||||
|
"maintainer": "Cybrosys Techno Solutions", |
||||
|
"website": "https://www.cybrosys.com", |
||||
|
"depends": ["website", "contacts"], |
||||
|
"data": [ |
||||
|
"security/ir.model.access.csv", |
||||
|
"views/gdpr_request_views.xml", |
||||
|
"views/gdpr_template_views.xml", |
||||
|
"views/gdpr_request_templates.xml", |
||||
|
"views/mail_templates.xml", |
||||
|
"report/gdpr_request_templates.xml", |
||||
|
"views/gdpr_request_report_views.xml", |
||||
|
], |
||||
|
"assets": { |
||||
|
"web.assets_frontend": [ |
||||
|
"website_gdpr_odoo/static/src/js/gdpr_portal.js", |
||||
|
"website_gdpr_odoo/static/src/css/gdpr_portal.css", |
||||
|
] |
||||
|
}, |
||||
|
"images": ["static/description/banner.png"], |
||||
|
"license": "AGPL-3", |
||||
|
"installable": True, |
||||
|
"auto_install": False, |
||||
|
"application": False, |
||||
|
} |
||||
|
|
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Aysha Shalin (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC |
||||
|
# LICENSE (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from . import website_gdpr_odoo |
@ -0,0 +1,111 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Aysha Shalin (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC |
||||
|
# LICENSE (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from odoo import http |
||||
|
from odoo.http import request |
||||
|
|
||||
|
|
||||
|
class WebsiteForm(http.Controller): |
||||
|
""" |
||||
|
The WebsiteForm class provides the data to the page when it's loaded. |
||||
|
Methods: |
||||
|
gdpr_data_management(self): |
||||
|
When the page is loaded passing the values related to the gdpr |
||||
|
template and requests. |
||||
|
Return a dict variable. |
||||
|
data_management_confirm(self,**kw): |
||||
|
Creating gdpr requests based the type of request and the user. |
||||
|
create_request_submit(self): |
||||
|
Opening the submit window. |
||||
|
request_delete_done(self): |
||||
|
Opening the deleted window. |
||||
|
request_canceled(self): |
||||
|
opening the cancelled window. |
||||
|
""" |
||||
|
|
||||
|
@http.route(['/my/data_management'], type='http', auth="user", |
||||
|
website=True) |
||||
|
def gdpr_data_management(self): |
||||
|
""" |
||||
|
Summary: |
||||
|
Transferring data to the frontend |
||||
|
Returns: |
||||
|
Type:dict , it contains the data for the opening window. |
||||
|
""" |
||||
|
return request.render("website_gdpr_odoo.gdpr_manager", { |
||||
|
'values': [{'name': gdpr_template_id['name'], |
||||
|
'description': gdpr_template_id['description'], |
||||
|
'id': gdpr_template_id['id'], } for gdpr_template_id in |
||||
|
request.env['gdpr.template'].sudo().search_read( |
||||
|
[], ['name','description'])], |
||||
|
'request_values': [{ |
||||
|
'name': gdpr_request_id.req_name, |
||||
|
'partner': gdpr_request_id.partner_id.name, |
||||
|
'date': gdpr_request_id.create_date, |
||||
|
'state': gdpr_request_id.state, |
||||
|
'type': gdpr_request_id.req_type, |
||||
|
'template': gdpr_request_id.template_id.name, |
||||
|
'id': gdpr_request_id.id |
||||
|
} for gdpr_request_id in request.env['gdpr.request'].sudo().search( |
||||
|
[('partner_id', '=', request.env.user.partner_id.id)])], |
||||
|
}) |
||||
|
|
||||
|
@http.route(['/gdpr_management/confirm'], type='json', auth="public", |
||||
|
website=True) |
||||
|
def data_management_confirm(self, **kw): |
||||
|
""" |
||||
|
Summary: |
||||
|
Transferring data to the frontend |
||||
|
Arguments: |
||||
|
kw: dictionary |
||||
|
It contains selected template id user id. |
||||
|
""" |
||||
|
partner_id = request.env['res.partner'].search([ |
||||
|
('user_id', '=', request.env.user.id) |
||||
|
]) |
||||
|
if partner_id: |
||||
|
request.env['gdpr.request'].sudo().create({ |
||||
|
'req_name': f"{partner_id.name}'s {kw.get('type')} data", |
||||
|
'partner_id': partner_id.id, |
||||
|
'req_type': kw.get('type'), |
||||
|
'state': 'pending', |
||||
|
'template_id': kw.get('template_id') |
||||
|
}) |
||||
|
else: |
||||
|
request.redirect('/my/home') |
||||
|
|
||||
|
@http.route(['/gdpr_management/submit'], type='http', auth="user", |
||||
|
website=True) |
||||
|
def create_request_submit(self): |
||||
|
""" Opening submit window """ |
||||
|
return request.render("website_gdpr_odoo.gdpr_submit") |
||||
|
|
||||
|
@http.route(['/gdpr_management/success/delete'], type='http', |
||||
|
auth="user", website=True) |
||||
|
def request_delete_done(self): |
||||
|
""" Opening delete window """ |
||||
|
return request.render("website_gdpr_odoo.gdpr_delete_success") |
||||
|
|
||||
|
@http.route(['/gdpr_management/canceled'], type='http', auth="user", |
||||
|
website=True) |
||||
|
def request_canceled(self): |
||||
|
""" Opening cancel window """ |
||||
|
return request.render("website_gdpr_odoo.gdpr_cancel_success") |
@ -0,0 +1,6 @@ |
|||||
|
## Module <website_gdpr_odoo> |
||||
|
|
||||
|
#### 04.10.2024 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
##### ADD |
||||
|
- Initial Commit for Website GDPR In Odoo |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Aysha Shalin (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC |
||||
|
# LICENSE (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from . import gdpr_request |
||||
|
from . import gdpr_template |
@ -0,0 +1,141 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Aysha Shalin (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC |
||||
|
# LICENSE (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
import base64 |
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
|
class GDPRRequest(models.Model): |
||||
|
""" |
||||
|
The GDPRRequest class fields and different methods are included. |
||||
|
Methods: |
||||
|
action_confirm_request(self): |
||||
|
For action confirm button change state to confirm. |
||||
|
action_delete_request(self,**kw): |
||||
|
For updating the values in 'res.partner'(deleting records). |
||||
|
action_cancel_request(self): |
||||
|
For action cancel button change state to cancel. |
||||
|
action_download_pdf(self): |
||||
|
For downloading the selected data. |
||||
|
create(self): |
||||
|
For getting overriding sequence number. |
||||
|
""" |
||||
|
_name = "gdpr.request" |
||||
|
_description = "GDPR Request" |
||||
|
|
||||
|
name = fields.Char(string="Serial Number", readonly=True, |
||||
|
copy=False, default='New', help="The serial number") |
||||
|
req_name = fields.Char(string="Name", help="Request Name") |
||||
|
partner_id = fields.Many2one('res.partner', string="Customer", |
||||
|
help="Specify the customer for the request.") |
||||
|
req_type = fields.Selection([ |
||||
|
('download', 'Download Data'), |
||||
|
('delete', 'Delete Data')], string="Request Type", |
||||
|
help="Please specify the type of request you want to make.") |
||||
|
state = fields.Selection([ |
||||
|
('pending', 'Pending'), |
||||
|
('cancel', 'Cancel'), |
||||
|
('done', 'Done')], default="pending", help="State of the request") |
||||
|
template_id = fields.Many2one('gdpr.template', string="Template", |
||||
|
help="Selected Template") |
||||
|
|
||||
|
def action_confirm_request(self): |
||||
|
""" For action confirm """ |
||||
|
self.write({'state': 'done'}) |
||||
|
self.action_send_email() |
||||
|
|
||||
|
def action_send_email(self): |
||||
|
""" For sending mail to the partner when the request is confirmed or |
||||
|
canceled. """ |
||||
|
state = "Confirmed" if self.state == "done" else "Cancelled" |
||||
|
email_values = { |
||||
|
'email_to': self.partner_id.email, |
||||
|
'content': "Your Gdpr Request " + self.name + " for " + |
||||
|
self.req_type + " data is " + state, |
||||
|
'company': self.env.company.name, |
||||
|
} |
||||
|
mail_template = self.env.ref( |
||||
|
'website_gdpr_odoo.gdpr_request_email_template') |
||||
|
mail_template.with_context(email_values).send_mail(self.id, |
||||
|
email_layout_xmlid='mail.mail_notification_light', |
||||
|
force_send=True) |
||||
|
|
||||
|
def action_delete_request(self): |
||||
|
""" For updating the values in 'res.partner'(deleting records) """ |
||||
|
value_list = [partner_field.name for partner_field in |
||||
|
self.template_id.field_ids] |
||||
|
for value in value_list: |
||||
|
self.partner_id.write({ |
||||
|
value: False, |
||||
|
}) |
||||
|
self.write({'state': 'done'}) |
||||
|
|
||||
|
def action_cancel_request(self): |
||||
|
""" For action cancel """ |
||||
|
self.write({'state': 'cancel'}) |
||||
|
self.action_send_email() |
||||
|
|
||||
|
def action_download_pdf(self, data): |
||||
|
""" For downloading the selected data """ |
||||
|
value_list = [] |
||||
|
request_id = self.env['gdpr.request'].sudo().browse(data) |
||||
|
partner_fields = request_id.template_id.sudo().field_ids |
||||
|
partner_id = request_id.partner_id |
||||
|
for rec in partner_fields: |
||||
|
if rec.ttype == "many2one": |
||||
|
field_val = partner_id.mapped(rec.name).name |
||||
|
if field_val: |
||||
|
list_to_str = ' '.join([str(elem) for elem in field_val]) |
||||
|
else: |
||||
|
list_to_str = False |
||||
|
value_list.append({'data': list_to_str, |
||||
|
'name': rec.field_description}) |
||||
|
else: |
||||
|
field_val = partner_id.mapped(rec.name) |
||||
|
list_to_str = ' '.join([str(elem) for elem in field_val]) |
||||
|
value_list.append({'data': list_to_str, |
||||
|
'name': rec.field_description}) |
||||
|
values = { |
||||
|
'name': partner_id.name, |
||||
|
'value': value_list |
||||
|
} |
||||
|
pdf = self.env['ir.actions.report'].sudo()._render_qweb_pdf( |
||||
|
'website_gdpr_odoo.action_pdf_download', request_id.id, data=values) |
||||
|
attachment = self.env['ir.attachment'].sudo().create({ |
||||
|
'datas': base64.b64encode(pdf[0]), |
||||
|
'name': "Data Download", |
||||
|
'type': 'binary', |
||||
|
'res_model': 'gdpr.request', |
||||
|
'res_id': request_id.id, |
||||
|
'public': True |
||||
|
}) |
||||
|
return { |
||||
|
'url': f'/web/content/{attachment.id}?download=true&access_token=', |
||||
|
} |
||||
|
|
||||
|
@api.model_create_multi |
||||
|
def create(self, vals): |
||||
|
""" For getting overriding sequence number """ |
||||
|
for val in vals: |
||||
|
if val.get('name', 'New') == 'New': |
||||
|
val['name'] = self.env['ir.sequence'].next_by_code( |
||||
|
'request.sequence') or 'New' |
||||
|
return super(GDPRRequest, self).create(vals) |
@ -0,0 +1,53 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Aysha Shalin (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC |
||||
|
# LICENSE (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class GDPRTemplate(models.Model): |
||||
|
""" |
||||
|
The GDPRTemplate class included fields and methode to archive. |
||||
|
Methods: |
||||
|
action_archive_template(self): |
||||
|
To archive the record. |
||||
|
""" |
||||
|
_name = "gdpr.template" |
||||
|
_description = "GDPR Template" |
||||
|
|
||||
|
name = fields.Char(string="Title", required=True, |
||||
|
help="Providing the name of the template") |
||||
|
description = fields.Html(string="Short Description", required=True, |
||||
|
help="Providing the description for the template") |
||||
|
active = fields.Boolean(default=True) |
||||
|
allow_messages = fields.Boolean(string="Allow Gdpr Message", default=True, |
||||
|
help="By enabling this an email will send " |
||||
|
"to the partner while confirming the " |
||||
|
"gdpr request") |
||||
|
field_ids = fields.Many2many('ir.model.fields', |
||||
|
domain="[('model', '=', 'res.partner')]", |
||||
|
string="Data Fields", |
||||
|
required=True, |
||||
|
help="Select the fields to" |
||||
|
" visible to the customer") |
||||
|
|
||||
|
def action_archive_template(self): |
||||
|
""" To archive the record """ |
||||
|
self.active = False |
@ -0,0 +1,39 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- Template for the pdf file--> |
||||
|
<template id="download_template"> |
||||
|
<t t-call="web.html_container"> |
||||
|
<t t-call="web.external_layout"> |
||||
|
<div class="page"> |
||||
|
<h1 style="text-align:center">Downloaded Data</h1> |
||||
|
<hr/> |
||||
|
<br/> |
||||
|
<p>Name : |
||||
|
<span t-esc="name"/> |
||||
|
</p> |
||||
|
<p>Data</p> |
||||
|
<hr/> |
||||
|
<div> |
||||
|
<table class="table"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th scope="col">Name</th> |
||||
|
<th scope="col">Data</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<tr t-foreach="value" t-as="data"> |
||||
|
<th t-esc="data.get('name')"/> |
||||
|
<td t-if="data.get('data') == 'False' or data.get('data') == ''"> |
||||
|
No data for this field |
||||
|
</td> |
||||
|
<td t-else="" t-esc="data.get('data')"/> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
</template> |
||||
|
</odoo> |
|
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 912 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 107 KiB |
After Width: | Height: | Size: 107 KiB |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 116 KiB |
After Width: | Height: | Size: 237 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 8.9 KiB |
@ -0,0 +1,85 @@ |
|||||
|
.c-pill { |
||||
|
align-items: center; |
||||
|
font-family: "Open Sans", Arial, Verdana, sans-serif; |
||||
|
font-weight: bold; |
||||
|
font-size: 11px; |
||||
|
display: inline-block; |
||||
|
height: 100%; |
||||
|
white-space: nowrap; |
||||
|
width: auto; |
||||
|
position: relative; |
||||
|
border-radius: 100px; |
||||
|
line-height: 1; |
||||
|
overflow: hidden; |
||||
|
padding: 0px 12px 0px 20px; |
||||
|
text-overflow: ellipsis; |
||||
|
line-height: 1.25rem; |
||||
|
color: #fff; |
||||
|
word-break: break-word; |
||||
|
} |
||||
|
.c-pill--success { |
||||
|
background: #6BC167; |
||||
|
} |
||||
|
.c-pill--warning { |
||||
|
background: #ffc400; |
||||
|
} |
||||
|
.c-pill--danger { |
||||
|
background: #ff4436; |
||||
|
} |
||||
|
.card-gdpr:hover { |
||||
|
background-color: coral; |
||||
|
} |
||||
|
.table-gdpr { |
||||
|
font-family: arial, sans-serif; |
||||
|
border-collapse: collapse; |
||||
|
width: 100% |
||||
|
} |
||||
|
.th-gdpr { |
||||
|
background-color: #04AA6D; |
||||
|
color: white; |
||||
|
} |
||||
|
.td-gdpr, |
||||
|
.th-gdpr { |
||||
|
border: 2px solid #dddddd; |
||||
|
padding: 8px; |
||||
|
} |
||||
|
.gdpr-modal { |
||||
|
position: fixed; |
||||
|
left: 0; |
||||
|
top: 0; |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
background-color: rgba(0, 0, 0, 0.5); |
||||
|
opacity: 0; |
||||
|
visibility: hidden; |
||||
|
transform: scale(1.1); |
||||
|
transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s; |
||||
|
} |
||||
|
.gdpr-modal-content { |
||||
|
position: absolute; |
||||
|
top: 50%; |
||||
|
left: 50%; |
||||
|
transform: translate(-50%, -50%); |
||||
|
background-color: white; |
||||
|
padding: 1rem 1.5rem; |
||||
|
width: 30rem; |
||||
|
border-radius: 0.5rem; |
||||
|
} |
||||
|
.gdpr-close-button { |
||||
|
float: right; |
||||
|
width: 1.5rem; |
||||
|
line-height: 1.5rem; |
||||
|
text-align: center; |
||||
|
cursor: pointer; |
||||
|
border-radius: 0.25rem; |
||||
|
background-color: lightgray; |
||||
|
} |
||||
|
.gdpr-close-button:hover { |
||||
|
background-color: darkgray; |
||||
|
} |
||||
|
.gdpr-show-modal { |
||||
|
opacity: 1; |
||||
|
visibility: visible; |
||||
|
transform: scale(1.0); |
||||
|
transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s; |
||||
|
} |
@ -0,0 +1,59 @@ |
|||||
|
/** @odoo-module */ |
||||
|
|
||||
|
import publicWidget from '@web/legacy/js/public/public_widget'; |
||||
|
import {session} from "@web/session"; |
||||
|
import { rpc } from "@web/core/network/rpc"; |
||||
|
|
||||
|
var Template = publicWidget.Widget.extend({ |
||||
|
selector: '.gdpr_portal_template', |
||||
|
events: { |
||||
|
'click ._actionDelete': '_actionModalCloseAndOpen', |
||||
|
'click ._actionDownload': '_onClickActionDownload', |
||||
|
'click ._actionReqDownload': '_onClickActionReqDownload', |
||||
|
'click .gdpr-close-button': '_actionModalCloseAndOpen', |
||||
|
'click .gdpr-modal-confirm': '_onClickActionDelete', |
||||
|
}, |
||||
|
init() { |
||||
|
this._super(...arguments); |
||||
|
this.orm = this.bindService("orm"); |
||||
|
}, |
||||
|
/** |
||||
|
* Action to transfer data to create record type of delete |
||||
|
*/ |
||||
|
_onClickActionDelete: function(ev) { |
||||
|
rpc('/gdpr_management/confirm',{ |
||||
|
user_id: session.user_id, |
||||
|
template_id: this.template_id, |
||||
|
type: 'delete' |
||||
|
}) |
||||
|
}, |
||||
|
/** |
||||
|
* For opening and closing the modal |
||||
|
*/ |
||||
|
_actionModalCloseAndOpen: function(ev) { |
||||
|
this.template_id = Number(ev.currentTarget.getAttribute("id")) |
||||
|
this.el.querySelector(".gdpr-modal").classList.toggle("gdpr-show-modal") |
||||
|
}, |
||||
|
/** |
||||
|
* Action to transfer data to create record type of download |
||||
|
*/ |
||||
|
_onClickActionDownload: function(ev) { |
||||
|
rpc('/gdpr_management/confirm',{ |
||||
|
user_id: session.user_id, |
||||
|
template_id: Number(ev.currentTarget.getAttribute("id")), |
||||
|
type: 'download' |
||||
|
}) |
||||
|
}, |
||||
|
/** |
||||
|
* Action to open window of the content to download |
||||
|
*/ |
||||
|
_onClickActionReqDownload: function(ev) { |
||||
|
var req_id = Number(ev.currentTarget.getAttribute("id")) |
||||
|
this.orm.call('gdpr.request', 'action_download_pdf',[,req_id],{} |
||||
|
).then(function(result) { |
||||
|
window.open(result['url']) |
||||
|
}); |
||||
|
} |
||||
|
}) |
||||
|
publicWidget.registry.gdpr_portal_template = Template; |
||||
|
return Template; |
@ -0,0 +1,14 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- Action for downloading pdf --> |
||||
|
<record id="action_pdf_download" model="ir.actions.report"> |
||||
|
<field name="name">Download Data</field> |
||||
|
<field name="model">gdpr.request</field> |
||||
|
<field name="report_type">qweb-pdf</field> |
||||
|
<field name="report_name">website_gdpr_odoo.download_template</field> |
||||
|
<field name="report_file">website_gdpr_odoo.download_template</field> |
||||
|
<field name="print_report_name">Download Data</field> |
||||
|
<field name="binding_model_id" ref="model_gdpr_request"/> |
||||
|
<field name="binding_type">report</field> |
||||
|
</record> |
||||
|
</odoo> |