@ -0,0 +1,43 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg |
||||
|
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html |
||||
|
:alt: License: LGPL-3 |
||||
|
|
||||
|
Reports With Watermark |
||||
|
====================== |
||||
|
* This module allow to have watermark on your pdf reports |
||||
|
|
||||
|
Installation |
||||
|
============ |
||||
|
- www.odoo.com/documentation/17.0/setup/install.html |
||||
|
- Install our custom addon |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
General Public License, Version 3 (LGPL v3). |
||||
|
(https://www.odoo.com/documentation/user/17.0/legal/licenses/licenses.html) |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developer:(v18) Saneen K, Contact: odoo@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,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Saneen K (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import models |
@ -0,0 +1,45 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Saneen K (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
'name': 'Reports With Watermark', |
||||
|
'version': '18.0.1.1.1', |
||||
|
'category': 'Extra Tools', |
||||
|
'summary':"""Print the PDF reports with watermark""", |
||||
|
'description':"""This module allows you to add watermarks to PDF reports |
||||
|
generated in Odoo. You can customize the watermark text, font, size, |
||||
|
color, and position.""", |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': "https://www.cybrosys.com", |
||||
|
'depends': ['base', 'mail'], |
||||
|
'data': [ |
||||
|
'views/res_company_views.xml', |
||||
|
'report/pdf_with_watermark_template.xml', |
||||
|
'views/base_document_layout.xml', |
||||
|
], |
||||
|
'images': ['static/description/banner.jpg'], |
||||
|
'license': 'LGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
} |
@ -0,0 +1,5 @@ |
|||||
|
## Module <pdf_report_with_watermark> |
||||
|
#### 04.11.2024 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
##### ADD |
||||
|
- Initial Commit for Reports With Watermark |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Saneen K (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import res_company |
||||
|
from . import base_document_layout |
@ -0,0 +1,43 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Saneen K (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class BaseDocumentLayout(models.TransientModel): |
||||
|
_inherit = 'base.document.layout' |
||||
|
|
||||
|
watermark = fields.Boolean(related='company_id.watermark', |
||||
|
help='Enable it, if you want to apply watermark ' |
||||
|
'on all your pdf reports' |
||||
|
) |
||||
|
content_text = fields.Char(related='company_id.content_text', |
||||
|
help="Enter the text You want to display") |
||||
|
watermark_type = fields.Selection(related='company_id.watermark_type', |
||||
|
help='Select the Type of watermark') |
||||
|
color_picker = fields.Char(related='company_id.color_picker', |
||||
|
help='Select the Color') |
||||
|
font_size = fields.Integer(related='company_id.font_size', |
||||
|
help="Enter the font size for the text") |
||||
|
background_image = fields.Image(related='company_id.background_image', |
||||
|
help='Set an image to display') |
||||
|
rotating_angle = fields.Float(related='company_id.rotating_angle', |
||||
|
help='Enter the angle of rotation') |
@ -0,0 +1,44 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Saneen K (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ResCompany(models.Model): |
||||
|
"""Introduce watermark in pdf reports""" |
||||
|
_inherit = 'res.company' |
||||
|
|
||||
|
watermark = fields.Boolean(string='Watermark', |
||||
|
help='Enable it, if you want to apply watermark ' |
||||
|
'on all your pdf reports') |
||||
|
content_text = fields.Char(string='Text', |
||||
|
help="Enter the text You want to display") |
||||
|
watermark_type = fields.Selection([('image', 'Image'), |
||||
|
('text', 'Text'), ('logo', 'Logo'),], |
||||
|
default='text', |
||||
|
help='Select the Type of watermark') |
||||
|
color_picker = fields.Char(string='Color Picker', help='Select the Color') |
||||
|
font_size = fields.Integer(string='Font size', default=20, |
||||
|
help="Enter the font size for the text") |
||||
|
background_image = fields.Image(string='Image', |
||||
|
help='Set an image to display') |
||||
|
rotating_angle = fields.Float(string='Angle of Rotation', |
||||
|
help='Enter the angle of rotation') |
@ -0,0 +1,31 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!--Apply the watermark to the pdf report with mentioned specifications--> |
||||
|
<odoo> |
||||
|
<template id="pdf_watermark_report" |
||||
|
inherit_id="web.external_layout_standard"> |
||||
|
<xpath expr="//div[hasclass('row')][last()]" position="after"> |
||||
|
<t t-if="company.watermark"> |
||||
|
<div class="row" |
||||
|
style="height:200px; width:300px;margin-left:30%;margin-top:50%;"> |
||||
|
<div class="col-6" name="watermark"> |
||||
|
<span t-attf-style="-webkit-transform:rotate(-{{company.rotating_angle}}deg);color:{{company.color_picker}};font-size:{{company.font_size}}px;text-align:center;position:absolute;text-align:center;opacity:0.25;"> |
||||
|
<t t-if="company.watermark_type == 'text'"> |
||||
|
<t t-esc="company.content_text"/> |
||||
|
</t> |
||||
|
<t t-if="company.watermark_type == 'image'"> |
||||
|
<img t-if="company.background_image" |
||||
|
t-att-src="image_data_uri(company.background_image)" |
||||
|
style="position:absolute;height:200px; width:300px; opacity: 1;"/> |
||||
|
</t> |
||||
|
<t t-if="company.watermark_type == 'logo'"> |
||||
|
<img t-if="company.logo" |
||||
|
t-att-src="image_data_uri(company.logo)" |
||||
|
style="position:absolute;height:200px; width:300px; opacity: 1;"/> |
||||
|
</t> |
||||
|
</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</t> |
||||
|
</xpath> |
||||
|
</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: 82 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: 757 KiB |
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 723 KiB |
After Width: | Height: | Size: 141 KiB |
After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,16 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!--Configuration of Layout View--> |
||||
|
<record id="view_base_document_layout" model="ir.ui.view"> |
||||
|
<field name="name"> |
||||
|
base.document.layout.view.form.inherit.sale.report.format.editor |
||||
|
</field> |
||||
|
<field name="model">base.document.layout</field> |
||||
|
<field name="inherit_id" ref="web.view_base_document_layout"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="paperformat_id" position="after"> |
||||
|
<field name="watermark"/> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |
@ -0,0 +1,26 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!--Adding new fields to the res.company, that related to the watermark--> |
||||
|
<odoo> |
||||
|
<record id="res_company_view_form" model="ir.ui.view"> |
||||
|
<field name="name">res.company.view.form.inherit.pdf.report.with.watermark</field> |
||||
|
<field name="model">res.company</field> |
||||
|
<field name="inherit_id" ref="base.view_company_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="currency_id" position="after"> |
||||
|
<field name="watermark"/> |
||||
|
<field name="watermark_type" widget="radio" |
||||
|
invisible="watermark == False"/> |
||||
|
<field name="content_text" |
||||
|
invisible ="watermark_type in ('image' , 'logo') or watermark == False"/> |
||||
|
<field name="font_size" |
||||
|
invisible ="watermark_type in ('image' , 'logo') or watermark == False"/> |
||||
|
<field name="color_picker" widget='color' |
||||
|
invisible ="watermark_type in ('image' , 'logo' , False) or watermark == False"/> |
||||
|
<field name="background_image" widget='image' |
||||
|
invisible ="watermark_type in ('text' , 'logo' , False) or watermark == False"/> |
||||
|
<field name="rotating_angle" |
||||
|
invisible="watermark == False"/> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |