diff --git a/invoice_format_editor/README.rst b/invoice_format_editor/README.rst new file mode 100644 index 000000000..4e25edade --- /dev/null +++ b/invoice_format_editor/README.rst @@ -0,0 +1,43 @@ +Invoice Format Editor +===================== +* Invoice Format Editor for Odoo 14 community editions + +Installation +============= + - www.odoo.com/documentation/14.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/14.0/legal/licenses/licenses.html) + +Company +------- +* 'Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: +(v14) Sonu @ Cybrosys +(v14) Dino @ Cybrosys + + +Contacts +-------- +* Mail 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 +========== +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ + diff --git a/invoice_format_editor/__init__.py b/invoice_format_editor/__init__.py new file mode 100644 index 000000000..29aed00c1 --- /dev/null +++ b/invoice_format_editor/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# + +from . import model diff --git a/invoice_format_editor/__manifest__.py b/invoice_format_editor/__manifest__.py new file mode 100644 index 000000000..b8a3d6ec4 --- /dev/null +++ b/invoice_format_editor/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# + +{ + 'name': 'Invoice Format Editor', + 'version': '14.0.1.0.0', + 'category': 'Accounting', + 'summary': 'Invoice Format Editor', + 'description': """Invoice Format Editor For Configuring the Invoice Templates""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'images': ['static/description/banner.jpg'], + 'website': 'https://www.cybrosys.com', + 'depends': ['account'], + 'data': ['security/ir.model.access.csv', + 'data/design_templates.xml', + 'views/custom_layouts.xml', + 'views/document_base_layout.xml', + 'reports/custom_invoice_template.xml', + 'reports/custom_invoice_template_fantacy.xml', + 'reports/custom_invoice_template_old_standard.xml', + 'reports/default_invoice_template.xml', + 'template_view/default_template_view.xml', + 'template_view/normal_template_view.xml', + 'template_view/modern_template_view.xml', + 'template_view/old_template_view.xml', + ], + 'license': 'LGPL-3', + 'installable': True, + 'application': True, + 'auto_install': False, + +} diff --git a/invoice_format_editor/data/design_templates.xml b/invoice_format_editor/data/design_templates.xml new file mode 100644 index 000000000..3bfe5e48a --- /dev/null +++ b/invoice_format_editor/data/design_templates.xml @@ -0,0 +1,27 @@ + + + + + Modern + #732673 + #ffffff + #000000 + #000000 + right + right + left + #808080 + + + Standard + #ff7733 + #ffffff + #000000 + #000000 + left + left + right + #808080 + + + \ No newline at end of file diff --git a/invoice_format_editor/model/__init__.py b/invoice_format_editor/model/__init__.py new file mode 100644 index 000000000..9794f65c5 --- /dev/null +++ b/invoice_format_editor/model/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# + +from . import res_company +from . import document_layout diff --git a/invoice_format_editor/model/document_layout.py b/invoice_format_editor/model/document_layout.py new file mode 100644 index 000000000..15b20b172 --- /dev/null +++ b/invoice_format_editor/model/document_layout.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# + +from odoo import models, fields, api + + +class AddDocumentTemplate(models.Model): + _name = "doc.layout" + _description = 'Adding the fields for customization' + _rec_name = 'name' + + name = fields.Char("Name") + + base_color = fields.Char("Base Color", + help="Background color for the invoice") + + heading_text_color = fields.Char("Heading text Color", + help="Heading Text color") + + text_color = fields.Char("Text Color", help="Text color of items") + + customer_text_color = fields.Char("Customer Text Color", + help="Customer address text color") + + company_text_color = fields.Char("Company Text Color", + help="Company address Text color") + + logo_position = fields.Selection([('left', 'Left'), ('right', 'Right')], + string="Logo Position", + help="Company logo position") + + customer_position = fields.Selection( + [('left', 'Left'), ('right', 'Right')], string="Customer position", + help="Customer address position") + + company_position = fields.Selection([('left', 'Left'), ('right', 'Right')], + string="Company Address Position", + help="Company address position") + + sales_person = fields.Boolean('Sales person', default=False, + help="Sales Person") + description = fields.Boolean('Description', default=False, + help="Description") + hsn_code = fields.Boolean('HSN Code', default=False, help="HSN code") + tax_value = fields.Boolean('Tax', default=False, help="Tax") + reference = fields.Boolean('Reference', default=False, + help="Customer Reference") + source = fields.Boolean('Source', default=False, + help="Source Document") + address = fields.Boolean('Address', default=False, + help="Address") + city = fields.Boolean('City', default=False, + help="City") + country = fields.Boolean('Country', default=False, + help="Country") diff --git a/invoice_format_editor/model/res_company.py b/invoice_format_editor/model/res_company.py new file mode 100644 index 000000000..479163b83 --- /dev/null +++ b/invoice_format_editor/model/res_company.py @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 . +# +############################################################################# + +from odoo import models, fields, api + + +class ReportCompanyTemplate(models.Model): + _inherit = 'res.company' + + base_layout = fields.Selection( + [('normal', 'Normal'), ('modern', 'Modern'), ('old', 'Old Standard'), + ('default', 'Default')], + string="Invoice Document Layout", default="default") + document_layout_id = fields.Many2one("doc.layout", + string="Invoice Layout Configuration" + ) + + +class TemplateInvoice(models.Model): + _inherit = 'account.move' + + base_layout = fields.Selection( + [('normal', 'Normal'), ('modern', 'Modern'), ('old', 'Old Standard'), + ('default', 'Default')]) + theme_id = fields.Many2one('doc.layout', + related='company_id.document_layout_id') + + +class BaseDocumentLayout(models.TransientModel): + _inherit = 'base.document.layout' + + base_layout = fields.Selection(related='company_id.base_layout', + readonly=False) + document_layout_id = fields.Many2one( + related='company_id.document_layout_id', readonly=False) + + @api.depends('report_layout_id', 'logo', 'font', 'primary_color', + 'secondary_color', 'report_header', 'report_footer', + 'base_layout', 'document_layout_id') + def _compute_preview(self): + """ compute a qweb based preview to display on the wizard """ + + styles = self._get_asset_style() + + for wizard in self: + if wizard.report_layout_id: + if wizard.base_layout == 'default': + preview_css = self._get_css_for_preview(styles, wizard.id) + ir_ui_view = wizard.env['ir.ui.view'] + wizard.preview = ir_ui_view._render_template( + 'invoice_format_editor.report_preview_default', + {'company': wizard, 'preview_css': preview_css}) + + elif wizard.base_layout == 'normal': + preview_css = self._get_css_for_preview(styles, wizard.id) + ir_ui_view = wizard.env['ir.ui.view'] + wizard.preview = ir_ui_view._render_template( + 'invoice_format_editor.report_preview_normal', + {'company': wizard, 'preview_css': preview_css, }) + + elif wizard.base_layout == 'modern': + preview_css = self._get_css_for_preview(styles, wizard.id) + ir_ui_view = wizard.env['ir.ui.view'] + wizard.preview = ir_ui_view._render_template( + 'invoice_format_editor.report_preview_modern', + {'company': wizard, 'preview_css': preview_css, }) + + elif wizard.base_layout == 'old': + preview_css = self._get_css_for_preview(styles, wizard.id) + ir_ui_view = wizard.env['ir.ui.view'] + wizard.preview = ir_ui_view._render_template( + 'invoice_format_editor.report_preview_old', + {'company': wizard, 'preview_css': preview_css, }) + + else: + wizard.preview = False diff --git a/invoice_format_editor/reports/custom_invoice_template.xml b/invoice_format_editor/reports/custom_invoice_template.xml new file mode 100644 index 000000000..5a3559e3c --- /dev/null +++ b/invoice_format_editor/reports/custom_invoice_template.xml @@ -0,0 +1,459 @@ + + + + + + + + \ No newline at end of file diff --git a/invoice_format_editor/reports/custom_invoice_template_fantacy.xml b/invoice_format_editor/reports/custom_invoice_template_fantacy.xml new file mode 100644 index 000000000..e0fc2731b --- /dev/null +++ b/invoice_format_editor/reports/custom_invoice_template_fantacy.xml @@ -0,0 +1,344 @@ + + + + + + + \ No newline at end of file diff --git a/invoice_format_editor/reports/custom_invoice_template_old_standard.xml b/invoice_format_editor/reports/custom_invoice_template_old_standard.xml new file mode 100644 index 000000000..e62178806 --- /dev/null +++ b/invoice_format_editor/reports/custom_invoice_template_old_standard.xml @@ -0,0 +1,269 @@ + + + + + + \ No newline at end of file diff --git a/invoice_format_editor/reports/default_invoice_template.xml b/invoice_format_editor/reports/default_invoice_template.xml new file mode 100644 index 000000000..32e64bfe7 --- /dev/null +++ b/invoice_format_editor/reports/default_invoice_template.xml @@ -0,0 +1,353 @@ + + + + + + + + + + + + + diff --git a/invoice_format_editor/security/ir.model.access.csv b/invoice_format_editor/security/ir.model.access.csv new file mode 100644 index 000000000..d7804d521 --- /dev/null +++ b/invoice_format_editor/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_document_template,document.template,model_doc_layout,base.group_user,1,1,1,1 diff --git a/invoice_format_editor/static/description/banner.jpg b/invoice_format_editor/static/description/banner.jpg new file mode 100644 index 000000000..05dd44b09 Binary files /dev/null and b/invoice_format_editor/static/description/banner.jpg differ diff --git a/invoice_format_editor/static/description/icon.png b/invoice_format_editor/static/description/icon.png new file mode 100644 index 000000000..4722db21c Binary files /dev/null and b/invoice_format_editor/static/description/icon.png differ diff --git a/invoice_format_editor/static/description/images/configuration.png b/invoice_format_editor/static/description/images/configuration.png new file mode 100644 index 000000000..5eaaebeca Binary files /dev/null and b/invoice_format_editor/static/description/images/configuration.png differ diff --git a/invoice_format_editor/static/description/images/default.png b/invoice_format_editor/static/description/images/default.png new file mode 100644 index 000000000..b25d08f14 Binary files /dev/null and b/invoice_format_editor/static/description/images/default.png differ diff --git a/invoice_format_editor/static/description/images/hidefield.png b/invoice_format_editor/static/description/images/hidefield.png new file mode 100644 index 000000000..6af04c5af Binary files /dev/null and b/invoice_format_editor/static/description/images/hidefield.png differ diff --git a/invoice_format_editor/static/description/images/invoiceselection.png b/invoice_format_editor/static/description/images/invoiceselection.png new file mode 100644 index 000000000..6ffab1601 Binary files /dev/null and b/invoice_format_editor/static/description/images/invoiceselection.png differ diff --git a/invoice_format_editor/static/description/images/modern.png b/invoice_format_editor/static/description/images/modern.png new file mode 100644 index 000000000..eaf8df6a3 Binary files /dev/null and b/invoice_format_editor/static/description/images/modern.png differ diff --git a/invoice_format_editor/static/description/images/normal.png b/invoice_format_editor/static/description/images/normal.png new file mode 100644 index 000000000..2c9fbd196 Binary files /dev/null and b/invoice_format_editor/static/description/images/normal.png differ diff --git a/invoice_format_editor/static/description/images/oldstandard.png b/invoice_format_editor/static/description/images/oldstandard.png new file mode 100644 index 000000000..c5f0d6688 Binary files /dev/null and b/invoice_format_editor/static/description/images/oldstandard.png differ diff --git a/invoice_format_editor/static/description/images/screen.gif b/invoice_format_editor/static/description/images/screen.gif new file mode 100644 index 000000000..62c72e274 Binary files /dev/null and b/invoice_format_editor/static/description/images/screen.gif differ diff --git a/invoice_format_editor/static/description/index.html b/invoice_format_editor/static/description/index.html new file mode 100644 index 000000000..cafc65ff3 --- /dev/null +++ b/invoice_format_editor/static/description/index.html @@ -0,0 +1,729 @@ + + + + + + + + Invoice Template Editor + + + + + + +
+
+
+ +
+
+ +
+

+ Invoice Format Editor

+ +

+ Odoo Invoice Format Editor +

+ + Key Highlights + +
+
+
+ +
    +
  • Configure the + layout. +
  • +
  • Configure the + position of fields. +
  • +
+
+ +
+ +
    +
  • Hide the option + invoice fields. +
  • +
  • Edit the theme. +
+
+ +
+ Download Odoo 14 + + + + +
+
+
+ +
+ + +
+ + + + +
+ +
+ +
+
+
+ + +
+
+ +
+
+

+ Overview

+ +

In the Invoice Format Editor + App, We can configure the invoice + fields to our own need. There we can have 4 + types of templates - Default, Normal, Modern, + Old Standard. We can also customize and hide the + fields.

+
+
+

+ Features

+
    +
  • +
    + Configure the layout.
    +
  • +
  • +
    + Configure the position of fields.
    +
  • +
  • +
    + Hide option for the invoice fields.
    +
  • +
  • +
    + Edit the theme.
    +
  • + +
+
+
+

+ Screenshots

+
+
+ + + + + + + +
+
+
+
+ +
+
+
+ +
+

+ Suggested Products

+
+ +
+ + +
+ +
+
+ Odoo Gold Partner +
+
+

+ Our Services

+

We provide following services

+ +
+
+
+ Odoo Gold Partner +
+
+ + +
+ +
+ + +
+
+
+

+ Need Help?

+
+
+
+ + +
+
+
Visit us
+

Visit our + website for more + information.

+ www.cybrosys.com +
+ +
+
Write to us
+

Do you + have any queries regarding our + products & services? Let us know.

+ odoo@cybrosys.com + info@cybrosys.com +
+ b + +
+
Follow Us
+

Follow us + on social media for latest + updates.

+
+ + + + + + +
+ +
+ +
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + + + + diff --git a/invoice_format_editor/static/src/css/invoice_layout.css b/invoice_format_editor/static/src/css/invoice_layout.css new file mode 100644 index 000000000..84139d5c3 --- /dev/null +++ b/invoice_format_editor/static/src/css/invoice_layout.css @@ -0,0 +1,3 @@ +body{ + color:red; +} \ No newline at end of file diff --git a/invoice_format_editor/template_view/default_template_view.xml b/invoice_format_editor/template_view/default_template_view.xml new file mode 100644 index 000000000..7de1381cf --- /dev/null +++ b/invoice_format_editor/template_view/default_template_view.xml @@ -0,0 +1,204 @@ + + + + + + + \ No newline at end of file diff --git a/invoice_format_editor/template_view/modern_template_view.xml b/invoice_format_editor/template_view/modern_template_view.xml new file mode 100644 index 000000000..f2722005b --- /dev/null +++ b/invoice_format_editor/template_view/modern_template_view.xml @@ -0,0 +1,233 @@ + + + + + + + \ No newline at end of file diff --git a/invoice_format_editor/template_view/normal_template_view.xml b/invoice_format_editor/template_view/normal_template_view.xml new file mode 100644 index 000000000..7d5a74fc0 --- /dev/null +++ b/invoice_format_editor/template_view/normal_template_view.xml @@ -0,0 +1,223 @@ + + + + + + diff --git a/invoice_format_editor/template_view/old_template_view.xml b/invoice_format_editor/template_view/old_template_view.xml new file mode 100644 index 000000000..faf6688e7 --- /dev/null +++ b/invoice_format_editor/template_view/old_template_view.xml @@ -0,0 +1,249 @@ + + + + + + + \ No newline at end of file diff --git a/invoice_format_editor/views/custom_layouts.xml b/invoice_format_editor/views/custom_layouts.xml new file mode 100644 index 000000000..35a4049eb --- /dev/null +++ b/invoice_format_editor/views/custom_layouts.xml @@ -0,0 +1,59 @@ + + + + + document.custom.layout + doc.layout + +
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ + diff --git a/invoice_format_editor/views/document_base_layout.xml b/invoice_format_editor/views/document_base_layout.xml new file mode 100644 index 000000000..2d41fa019 --- /dev/null +++ b/invoice_format_editor/views/document_base_layout.xml @@ -0,0 +1,17 @@ + + + + + base.layout.new + base.document.layout + + + + + + + + + + \ No newline at end of file