@ -1,6 +1,6 @@ |
|||
## Module <advanced_dynamic_dashboard> |
|||
|
|||
#### 15.07.2023 |
|||
#### 22.03.2024 |
|||
#### Version 16.0.1.0.0 |
|||
#### ADD |
|||
- Initial commit for Advanced Dynamic Dashboard |
@ -0,0 +1,27 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.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 api, SUPERUSER_ID |
|||
|
|||
|
|||
def uninstall_hook(cr, registry): |
|||
env = api.Environment(cr, SUPERUSER_ID, {}) |
|||
env['dashboard.menu'].search([]).unlink() |
|
Before Width: | Height: | Size: 4.1 MiB |
After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 300 KiB After Width: | Height: | Size: 150 KiB |
Before Width: | Height: | Size: 376 KiB After Width: | Height: | Size: 150 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 300 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 300 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 265 KiB After Width: | Height: | Size: 150 KiB |
Before Width: | Height: | Size: 285 KiB After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 261 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 212 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 308 KiB After Width: | Height: | Size: 157 KiB |
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 140 KiB |
Before Width: | Height: | Size: 263 KiB After Width: | Height: | Size: 204 KiB |
Before Width: | Height: | Size: 288 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 155 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 201 KiB |
Before Width: | Height: | Size: 288 KiB After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 183 KiB |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.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 dashboard_mail |
@ -0,0 +1,75 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.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 DashboardMail(models.TransientModel): |
|||
_name = 'dashboard.mail' |
|||
_description = 'Dashboard Mail' |
|||
|
|||
user_ids = fields.Many2many('res.users', string="Users", |
|||
domain="[('id','!=', uid)]", |
|||
help="Select User") |
|||
base64code = fields.Char(string='Base 64', help='Base64 Code of the pdf') |
|||
|
|||
def send_mail(self): |
|||
""" |
|||
Function for sending mail to the selected users |
|||
""" |
|||
for user in self.user_ids: |
|||
mail_content = ( |
|||
'Hi %s, <br/> ' |
|||
'I hope this mail finds you well. I am pleased to share the <b>Dashboard Report</b> with you.<br/>' |
|||
'Please find the attachment<br/>') % user.name |
|||
mail_values = { |
|||
'subject': 'Dashboard Report', |
|||
'author_id': self.env.user.partner_id.id, |
|||
'body_html': mail_content, |
|||
'email_to': user.email, |
|||
} |
|||
mail_id = self.env['mail.mail'].create(mail_values) |
|||
attachment_values = { |
|||
'name': 'Dashboard.pdf', |
|||
'datas': self.base64code, |
|||
'type': 'binary', |
|||
'res_model': 'mail.mail', |
|||
'res_id': mail_id.id, |
|||
} |
|||
attachment_id = self.env['ir.attachment'].create(attachment_values) |
|||
mail_id.write({ |
|||
'attachment_ids': [(4, attachment_id.id)] |
|||
}) |
|||
mail_id.send() |
|||
|
|||
return { |
|||
'type': 'ir.actions.client', |
|||
'tag': 'reload', |
|||
} |
|||
|
|||
def cancel_mail(self): |
|||
""" |
|||
Function for refreshing the page while clicking cancel |
|||
""" |
|||
return { |
|||
'type': 'ir.actions.client', |
|||
'tag': 'reload', |
|||
} |
@ -0,0 +1,22 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Sending dashboard pdf to users --> |
|||
<record id="dashboard_mail_view_form" model="ir.ui.view"> |
|||
<field name="name">dashboard.mail.view.form</field> |
|||
<field name="model">dashboard.mail</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Sent Mail"> |
|||
<group> |
|||
<field name="user_ids" widget="many2many_tags"/> |
|||
<field name="base64code" invisible="1"/> |
|||
</group> |
|||
<footer> |
|||
<button name="send_mail" string="SEND" |
|||
class="btn-primary" type="object"/> |
|||
<button string="Cancel" class="btn-secondary" |
|||
name="cancel_mail" type="object"/> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
</odoo> |