@ -0,0 +1,42 @@ |
|||
.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg |
|||
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html |
|||
:alt: License: LGPL-3 |
|||
|
|||
Odoo Professional Report Templates |
|||
================================== |
|||
Odoo Professional Report Templates. |
|||
|
|||
License |
|||
------- |
|||
General Public License, Version 3 (LGPL-3). |
|||
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
Credits |
|||
------- |
|||
Developers: (V18) Bhagyadev KP, (V17) Subina P, (V16) Gayathri, Contact: odoo@cybrosys.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,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Bhagyadev KP (<https://www.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 model |
@ -0,0 +1,69 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Bhagyadev KP (<https://www.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': 'Odoo Professional Report Templates', |
|||
'version': '18.0.1.0.0', |
|||
'category': 'Sales,Purchases,Accounting,Warehouse', |
|||
'summary': "Report Templates, Professional Report Templates, Report Customisations, Sale Reports, Purchase Reports, Invoice Reports, Templates, Odoo17, Oodoo Apps", |
|||
'description': "To tailor the presentation of different reports such as " |
|||
"Sales Orders, Purchase Orders, Invoices, and Delivery " |
|||
"Orders, the process involves customizing the report " |
|||
"templates , especially for PDF reports By doing so, " |
|||
"you can personalize the design,content of these reports to" |
|||
"better suit your business needs and preferences.", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': 'https://www.cybrosys.com', |
|||
'depends': ['sale_management', 'account', 'stock', 'purchase'], |
|||
'data': [ |
|||
'data/doc_layout_data.xml', |
|||
'security/ir.model.access.csv', |
|||
'views/res_company_views.xml', |
|||
'views/sale_order_views.xml', |
|||
'views/purchase_order_views.xml', |
|||
'views/account_move_views.xml', |
|||
'views/stock_picking_views.xml', |
|||
'views/doc_layout_views.xml', |
|||
'report/purchase_traditional_templates.xml', |
|||
'report/purchase_standard_templates.xml', |
|||
'report/purchase_modern_templates.xml', |
|||
'report/purchase_attractive_templates.xml', |
|||
'report/sale_traditional_templates.xml', |
|||
'report/sale_standrd_templates.xml', |
|||
'report/sale_modern_templates.xml', |
|||
'report/sale_attractive_templates.xml', |
|||
'report/stock_traditional_templates.xml', |
|||
'report/stock_standard_templates.xml', |
|||
'report/stock_modern_templates.xml', |
|||
'report/stock_attractive_templates.xml', |
|||
'report/account_traditional_templates.xml', |
|||
'report/account_standrd_templates.xml', |
|||
'report/account_modern_templates.xml', |
|||
'report/account_attractive_templates.xml', |
|||
], |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'LGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,53 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data noupdate="1"> |
|||
<!-- Modern Doc Layout --> |
|||
<record id="modern" model="doc.layout"> |
|||
<field name="name">Modern</field> |
|||
<field name="base_color">#732673</field> |
|||
<field name="heading_text_color">#ffffff</field> |
|||
<field name="text_color">#000000</field> |
|||
<field name="customer_text_color">#000000</field> |
|||
<field name="logo_position">right</field> |
|||
<field name="customer_position">right</field> |
|||
<field name="company_position">left</field> |
|||
<field name="company_text_color">#808080</field> |
|||
</record> |
|||
<!-- Standard Doc Layout --> |
|||
<record id="standard" model="doc.layout"> |
|||
<field name="name">Standard</field> |
|||
<field name="base_color">#ff7733</field> |
|||
<field name="heading_text_color">#ffffff</field> |
|||
<field name="text_color">#000000</field> |
|||
<field name="customer_text_color">#000000</field> |
|||
<field name="logo_position">left</field> |
|||
<field name="customer_position">left</field> |
|||
<field name="company_position">right</field> |
|||
<field name="company_text_color">#808080</field> |
|||
</record> |
|||
<!-- Traditional Doc Layout --> |
|||
<record id="traditional" model="doc.layout"> |
|||
<field name="name">Traditional</field> |
|||
<field name="base_color">#ff7733</field> |
|||
<field name="heading_text_color">#ffffff</field> |
|||
<field name="text_color">#000000</field> |
|||
<field name="customer_text_color">#000000</field> |
|||
<field name="logo_position">left</field> |
|||
<field name="customer_position">left</field> |
|||
<field name="company_position">right</field> |
|||
<field name="company_text_color">#808080</field> |
|||
</record> |
|||
<!-- Attractive Doc Layout --> |
|||
<record id="attractive" model="doc.layout"> |
|||
<field name="name">Attractive</field> |
|||
<field name="base_color">#ff7733</field> |
|||
<field name="heading_text_color">#ffffff</field> |
|||
<field name="text_color">#000000</field> |
|||
<field name="customer_text_color">#000000</field> |
|||
<field name="logo_position">left</field> |
|||
<field name="customer_position">left</field> |
|||
<field name="company_position">right</field> |
|||
<field name="company_text_color">#808080</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,6 @@ |
|||
## Module <base_advanced_report_templates> |
|||
|
|||
#### 08.08.2024 |
|||
#### Version 18.0.1.0.0 |
|||
##### ADD |
|||
- Initial commit for Odoo Professional Report Templates |
@ -0,0 +1,32 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Bhagyadev KP (<https://www.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 account_move |
|||
from . import account_move_line |
|||
from . import base_document_layout |
|||
from . import doc_layout |
|||
from . import purchase_order_line |
|||
from . import purchase_order |
|||
from . import res_company |
|||
from . import sale_order |
|||
from . import sale_order_line |
|||
from . import stock_move |
|||
from . import stock_picking |
@ -0,0 +1,37 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Bhagyadev KP (<https://www.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 AccountMove(models.Model): |
|||
""" |
|||
Inheriting account_move model |
|||
""" |
|||
_inherit = 'account.move' |
|||
|
|||
theme_id = fields.Many2one( |
|||
comodel_name='doc.layout', |
|||
related='company_id.account_document_layout_id', |
|||
help='This field is used to specify the document' |
|||
'layout theme associated with the company.', |
|||
string='Theme' |
|||
) |
@ -0,0 +1,36 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Bhagyadev KP (<https://www.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 AccountMoveLine(models.Model): |
|||
"""invoice line image""" |
|||
_inherit = 'account.move.line' |
|||
|
|||
order_line_image = fields.Binary( |
|||
string="Image", |
|||
related="product_id.image_128", |
|||
help="This field represents the image " |
|||
"associated with the product on the " |
|||
"invoice line." |
|||
) |
@ -0,0 +1,205 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Bhagyadev KP (<https://www.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 api, fields, models |
|||
|
|||
|
|||
class BaseDocumentLayout(models.TransientModel): |
|||
""" |
|||
This model extends the 'base.document.layout' transient model to |
|||
incorporate additional document layout fields related to sales, |
|||
purchases, and company-wide settings. |
|||
""" |
|||
_inherit = 'base.document.layout' |
|||
|
|||
sale_document_layout_id = fields.Many2one( |
|||
related='company_id.sale_document_layout_id', readonly=False, |
|||
string="Sale Document Layout", help="This field specify the " |
|||
"document layout for sales associated with the company." |
|||
) |
|||
|
|||
purchase_document_layout_id = fields.Many2one( |
|||
related='company_id.purchase_document_layout_id', readonly=False, |
|||
string="Purchase Document Layout", |
|||
help="This field specify the document layout for purchases associated " |
|||
"with the company." |
|||
) |
|||
account_document_layout_id = fields.Many2one( |
|||
related='company_id.account_document_layout_id', readonly=False, |
|||
string="Account Document Layout", |
|||
help="This field specify the document layout for accounting " |
|||
"associated with the company." |
|||
) |
|||
stock_document_layout_id = fields.Many2one( |
|||
related='company_id.stock_document_layout_id', readonly=False, |
|||
string="Stock Document Layout", |
|||
help="This field specify the document layout for stock " |
|||
"management associated with the company. " |
|||
) |
|||
watermark = fields.Boolean( |
|||
string='Watermark', |
|||
help="This field is used to specify the document" |
|||
"layout for stock management associated " |
|||
"with the company." |
|||
) |
|||
watermark_show = fields.Selection([ |
|||
('logo', 'Company Logo'), |
|||
('name', 'Company Name'), |
|||
], default='logo', string="Watermark Show", |
|||
help="Select the element to show as a watermark on the documents." |
|||
) |
|||
|
|||
@api.depends('report_layout_id', 'logo', 'font', 'primary_color', |
|||
'secondary_color', 'report_header', 'report_footer', |
|||
'sale_document_layout_id', |
|||
'stock_document_layout_id', 'account_document_layout_id', |
|||
'purchase_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.sale_document_layout_id: |
|||
if wizard.sale_document_layout_id == '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( |
|||
'base_advanced_report_templates.report_saleorder_modern_document', |
|||
{'company': wizard, 'preview_css': preview_css}) |
|||
elif wizard.sale_document_layout_id == 'traditional': |
|||
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( |
|||
'base_advanced_report_templates.report_saleorder_traditional_document', |
|||
{'company': wizard, 'preview_css': preview_css, }) |
|||
elif wizard.sale_document_layout_id == 'standard': |
|||
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( |
|||
'base_advanced_report_templates.report_saleorder_standard_document', |
|||
{'company': wizard, 'preview_css': preview_css, }) |
|||
elif wizard.sale_document_layout_id == 'attractive': |
|||
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( |
|||
'base_advanced_report_templates.report_saleorder_attractive_document', |
|||
{'company': wizard, 'preview_css': preview_css, }) |
|||
else: |
|||
wizard.preview = False |
|||
if wizard.purchase_document_layout_id: |
|||
if wizard.purchase_document_layout_id == '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( |
|||
'base_advanced_report_templates.report_purchaseorder_modern_document', |
|||
{'company': wizard, 'preview_css': preview_css}) |
|||
elif wizard.purchase_document_layout_id == 'traditional': |
|||
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( |
|||
'base_advanced_report_templates.report_purchaseorder_traditional_document', |
|||
{'company': wizard, 'preview_css': preview_css, }) |
|||
elif wizard.purchase_document_layout_id == 'standard': |
|||
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( |
|||
'base_advanced_report_templates.report_purchaseorder_standard_document', |
|||
{'company': wizard, 'preview_css': preview_css, }) |
|||
elif wizard.purchase_document_layout_id == 'attractive': |
|||
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( |
|||
'base_advanced_report_templates.report_purchaseorder_attractive_document', |
|||
{'company': wizard, 'preview_css': preview_css, }) |
|||
else: |
|||
wizard.preview = False |
|||
if wizard.account_document_layout_id: |
|||
if wizard.account_document_layout_id == '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( |
|||
'base_advanced_report_templates.report_account_modern_document', |
|||
{'company': wizard, 'preview_css': preview_css}) |
|||
elif wizard.account_document_layout_id == 'traditional': |
|||
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( |
|||
'base_advanced_report_templates.report_account_traditional_document', |
|||
{'company': wizard, 'preview_css': preview_css, }) |
|||
elif wizard.account_document_layout_id == 'standard': |
|||
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( |
|||
'base_advanced_report_templates.report_account_standard_document', |
|||
{'company': wizard, 'preview_css': preview_css, }) |
|||
elif wizard.account_document_layout_id == 'attractive': |
|||
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( |
|||
'base_advanced_report_templates.report_account_attractive_document', |
|||
{'company': wizard, 'preview_css': preview_css, }) |
|||
else: |
|||
wizard.preview = False |
|||
if wizard.stock_document_layout_id: |
|||
if wizard.stock_document_layout_id == '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( |
|||
'base_advanced_report_templates.report_stock_modern_document', |
|||
{'company': wizard, 'preview_css': preview_css}) |
|||
elif wizard.stock_document_layout_id == 'traditional': |
|||
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( |
|||
'base_advanced_report_templates.report_stock_traditional_document', |
|||
{'company': wizard, 'preview_css': preview_css, }) |
|||
elif wizard.stock_document_layout_id == 'standard': |
|||
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( |
|||
'base_advanced_report_templates.report_stock_standard_document', |
|||
{'company': wizard, 'preview_css': preview_css, }) |
|||
elif wizard.stock_document_layout_id == 'attractive': |
|||
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( |
|||
'base_advanced_report_templates.report_stock_attractive_document', |
|||
{'company': wizard, 'preview_css': preview_css, }) |
|||
else: |
|||
wizard.preview = False |
|||
else: |
|||
wizard.preview = False |
@ -0,0 +1,74 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Bhagyadev KP (<https://www.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 DocLayout(models.Model): |
|||
"""Adding the fields for customization""" |
|||
_name = "doc.layout" |
|||
_description = 'Adding the fields for customization' |
|||
|
|||
name = fields.Char( |
|||
string="Name", |
|||
help="Name" |
|||
) |
|||
base_color = fields.Char( |
|||
string="Base Color", |
|||
help="Background color for the invoice" |
|||
) |
|||
heading_text_color = fields.Char( |
|||
string="Heading text Color", |
|||
help="Heading Text color" |
|||
) |
|||
text_color = fields.Char( |
|||
string="Text Color", |
|||
help="Text color of items" |
|||
) |
|||
customer_text_color = fields.Char( |
|||
string="Customer Text Color", |
|||
help="Customer address text color" |
|||
) |
|||
company_text_color = fields.Char( |
|||
string="Company Text Color", |
|||
help="Company address Text color" |
|||
) |
|||
logo_position = fields.Selection( |
|||
selection=[('left', 'Left'), ('right', 'Right')], |
|||
string="Logo Position", |
|||
help="Company logo position" |
|||
) |
|||
customer_position = fields.Selection( |
|||
selection=[('left', 'Left'), ('right', 'Right')], |
|||
string="Customer position", |
|||
help="Customer address position" |
|||
) |
|||
company_position = fields.Selection( |
|||
selection=[('left', 'Left'), ('right', 'Right')], |
|||
string="Company Address Position", |
|||
help="Company address position" |
|||
) |
|||
company_id = fields.Many2one( |
|||
selection='res.company', string='Company', index=True, |
|||
default=lambda self: self.env.company, |
|||
help="Company name" |
|||
) |
@ -0,0 +1,37 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Bhagyadev KP (<https://www.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 PurchaseOrder(models.Model): |
|||
""" This model extends the 'purchase.order' model to include additional |
|||
fields related to document layout, specifically the 'theme_id' field.""" |
|||
_inherit = 'purchase.order' |
|||
|
|||
theme_id = fields.Many2one( |
|||
comodel_name='doc.layout', |
|||
related='company_id.purchase_document_layout_id', |
|||
string='Document Layout Theme', |
|||
help="This field is used to specify the document" |
|||
"layout theme associated with the company's" |
|||
" purchase orders. " |
|||
) |
@ -0,0 +1,36 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Bhagyadev KP (<https://www.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 PurchaseOrderLine(models.Model): |
|||
"""purchase orderline image""" |
|||
_inherit = 'purchase.order.line' |
|||
|
|||
order_line_image = fields.Binary( |
|||
string="Image", |
|||
related="product_id.image_128", |
|||
help="This field represents the image " |
|||
"associated with the product on the" |
|||
" purchase order line." |
|||
) |
@ -0,0 +1,57 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Bhagyadev KP (<https://www.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): |
|||
"""This model extends the 'res.company' model to include additional fields |
|||
related to document layouts for sales, purchases, accounts, and stock. |
|||
""" |
|||
_inherit = 'res.company' |
|||
|
|||
sale_document_layout_id = fields.Many2one( |
|||
comodel_name="doc.layout", |
|||
string="Sale", |
|||
help="This field " |
|||
"specifies the document layout " |
|||
"associated with sales for the " |
|||
"company." |
|||
) |
|||
purchase_document_layout_id = fields.Many2one( |
|||
comodel_name="doc.layout", |
|||
string="Purchase", |
|||
help="This field specifies the document layout associated with " |
|||
"purchases for the company." |
|||
) |
|||
account_document_layout_id = fields.Many2one( |
|||
comodel_name="doc.layout", |
|||
string="Account", |
|||
help="Document layout " |
|||
"associated with accounting" |
|||
" for the company." |
|||
) |
|||
stock_document_layout_id = fields.Many2one( |
|||
comodel_name="doc.layout", |
|||
string="Stock", |
|||
help="Document " |
|||
"layout associated with stock" |
|||
) |
@ -0,0 +1,44 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Bhagyadev KP (<https://www.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 SaleOrder(models.Model): |
|||
""" This model extends the 'sale.order' model to include additional fields |
|||
related to customer images and document layout themes.""" |
|||
_inherit = 'sale.order' |
|||
|
|||
customer_image = fields.Binary( |
|||
string="Image", |
|||
related="partner_id.image_1920", |
|||
help="This field represents the image " |
|||
"associated with the customer on the" |
|||
" sale order." |
|||
) |
|||
theme_id = fields.Many2one( |
|||
comodel_name='doc.layout', |
|||
related='company_id.sale_document_layout_id', |
|||
string='Document Layout Theme', |
|||
help="This field is used to specify the document" |
|||
"layout theme associated with the company's" |
|||
"sale orders." |
|||
) |
@ -0,0 +1,35 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Bhagyadev KP (<https://www.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 SaleOrderLine(models.Model): |
|||
"""sale order line image""" |
|||
_inherit = 'sale.order.line' |
|||
|
|||
order_line_image = fields.Binary(string="Image", |
|||
related="product_id.image_128", |
|||
help="This field represents the image " |
|||
"associated with the product on the " |
|||
"sale order line." |
|||
) |
@ -0,0 +1,35 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Bhagyadev KP (<https://www.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 StockMove(models.Model): |
|||
"""Delivery report image""" |
|||
_inherit = 'stock.move' |
|||
|
|||
order_line_image = fields.Binary( |
|||
string="Image", |
|||
related="product_id.image_128", |
|||
help="this field represents the image " |
|||
"associated with the product on the " |
|||
"stock move." |
|||
) |
@ -0,0 +1,38 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Bhagyadev KP (<https://www.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 StockPicking(models.Model): |
|||
""" |
|||
This model extends the 'stock.picking' model to include additional fields |
|||
related to document layout themes, specifically the 'theme_id' field. |
|||
""" |
|||
_inherit = 'stock.picking' |
|||
|
|||
theme_id = fields.Many2one( |
|||
comodel_name='doc.layout', |
|||
related='company_id.stock_document_layout_id', |
|||
help="This field is used to specify the document" |
|||
"layout theme associated with the company's" |
|||
"stock pickings" |
|||
) |
@ -0,0 +1,338 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Account attractive report template--> |
|||
<template id="report_account_attractive_document"> |
|||
<t t-if="o and 'company_id' in o"> |
|||
<t t-set="company" t-value="o.company_id"/> |
|||
</t> |
|||
<t t-if="not o or not 'company_id' in o"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" |
|||
style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" |
|||
t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-call="web.external_layout"> |
|||
<t t-set="o" t-value="o.with_context(lang=lang)"/> |
|||
<t t-set="forced_vat" |
|||
t-value="o.fiscal_position_id.foreign_vat"/> <!-- So that it appears in the footer of the report instead of the company VAT if it's set --> |
|||
<div class="mt-5"> |
|||
<div class="page"> |
|||
<table class="table table-sm o_main_table" name="invoice_line_table"> |
|||
<thead t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr t-if="o.invoice_date"> |
|||
<th name="th_description" t-if="o.move_type == 'out_invoice'" class="text-start"> |
|||
<span>Invoice Date</span> |
|||
</th> |
|||
<th name="th_description" t-if="o.move_type == 'out_invoice'" class="text-start"> |
|||
<span>Invoice Number</span> |
|||
</th> |
|||
<th name="th_quantity" t-elif="o.move_type == 'out_refund'" class="text-end"> |
|||
<span>Credit Note Date</span> |
|||
</th> |
|||
<th name="th_quantity" t-elif="o.move_type == 'out_receipt'" class="text-end"> |
|||
<span>Receipt Date</span> |
|||
</th> |
|||
<th name="th_quantity" t-elif="o.move_type == 'out_receipt'" class="text-end"> |
|||
<span>Receipt Date</span> |
|||
</th> |
|||
<th name="th_quantity" t-elif="o.move_type == 'out_receipt'" class="text-end"> |
|||
<span>Receipt Date</span> |
|||
</th> |
|||
<th name="th_quantity" t-else="" class="text-end"> |
|||
<span>Date</span> |
|||
</th> |
|||
<th name="th_quantity" |
|||
t-if="o.invoice_date_due and o.move_type == 'out_invoice' and o.state == 'posted'" |
|||
class="text-end"> |
|||
<span>Due Date</span> |
|||
</th> |
|||
<th name="th_quantity" t-if="o.invoice_origin" class="text-end"> |
|||
<span>Source</span> |
|||
</th> |
|||
<th name="th_quantity" t-if="o.partner_id.ref" class="text-end"> |
|||
<span>Customer Code</span> |
|||
</th> |
|||
<th name="th_quantity" t-if="o.ref" class="text-end"> |
|||
<span>Reference</span> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<td class="text-start"> |
|||
<p class="m-0" t-field="o.invoice_date"/> |
|||
</td> |
|||
<td class="text-enf" t-if="o.payment_reference"> |
|||
<p class="m-0" t-field="o.payment_reference"/> |
|||
</td> |
|||
<td t-if="o.invoice_date_due and o.move_type == 'out_invoice' and o.state == 'posted'" |
|||
class="text-end"> |
|||
<p class="m-0" t-field="o.invoice_date_due"/> |
|||
</td> |
|||
<td t-if="o.invoice_origin" class="text-end"> |
|||
<p class="m-0" t-field="o.invoice_origin"/> |
|||
</td> |
|||
<td t-if="o.partner_id.ref" class="text-end"> |
|||
<p class="m-0" t-field="o.partner_id.ref"/> |
|||
</td> |
|||
<td t-if="o.ref" class="text-end"> |
|||
<p class="m-0" t-field="o.ref"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<t t-set="display_discount" t-value="any(l.discount for l in o.invoice_line_ids)"/> |
|||
<table class="table table-sm o_main_table" name="invoice_line_table"> |
|||
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description" class="text-start"> |
|||
<span>Description</span> |
|||
</th> |
|||
<th name="th_quantity" class="text-end"> |
|||
<span>Quantity</span> |
|||
</th> |
|||
<th name="th_priceunit" |
|||
t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span>Unit Price</span> |
|||
</th> |
|||
<th name="th_price_unit" t-if="display_discount" |
|||
t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span>Disc.%</span> |
|||
</th> |
|||
<th name="th_taxes" |
|||
t-attf-class="text-start {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span>Taxes</span> |
|||
</th> |
|||
<th name="th_subtotal" class="text-end"> |
|||
<span groups="account.group_show_line_subtotals_tax_excluded">Amount</span> |
|||
<span groups="account.group_show_line_subtotals_tax_included">Total Price</span> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody class="invoice_tbody"> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
<t t-set="lines" |
|||
t-value="o.invoice_line_ids.sorted(key=lambda l: (-l.sequence, l.date, l.move_name, -l.id), reverse=True)"/> |
|||
<t t-foreach="lines" t-as="line"> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" |
|||
groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" |
|||
groups="account.group_show_line_subtotals_tax_included"/> |
|||
<tr t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''" |
|||
t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<t t-if="line.display_type == 'product'" name="account_invoice_line_accountable"> |
|||
<td name="account_invoice_line_name"> |
|||
<span t-field="line.name" t-options="{'widget': 'text'}"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="line.quantity"/> |
|||
<span t-field="line.product_uom_id" groups="uom.group_uom"/> |
|||
</td> |
|||
<td t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span class="text-nowrap" t-field="line.price_unit"/> |
|||
</td> |
|||
<td t-if="display_discount" |
|||
t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span class="text-nowrap" t-field="line.discount"/> |
|||
</td> |
|||
<td t-attf-class="text-start {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))" |
|||
id="line_tax_ids"/> |
|||
</td> |
|||
<td class="text-end o_price_total"> |
|||
<span class="text-nowrap" t-field="line.price_subtotal" |
|||
groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<span class="text-nowrap" t-field="line.price_total" |
|||
groups="account.group_show_line_subtotals_tax_included"/> |
|||
</td> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_section'"> |
|||
<td colspan="99"> |
|||
<span t-field="line.name" t-options="{'widget': 'text'}"/> |
|||
</td> |
|||
<t t-set="current_section" t-value="line"/> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_note'"> |
|||
<td colspan="99"> |
|||
<span t-field="line.name" t-options="{'widget': 'text'}"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
<t t-if="current_section and (line_last or lines[line_index+1].display_type == 'line_section')"> |
|||
<tr class="is-subtotal text-end"> |
|||
<td colspan="99"> |
|||
<strong class="mr16">Subtotal</strong> |
|||
<span |
|||
t-esc="current_subtotal" |
|||
t-options='{"widget": "monetary", "display_currency": o.currency_id}' |
|||
/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<div class="clearfix mb-4"> |
|||
<div id="total" class="row"> |
|||
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto"> |
|||
<table class="table table-sm" |
|||
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<!--Tax totals--> |
|||
<t t-call="account.document_tax_totals"> |
|||
<t t-set="tax_totals" t-value="o.tax_totals"/> |
|||
<t t-set="currency" t-value="o.currency_id"/> |
|||
</t> |
|||
<!--Payments--> |
|||
<t t-if="print_with_payments"> |
|||
<t t-if="o.payment_state != 'invoicing_legacy'"> |
|||
<t t-set="payments_vals" |
|||
t-value="o.sudo().invoice_payments_widget and o.sudo().invoice_payments_widget['content'] or []"/> |
|||
<t t-foreach="payments_vals" t-as="payment_vals"> |
|||
<tr t-if="payment_vals['is_exchange'] == 0"> |
|||
<td> |
|||
<i class="oe_form_field text-end oe_payment_label">Paid on |
|||
<t t-esc="payment_vals['date']" |
|||
t-options='{"widget": "date"}'/> |
|||
</i> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-esc="payment_vals['amount']" |
|||
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
<t t-if="len(payments_vals) > 0"> |
|||
<tr class="border-black" t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<td> |
|||
<strong>Amount Due</strong> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="o.amount_residual"/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<h2 t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'posted'">Invoice</span> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</span> |
|||
<span t-if="o.move_type == 'out_refund'">Credit Note</span> |
|||
<span t-if="o.move_type == 'in_refund'">Vendor Credit Note</span> |
|||
<span t-if="o.move_type == 'in_invoice'">Vendor Bill</span> |
|||
<span t-if="o.name != '/'" t-field="o.name"/> |
|||
</h2> |
|||
<strong>Customer</strong> |
|||
<span class="mb-0" t-field="o.partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/> |
|||
<div t-if="o.partner_id.vat"> |
|||
<t t-if="o.company_id.account_fiscal_country_id.vat_label" |
|||
t-esc="o.company_id.account_fiscal_country_id.vat_label" id="inv_tax_id_label"/> |
|||
<t t-else="">Tax ID</t>: |
|||
<span t-field="o.partner_id.vat"/> |
|||
</div> |
|||
</div> |
|||
<div t-if="o.move_type in ('out_invoice', 'in_refund') and o.payment_reference" |
|||
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};" |
|||
name="payment_communication" class="mt-4"> |
|||
Please use the following communication for your payment : |
|||
<b> |
|||
<span t-field="o.payment_reference"/> |
|||
</b> |
|||
<div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_payment_term_id.note" |
|||
name="reference"> |
|||
<t t-set="payment_term_details" t-value="o.payment_term_details"/> |
|||
|
|||
<div t-field="o.invoice_payment_term_id.note" name="payment_term"/> |
|||
</div> |
|||
</div> |
|||
<t t-if="o.invoice_payment_term_id.display_on_invoice and payment_term_details"> |
|||
<div t-if='o.show_payment_term_details' id="total_payment_term_details_table" class="row"> |
|||
<div t-attf-class="#{'col-7' if report_type != 'html' else 'col-sm-7 col-md-6'} mt-2 mb-2"> |
|||
<table class="table table-sm" style="page-break-inside: avoid;"> |
|||
<th class="border-black text-start"> |
|||
Due Date |
|||
</th> |
|||
<th class="border-black text-end"> |
|||
Amount Due |
|||
</th> |
|||
<th t-if="o.show_discount_details" class="border-black text-end"> |
|||
Discount |
|||
</th> |
|||
<t t-foreach="payment_term_details" t-as="term"> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<td t-esc="term.get('date')" class="text-start"/> |
|||
<td t-options='{"widget": "monetary", "display_currency": o.currency_id}' |
|||
t-esc="term.get('amount')" class="text-end"/> |
|||
<td t-if="term.get('discount_date')" class="text-end"> |
|||
<span t-options='{"widget": "monetary", "display_currency": o.currency_id}' |
|||
t-esc="term.get('discount_amount_currency')"/> |
|||
if paid before |
|||
<span t-esc="term.get('discount_date')"/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
<div t-if="not is_html_empty(o.narration)" name="comment"> |
|||
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;" |
|||
t-field="o.narration"/> |
|||
</div> |
|||
<p t-if="not is_html_empty(o.fiscal_position_id.note)" name="note"> |
|||
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;" |
|||
t-field="o.fiscal_position_id.note"/> |
|||
</p> |
|||
<p t-if="o.invoice_incoterm_id" name="incoterm"> |
|||
<strong>Incoterm:</strong> |
|||
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;" |
|||
t-field="o.invoice_incoterm_id.code"/> |
|||
- |
|||
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;" |
|||
t-field="o.invoice_incoterm_id.name"/> |
|||
</p> |
|||
<div id="qrcode" t-if="o.display_qr_code and o.amount_residual > 0"> |
|||
<p t-if="qr_code_urls.get(o.id)"> |
|||
<strong class="text-center">Scan me with your banking app.</strong> |
|||
<br/> |
|||
<br/> |
|||
<img class="border border-dark rounded" t-att-src="qr_code_urls[o.id]"/> |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,389 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Account report modern template --> |
|||
<template id="report_account_modern_document"> |
|||
<t t-if="o and 'company_id' in o"> |
|||
<t t-set="company" t-value="o.company_id"/> |
|||
</t> |
|||
<t t-if="not o or not 'company_id' in o"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" |
|||
t-att-src="image_data_uri(company.logo)" |
|||
style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" |
|||
t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-call="web.external_layout"> |
|||
<t t-set="o" t-value="o.with_context(lang=lang)"/> |
|||
<t t-set="forced_vat" |
|||
t-value="o.fiscal_position_id.foreign_vat"/> <!-- So that it appears in the footer of the report instead of the company VAT if it's set --> |
|||
|
|||
<table class="table table-sm o_main_table"> |
|||
<thead t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<td> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'posted'"> |
|||
Invoice |
|||
</span> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'draft'"> |
|||
Draft Invoice |
|||
</span> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'cancel'"> |
|||
Cancelled Invoice |
|||
</span> |
|||
<span t-if="o.move_type == 'out_refund'">Credit |
|||
Note |
|||
</span> |
|||
<span t-if="o.move_type == 'in_refund'">Vendor |
|||
Credit Note |
|||
</span> |
|||
<span t-if="o.move_type == 'in_invoice'">Vendor |
|||
Bill |
|||
</span> |
|||
<span t-if="o.name != '/'" t-field="o.name"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th name="th_description" |
|||
class="text-start"> |
|||
<span>Customer</span> |
|||
</th> |
|||
<th name="th_quantity" |
|||
t-if="o.partner_shipping_id and (o.partner_shipping_id != o.partner_id)" |
|||
class="text-end"> |
|||
<span>Shipping Address</span> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<td> |
|||
<span class="mb-0" t-field="o.partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/> |
|||
<div t-if="o.partner_id.vat"> |
|||
<t t-if="o.company_id.account_fiscal_country_id.vat_label" |
|||
t-esc="o.company_id.account_fiscal_country_id.vat_label" |
|||
id="inv_tax_id_label"/> |
|||
<t t-else="">Tax ID</t>: |
|||
<span t-field="o.partner_id.vat"/> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
<t t-set="information_block"> |
|||
<div groups="account.group_delivery_invoice_address" |
|||
name="shipping_address_block"> |
|||
<div t-field="o.partner_shipping_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/> |
|||
</div> |
|||
</t> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<div class="mt-5"> |
|||
<div class="page"> |
|||
<div id="informations" class="mt-4 mb-4" |
|||
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<div class="col-auto col-3 mw-100 mb-2" |
|||
t-if="o.invoice_date" name="invoice_date"> |
|||
<t t-if="o.move_type == 'out_invoice'"> |
|||
<strong>Invoice Date:</strong> |
|||
</t> |
|||
<t t-elif="o.move_type == 'out_refund'"> |
|||
<strong>Credit Note Date:</strong> |
|||
</t> |
|||
<t t-elif="o.move_type == 'out_receipt'"> |
|||
<strong>Receipt Date:</strong> |
|||
</t> |
|||
<t t-else=""> |
|||
<strong>Date:</strong> |
|||
</t> |
|||
<p class="m-0" t-field="o.invoice_date"/> |
|||
</div> |
|||
<div class="col-auto col-3 mw-100 mb-2" |
|||
t-if="o.invoice_date_due and o.move_type == 'out_invoice' and o.state == 'posted'" |
|||
name="due_date"> |
|||
<strong>Due Date:</strong> |
|||
<p class="m-0" t-field="o.invoice_date_due"/> |
|||
</div> |
|||
<div class="col-auto col-3 mw-100 mb-2" |
|||
t-if="o.invoice_origin" name="origin"> |
|||
<strong>Source:</strong> |
|||
<p class="m-0" t-field="o.invoice_origin"/> |
|||
</div> |
|||
<div class="col-auto col-3 mw-100 mb-2" |
|||
t-if="o.partner_id.ref" name="customer_code"> |
|||
<strong>Customer Code:</strong> |
|||
<p class="m-0" t-field="o.partner_id.ref"/> |
|||
</div> |
|||
<div class="col-auto col-3 mw-100 mb-2" t-if="o.ref" |
|||
name="reference"> |
|||
<strong>Reference:</strong> |
|||
<p class="m-0" t-field="o.ref"/> |
|||
</div> |
|||
</div> |
|||
<t t-set="display_discount" |
|||
t-value="any(l.discount for l in o.invoice_line_ids)"/> |
|||
<table class="table table-sm o_main_table" |
|||
name="invoice_line_table"> |
|||
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};" |
|||
class="col-12"> |
|||
<tr> |
|||
<th name="th_description" class="text-start"> |
|||
<span>Description</span> |
|||
</th> |
|||
<th name="th_quantity" class="text-end"> |
|||
<span>Quantity</span> |
|||
</th> |
|||
<th name="th_priceunit" |
|||
t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span>Unit Price</span> |
|||
</th> |
|||
<th name="th_price_unit" t-if="display_discount" |
|||
t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span>Disc.%</span> |
|||
</th> |
|||
<th name="th_taxes" |
|||
t-attf-class="text-start {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span>Taxes</span> |
|||
</th> |
|||
<th name="th_subtotal" class="text-end"> |
|||
<span groups="account.group_show_line_subtotals_tax_excluded"> |
|||
Amount |
|||
</span> |
|||
<span groups="account.group_show_line_subtotals_tax_included"> |
|||
Total Price |
|||
</span> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody class="invoice_tbody"> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
<t t-set="lines" |
|||
t-value="o.invoice_line_ids.sorted(key=lambda l: (-l.sequence, l.date, l.move_name, -l.id), reverse=True)"/> |
|||
<t t-foreach="lines" t-as="line"> |
|||
<t t-set="current_subtotal" |
|||
t-value="current_subtotal + line.price_subtotal" |
|||
groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<t t-set="current_subtotal" |
|||
t-value="current_subtotal + line.price_total" |
|||
groups="account.group_show_line_subtotals_tax_included"/> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;" |
|||
t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''"> |
|||
<t t-if="line.display_type == 'product'" |
|||
name="account_invoice_line_accountable"> |
|||
<td name="account_invoice_line_name"> |
|||
<span t-field="line.name" |
|||
t-options="{'widget': 'text'}"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="line.quantity"/> |
|||
<span t-field="line.product_uom_id" |
|||
groups="uom.group_uom"/> |
|||
</td> |
|||
<td t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span class="text-nowrap" |
|||
t-field="line.price_unit"/> |
|||
</td> |
|||
<td t-if="display_discount" |
|||
t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span class="text-nowrap" |
|||
t-field="line.discount"/> |
|||
</td> |
|||
<td t-attf-class="text-start {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))" |
|||
id="line_tax_ids"/> |
|||
</td> |
|||
<td class="text-end o_price_total"> |
|||
<span class="text-nowrap" |
|||
t-field="line.price_subtotal" |
|||
groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<span class="text-nowrap" |
|||
t-field="line.price_total" |
|||
groups="account.group_show_line_subtotals_tax_included"/> |
|||
</td> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_section'"> |
|||
<td colspan="99"> |
|||
<span t-field="line.name" |
|||
t-options="{'widget': 'text'}"/> |
|||
</td> |
|||
<t t-set="current_section" |
|||
t-value="line"/> |
|||
<t t-set="current_subtotal" |
|||
t-value="0"/> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_note'"> |
|||
<td colspan="99"> |
|||
<span t-field="line.name" |
|||
t-options="{'widget': 'text'}"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
<t t-if="current_section and (line_last or lines[line_index+1].display_type == 'line_section')"> |
|||
<tr class="is-subtotal text-end"> |
|||
<td colspan="99"> |
|||
<strong class="mr16">Subtotal |
|||
</strong> |
|||
<span |
|||
t-esc="current_subtotal" |
|||
t-options='{"widget": "monetary", "display_currency": o.currency_id}' |
|||
/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<div class="clearfix mb-4"> |
|||
<div id="total" class="row"> |
|||
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto"> |
|||
<table class="table table-sm" |
|||
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<!--Tax totals--> |
|||
<t t-call="account.document_tax_totals"> |
|||
<t t-set="tax_totals" t-value="o.tax_totals"/> |
|||
<t t-set="currency" t-value="o.currency_id"/> |
|||
</t> |
|||
<!--Payments--> |
|||
<t t-if="print_with_payments"> |
|||
<t t-if="o.payment_state != 'invoicing_legacy'"> |
|||
<t t-set="payments_vals" |
|||
t-value="o.sudo().invoice_payments_widget and o.sudo().invoice_payments_widget['content'] or []"/> |
|||
<t t-foreach="payments_vals" |
|||
t-as="payment_vals"> |
|||
<tr t-if="payment_vals['is_exchange'] == 0"> |
|||
<td> |
|||
<i class="oe_form_field text-end oe_payment_label"> |
|||
Paid on |
|||
<t t-esc="payment_vals['date']" |
|||
t-options='{"widget": "date"}'/> |
|||
</i> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-esc="payment_vals['amount']" |
|||
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
<t t-if="len(payments_vals) > 0"> |
|||
<tr class="border-black"> |
|||
<td> |
|||
<strong>Amount Due |
|||
</strong> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="o.amount_residual"/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div t-if="o.move_type in ('out_invoice', 'in_refund') and o.payment_reference" |
|||
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};" |
|||
name="payment_communication" class="mt-4"> |
|||
Please use the following communication for your payment : |
|||
<b> |
|||
<span t-field="o.payment_reference"/> |
|||
</b> |
|||
<div class="col-auto col-3 mw-100 mb-2" |
|||
t-if="o.invoice_payment_term_id.note" |
|||
name="reference"> |
|||
<t t-set="payment_term_details" |
|||
t-value="o.payment_term_details"/> |
|||
|
|||
<div t-field="o.invoice_payment_term_id.note" |
|||
name="payment_term"/> |
|||
</div> |
|||
</div> |
|||
<t t-if="o.invoice_payment_term_id.display_on_invoice and payment_term_details"> |
|||
<div t-if='o.show_payment_term_details' |
|||
id="total_payment_term_details_table" class="row"> |
|||
<div t-attf-class="#{'col-7' if report_type != 'html' else 'col-sm-7 col-md-6'} mt-2 mb-2"> |
|||
<table class="table table-sm" |
|||
style="page-break-inside: avoid;"> |
|||
<th class="border-black text-start"> |
|||
Due Date |
|||
</th> |
|||
<th class="border-black text-end"> |
|||
Amount Due |
|||
</th> |
|||
<th t-if="o.show_discount_details" |
|||
class="border-black text-end"> |
|||
Discount |
|||
</th> |
|||
<t t-foreach="payment_term_details" t-as="term"> |
|||
<tr> |
|||
<td t-esc="term.get('date')" |
|||
class="text-start"/> |
|||
<td t-options='{"widget": "monetary", "display_currency": o.currency_id}' |
|||
t-esc="term.get('amount')" |
|||
class="text-end"/> |
|||
<td t-if="term.get('discount_date')" |
|||
class="text-end"> |
|||
<span t-options='{"widget": "monetary", "display_currency": o.currency_id}' |
|||
t-esc="term.get('discount_amount_currency')"/> |
|||
if paid before |
|||
<span t-esc="term.get('discount_date')"/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
<div t-if="not is_html_empty(o.narration)" name="comment"> |
|||
<span t-field="o.narration"/> |
|||
</div> |
|||
<p t-if="not is_html_empty(o.fiscal_position_id.note)" |
|||
name="note"> |
|||
<span t-field="o.fiscal_position_id.note"/> |
|||
</p> |
|||
<p t-if="o.invoice_incoterm_id" name="incoterm"> |
|||
<strong>Incoterm:</strong> |
|||
<span t-field="o.invoice_incoterm_id.code"/> |
|||
- |
|||
<span t-field="o.invoice_incoterm_id.name"/> |
|||
</p> |
|||
<div id="qrcode" |
|||
t-if="o.display_qr_code and o.amount_residual > 0"> |
|||
<p t-if="qr_code_urls.get(o.id)"> |
|||
<strong class="text-center">Scan me with your banking |
|||
app. |
|||
</strong> |
|||
<br/> |
|||
<br/> |
|||
<img class="border border-dark rounded" |
|||
t-att-src="qr_code_urls[o.id]"/> |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,263 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Account report standard template --> |
|||
<template id="report_account_standard_document"> |
|||
<t t-if="o and 'company_id' in o"> |
|||
<t t-set="company" t-value="o.company_id"/> |
|||
</t> |
|||
<t t-if="not o or not 'company_id' in o"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" |
|||
t-att-src="image_data_uri(company.logo)" |
|||
style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-call="web.external_layout"> |
|||
<t t-set="o" t-value="o.with_context(lang=lang)"/> |
|||
<t t-set="forced_vat" t-value="o.fiscal_position_id.foreign_vat"/> <!-- So that it appears in the footer of the report instead of the company VAT if it's set --> |
|||
<div class="mt-5"> |
|||
<div class="page"> |
|||
<h1 t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'posted'"> |
|||
Invoice |
|||
</span> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'draft'"> |
|||
Draft Invoice |
|||
</span> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'cancel'"> |
|||
Cancelled Invoice |
|||
</span> |
|||
<span t-if="o.move_type == 'out_refund'">Credit Note |
|||
</span> |
|||
<span t-if="o.move_type == 'in_refund'">Vendor Credit |
|||
Note |
|||
</span> |
|||
<span t-if="o.move_type == 'in_invoice'">Vendor Bill |
|||
</span> |
|||
<span t-if="o.name != '/'" t-field="o.name"/> |
|||
<div id="informations" class="row mt-4 mb-4"> |
|||
<div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_date" name="invoice_date"> |
|||
<t t-if="o.move_type == 'out_invoice'"> |
|||
<strong>Invoice Date:</strong> |
|||
</t> |
|||
<t t-elif="o.move_type == 'out_refund'"> |
|||
<strong>Credit Note Date:</strong> |
|||
</t> |
|||
<t t-elif="o.move_type == 'out_receipt'"> |
|||
<strong>Receipt Date:</strong> |
|||
</t> |
|||
<t t-else=""> |
|||
<strong>Date:</strong> |
|||
</t> |
|||
<p class="m-0" t-field="o.invoice_date"/> |
|||
</div> |
|||
<div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_date_due and o.move_type == 'out_invoice' and o.state == 'posted'" name="due_date"> |
|||
<strong>Due Date:</strong> |
|||
<p class="m-0" t-field="o.invoice_date_due"/> |
|||
</div> |
|||
<div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_origin" name="origin"> |
|||
<strong>Source:</strong> |
|||
<p class="m-0" t-field="o.invoice_origin"/> |
|||
</div> |
|||
<div class="col-auto col-3 mw-100 mb-2" t-if="o.partner_id.ref" name="customer_code"> |
|||
<strong>Customer Code:</strong> |
|||
<p class="m-0" t-field="o.partner_id.ref"/> |
|||
</div> |
|||
<div class="col-auto col-3 mw-100 mb-2" t-if="o.ref" name="reference"> |
|||
<strong>Reference:</strong> |
|||
<p class="m-0" t-field="o.ref"/> |
|||
</div> |
|||
<div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_payment_term_id.note" name="reference"> |
|||
<t t-set="payment_term_details" t-value="o.payment_term_details"/> |
|||
<div t-field="o.invoice_payment_term_id.note" name="payment_term"/> |
|||
</div> |
|||
<div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_user_id" name="reference"> |
|||
<t t-set="payment_term_details" t-value="o.invoice_user_id"/> |
|||
<strong>SalesPerson:</strong> |
|||
<div t-field="o.invoice_user_id.name" name="payment_term"/> |
|||
</div> |
|||
</div> |
|||
<strong>Customer</strong> |
|||
</h1> |
|||
<div class="offset-col-6 col-6" name="no_shipping"> |
|||
<span class="mb-0" t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/> |
|||
<div t-if="o.partner_id.vat"> |
|||
<t t-if="o.company_id.account_fiscal_country_id.vat_label" t-esc="o.company_id.account_fiscal_country_id.vat_label" id="inv_tax_id_label"/> |
|||
<t t-else="">Tax ID</t>: |
|||
<span t-field="o.partner_id.vat"/> |
|||
</div> |
|||
</div> |
|||
<t t-set="display_discount" t-value="any(l.discount for l in o.invoice_line_ids)"/> |
|||
<table class="table table-sm o_main_table" name="invoice_line_table"> |
|||
<thead t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description" class="text-start"> |
|||
<span>Description</span> |
|||
</th> |
|||
<th name="th_quantity" class="text-end"> |
|||
<span>Quantity</span> |
|||
</th> |
|||
<th name="th_priceunit" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span>Unit Price</span> |
|||
</th> |
|||
<th name="th_price_unit" t-if="display_discount" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span>Disc.%</span> |
|||
</th> |
|||
<th name="th_taxes" t-attf-class="text-start {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span>Taxes</span> |
|||
</th> |
|||
<th name="th_subtotal" class="text-end"> |
|||
<span groups="account.group_show_line_subtotals_tax_excluded"> |
|||
Amount |
|||
</span> |
|||
<span groups="account.group_show_line_subtotals_tax_included"> |
|||
Total Price |
|||
</span> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody class="invoice_tbody"> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
<t t-set="lines" t-value="o.invoice_line_ids.sorted(key=lambda l: (-l.sequence, l.date, l.move_name, -l.id), reverse=True)"/> |
|||
<t t-foreach="lines" t-as="line"> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;" t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''"> |
|||
<t t-if="line.display_type == 'product'" name="account_invoice_line_accountable"> |
|||
<td name="account_invoice_line_name"> |
|||
<span t-field="line.name" t-options="{'widget': 'text'}"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="line.quantity"/> |
|||
<span t-field="line.product_uom_id" groups="uom.group_uom"/> |
|||
</td> |
|||
<td t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span class="text-nowrap" t-field="line.price_unit"/> |
|||
</td> |
|||
<td t-if="display_discount" |
|||
t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span class="text-nowrap" t-field="line.discount"/> |
|||
</td> |
|||
<td t-attf-class="text-start {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))" id="line_tax_ids"/> |
|||
</td> |
|||
<td class="text-end o_price_total"> |
|||
<span class="text-nowrap" t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<span class="text-nowrap" t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/> |
|||
</td> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_section'"> |
|||
<td colspan="99"> |
|||
<span t-field="line.name" t-options="{'widget': 'text'}"/> |
|||
</td> |
|||
<t t-set="current_section" t-value="line"/> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_note'"> |
|||
<td colspan="99"> |
|||
<span t-field="line.name" t-options="{'widget': 'text'}"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
<t t-if="current_section and (line_last or lines[line_index+1].display_type == 'line_section')"> |
|||
<tr class="is-subtotal text-end"> |
|||
<td colspan="99"> |
|||
<strong class="mr16">Subtotal</strong> |
|||
<span t-esc="current_subtotal" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<div class="clearfix mb-4"> |
|||
<div id="total" class="row"> |
|||
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto"> |
|||
<table class="table table-sm" t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<!--Tax totals--> |
|||
<t t-call="account.document_tax_totals"> |
|||
<t t-set="tax_totals" t-value="o.tax_totals"/> |
|||
<t t-set="currency" t-value="o.currency_id"/> |
|||
</t> |
|||
<!--Payments--> |
|||
<t t-if="print_with_payments"> |
|||
<t t-if="o.payment_state != 'invoicing_legacy'"> |
|||
<t t-set="payments_vals" t-value="o.sudo().invoice_payments_widget and o.sudo().invoice_payments_widget['content'] or []"/> |
|||
<t t-foreach="payments_vals" t-as="payment_vals"> |
|||
<tr t-if="payment_vals['is_exchange'] == 0"> |
|||
<td> |
|||
<i class="oe_form_field text-end oe_payment_label"> |
|||
Paid on |
|||
<t t-esc="payment_vals['date']" t-options='{"widget": "date"}'/> |
|||
</i> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-esc="payment_vals['amount']" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
<t t-if="len(payments_vals) > 0"> |
|||
<tr class="border-black"> |
|||
<td> |
|||
<strong>Amount Due |
|||
</strong> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="o.amount_residual"/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div t-if="not is_html_empty(o.narration)" name="comment"> |
|||
<span t-field="o.narration"/> |
|||
</div> |
|||
<p t-if="not is_html_empty(o.fiscal_position_id.note)" |
|||
name="note"> |
|||
<span t-field="o.fiscal_position_id.note"/> |
|||
</p> |
|||
<p t-if="o.invoice_incoterm_id" name="incoterm"> |
|||
<strong>Incoterm:</strong> |
|||
<span t-field="o.invoice_incoterm_id.code"/> |
|||
- |
|||
<span t-field="o.invoice_incoterm_id.name"/> |
|||
</p> |
|||
<div id="qrcode" |
|||
t-if="o.display_qr_code and o.amount_residual > 0"> |
|||
<p t-if="qr_code_urls.get(o.id)"> |
|||
<strong class="text-center">Scan me with your banking app.</strong> |
|||
<br/> |
|||
<br/> |
|||
<img class="border border-dark rounded" t-att-src="qr_code_urls[o.id]"/> |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,280 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<record id="account.account_invoices" model="ir.actions.report"> |
|||
<field name="name">Invoices</field> |
|||
<field name="model">account.move</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">base_advanced_report_templates.report_invoice_custom</field> |
|||
<field name="report_file">base_advanced_report_templates.report_invoice_custom</field> |
|||
<field name="print_report_name">(object._get_report_base_filename())</field> |
|||
<field name="attachment">(object.state == 'posted') and ((object.name or 'INV').replace('/','_')+'.pdf')</field> |
|||
<field name="binding_model_id" ref="model_account_move"/> |
|||
<field name="binding_type">report</field> |
|||
<field name="groups_id" eval="[(4, ref('account.group_account_invoice')),(4, ref('account.group_account_readonly'))]"/> |
|||
</record> |
|||
<!-- Custom invoice report template--> |
|||
<template id="report_invoice_custom"> |
|||
<t t-call="web.html_container"> |
|||
<t t-foreach="docs" t-as="o"> |
|||
<t t-set="lang" t-value="o.partner_id.lang"/> |
|||
<t t-if="o._get_name_invoice_report() == 'base_advanced_report_templates.report_invoice_custom'"/> |
|||
<t t-if="o.theme_id.name=='Traditional'"> |
|||
<t t-call="base_advanced_report_templates.report_account_traditional_document" t-lang="ang"/> |
|||
</t> |
|||
<t t-elif="o.theme_id.name=='Standard'"> |
|||
<t t-call="base_advanced_report_templates.report_account_standard_document" t-lang="lang"/> |
|||
</t> |
|||
<t t-elif="o.theme_id.name=='Modern'"> |
|||
<t t-call="base_advanced_report_templates.report_account_modern_document" t-lang="lang"/> |
|||
</t> |
|||
<t t-elif="o.theme_id.name=='Attractive'"> |
|||
<t t-call="base_advanced_report_templates.report_account_attractive_document" t-lang="lang"/> |
|||
</t> |
|||
<t t-else=""> |
|||
<t t-call="account.report_invoice_document" t-lang="lang"/> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
<!-- Account report traditional template--> |
|||
<template id="report_account_traditional_document"> |
|||
<t t-if="o and 'company_id' in o"> |
|||
<t t-set="company" t-value="o.company_id"/> |
|||
</t> |
|||
<t t-if="not o or not 'company_id' in o"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-call="web.external_layout"> |
|||
<t t-set="o" t-value="o.with_context(lang=lang)"/> |
|||
<t t-set="forced_vat" t-value="o.fiscal_position_id.foreign_vat"/> <!-- So that it appears in the footer of the report instead of the company VAT if it's set --> |
|||
<div class="mt-5"> |
|||
<div class="page"> |
|||
<h1 style="size:200px;"> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'posted'"> |
|||
Invoice |
|||
</span> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'draft'"> |
|||
Draft Invoice |
|||
</span> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'cancel'"> |
|||
Cancelled Invoice |
|||
</span> |
|||
<span t-if="o.move_type == 'out_refund'">Credit Note |
|||
</span> |
|||
<span t-if="o.move_type == 'in_refund'">Vendor Credit |
|||
Note |
|||
</span> |
|||
<span t-if="o.move_type == 'in_invoice'">Vendor Bill |
|||
</span> |
|||
<span t-if="o.name != '/'" t-field="o.name"/> |
|||
</h1> |
|||
<table class="table table-sm o_main_table" name="invoice_line_table"> |
|||
<thead t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};" class="col-12"> |
|||
<tr> |
|||
<th class="text-start"> |
|||
Customer |
|||
</th> |
|||
<th t-if="o.move_type == 'out_invoice'" name="th_description"> |
|||
Invoice Date: |
|||
</th> |
|||
<th t-if="o.move_type == 'out_refund'" name="th_description"> |
|||
Credit Note Date |
|||
</th> |
|||
<th t-if="o.move_type == 'out_receipt'" name="th_description"> |
|||
</th> |
|||
<th t-if="o.move_type == 'out_refund'" name="th_description"> |
|||
Receipt Date |
|||
</th> |
|||
<th t-if="o.move_type == 'out_refund'" name="th_description"> |
|||
Receipt Date |
|||
</th> |
|||
<th t-else="" name="th_description"> |
|||
Date |
|||
</th> |
|||
<th t-if="o.ref" name="th_description"> |
|||
Reference |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<td> |
|||
<address class="mb-0" t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/> |
|||
<div t-if="o.partner_id.vat"> |
|||
<t t-if="o.company_id.account_fiscal_country_id.vat_label" t-esc="o.company_id.account_fiscal_country_id.vat_label" id="inv_tax_id_label"/> |
|||
<t t-else="">Tax ID</t>: |
|||
<span t-field="o.partner_id.vat"/> |
|||
</div> |
|||
</td> |
|||
<td class="text-end"> |
|||
<p class="m-0" t-field="o.invoice_date"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<p class="m-0" t-field="o.invoice_date_due"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<p class="m-0" t-field="o.ref"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<t t-set="display_discount" t-value="any(l.discount for l in o.invoice_line_ids)"/> |
|||
<table class="table table-sm o_main_table" name="invoice_line_table"> |
|||
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description" class="text-start"> |
|||
<span>Description</span> |
|||
</th> |
|||
<th name="th_product" class="text-start"> |
|||
<span>Product</span> |
|||
</th> |
|||
<th name="th_quantity" class="text-end"> |
|||
<span>Quantity</span> |
|||
</th> |
|||
<th name="th_priceunit" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span>Unit Price</span> |
|||
</th> |
|||
<th name="th_price_unit" t-if="display_discount" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span>Disc.%</span> |
|||
</th> |
|||
<th name="th_taxes" t-attf-class="text-start {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span>Taxes</span> |
|||
</th> |
|||
<th name="th_subtotal" class="text-end"> |
|||
<span groups="account.group_show_line_subtotals_tax_excluded"> |
|||
Amount |
|||
</span> |
|||
<span groups="account.group_show_line_subtotals_tax_included"> |
|||
Total Price |
|||
</span> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody class="invoice_tbody"> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
<t t-set="lines" t-value="o.invoice_line_ids.sorted(key=lambda l: (-l.sequence, l.date, l.move_name, -l.id), reverse=True)"/> |
|||
<t t-foreach="lines" t-as="line"> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;" t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''"> |
|||
<t t-if="line.display_type == 'product'" name="account_invoice_line_accountable"> |
|||
<td name="account_invoice_line_name"> |
|||
<span t-field="line.name" t-options="{'widget': 'text'}"/> |
|||
</td> |
|||
<td name="td_image"> |
|||
<span t-field="line.order_line_image" t-options="{'widget': 'image'}"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="line.quantity"/> |
|||
<span t-field="line.product_uom_id" groups="uom.group_uom"/> |
|||
</td> |
|||
<td t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span class="text-nowrap" t-field="line.price_unit"/> |
|||
</td> |
|||
<td t-if="display_discount" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span class="text-nowrap" t-field="line.discount"/> |
|||
</td> |
|||
<td t-attf-class="text-start {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))" id="line_tax_ids"/> |
|||
</td> |
|||
<td class="text-end o_price_total"> |
|||
<span class="text-nowrap" t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<span class="text-nowrap" t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/> |
|||
</td> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_section'"> |
|||
<td colspan="99"> |
|||
<span t-field="line.name" t-options="{'widget': 'text'}"/> |
|||
</td> |
|||
<t t-set="current_section" t-value="line"/> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_note'"> |
|||
<td colspan="99"> |
|||
<span t-field="line.name" t-options="{'widget': 'text'}"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
<t t-if="current_section and (line_last or lines[line_index+1].display_type == 'line_section')"> |
|||
<tr class="is-subtotal text-end"> |
|||
<td colspan="99"> |
|||
<strong class="mr16">Subtotal |
|||
</strong> |
|||
<span t-esc="current_subtotal" t-options='{"widget": "monetary", "display_currency": o.currency_id}' |
|||
/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<div class="clearfix mb-4"> |
|||
<div id="total" class="row"> |
|||
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto"> |
|||
<table class="table table-sm" t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<!--Tax totals--> |
|||
<t t-call="account.document_tax_totals"> |
|||
<t t-set="tax_totals" t-value="o.tax_totals"/> |
|||
<t t-set="currency" t-value="o.currency_id"/> |
|||
</t> |
|||
<!--Payments--> |
|||
<t t-if="print_with_payments"> |
|||
<t t-if="o.payment_state != 'invoicing_legacy'"> |
|||
<t t-set="payments_vals" t-value="o.sudo().invoice_payments_widget and o.sudo().invoice_payments_widget['content'] or []"/> |
|||
<t t-foreach="payments_vals" t-as="payment_vals"> |
|||
<tr t-if="payment_vals['is_exchange'] == 0"> |
|||
<td> |
|||
<i class="oe_form_field text-end oe_payment_label"> |
|||
Paid on |
|||
<t t-esc="payment_vals['date']" t-options='{"widget": "date"}'/> |
|||
</i> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-esc="payment_vals['amount']" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
<t t-if="len(payments_vals) > 0"> |
|||
<tr class="border-black"> |
|||
<td> |
|||
<strong>Amount Due</strong> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="o.amount_residual"/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,194 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Purchase order report attractive template--> |
|||
<template id="report_purchaseorder_attractive_document"> |
|||
<t t-if="o and 'company_id' in o"> |
|||
<t t-set="company" t-value="o.company_id"/> |
|||
</t> |
|||
<t t-if="not o or not 'company_id' in o"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-call="web.external_layout"> |
|||
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/> |
|||
<t t-set="forced_vat" t-value="o.fiscal_position_id.foreign_vat"/> <!-- So that it appears in the footer of the report instead of the company VAT if it's set --> |
|||
<t t-set="address"> |
|||
<div class="mt-4" t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<h2 t-if="o.state in ['draft', 'sent', 'to approve']"> |
|||
Request for Quotation # |
|||
<span t-field="o.name"/> |
|||
</h2> |
|||
<h2 t-if="o.state in ['purchase', 'done']">Purchase Order # |
|||
<span t-field="o.name"/> |
|||
</h2> |
|||
<h2 t-if="o.state == 'cancel'">Cancelled Purchase Order # |
|||
<span t-field="o.name"/> |
|||
</h2> |
|||
</div> |
|||
</t> |
|||
|
|||
<table class="table table-sm mt-4" t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<thead style="display: table-row-group"> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<th name="th_description"> |
|||
<strong>Vendor</strong> |
|||
</th> |
|||
<th t-if="o.dest_address_id" class="text-center"> |
|||
<strong>Shipping Address</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<td class="text-center"> |
|||
<div t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone", "vat"], "no_marker": True, "phone_icons": True}'/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<t t-if="o.dest_address_id"> |
|||
<t t-set="information_block"> |
|||
<strong>Shipping address:</strong> |
|||
<div t-field="o.dest_address_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}' name="purchase_shipping_address"/> |
|||
</t> |
|||
</t> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<table class="table table-sm o_main_table mt-4"> |
|||
<thead t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description"> |
|||
<strong>Order Date</strong> |
|||
</th> |
|||
<th name="th_taxes"> |
|||
<strong>Scheduled Date</strong> |
|||
</th> |
|||
<th name="th_date_req" class="text-center"> |
|||
<strong>Approval Date</strong> |
|||
</th> |
|||
<th name="th_quantity" class="text-end"> |
|||
<strong>Payment Term</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<td class="text-end"> |
|||
<div t-if="o.date_order"> |
|||
<span t-field="o.date_order" class="m-0"/> |
|||
</div> |
|||
</td> |
|||
<td class="text-end"> |
|||
<div t-if="o.date_planned"> |
|||
<span t-field="o.date_planned" class="m-0"/> |
|||
</div> |
|||
</td> |
|||
<td class="text-end"> |
|||
<div t-if="o.state in ['purchase','done'] and o.date_approve"> |
|||
<span t-field="o.date_approve" class="m-0"/> |
|||
</div> |
|||
</td> |
|||
<td class="text-end"> |
|||
<div t-if="o.payment_term_id"> |
|||
<span t-field="o.payment_term_id.name" |
|||
class="m-0"/> |
|||
</div> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<div class="page"> |
|||
<div class="oe_structure"/> |
|||
<table class="table table-sm mt-4"> |
|||
<thead t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description"> |
|||
<strong>Description</strong> |
|||
</th> |
|||
<th name="th_expected_date" class="text-center"> |
|||
<strong>Expected Date</strong> |
|||
</th> |
|||
<th name="th_quantity" class="text-end"> |
|||
<strong>Qty</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<t t-foreach="o.order_line" t-as="order_line"> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;" t-att-class="'bg-200 fw-bold o_line_section' if order_line.display_type == 'line_section' else 'fst-italic o_line_note' if order_line.display_type == 'line_note' else ''"> |
|||
<t t-if="not order_line.display_type"> |
|||
<td id="product"> |
|||
<span t-field="order_line.name"/> |
|||
</td> |
|||
<td class="text-center"> |
|||
<span t-field="order_line.date_planned"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="order_line.product_qty"/> |
|||
<span t-field="order_line.product_uom" |
|||
groups="uom.group_uom"/> |
|||
</td> |
|||
</t> |
|||
<t t-else=""> |
|||
<td colspan="99" id="section"> |
|||
<span t-field="order_line.name"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<div id="total" class="row justify-content-end" |
|||
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<div class="col-12"> |
|||
<table class="table table-sm"> |
|||
<t t-call="account.document_tax_totals"> |
|||
<t t-set="tax_totals" t-value="o.tax_totals"/> |
|||
<t t-set="currency" t-value="o.currency_id"/> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<div t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<span/> |
|||
<span/> |
|||
<span>Note</span> |
|||
<p t-field="o.notes" class="mt-4"/> |
|||
<div class="oe_structure"/> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,226 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Purchase order modern report template--> |
|||
<template id="report_purchaseorder_modern_document"> |
|||
<t t-if="o and 'company_id' in o"> |
|||
<t t-set="company" t-value="o.company_id"/> |
|||
</t> |
|||
<t t-if="not o or not 'company_id' in o"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-call="web.external_layout"> |
|||
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/> |
|||
<div class="page"> |
|||
<table class="table table-sm o_main_table mt-4"> |
|||
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description" class="text-start"> |
|||
<strong>Vendor</strong> |
|||
</th> |
|||
<th name="th_taxes" t-if="o.dest_address_id" class="text-end"> |
|||
<strong>Shipping Address</strong> |
|||
</th> |
|||
<th name="th_date_req" t-if="o.partner_ref" class="text-end"> |
|||
<strong>Reference/Description</strong> |
|||
</th> |
|||
<th t-if="o.state in ['draft', 'sent', 'to approve']" name="th_quantity" class="text-end"> |
|||
<strong>Request For Quotation</strong> |
|||
</th> |
|||
<th t-if="o.state in ['purchase', 'done']" name="th_quantity" class="text-end"> |
|||
<strong>Purchase Order</strong> |
|||
</th> |
|||
<th t-if="o.state == 'cancel'" name="th_quantity" class="text-end"> |
|||
<strong>Cancelled Purchase Order #</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<td class="text-start"> |
|||
<div t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone", "vat"], "no_marker": True, "phone_icons": True}'/> |
|||
</td> |
|||
<td class="text-end" t-if="o.dest_address_id"> |
|||
<t t-if="o.dest_address_id"> |
|||
<t t-set="information_block"> |
|||
<div t-if="o.dest_address_id"> |
|||
<div t-field="o.dest_address_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}' name="purchase_shipping_address"/> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</td> |
|||
<td class="text-end" t-if="o.partner_ref"> |
|||
<div t-if="o.partner_ref"> |
|||
<p t-field="o.partner_ref" class="m-0"/> |
|||
</div> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="o.name"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<br/> |
|||
<br/> |
|||
<table class="table table-sm o_main_table mt-4"> |
|||
<thead t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description"> |
|||
<strong>Order Date</strong> |
|||
</th> |
|||
<th name="th_taxes"> |
|||
<strong>Scheduled Date</strong> |
|||
</th> |
|||
<th name="th_date_req" class="text-center"> |
|||
<strong>Approval Date</strong> |
|||
</th> |
|||
<th name="th_quantity" class="text-end"> |
|||
<strong>Payment Term</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<td class="text-end"> |
|||
<div t-if="o.date_order"> |
|||
<span t-field="o.date_order" class="m-0"/> |
|||
</div> |
|||
</td> |
|||
<td class="text-end"> |
|||
<div t-if="o.date_planned"> |
|||
<span t-field="o.date_planned" class="m-0"/> |
|||
</div> |
|||
</td> |
|||
<td class="text-end"> |
|||
<div t-if="o.state in ['purchase','done'] and o.date_approve"> |
|||
<span t-field="o.date_approve" class="m-0"/> |
|||
</div> |
|||
</td> |
|||
<td class="text-end"> |
|||
<div t-if="o.payment_term_id"> |
|||
<span t-field="o.payment_term_id.name" |
|||
class="m-0"/> |
|||
</div> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<table class="table table-sm o_main_table mt-4"> |
|||
<thead t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description"> |
|||
<strong>Description</strong> |
|||
</th> |
|||
<th name="th_taxes"> |
|||
<strong>Taxes</strong> |
|||
</th> |
|||
<th name="th_date_req" class="text-center"> |
|||
<strong>Date Req.</strong> |
|||
</th> |
|||
<th name="th_quantity" class="text-end"> |
|||
<strong>Qty</strong> |
|||
</th> |
|||
<th name="th_price_unit" class="text-end"> |
|||
<strong>Unit Price</strong> |
|||
</th> |
|||
<th name="th_amount" class="text-end"> |
|||
<strong>Amount</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
<t t-foreach="o.order_line" t-as="line"> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;" t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''"> |
|||
<t t-if="not line.display_type"> |
|||
<td id="product"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
<td name="td_taxes"> |
|||
<span t-esc="', '.join(map(lambda x: x.name, line.taxes_id))"/> |
|||
</td> |
|||
<td class="text-center"> |
|||
<span t-field="line.date_planned"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="line.product_qty"/> |
|||
<span t-field="line.product_uom.name" |
|||
groups="uom.group_uom"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="line.price_unit"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="line.price_subtotal" |
|||
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> |
|||
</td> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_section'"> |
|||
<td colspan="99" id="section"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
<t t-set="current_section" t-value="line"/> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_note'"> |
|||
<td colspan="99" id="note"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
<t t-if="current_section and (line_last or o.order_line[line_index+1].display_type == 'line_section')"> |
|||
<tr class="is-subtotal text-end"> |
|||
<td colspan="99" id="subtotal"> |
|||
<strong class="mr16">Subtotal</strong> |
|||
<span |
|||
t-esc="current_subtotal" |
|||
t-options='{"widget": "monetary", "display_currency": o.currency_id}' |
|||
/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<div id="total" class="row justify-content-end" t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<div class="col-12"> |
|||
<table class="table table-sm"> |
|||
<t t-call="account.document_tax_totals"> |
|||
<t t-set="tax_totals" t-value="o.tax_totals"/> |
|||
<t t-set="currency" t-value="o.currency_id"/> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<p t-field="o.notes" class="mt-4"/> |
|||
<div class="oe_structure"/> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,161 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Purchase order standard report template--> |
|||
<template id="report_purchaseorder_standard_document"> |
|||
<t t-if="o and 'company_id' in o"> |
|||
<t t-set="company" t-value="o.company_id"/> |
|||
</t> |
|||
<t t-if="not o or not 'company_id' in o"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-call="web.external_layout"> |
|||
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/> |
|||
<div class="page"> |
|||
<div class="oe_structure"/> |
|||
<div class="mt-4" t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<h2 t-if="o.state in ['draft', 'sent', 'to approve']">Request for Quotation # |
|||
<span t-field="o.name"/> |
|||
</h2> |
|||
<h2 t-if="o.state in ['purchase', 'done']">Purchase Order # |
|||
<span t-field="o.name"/> |
|||
</h2> |
|||
<h2 t-if="o.state == 'cancel'">Cancelled Purchase Order # |
|||
<span t-field="o.name"/> |
|||
</h2> |
|||
</div> |
|||
<div t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone", "vat"], "no_marker": True, "phone_icons": True}'/> |
|||
<t t-if="o.dest_address_id"> |
|||
<t t-set="information_block"> |
|||
<strong>Shipping address:</strong> |
|||
<div t-if="o.dest_address_id"> |
|||
<div t-field="o.dest_address_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}' |
|||
name="purchase_shipping_address"/> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
<table class="table table-sm o_main_table mt-4"> |
|||
<thead t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description"> |
|||
<strong>Description</strong> |
|||
</th> |
|||
<th name="th_taxes"> |
|||
<strong>Taxes</strong> |
|||
</th> |
|||
<th name="th_date_req" class="text-center"> |
|||
<strong>Date Req.</strong> |
|||
</th> |
|||
<th name="th_quantity" class="text-end"> |
|||
<strong>Qty</strong> |
|||
</th> |
|||
<th name="th_price_unit" class="text-end"> |
|||
<strong>Unit Price</strong> |
|||
</th> |
|||
<th name="th_amount" class="text-end"> |
|||
<strong>Amount</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
<t t-foreach="o.order_line" t-as="line"> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;" t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''"> |
|||
<t t-if="not line.display_type"> |
|||
<td id="product"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
<td name="td_taxes"> |
|||
<span t-esc="', '.join(map(lambda x: x.name, line.taxes_id))"/> |
|||
</td> |
|||
<td class="text-center"> |
|||
<span t-field="line.date_planned"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="line.product_qty"/> |
|||
<span t-field="line.product_uom.name" groups="uom.group_uom"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="line.price_unit"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="line.price_subtotal" |
|||
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> |
|||
</td> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_section'"> |
|||
<td colspan="99" id="section"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
<t t-set="current_section" t-value="line"/> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_note'"> |
|||
<td colspan="99" id="note"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
<t t-if="current_section and (line_last or o.order_line[line_index+1].display_type == 'line_section')"> |
|||
<tr class="is-subtotal text-end"> |
|||
<td colspan="99" id="subtotal"> |
|||
<strong class="mr16">Subtotal</strong> |
|||
<span |
|||
t-esc="current_subtotal" |
|||
t-options='{"widget": "monetary", "display_currency": o.currency_id}' |
|||
/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<div id="total" class="row justify-content-end" |
|||
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<div class="col-12"> |
|||
<table class="table table-sm"> |
|||
<t t-call="account.document_tax_totals"> |
|||
<t t-set="tax_totals" t-value="o.tax_totals"/> |
|||
<t t-set="currency" t-value="o.currency_id"/> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<div t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<span>Notes</span> |
|||
<p t-field="o.notes" class="mt-4"/> |
|||
<div class="oe_structure"/> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,233 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Purchase Quotation Report --> |
|||
<record id="purchase.report_purchase_quotation" model="ir.actions.report"> |
|||
<field name="name">Request for Quotation</field> |
|||
<field name="model">purchase.order</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">base_advanced_report_templates.report_purchase_custom</field> |
|||
<field name="report_file">base_advanced_report_templates.report_purchase_custom</field> |
|||
<field name="print_report_name">'Request for Quotation - %s' % (object.name)</field> |
|||
<field name="binding_model_id" ref="model_purchase_order"/> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
<!-- Purchase Order Report --> |
|||
<record id="purchase.action_report_purchase_order" model="ir.actions.report"> |
|||
<field name="name">Purchase Order</field> |
|||
<field name="model">purchase.order</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">base_advanced_report_templates.report_purchase_custom</field> |
|||
<field name="report_file">base_advanced_report_templates.report_purchase_custom</field> |
|||
<field name="print_report_name">'Request for Quotation - %s' % (object.name)</field> |
|||
<field name="binding_model_id" ref="model_purchase_order"/> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
<!-- Purchase Custom Report Template --> |
|||
<template id="report_purchase_custom"> |
|||
<t t-call="web.html_container"> |
|||
<t t-foreach="docs" t-as="o"> |
|||
<t t-if="o.theme_id.name=='Traditional'"> |
|||
<t t-call="base_advanced_report_templates.report_purchaseorder_traditional_document" t-lang="o.partner_id.lang"/> |
|||
</t> |
|||
<t t-elif="o.theme_id.name=='Standard'"> |
|||
<t t-call="base_advanced_report_templates.report_purchaseorder_standard_document" t-lang="o.partner_id.lang"/> |
|||
</t> |
|||
<t t-elif="o.theme_id.name=='Modern'"> |
|||
<t t-call="base_advanced_report_templates.report_purchaseorder_modern_document" t-lang="o.partner_id.lang"/> |
|||
</t> |
|||
<t t-elif="o.theme_id.name=='Attractive'"> |
|||
<t t-call="base_advanced_report_templates.report_purchaseorder_attractive_document" t-lang="o.partner_id.lang"/> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
<!-- Traditional Template Preview --> |
|||
<template id="report_purchaseorder_traditional_document"> |
|||
<t t-if="o and 'company_id' in o"> |
|||
<t t-set="company" t-value="o.company_id"/> |
|||
</t> |
|||
<t t-if="not o or not 'company_id' in o"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-call="web.external_layout"> |
|||
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/> |
|||
<div class="page"> |
|||
<div class="oe_structure"/> |
|||
<div class="mt-4"> |
|||
<h2 t-if="o.state in ['draft', 'sent', 'to approve']">Request for Quotation # |
|||
<span t-field="o.name"/> |
|||
</h2> |
|||
<h2 t-if="o.state in ['purchase', 'done']">Purchase Order # |
|||
<span t-field="o.name"/> |
|||
</h2> |
|||
<h2 t-if="o.state == 'cancel'">Cancelled Purchase Order # |
|||
<span t-field="o.name"/> |
|||
</h2> |
|||
</div> |
|||
<div id="informations" class="row mt-4 mb32"> |
|||
<div t-if="o.state in ['purchase','done'] and o.date_approve" class="col-3 bm-2"> |
|||
<strong>Order Date:</strong> |
|||
<p t-field="o.date_approve" class="m-0"/> |
|||
</div> |
|||
<div t-elif="o.date_order" class="col-3 bm-2"> |
|||
<strong>Order Deadline:</strong> |
|||
<p t-field="o.date_order" class="m-0"/> |
|||
</div> |
|||
</div> |
|||
<table class="table table-sm o_main_table mt-4"> |
|||
<thead t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description"> |
|||
<strong>Purchase Representative</strong> |
|||
</th> |
|||
<th name="th_description"> |
|||
<strong>Your Order Reference</strong> |
|||
</th> |
|||
<th name="th_description"> |
|||
<strong>Shipping address</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<td class="text-center"> |
|||
<div t-if="o.user_id"> |
|||
<p t-field="o.user_id" class="m-0"/> |
|||
</div> |
|||
</td> |
|||
<td class="text-end"> |
|||
<div t-if="o.partner_ref"> |
|||
<p t-field="o.partner_ref" class="m-0"/> |
|||
</div> |
|||
</td> |
|||
<td class="text-end"> |
|||
<div t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone", "vat"], "no_marker": True, "phone_icons": True}'/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<table class="table table-sm o_main_table mt-4"> |
|||
<thead t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description"> |
|||
<strong>Description</strong> |
|||
</th> |
|||
<th name="th_product"> |
|||
<strong>Product</strong> |
|||
</th> |
|||
<th name="th_taxes"> |
|||
<strong>Taxes</strong> |
|||
</th> |
|||
<th name="th_date_req" class="text-center"> |
|||
<strong>Date Req.</strong> |
|||
</th> |
|||
<th name="th_quantity" class="text-end"> |
|||
<strong>Qty</strong> |
|||
</th> |
|||
<th name="th_price_unit" class="text-end"> |
|||
<strong>Unit Price</strong> |
|||
</th> |
|||
<th name="th_amount" class="text-end"> |
|||
<strong>Amount</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
<t t-foreach="o.order_line" t-as="line"> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;" t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''"> |
|||
<t t-if="not line.display_type"> |
|||
<td id="product"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
<td id="product"> |
|||
<span t-field="line.order_line_image" t-options='{"widget": "image"}'/> |
|||
</td> |
|||
<td name="td_taxes"> |
|||
<span t-esc="', '.join(map(lambda x: x.name, line.taxes_id))"/> |
|||
</td> |
|||
<td class="text-center"> |
|||
<span t-field="line.date_planned"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="line.product_qty"/> |
|||
<span t-field="line.product_uom.name" groups="uom.group_uom"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="line.price_unit"/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="line.price_subtotal" |
|||
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> |
|||
</td> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_section'"> |
|||
<td colspan="99" id="section"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
<t t-set="current_section" t-value="line"/> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_note'"> |
|||
<td colspan="99" id="note"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
<t t-if="current_section and (line_last or o.order_line[line_index+1].display_type == 'line_section')"> |
|||
<tr class="is-subtotal text-end"> |
|||
<td colspan="99" id="subtotal"> |
|||
<strong class="mr16">Subtotal</strong> |
|||
<span t-esc="current_subtotal" t-options='{"widget": "monetary", "display_currency": o.currency_id}' |
|||
/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<div id="total" class="row justify-content-end"> |
|||
<div class="col-4"> |
|||
<table class="table table-sm"> |
|||
<t t-call="account.document_tax_totals"> |
|||
<t t-set="tax_totals" t-value="o.tax_totals"/> |
|||
<t t-set="currency" t-value="o.currency_id"/> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<p t-field="o.notes" class="mt-4"/> |
|||
<div class="oe_structure"/> |
|||
</div> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,225 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Sale order attractive report template--> |
|||
<template id="report_saleorder_attractive_document"> |
|||
<t t-call="web.external_layout"> |
|||
<t t-if="doc and 'company_id' in doc"> |
|||
<t t-set="company" t-value="doc.company_id"/> |
|||
</t> |
|||
<t t-if="not doc or not 'company_id' in doc"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" |
|||
style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" |
|||
t-attf-style="font:14px lucida-console,sans-serif; color:#{doc.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/> |
|||
<t t-set="forced_vat" |
|||
t-value="doc.fiscal_position_id.foreign_vat"/> <!-- So that it appears in the footer of the report instead of the company VAT if it's set --> |
|||
<h1 t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> |
|||
<div class="row mt-4 mb-4" id="informations"> |
|||
<div t-if="doc.client_order_ref" class="col-auto col-3 mw-100 mb-2" name="informations_reference" |
|||
style="font-size: 25px;"> |
|||
<strong>Your Reference:</strong> |
|||
<p class="m-0" t-field="doc.client_order_ref"/> |
|||
</div> |
|||
<div t-if="doc.date_order" class="col-auto col-2 mw-100 mb-2" name="informations_date" |
|||
style="font-size: 25px;"> |
|||
<strong t-if="doc.state in ['draft', 'sent']">Quotation Date:</strong> |
|||
<strong t-else="">Order Date:</strong> |
|||
<p class="m-0" t-field="doc.date_order" t-options='{"widget": "date"}'/> |
|||
</div> |
|||
<div t-if="doc.validity_date and doc.state in ['draft', 'sent']" class="col-auto col-3 mw-100 mb-2" |
|||
name="expiration_date" style="font-size: 25px;"> |
|||
<strong>Expiration:</strong> |
|||
<p class="m-0" t-field="doc.validity_date"/> |
|||
</div> |
|||
<div t-if="doc.user_id.name" class="col-auto col-3 mw-100 mb-2" style="font-size: 25px;"> |
|||
<strong>Salesperson:</strong> |
|||
<p class="m-0" t-field="doc.user_id"/> |
|||
</div> |
|||
</div> |
|||
</h1> |
|||
<table class="table table-sm o_main_table mt-4"> |
|||
<thead t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> |
|||
<th t-if="doc.state not in ['draft','sent']">Customer</th> |
|||
<th t-if="env.context.get('proforma', False) or is_pro_forma">Pro-Forma Invoice #</th> |
|||
<th t-if="doc.state in ['draft','sent']">Quotation #</th> |
|||
<th t-if="doc.state not in ['draft','sent']">Order #</th> |
|||
<th t-if="doc.state not in ['draft','sent']">Payment Term</th> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-attf-style="color:#{doc.theme_id.customer_text_color} !important;"> |
|||
<td> |
|||
<div t-field="doc.partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'> |
|||
<p t-if="doc.partner_id.vat"> |
|||
<t t-out="doc.company_id.account_fiscal_country_id.vat_label or 'Tax ID'"/> |
|||
: |
|||
<span t-field="doc.partner_id.vat"/> |
|||
</p> |
|||
</div> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="doc.name"/> |
|||
</td> |
|||
|
|||
<td class="text-end"> |
|||
<span t-field="doc.payment_term_id.note"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<t t-if="doc.partner_shipping_id == doc.partner_invoice_id and doc.partner_invoice_id != doc.partner_id or doc.partner_shipping_id != doc.partner_invoice_id"> |
|||
<t t-set="information_block"> |
|||
<strong> |
|||
<t t-if="doc.partner_shipping_id == doc.partner_invoice_id"> |
|||
Invoicing and Shipping Address: |
|||
</t> |
|||
<t t-else=""> |
|||
Invoicing Address: |
|||
</t> |
|||
</strong> |
|||
<div t-field="doc.partner_invoice_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
|||
<t t-if="doc.partner_shipping_id != doc.partner_invoice_id"> |
|||
<strong>Shipping Address:</strong> |
|||
<div t-field="doc.partner_shipping_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
<div class="page"> |
|||
<div class="oe_structure"/> |
|||
<!-- Is there a discount on at least one line? --> |
|||
<t t-set="lines_to_report" t-value="doc._get_order_lines_to_report()"/> |
|||
<t t-set="display_discount" t-value="any(l.discount for l in lines_to_report)"/> |
|||
<table class="table table-sm o_main_table mt-4"> |
|||
<!-- In case we want to repeat the header, remove "display: table-row-group" --> |
|||
<thead t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description" class="text-start">Description</th> |
|||
<th name="th_quantity" class="text-end">Quantity</th> |
|||
<th name="th_priceunit" class="text-end">Unit Price</th> |
|||
<th name="th_discount" t-if="display_discount" class="text-end" |
|||
groups="product.group_discount_per_so_line"> |
|||
<span>Disc.%</span> |
|||
</th> |
|||
<th name="th_taxes" class="text-end">Taxes</th> |
|||
<th name="th_subtotal" class="text-end"> |
|||
<span groups="account.group_show_line_subtotals_tax_excluded">Amount</span> |
|||
<span groups="account.group_show_line_subtotals_tax_included">Total Price</span> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody class="sale_tbody"> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
<t t-foreach="lines_to_report" t-as="line"> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" |
|||
groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" |
|||
groups="account.group_show_line_subtotals_tax_included"/> |
|||
<tr t-attf-style="color:#{doc.theme_id.customer_text_color} !important;" |
|||
t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''"> |
|||
<t t-if="not line.display_type"> |
|||
<td name="td_name"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
<td name="td_quantity" class="text-end"> |
|||
<span t-field="line.product_uom_qty"/> |
|||
<span t-field="line.product_uom"/> |
|||
</td> |
|||
<td name="td_priceunit" class="text-end"> |
|||
<span t-field="line.price_unit"/> |
|||
</td> |
|||
<td t-if="display_discount" class="text-end" |
|||
groups="product.group_discount_per_so_line"> |
|||
<span t-field="line.discount"/> |
|||
</td> |
|||
<td name="td_taxes" class="text-end"> |
|||
<span t-out="', '.join(map(lambda x: (x.description or x.name), line.tax_id))"/> |
|||
</td> |
|||
<td t-if="not line.is_downpayment" name="td_subtotal" |
|||
class="text-end o_price_total"> |
|||
<span t-field="line.price_subtotal" |
|||
groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<span t-field="line.price_total" |
|||
groups="account.group_show_line_subtotals_tax_included"/> |
|||
</td> |
|||
</t> |
|||
<t t-elif="line.display_type == 'line_section'"> |
|||
<td name="td_section_line" colspan="99"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
<t t-set="current_section" t-value="line"/> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
</t> |
|||
<t t-elif="line.display_type == 'line_note'"> |
|||
<td name="td_note_line" colspan="99"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
<t t-if="current_section and (line_last or doc.order_line[line_index+1].display_type == 'line_section') and not line.is_downpayment"> |
|||
<tr class="is-subtotal text-end"> |
|||
<td name="td_section_subtotal" colspan="99"> |
|||
<strong class="mr16">Subtotal</strong> |
|||
<span t-out="current_subtotal" |
|||
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}' |
|||
/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<div class="clearfix col-6" name="so_total_summary" |
|||
t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> |
|||
<div id="total" class="row" name="total"> |
|||
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto"> |
|||
<table class="table table-sm"> |
|||
<!-- Tax totals --> |
|||
<t t-call="account.document_tax_totals"> |
|||
<t t-set="tax_totals" t-value="doc.tax_totals"/> |
|||
<t t-set="currency" t-value="doc.currency_id"/> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div t-if="doc.signature" class="mt-4 ml64 mr4" name="signature"> |
|||
<div class="offset-8"> |
|||
<strong>Signature</strong> |
|||
</div> |
|||
<div class="offset-8"> |
|||
<img t-att-src="image_data_uri(doc.signature)" style="max-height: 4cm; max-width: 8cm;"/> |
|||
</div> |
|||
<div class="offset-8 text-center"> |
|||
<p t-field="doc.signed_by"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,269 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Sale order report modern template--> |
|||
<template id="report_saleorder_modern_document"> |
|||
<t t-call="web.external_layout"> |
|||
<t t-if="doc and 'company_id' in doc"> |
|||
<t t-set="company" t-value="doc.company_id"/> |
|||
</t> |
|||
<t t-if="not doc or not 'company_id' in doc"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" t-attf-style="font:14px lucida-console,sans-serif; color:#{doc.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/> |
|||
<t t-set="forced_vat" t-value="doc.fiscal_position_id.foreign_vat"/> <!-- So that it appears in the footer of the report instead of the company VAT if it's set --> |
|||
<table class="table table-sm o_main_table mt-4"> |
|||
<thead t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description"> |
|||
Customer |
|||
</th> |
|||
<t t-if="doc.partner_shipping_id == doc.partner_invoice_id |
|||
and doc.partner_invoice_id != doc.partner_id |
|||
or doc.partner_shipping_id != doc.partner_invoice_id"> |
|||
<t t-if="doc.partner_shipping_id == doc.partner_invoice_id"> |
|||
|
|||
<th name="th_quantity" |
|||
class="text-end"> |
|||
|
|||
Invoicing and shipping Address |
|||
</th> |
|||
</t> |
|||
</t> |
|||
<t t-else=""> |
|||
<th name="th_priceunit" |
|||
t-if="doc.partner_shipping_id != doc.partner_invoice_id" |
|||
class="text-end"> |
|||
Invoicing Address |
|||
</th> |
|||
</t> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-attf-style="color:#{doc.theme_id.customer_text_color} !important;"> |
|||
<td> |
|||
<div t-field="doc.partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/> |
|||
<p t-if="doc.partner_id.vat"> |
|||
<t t-out="doc.company_id.account_fiscal_country_id.vat_label or 'Tax ID'"/> |
|||
: |
|||
<span t-field="doc.partner_id.vat"/> |
|||
</p> |
|||
</td> |
|||
<td> |
|||
<t t-set="information_block"> |
|||
<div t-field="doc.partner_invoice_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
|||
<t t-if="doc.partner_shipping_id != doc.partner_invoice_id"> |
|||
<div t-field="doc.partner_shipping_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
|||
</t> |
|||
</t> |
|||
</td> |
|||
|
|||
</tr> |
|||
|
|||
</tbody> |
|||
</table> |
|||
<h1 class="mt-4" |
|||
t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> |
|||
<span t-if="env.context.get('proforma', False) or is_pro_forma"> |
|||
<strong>Pro-Forma Invoice #</strong> |
|||
</span> |
|||
<span t-elif="doc.state in ['draft','sent']"> |
|||
<strong>Quotation #</strong> |
|||
</span> |
|||
<span t-else=""> |
|||
<strong>Order #</strong> |
|||
</span> |
|||
<span t-field="doc.name"/> |
|||
<span t-if="doc.date_order" class="col-auto col-3 mw-100 mb-2" |
|||
name="informations_date"> |
|||
<strong t-if="doc.state in ['draft', 'sent']">Quotation |
|||
Date: |
|||
</strong> |
|||
<strong t-else="">Order Date:</strong> |
|||
<span class="m-0" t-field="doc.date_order" |
|||
t-options='{"widget": "date"}'/> |
|||
</span> |
|||
<span t-if="not is_html_empty(doc.payment_term_id.note)"> |
|||
<span t-field="doc.payment_term_id.note"/> |
|||
</span> |
|||
<span t-if="doc.user_id.name" |
|||
class="col-auto col-3 mw-100 mb-2"> |
|||
<strong>Salesperson:</strong> |
|||
<span t-field="doc.user_id"/> |
|||
</span> |
|||
</h1> |
|||
<div class="page"> |
|||
<div class="oe_structure"/> |
|||
<!-- Is there a discount on at least one line? --> |
|||
<t t-set="lines_to_report" |
|||
t-value="doc._get_order_lines_to_report()"/> |
|||
<t t-set="display_discount" |
|||
t-value="any(l.discount for l in lines_to_report)"/> |
|||
<table class="table table-sm o_main_table mt-4"> |
|||
<!-- In case we want to repeat the header, remove "display: table-row-group" --> |
|||
<thead t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description" class="text-start"> |
|||
Description |
|||
</th> |
|||
<th name="th_quantity" class="text-end">Quantity |
|||
</th> |
|||
<th name="th_priceunit" class="text-end">Unit |
|||
Price |
|||
</th> |
|||
<th name="th_discount" t-if="display_discount" |
|||
class="text-end" |
|||
groups="product.group_discount_per_so_line"> |
|||
<span>Disc.%</span> |
|||
</th> |
|||
<th name="th_taxes" class="text-end">Taxes</th> |
|||
<th name="th_subtotal" class="text-end"> |
|||
<span groups="account.group_show_line_subtotals_tax_excluded"> |
|||
Amount |
|||
</span> |
|||
<span groups="account.group_show_line_subtotals_tax_included"> |
|||
Total Price |
|||
</span> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody class="sale_tbody"> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
<t t-foreach="lines_to_report" t-as="line"> |
|||
<t t-set="current_subtotal" |
|||
t-value="current_subtotal + line.price_subtotal" |
|||
groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<t t-set="current_subtotal" |
|||
t-value="current_subtotal + line.price_total" |
|||
groups="account.group_show_line_subtotals_tax_included"/> |
|||
<tr t-attf-style="color:#{doc.theme_id.customer_text_color} !important;" |
|||
t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''"> |
|||
<t t-if="not line.display_type"> |
|||
<td name="td_name"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
<td name="td_quantity" class="text-end"> |
|||
<span t-field="line.product_uom_qty"/> |
|||
<span t-field="line.product_uom"/> |
|||
</td> |
|||
<td name="td_priceunit" class="text-end"> |
|||
<span t-field="line.price_unit"/> |
|||
</td> |
|||
<td t-if="display_discount" class="text-end" |
|||
groups="product.group_discount_per_so_line"> |
|||
<span t-field="line.discount"/> |
|||
</td> |
|||
<td name="td_taxes" class="text-end"> |
|||
<span t-out="', '.join(map(lambda x: (x.description or x.name), line.tax_id))"/> |
|||
</td> |
|||
<td t-if="not line.is_downpayment" |
|||
name="td_subtotal" |
|||
class="text-end o_price_total"> |
|||
<span t-field="line.price_subtotal" |
|||
groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<span t-field="line.price_total" |
|||
groups="account.group_show_line_subtotals_tax_included"/> |
|||
</td> |
|||
</t> |
|||
<t t-elif="line.display_type == 'line_section'"> |
|||
<td name="td_section_line" colspan="99"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
<t t-set="current_section" t-value="line"/> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
</t> |
|||
<t t-elif="line.display_type == 'line_note'"> |
|||
<td name="td_note_line" colspan="99"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
<t t-if="current_section and (line_last or doc.order_line[line_index+1].display_type == 'line_section') and not line.is_downpayment"> |
|||
<tr class="is-subtotal text-end"> |
|||
<td name="td_section_subtotal" colspan="99"> |
|||
<strong class="mr16">Subtotal</strong> |
|||
<span |
|||
t-out="current_subtotal" |
|||
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}' |
|||
/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<div class="clearfix" name="so_total_summary"> |
|||
<div id="total" class="row" name="total"> |
|||
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto"> |
|||
<table class="table table-sm" |
|||
t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> |
|||
<!-- Tax totals --> |
|||
<t t-call="account.document_tax_totals"> |
|||
<t t-set="tax_totals" t-value="doc.tax_totals"/> |
|||
<t t-set="currency" t-value="doc.currency_id"/> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br></br> |
|||
<div t-if="doc.signature" class="mt-4 ml64 mr4" |
|||
name="signature"> |
|||
<div class="offset-8"> |
|||
<strong>Signature</strong> |
|||
</div> |
|||
<div class="offset-8"> |
|||
<img t-att-src="image_data_uri(doc.signature)" |
|||
style="max-height: 4cm; max-width: 8cm;"/> |
|||
</div> |
|||
<div class="offset-8 text-center"> |
|||
<p t-field="doc.signed_by"/> |
|||
</div> |
|||
</div> |
|||
<div t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> |
|||
<t t-if="doc.note"> |
|||
<strong>Note</strong> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
</t> |
|||
<p t-field="doc.note" name="order_note"/> |
|||
<p t-if="doc.fiscal_position_id and not is_html_empty(doc.fiscal_position_id.sudo().note)" |
|||
id="fiscal_position_remark"> |
|||
<strong>Fiscal Position Remark:</strong> |
|||
<span t-field="doc.fiscal_position_id.sudo().note"/> |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,228 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<odoo> |
|||
<!-- Sale order report standard template--> |
|||
<template id="report_saleorder_standard_document"> |
|||
<t t-call="web.external_layout"> |
|||
<t t-if="doc and 'company_id' in doc"> |
|||
<t t-set="company" t-value="doc.company_id"/> |
|||
</t> |
|||
<t t-if="not doc or not 'company_id' in doc"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" |
|||
t-att-src="image_data_uri(company.logo)" |
|||
style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" |
|||
t-attf-style="font:14px lucida-console,sans-serif; color:#{doc.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-set="doc" |
|||
t-value="doc.with_context(lang=doc.partner_id.lang)"/> |
|||
<t t-set="forced_vat" |
|||
t-value="doc.fiscal_position_id.foreign_vat"/> <!-- So that it appears in the footer of the report instead of the company VAT if it's set --> |
|||
|
|||
<h1 class="mt-4 col-12" |
|||
t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> |
|||
<span t-if="env.context.get('proforma', False) or is_pro_forma"> |
|||
Pro-Forma Invoice # |
|||
</span> |
|||
<span t-elif="doc.state in ['draft','sent']">Quotation #</span> |
|||
<span t-else="">Order #</span> |
|||
<span t-field="doc.name"/> |
|||
</h1> |
|||
<t t-if="doc.partner_id"> |
|||
<div t-field="doc.partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/> |
|||
<p t-if="doc.partner_id.vat"> |
|||
<t t-out="doc.company_id.account_fiscal_country_id.vat_label or 'Tax ID'"/> |
|||
: |
|||
<span t-field="doc.partner_id.vat"/> |
|||
</p> |
|||
</t> |
|||
<t t-if="doc.partner_shipping_id == doc.partner_invoice_id |
|||
and doc.partner_invoice_id != doc.partner_id |
|||
or doc.partner_shipping_id != doc.partner_invoice_id"> |
|||
<t t-set="information_block"> |
|||
<strong> |
|||
<t t-if="doc.partner_shipping_id == doc.partner_invoice_id"> |
|||
Invoicing and Shipping Address: |
|||
</t> |
|||
<t t-else=""> |
|||
Invoicing Address: |
|||
</t> |
|||
</strong> |
|||
<div t-field="doc.partner_invoice_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
|||
<t t-if="doc.partner_shipping_id != doc.partner_invoice_id"> |
|||
<strong>Shipping Address:</strong> |
|||
<div t-field="doc.partner_shipping_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
<div class="page"> |
|||
<div class="oe_structure"/> |
|||
<!-- Is there a discount on at least one line? --> |
|||
<t t-set="lines_to_report" |
|||
t-value="doc._get_order_lines_to_report()"/> |
|||
<t t-set="display_discount" |
|||
t-value="any(l.discount for l in lines_to_report)"/> |
|||
<table class="table table-sm o_main_table mt-4"> |
|||
<!-- In case we want to repeat the header, remove "display: table-row-group" --> |
|||
<thead t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description" class="text-start"> |
|||
Description |
|||
</th> |
|||
<th name="th_quantity" class="text-end">Quantity |
|||
</th> |
|||
<th name="th_priceunit" class="text-end">Unit |
|||
Price |
|||
</th> |
|||
<th name="th_discount" t-if="display_discount" |
|||
class="text-end" |
|||
groups="product.group_discount_per_so_line"> |
|||
<span>Disc.%</span> |
|||
</th> |
|||
<th name="th_taxes" class="text-end">Taxes</th> |
|||
<th name="th_subtotal" class="text-end"> |
|||
<span groups="account.group_show_line_subtotals_tax_excluded"> |
|||
Amount |
|||
</span> |
|||
<span groups="account.group_show_line_subtotals_tax_included"> |
|||
Total Price |
|||
</span> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody class="sale_tbody"> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
<t t-foreach="lines_to_report" t-as="line"> |
|||
<t t-set="current_subtotal" |
|||
t-value="current_subtotal + line.price_subtotal" |
|||
groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<t t-set="current_subtotal" |
|||
t-value="current_subtotal + line.price_total" |
|||
groups="account.group_show_line_subtotals_tax_included"/> |
|||
<tr t-attf-style="color:#{doc.theme_id.customer_text_color} !important;" |
|||
t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''"> |
|||
<t t-if="not line.display_type"> |
|||
<td name="td_name"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
<td name="td_quantity" class="text-end"> |
|||
<span t-field="line.product_uom_qty"/> |
|||
<span t-field="line.product_uom"/> |
|||
</td> |
|||
<td name="td_priceunit" class="text-end"> |
|||
<span t-field="line.price_unit"/> |
|||
</td> |
|||
<td t-if="display_discount" class="text-end" |
|||
groups="product.group_discount_per_so_line"> |
|||
<span t-field="line.discount"/> |
|||
</td> |
|||
<td name="td_taxes" class="text-end"> |
|||
<span t-out="', '.join(map(lambda x: (x.description or x.name), line.tax_id))"/> |
|||
</td> |
|||
<td t-if="not line.is_downpayment" |
|||
name="td_subtotal" |
|||
class="text-end o_price_total"> |
|||
<span t-field="line.price_subtotal" |
|||
groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<span t-field="line.price_total" |
|||
groups="account.group_show_line_subtotals_tax_included"/> |
|||
</td> |
|||
</t> |
|||
<t t-elif="line.display_type == 'line_section'"> |
|||
<td name="td_section_line" colspan="99"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
<t t-set="current_section" t-value="line"/> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
</t> |
|||
<t t-elif="line.display_type == 'line_note'"> |
|||
<td name="td_note_line" colspan="99"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
<t t-if="current_section and (line_last or doc.order_line[line_index+1].display_type == 'line_section') and not line.is_downpayment"> |
|||
<tr class="is-subtotal text-end"> |
|||
<td name="td_section_subtotal" colspan="99"> |
|||
<strong class="mr16">Subtotal</strong> |
|||
<span |
|||
t-out="current_subtotal" |
|||
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}' |
|||
/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<div class="clearfix" name="so_total_summary" |
|||
t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> |
|||
<div id="total" class="row" name="total"> |
|||
<div t-attf-class="#{'col-12' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto"> |
|||
<table class="table table-sm"> |
|||
<!-- Tax totals --> |
|||
<t t-call="account.document_tax_totals"> |
|||
<t t-set="tax_totals" t-value="doc.tax_totals"/> |
|||
<t t-set="currency" t-value="doc.currency_id"/> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div t-if="doc.signature" class="mt-4 ml64 mr4" |
|||
name="signature"> |
|||
<div class="offset-8"> |
|||
<strong>Signature</strong> |
|||
</div> |
|||
<div class="offset-8"> |
|||
<img t-att-src="image_data_uri(doc.signature)" |
|||
style="max-height: 4cm; max-width: 8cm;"/> |
|||
</div> |
|||
<div class="offset-8 text-center"> |
|||
<p t-field="doc.signed_by"/> |
|||
</div> |
|||
</div> |
|||
<div t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};" |
|||
class="col-6"> |
|||
<p t-field="doc.note" name="order_note"/> |
|||
<p t-if="not is_html_empty(doc.payment_term_id.note)"> |
|||
<span t-field="doc.payment_term_id.note"/> |
|||
</p> |
|||
<div t-if="doc.user_id.name" class="col-auto mw-100 mb-2"> |
|||
<strong>Salesperson:</strong> |
|||
<p class="m-0" t-field="doc.user_id"/> |
|||
</div> |
|||
<p t-if="doc.fiscal_position_id and not is_html_empty(doc.fiscal_position_id.sudo().note)" |
|||
id="fiscal_position_remark"> |
|||
<strong>Fiscal Position Remark:</strong> |
|||
<span t-field="doc.fiscal_position_id.sudo().note"/> |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,215 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<record id="sale.action_report_saleorder" model="ir.actions.report"> |
|||
<field name="name">Quotation / Order</field> |
|||
<field name="model">sale.order</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">base_advanced_report_templates.report_saleorder_custom</field> |
|||
<field name="report_file">base_advanced_report_templates.report_saleorder</field> |
|||
<field name="print_report_name">(object.state in ('draft', 'sent') and 'Quotation - %s' % (object.name)) or 'Order - %s' % (object.name) |
|||
</field> |
|||
<field name="binding_model_id" ref="model_sale_order"/> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
<template id="report_saleorder_custom"> |
|||
<t t-call="web.html_container"> |
|||
<t t-foreach="docs" t-as="doc"> |
|||
<t t-if="doc.theme_id.name=='Traditional'"> |
|||
<t t-call="base_advanced_report_templates.report_saleorder_traditional_document" |
|||
t-lang="doc.partner_id.lang"/> |
|||
</t> |
|||
<t t-elif="doc.theme_id.name=='Standard'"> |
|||
<t t-call="base_advanced_report_templates.report_saleorder_standard_document" |
|||
t-lang="doc.partner_id.lang"/> |
|||
</t> |
|||
<t t-elif="doc.theme_id.name=='Modern'"> |
|||
<t t-call="base_advanced_report_templates.report_saleorder_modern_document" |
|||
t-lang="doc.partner_id.lang"/> |
|||
</t> |
|||
<t t-elif="doc.theme_id.name=='Attractive'"> |
|||
<t t-call="base_advanced_report_templates.report_saleorder_attractive_document" |
|||
t-lang="doc.partner_id.lang"/> |
|||
</t> |
|||
<t t-else=""> |
|||
<t t-call="sale.report_saleorder_document" |
|||
t-lang="doc.partner_id.lang"/> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
<!-- Sale order report traditional template--> |
|||
<template id="report_saleorder_traditional_document"> |
|||
<t t-call="web.external_layout"> |
|||
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/> |
|||
<t t-set="forced_vat" |
|||
t-value="doc.fiscal_position_id.foreign_vat"/> <!-- So that it appears in the footer of the report instead of the company VAT if it's set --> |
|||
<div class="page"> |
|||
<!-- Is there a discount on at least one line? --> |
|||
<t t-set="lines_to_report" t-value="doc._get_order_lines_to_report()"/> |
|||
<t t-set="display_discount" t-value="any(l.discount for l in lines_to_report)"/> |
|||
<table class="table table-sm o_main_table mt-4"> |
|||
<!-- In case we want to repeat the header, remove "display: table-row-group" --> |
|||
<thead t-attf-style=" background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description" class="text-start">Customer Address</th> |
|||
<th name="th_priceunit" t-if="doc.state in ['draft', 'sent']" class="text-end">Quotaion Date |
|||
</th> |
|||
<th name="th_priceunit" t-if="doc.state not in ['draft', 'sent']" class="text-end">Order |
|||
Date |
|||
</th> |
|||
<th name="th_priceunit" t-if="doc.state in ['draft','sent']" class="text-end">Quotaion</th> |
|||
<th name="th_priceunit" t-if="doc.state not in ['draft','sent']" class="text-end">Order</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-attf-style="color:#{doc.theme_id.customer_text_color} !important;"> |
|||
<td class="text-start"> |
|||
<div t-field="doc.partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/> |
|||
<p t-if="doc.partner_id.vat"> |
|||
<t t-out="doc.company_id.account_fiscal_country_id.vat_label or 'Tax ID'"/> |
|||
: |
|||
<span t-field="doc.partner_id.vat"/> |
|||
</p> |
|||
</td> |
|||
<td class="text-end"> |
|||
<p class="m-0" t-field="doc.date_order" t-options='{"widget": "date"}'/> |
|||
</td> |
|||
<td class="text-end"> |
|||
<span t-field="doc.name"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<table class="table table-sm o_main_table mt-4"> |
|||
<!-- In case we want to repeat the header, remove "display: table-row-group" --> |
|||
<thead t-attf-style=" background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_description" class="text-start">Description</th> |
|||
<th name="th_product" class="text-start">Product</th> |
|||
<th name="th_quantity" class="text-end">Quantity</th> |
|||
<th name="th_priceunit" class="text-end">Unit Price</th> |
|||
<th name="th_discount" t-if="display_discount" class="text-end" |
|||
groups="product.group_discount_per_so_line"> |
|||
<span>Disc.%</span> |
|||
</th> |
|||
<th name="th_taxes" class="text-end">Taxes</th> |
|||
<th name="th_subtotal" class="text-end"> |
|||
<span groups="account.group_show_line_subtotals_tax_excluded">Amount</span> |
|||
<span groups="account.group_show_line_subtotals_tax_included">Total Price</span> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody class="sale_tbody"> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
<t t-foreach="lines_to_report" t-as="line"> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" |
|||
groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" |
|||
groups="account.group_show_line_subtotals_tax_included"/> |
|||
<tr t-attf-style="color:#{doc.theme_id.customer_text_color} !important;" |
|||
t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''"> |
|||
<t t-if="not line.display_type"> |
|||
<td name="td_name"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
<td name="td_image"> |
|||
<span t-field="line.order_line_image" t-options='{"widget": "image"}'/> |
|||
</td> |
|||
<td name="td_quantity" class="text-end"> |
|||
<span t-field="line.product_uom_qty"/> |
|||
<span t-field="line.product_uom"/> |
|||
</td> |
|||
<td name="td_priceunit" class="text-end"> |
|||
<span t-field="line.price_unit"/> |
|||
</td> |
|||
<td t-if="display_discount" class="text-end" |
|||
groups="product.group_discount_per_so_line"> |
|||
<span t-field="line.discount"/> |
|||
</td> |
|||
<td name="td_taxes" class="text-end"> |
|||
<span t-out="', '.join(map(lambda x: (x.description or x.name), line.tax_id))"/> |
|||
</td> |
|||
<td t-if="not line.is_downpayment" name="td_subtotal" |
|||
class="text-end o_price_total"> |
|||
<span t-field="line.price_subtotal" |
|||
groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<span t-field="line.price_total" |
|||
groups="account.group_show_line_subtotals_tax_included"/> |
|||
</td> |
|||
</t> |
|||
<t t-elif="line.display_type == 'line_section'"> |
|||
<td name="td_section_line" colspan="99"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
<t t-set="current_section" t-value="line"/> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
</t> |
|||
<t t-elif="line.display_type == 'line_note'"> |
|||
<td name="td_note_line" colspan="99"> |
|||
<span t-field="line.name"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
<t t-if="current_section and (line_last or doc.order_line[line_index+1].display_type == 'line_section') and not line.is_downpayment"> |
|||
<tr class="is-subtotal text-end"> |
|||
<td name="td_section_subtotal" colspan="99"> |
|||
<strong class="mr16">Subtotal</strong> |
|||
<span |
|||
t-out="current_subtotal" |
|||
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}' |
|||
/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<div class="clearfix" name="so_total_summary"> |
|||
<div id="total" class="row" name="total"> |
|||
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto"> |
|||
<table class="table table-sm"> |
|||
<!-- Tax totals --> |
|||
<t t-call="account.document_tax_totals"> |
|||
<t t-set="tax_totals" t-value="doc.tax_totals"/> |
|||
<t t-set="currency" t-value="doc.currency_id"/> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div t-if="doc.signature" class="mt-4 ml64 mr4" name="signature"> |
|||
<div class="offset-8"> |
|||
<strong>Signature</strong> |
|||
</div> |
|||
<div class="offset-8"> |
|||
<img t-att-src="image_data_uri(doc.signature)" style="max-height: 4cm; max-width: 8cm;"/> |
|||
</div> |
|||
<div class="offset-8 text-center"> |
|||
<p t-field="doc.signed_by"/> |
|||
</div> |
|||
</div> |
|||
<br></br> |
|||
<br></br> |
|||
<br></br> |
|||
<br></br> |
|||
<br></br> |
|||
<br></br> |
|||
<div> |
|||
<div> |
|||
<p t-field="doc.note" name="order_note"/> |
|||
</div> |
|||
<p t-if="doc.fiscal_position_id and not is_html_empty(doc.fiscal_position_id.sudo().note)" |
|||
id="fiscal_position_remark"> |
|||
<strong>Fiscal Position Remark:</strong> |
|||
<span t-field="doc.fiscal_position_id.sudo().note"/> |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</template> |
|||
</odoo> |
|||
|
@ -0,0 +1,263 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Stock report attractive template--> |
|||
<template id="report_stock_attractive_document"> |
|||
<t t-if="o and 'company_id' in o"> |
|||
<t t-set="company" t-value="o.company_id"/> |
|||
</t> |
|||
<t t-if="not o or not 'company_id' in o"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" |
|||
style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" |
|||
t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-call="web.html_container"> |
|||
<t t-call="web.external_layout"> |
|||
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/> |
|||
<t t-set="partner" t-value="o.partner_id or (o.move_ids and o.move_ids[0].partner_id) or False"/> |
|||
<div class="row col-6" |
|||
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<div name="div_incoming_address"> |
|||
<div name="vendor_address" t-if="o.picking_type_id.code=='incoming' and partner"> |
|||
<span> |
|||
<strong>Vendor Address:</strong> |
|||
</span> |
|||
</div> |
|||
<div name="warehouse_address" t-if="o.picking_type_id.code=='internal' and partner"> |
|||
<span> |
|||
<strong>Warehouse Address:</strong> |
|||
</span> |
|||
</div> |
|||
<div name="customer_address" t-if="o.picking_type_id.code=='outgoing' and partner"> |
|||
<span> |
|||
<strong>Customer Address:</strong> |
|||
</span> |
|||
</div> |
|||
<div t-if="partner" name="partner_header"> |
|||
<div t-field="partner.commercial_partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone", "vat"], "no_marker": True, "phone_icons": True}'/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<br/> |
|||
<br/> |
|||
<div class="col-12" |
|||
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<h2>Number |
|||
<span t-field="o.name"/> |
|||
</h2> |
|||
</div> |
|||
<div class="page"> |
|||
<div class="row mt32 mb32" |
|||
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<div t-if="o.origin" class="col-auto" name="div_origin"> |
|||
<strong>Order:</strong> |
|||
<p t-field="o.origin"/> |
|||
</div> |
|||
<div t-if="o.state" class="col-auto" name="div_sched_date"> |
|||
<strong>Shipping Date:</strong> |
|||
<t t-if="o.state == 'done'"> |
|||
<p t-field="o.date_done"/> |
|||
</t> |
|||
<t t-if="o.state != 'done'"> |
|||
<p t-field="o.scheduled_date"/> |
|||
</t> |
|||
</div> |
|||
<div t-if="o.scheduled_date" class="col-auto" name="div_sched_date"> |
|||
<strong>Scheduled Date:</strong> |
|||
<p t-field="o.scheduled_date"/> |
|||
</div> |
|||
<div t-if="o.origin" class="col-auto" name="div_sched_date"> |
|||
<strong>Source:</strong> |
|||
<p t-field="o.origin"/> |
|||
</div> |
|||
</div> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<table class="table table-sm" t-if="o.state!='done'" name="stock_move_table"> |
|||
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_sm_product"> |
|||
<strong>Product</strong> |
|||
</th> |
|||
<th name="th_sm_ordered"> |
|||
<strong>Ordered</strong> |
|||
</th> |
|||
<th name="th_sm_quantity"> |
|||
<strong>Delivered</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<t t-set="lines" t-value="o.move_ids.filtered(lambda x: x.product_uom_qty)"/> |
|||
<tr t-foreach="lines" t-as="move"> |
|||
<td> |
|||
<span t-field="move.product_id"/> |
|||
<p t-if="move.description_picking != move.product_id.name and move.description_picking != move.product_id.display_name"> |
|||
<span t-field="move.description_picking"/> |
|||
</p> |
|||
</td> |
|||
<td> |
|||
<span t-field="move.product_uom_qty"/> |
|||
<span t-field="move.product_uom"/> |
|||
</td> |
|||
<td> |
|||
<span t-field="move.quantity"/> |
|||
<span t-field="move.product_uom"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<table class="table table-sm mt48" t-if="o.move_line_ids and o.state=='done'" |
|||
name="stock_move_line_table"> |
|||
<t t-set="has_serial_number" t-value="False"/> |
|||
<t t-set="has_serial_number" t-value="o.move_line_ids.mapped('lot_id')" |
|||
groups="stock.group_lot_on_delivery_slip"/> |
|||
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_sml_product"> |
|||
<strong>Product</strong> |
|||
</th> |
|||
<t name="lot_serial" t-if="has_serial_number"> |
|||
<th> |
|||
Lot/Serial Number |
|||
</th> |
|||
</t> |
|||
<th name="th_sml_qty_ordered" class="text-center" t-if="not has_serial_number"> |
|||
<strong>Ordered</strong> |
|||
</th> |
|||
<th name="th_sml_quantity" class="text-center"> |
|||
<strong>Delivered</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<!-- This part gets complicated with different use cases (additional use cases in extensions of this report): |
|||
1. If serial numbers are used and set to print on delivery slip => print lines as is, otherwise group them by overlapping |
|||
product + description + uom combinations |
|||
2. If any packages are assigned => split products up by package (or non-package) and then apply use case 1 --> |
|||
<!-- If has destination packages => create sections of corresponding products --> |
|||
<t t-if="o.has_packages" name="has_packages"> |
|||
<t t-set="packages" t-value="o.move_line_ids.mapped('result_package_id')"/> |
|||
<t t-foreach="packages" t-as="package"> |
|||
<t t-call="stock.stock_report_delivery_package_section_line"/> |
|||
<t t-set="package_move_lines" |
|||
t-value="o.move_line_ids.filtered(lambda l: l.result_package_id == package)"/> |
|||
<!-- If printing lots/serial numbers => keep products in original lines --> |
|||
<t t-if="has_serial_number"> |
|||
<tr t-foreach="package_move_lines" t-as="move_line"> |
|||
<t t-call="stock.stock_report_delivery_has_serial_move_line"/> |
|||
</tr> |
|||
</t> |
|||
<!-- If not printing lots/serial numbers => merge lines with same product+description+uom --> |
|||
<t t-else=""> |
|||
<t t-set="aggregated_lines" |
|||
t-value="package_move_lines._get_aggregated_product_quantities(strict=True)"/> |
|||
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/> |
|||
</t> |
|||
</t> |
|||
<!-- Make sure we do another section for package-less products if they exist --> |
|||
<t t-set="move_lines" |
|||
t-value="o.move_line_ids.filtered(lambda l: not l.result_package_id)"/> |
|||
<t t-set="aggregated_lines" |
|||
t-value="o.move_line_ids._get_aggregated_product_quantities(except_package=True)"/> |
|||
<t t-if="move_lines or aggregated_lines" name="no_package_move_lines"> |
|||
<t t-call="stock.stock_report_delivery_no_package_section_line" |
|||
name="no_package_section"/> |
|||
<t t-if="has_serial_number"> |
|||
<tr t-foreach="move_lines" t-as="move_line"> |
|||
<t t-call="stock.stock_report_delivery_has_serial_move_line"/> |
|||
</tr> |
|||
</t> |
|||
<t t-elif="aggregated_lines"> |
|||
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
<!-- No destination packages --> |
|||
<t t-else=""> |
|||
<!-- If printing lots/serial numbers => keep products in original lines --> |
|||
<t t-if="has_serial_number"> |
|||
<tr t-foreach="o.move_line_ids" t-as="move_line"> |
|||
<t t-call="stock.stock_report_delivery_has_serial_move_line"/> |
|||
</tr> |
|||
</t> |
|||
<!-- If not printing lots/serial numbers => merge lines with same product --> |
|||
<t t-else="" name="aggregated_move_lines"> |
|||
<t t-set="aggregated_lines" |
|||
t-value="o.move_line_ids._get_aggregated_product_quantities()"/> |
|||
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<t t-set="backorders" |
|||
t-value="o.backorder_ids.filtered(lambda x: x.state not in ('done', 'cancel'))"/> |
|||
<t t-if="o.backorder_ids and backorders"> |
|||
<p class="mt-5"> |
|||
<span>Remaining quantities not yet delivered:</span> |
|||
</p> |
|||
<table class="table table-sm" name="stock_backorder_table" style="table-layout: fixed;"> |
|||
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_sb_product"> |
|||
<strong>Product</strong> |
|||
</th> |
|||
<th/> |
|||
<th name="th_sb_quantity" class="text-center"> |
|||
<strong>Quantity</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<t t-foreach="backorders" t-as="backorder"> |
|||
<t t-set="bo_lines" |
|||
t-value="backorder.move_ids.filtered(lambda x: x.product_uom_qty)"/> |
|||
<tr t-foreach="bo_lines" t-as="bo_line"> |
|||
<td class="w-auto"> |
|||
<span t-field="bo_line.product_id"/> |
|||
<p t-if="bo_line.description_picking != bo_line.product_id.name and bo_line.description_picking != bo_line.product_id.display_name"> |
|||
<span t-field="bo_line.description_picking"/> |
|||
</p> |
|||
</td> |
|||
<td/> |
|||
<td class="text-center w-auto"> |
|||
<span t-field="bo_line.product_uom_qty"/> |
|||
<span t-field="bo_line.product_uom"/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
</t> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,285 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Stock report modern template--> |
|||
<template id="report_stock_modern_document"> |
|||
<t t-if="o and 'company_id' in o"> |
|||
<t t-set="company" t-value="o.company_id"/> |
|||
</t> |
|||
<t t-if="not o or not 'company_id' in o"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" |
|||
style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" |
|||
t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-call="web.html_container"> |
|||
<t t-call="web.external_layout"> |
|||
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/> |
|||
<t t-set="partner" t-value="o.partner_id or (o.move_ids and o.move_ids[0].partner_id) or False"/> |
|||
<div name="vendor_address" t-if="o.picking_type_id.code=='incoming' and partner" |
|||
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<span> |
|||
<strong>Vendor Address:</strong> |
|||
</span> |
|||
</div> |
|||
<div name="warehouse_address" t-if="o.picking_type_id.code=='internal' and partner" |
|||
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<span> |
|||
<strong>Warehouse Address:</strong> |
|||
</span> |
|||
</div> |
|||
<div name="customer_address" t-if="o.picking_type_id.code=='outgoing' and partner" |
|||
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<span> |
|||
<strong>Customer Address:</strong> |
|||
</span> |
|||
</div> |
|||
<div t-if="partner" name="partner_header"> |
|||
<div t-field="partner.commercial_partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone", "vat"], "no_marker": True, "phone_icons": True}'/> |
|||
</div> |
|||
<div name="customer_address" |
|||
t-if="o.picking_type_id.code != 'internal' and (not o.move_ids_without_package or not o.move_ids_without_package[0].partner_id or o.move_ids_without_package[0].partner_id == partner) and o.picking_type_id.warehouse_id.partner_id" |
|||
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<span> |
|||
<strong>Warehouse Address:</strong> |
|||
</span> |
|||
</div> |
|||
<div t-if="partner" name="partner_header"> |
|||
<div t-field="o.picking_type_id.warehouse_id.partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
|||
</div> |
|||
<div name="customer_address" |
|||
t-if="o.move_ids_without_package and o.move_ids_without_package[0].partner_id and o.move_ids_without_package[0].partner_id != partner" |
|||
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<span> |
|||
<strong>Delivery Address:</strong> |
|||
</span> |
|||
</div> |
|||
<div t-if="partner" name="partner_header"> |
|||
<div t-field="o.move_ids_without_package[0].partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
|||
</div> |
|||
<table class="table table-sm" t-if="o.state!='done'" name="stock_move_table"> |
|||
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_sm_ordered" t-if="o.state"> |
|||
<strong>Source</strong> |
|||
</th> |
|||
<th name="th_sm_product" t-if="o.origin"> |
|||
<strong>Order</strong> |
|||
</th> |
|||
<th name="th_sm_ordered" t-if="o.state"> |
|||
<strong>Shipping Date</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<td> |
|||
<span t-field="o.name"/> |
|||
</td> |
|||
<td> |
|||
<p t-field="o.origin"/> |
|||
</td> |
|||
<td> |
|||
<t t-if="o.state == 'done'"> |
|||
<p t-field="o.date_done"/> |
|||
</t> |
|||
<t t-if="o.state != 'done'"> |
|||
<p t-field="o.scheduled_date"/> |
|||
</t> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<div class="page"> |
|||
<table class="table table-sm" t-if="o.state!='done'" name="stock_move_table"> |
|||
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_sm_product"> |
|||
<strong>Product</strong> |
|||
</th> |
|||
<th name="th_sm_ordered"> |
|||
<strong>Ordered</strong> |
|||
</th> |
|||
<th name="th_sm_quantity"> |
|||
<strong>Delivered</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<t t-set="lines" t-value="o.move_ids.filtered(lambda x: x.product_uom_qty)"/> |
|||
<tr t-foreach="lines" t-as="move"> |
|||
<td> |
|||
<span t-field="move.product_id"/> |
|||
<p t-if="move.description_picking != move.product_id.name and move.description_picking != move.product_id.display_name"> |
|||
<span t-field="move.description_picking"/> |
|||
</p> |
|||
</td> |
|||
<td> |
|||
<span t-field="move.product_uom_qty"/> |
|||
<span t-field="move.product_uom"/> |
|||
</td> |
|||
<td> |
|||
<span t-field="move.quantity"/> |
|||
<span t-field="move.product_uom"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<table class="table table-sm mt48" t-if="o.move_line_ids and o.state=='done'" |
|||
name="stock_move_line_table"> |
|||
<t t-set="has_serial_number" t-value="False"/> |
|||
<t t-set="has_serial_number" t-value="o.move_line_ids.mapped('lot_id')" |
|||
groups="stock.group_lot_on_delivery_slip"/> |
|||
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_sml_product"> |
|||
<strong>Product</strong> |
|||
</th> |
|||
<t name="lot_serial" t-if="has_serial_number"> |
|||
<th> |
|||
Lot/Serial Number |
|||
</th> |
|||
</t> |
|||
<th name="th_sml_qty_ordered" class="text-center" t-if="not has_serial_number"> |
|||
<strong>Ordered</strong> |
|||
</th> |
|||
<th name="th_sml_quantity" class="text-center"> |
|||
<strong>Delivered</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<!-- This part gets complicated with different use cases (additional use cases in extensions of this report): |
|||
1. If serial numbers are used and set to print on delivery slip => print lines as is, otherwise group them by overlapping |
|||
product + description + uom combinations |
|||
2. If any packages are assigned => split products up by package (or non-package) and then apply use case 1 --> |
|||
<!-- If has destination packages => create sections of corresponding products --> |
|||
<t t-if="o.has_packages" name="has_packages"> |
|||
<t t-set="packages" t-value="o.move_line_ids.mapped('result_package_id')"/> |
|||
<t t-foreach="packages" t-as="package"> |
|||
<t t-call="stock.stock_report_delivery_package_section_line"/> |
|||
<t t-set="package_move_lines" |
|||
t-value="o.move_line_ids.filtered(lambda l: l.result_package_id == package)"/> |
|||
<!-- If printing lots/serial numbers => keep products in original lines --> |
|||
<t t-if="has_serial_number"> |
|||
<tr t-foreach="package_move_lines" t-as="move_line"> |
|||
<t t-call="stock.stock_report_delivery_has_serial_move_line"/> |
|||
</tr> |
|||
</t> |
|||
<!-- If not printing lots/serial numbers => merge lines with same product+description+uom --> |
|||
<t t-else=""> |
|||
<t t-set="aggregated_lines" |
|||
t-value="package_move_lines._get_aggregated_product_quantities(strict=True)"/> |
|||
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/> |
|||
</t> |
|||
</t> |
|||
<!-- Make sure we do another section for package-less products if they exist --> |
|||
<t t-set="move_lines" |
|||
t-value="o.move_line_ids.filtered(lambda l: not l.result_package_id)"/> |
|||
<t t-set="aggregated_lines" |
|||
t-value="o.move_line_ids._get_aggregated_product_quantities(except_package=True)"/> |
|||
<t t-if="move_lines or aggregated_lines" name="no_package_move_lines"> |
|||
<t t-call="stock.stock_report_delivery_no_package_section_line" |
|||
name="no_package_section"/> |
|||
<t t-if="has_serial_number"> |
|||
<tr t-foreach="move_lines" t-as="move_line"> |
|||
<t t-call="stock.stock_report_delivery_has_serial_move_line"/> |
|||
</tr> |
|||
</t> |
|||
<t t-elif="aggregated_lines"> |
|||
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
<!-- No destination packages --> |
|||
<t t-else=""> |
|||
<!-- If printing lots/serial numbers => keep products in original lines --> |
|||
<t t-if="has_serial_number"> |
|||
<tr t-foreach="o.move_line_ids" t-as="move_line"> |
|||
<t t-call="stock.stock_report_delivery_has_serial_move_line"/> |
|||
</tr> |
|||
</t> |
|||
<!-- If not printing lots/serial numbers => merge lines with same product --> |
|||
<t t-else="" name="aggregated_move_lines"> |
|||
<t t-set="aggregated_lines" |
|||
t-value="o.move_line_ids._get_aggregated_product_quantities()"/> |
|||
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<t t-set="backorders" |
|||
t-value="o.backorder_ids.filtered(lambda x: x.state not in ('done', 'cancel'))"/> |
|||
<t t-if="o.backorder_ids and backorders"> |
|||
<p class="mt-5"> |
|||
<span>Remaining quantities not yet delivered:</span> |
|||
</p> |
|||
<table class="table table-sm" name="stock_backorder_table" style="table-layout: fixed;"> |
|||
<thead> |
|||
<tr> |
|||
<th name="th_sb_product"> |
|||
<strong>Product</strong> |
|||
</th> |
|||
<th/> |
|||
<th name="th_sb_quantity" class="text-center"> |
|||
<strong>Quantity</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<t t-foreach="backorders" t-as="backorder"> |
|||
<t t-set="bo_lines" |
|||
t-value="backorder.move_ids.filtered(lambda x: x.product_uom_qty)"/> |
|||
<tr t-foreach="bo_lines" t-as="bo_line"> |
|||
<td class="w-auto"> |
|||
<span t-field="bo_line.product_id"/> |
|||
<p t-if="bo_line.description_picking != bo_line.product_id.name and bo_line.description_picking != bo_line.product_id.display_name"> |
|||
<span t-field="bo_line.description_picking"/> |
|||
</p> |
|||
</td> |
|||
<td/> |
|||
<td class="text-center w-auto"> |
|||
<span t-field="bo_line.product_uom_qty"/> |
|||
<span t-field="bo_line.product_uom"/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
</t> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,273 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Stock standard report template--> |
|||
<template id="report_stock_standard_document"> |
|||
<t t-if="o and 'company_id' in o"> |
|||
<t t-set="company" t-value="o.company_id"/> |
|||
</t> |
|||
<t t-if="not o or not 'company_id' in o"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" |
|||
style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" |
|||
t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-call="web.html_container"> |
|||
<t t-call="web.external_layout"> |
|||
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/> |
|||
<t t-set="partner" t-value="o.partner_id or (o.move_ids and o.move_ids[0].partner_id) or False"/> |
|||
<div t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<h2> |
|||
<span t-field="o.name"/> |
|||
</h2> |
|||
<div class="row mt32 mb32"> |
|||
<div t-if="o.origin" class="col-auto" name="div_origin"> |
|||
<strong>Order:</strong> |
|||
<p t-field="o.origin"/> |
|||
</div> |
|||
<div t-if="o.state" class="col-auto" name="div_sched_date"> |
|||
<strong>Shipping Date:</strong> |
|||
<t t-if="o.state == 'done'"> |
|||
<p t-field="o.date_done"/> |
|||
</t> |
|||
<t t-if="o.state != 'done'"> |
|||
<p t-field="o.scheduled_date"/> |
|||
</t> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="row mt32 mb32"> |
|||
<div name="vendor_address" t-if="o.picking_type_id.code=='incoming' and partner" class="col-auto"> |
|||
<div> |
|||
<strong>Vendor Address:</strong> |
|||
</div> |
|||
</div> |
|||
<div name="warehouse_address" t-if="o.picking_type_id.code=='internal' and partner" |
|||
class="col-auto"> |
|||
<div> |
|||
<strong>Warehouse Address:</strong> |
|||
</div> |
|||
</div> |
|||
<div name="customer_address" t-if="o.picking_type_id.code=='outgoing' and partner" class="col-auto"> |
|||
<div> |
|||
<strong>Customer Address:</strong> |
|||
</div> |
|||
<div t-if="partner" name="partner_header" class="col-auto"> |
|||
<div t-field="partner.commercial_partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone", "vat"], "no_marker": True, "phone_icons": True}'/> |
|||
</div> |
|||
</div> |
|||
<div name="outgoing_delivery_address" class="col-auto" |
|||
t-if="o.move_ids_without_package and o.move_ids_without_package[0].partner_id and o.move_ids_without_package[0].partner_id != partner"> |
|||
<div> |
|||
<strong>Delivery Address:</strong> |
|||
</div> |
|||
<div t-field="o.move_ids_without_package[0].partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
|||
</div> |
|||
<div name="outgoing_warehouse_address" class="col-auto" |
|||
t-if="o.picking_type_id.code != 'internal' and (not o.move_ids_without_package or not o.move_ids_without_package[0].partner_id or o.move_ids_without_package[0].partner_id == partner) and o.picking_type_id.warehouse_id.partner_id"> |
|||
<div> |
|||
<strong>Warehouse Address:</strong> |
|||
</div> |
|||
<div t-field="o.picking_type_id.warehouse_id.partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
|||
</div> |
|||
</div> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<div class="page"> |
|||
<table class="table table-sm" t-if="o.state!='done'" name="stock_move_table"> |
|||
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_sm_product"> |
|||
<strong>Product</strong> |
|||
</th> |
|||
<th name="th_sm_ordered"> |
|||
<strong>Ordered</strong> |
|||
</th> |
|||
<th name="th_sm_quantity"> |
|||
<strong>Delivered</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<t t-set="lines" t-value="o.move_ids.filtered(lambda x: x.product_uom_qty)"/> |
|||
<tr t-foreach="lines" t-as="move"> |
|||
<td> |
|||
<span t-field="move.product_id"/> |
|||
<p t-if="move.description_picking != move.product_id.name and move.description_picking != move.product_id.display_name"> |
|||
<span t-field="move.description_picking"/> |
|||
</p> |
|||
</td> |
|||
<td> |
|||
<span t-field="move.product_uom_qty"/> |
|||
<span t-field="move.product_uom"/> |
|||
</td> |
|||
<td> |
|||
<span t-field="move.quantity"/> |
|||
<span t-field="move.product_uom"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<table class="table table-sm mt48" t-if="o.move_line_ids and o.state=='done'" |
|||
name="stock_move_line_table"> |
|||
<t t-set="has_serial_number" t-value="False"/> |
|||
<t t-set="has_serial_number" t-value="o.move_line_ids.mapped('lot_id')" |
|||
groups="stock.group_lot_on_delivery_slip"/> |
|||
<thead> |
|||
<tr> |
|||
<th name="th_sml_product"> |
|||
<strong>Product</strong> |
|||
</th> |
|||
<t name="lot_serial" t-if="has_serial_number"> |
|||
<th> |
|||
Lot/Serial Number |
|||
</th> |
|||
</t> |
|||
<th name="th_sml_qty_ordered" class="text-center" t-if="not has_serial_number"> |
|||
<strong>Ordered</strong> |
|||
</th> |
|||
<th name="th_sml_quantity" class="text-center"> |
|||
<strong>Delivered</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<!-- This part gets complicated with different use cases (additional use cases in extensions of this report): |
|||
1. If serial numbers are used and set to print on delivery slip => print lines as is, otherwise group them by overlapping |
|||
product + description + uom combinations |
|||
2. If any packages are assigned => split products up by package (or non-package) and then apply use case 1 --> |
|||
<!-- If has destination packages => create sections of corresponding products --> |
|||
<t t-if="o.has_packages" name="has_packages"> |
|||
<t t-set="packages" t-value="o.move_line_ids.mapped('result_package_id')"/> |
|||
<t t-foreach="packages" t-as="package"> |
|||
<t t-call="stock.stock_report_delivery_package_section_line"/> |
|||
<t t-set="package_move_lines" |
|||
t-value="o.move_line_ids.filtered(lambda l: l.result_package_id == package)"/> |
|||
<!-- If printing lots/serial numbers => keep products in original lines --> |
|||
<t t-if="has_serial_number"> |
|||
<tr t-foreach="package_move_lines" t-as="move_line"> |
|||
<t t-call="stock.stock_report_delivery_has_serial_move_line"/> |
|||
</tr> |
|||
</t> |
|||
<!-- If not printing lots/serial numbers => merge lines with same product+description+uom --> |
|||
<t t-else=""> |
|||
<t t-set="aggregated_lines" |
|||
t-value="package_move_lines._get_aggregated_product_quantities(strict=True)"/> |
|||
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/> |
|||
</t> |
|||
</t> |
|||
<!-- Make sure we do another section for package-less products if they exist --> |
|||
<t t-set="move_lines" |
|||
t-value="o.move_line_ids.filtered(lambda l: not l.result_package_id)"/> |
|||
<t t-set="aggregated_lines" |
|||
t-value="o.move_line_ids._get_aggregated_product_quantities(except_package=True)"/> |
|||
<t t-if="move_lines or aggregated_lines" name="no_package_move_lines"> |
|||
<t t-call="stock.stock_report_delivery_no_package_section_line" |
|||
name="no_package_section"/> |
|||
<t t-if="has_serial_number"> |
|||
<tr t-foreach="move_lines" t-as="move_line"> |
|||
<t t-call="stock.stock_report_delivery_has_serial_move_line"/> |
|||
</tr> |
|||
</t> |
|||
<t t-elif="aggregated_lines"> |
|||
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
<!-- No destination packages --> |
|||
<t t-else=""> |
|||
<!-- If printing lots/serial numbers => keep products in original lines --> |
|||
<t t-if="has_serial_number"> |
|||
<tr t-foreach="o.move_line_ids" t-as="move_line"> |
|||
<t t-call="stock.stock_report_delivery_has_serial_move_line"/> |
|||
</tr> |
|||
</t> |
|||
<!-- If not printing lots/serial numbers => merge lines with same product --> |
|||
<t t-else="" name="aggregated_move_lines"> |
|||
<t t-set="aggregated_lines" |
|||
t-value="o.move_line_ids._get_aggregated_product_quantities()"/> |
|||
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<t t-set="backorders" |
|||
t-value="o.backorder_ids.filtered(lambda x: x.state not in ('done', 'cancel'))"/> |
|||
<t t-if="o.backorder_ids and backorders"> |
|||
<p class="mt-5"> |
|||
<span>Remaining quantities not yet delivered:</span> |
|||
</p> |
|||
<table class="table table-sm" name="stock_backorder_table" style="table-layout: fixed;"> |
|||
<thead> |
|||
<tr> |
|||
<th name="th_sb_product"> |
|||
<strong>Product</strong> |
|||
</th> |
|||
<th/> |
|||
<th name="th_sb_quantity" class="text-center"> |
|||
<strong>Quantity</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<t t-foreach="backorders" t-as="backorder"> |
|||
<t t-set="bo_lines" |
|||
t-value="backorder.move_ids.filtered(lambda x: x.product_uom_qty)"/> |
|||
<tr t-foreach="bo_lines" t-as="bo_line"> |
|||
<td class="w-auto"> |
|||
<span t-field="bo_line.product_id"/> |
|||
<p t-if="bo_line.description_picking != bo_line.product_id.name and bo_line.description_picking != bo_line.product_id.display_name"> |
|||
<span t-field="bo_line.description_picking"/> |
|||
</p> |
|||
</td> |
|||
<td/> |
|||
<td class="text-center w-auto"> |
|||
<span t-field="bo_line.product_uom_qty"/> |
|||
<span t-field="bo_line.product_uom"/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
</t> |
|||
<div t-if="o.signature" class="mt32 ml64 mr4" name="signature"> |
|||
<div class="offset-8"> |
|||
<strong>Signature</strong> |
|||
</div> |
|||
<div class="offset-8"> |
|||
<img t-att-src="image_data_uri(o.signature)" style="max-height: 4cm; max-width: 8cm;"/> |
|||
</div> |
|||
<div class="offset-8 text-center"> |
|||
<p t-field="o.partner_id.name"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,314 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<record id="stock.action_report_delivery" model="ir.actions.report"> |
|||
<field name="name">Delivery Slip</field> |
|||
<field name="model">stock.picking</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">base_advanced_report_templates.report_deliveryslip_custom</field> |
|||
<field name="report_file">base_advanced_report_templates.report_deliveryslip_custom</field> |
|||
<field name="print_report_name">'Delivery Slip - %s - %s' % (object.partner_id.name or '', object.name)</field> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
<template id="report_deliveryslip_custom"> |
|||
<t t-foreach="docs" t-as="o"> |
|||
<t t-if="o.theme_id.name=='Traditional'"> |
|||
<t t-call="base_advanced_report_templates.report_stock_traditional_document" |
|||
t-lang="o.partner_id.lang"/> |
|||
</t> |
|||
<t t-elif="o.theme_id.name=='Standard'"> |
|||
<t t-call="base_advanced_report_templates.report_stock_standard_document" |
|||
t-lang="o.partner_id.lang"/> |
|||
</t> |
|||
<t t-elif="o.theme_id.name=='Modern'"> |
|||
<t t-call="base_advanced_report_templates.report_stock_modern_document" |
|||
t-lang="o.partner_id.lang"/> |
|||
</t> |
|||
<t t-elif="o.theme_id.name=='Attractive'"> |
|||
<t t-call="base_advanced_report_templates.report_stock_attractive_document" |
|||
t-lang="o.partner_id.lang"/> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
<!-- Stock traditional report template--> |
|||
<template id="report_stock_traditional_document"> |
|||
<t t-if="o and 'company_id' in o"> |
|||
<t t-set="company" t-value="o.company_id"/> |
|||
</t> |
|||
<t t-if="not o or not 'company_id' in o"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
<div class="header row mt32 mb32"> |
|||
<div class="page-header col-12"> |
|||
<div t-attf-class="pull-left"> |
|||
<t t-if="company.logo"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" |
|||
style="max-height: 80px;"/> |
|||
</t> |
|||
</div> |
|||
<div t-attf-class="pull-left" |
|||
t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id.company_text_color} !important;"> |
|||
<span t-field="company.partner_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.street2"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.city"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.country_id"/> |
|||
<br/> |
|||
<span t-field="company.partner_id.vat"/> |
|||
<br/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<t t-call="web.html_container"> |
|||
<t t-call="web.external_layout"> |
|||
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/> |
|||
<t t-set="partner" t-value="o.partner_id or (o.move_ids and o.move_ids[0].partner_id) or False"/> |
|||
<div class="page"> |
|||
<table class="table table-sm" t-if="o.state!='done'" name="stock_move_table"> |
|||
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_sm_quantity" t-if="o.picking_type_id.code=='incoming' and partner" |
|||
class="text-start"> |
|||
<strong>Vendor Address</strong> |
|||
</th> |
|||
<th name="th_sm_quantity" t-if="o.picking_type_id.code=='internal'" class="text-start"> |
|||
<strong>Warehouse Address</strong> |
|||
</th> |
|||
<th name="th_sm_quantity" t-if="o.picking_type_id.code=='outgoing' and partner" |
|||
class="text-start"> |
|||
<strong>Customer Address</strong> |
|||
</th> |
|||
<th name="th_sm_quantity" |
|||
t-if="o.picking_type_id.code != 'internal' and (not o.move_ids_without_package or not o.move_ids_without_package[0].partner_id or o.move_ids_without_package[0].partner_id == partner) and o.picking_type_id.warehouse_id.partner_id" |
|||
class="text-start"> |
|||
<strong>Warehouse Address</strong> |
|||
</th> |
|||
<th name="th_sm_quantity" |
|||
t-if="o.move_ids_without_package and o.move_ids_without_package[0].partner_id and o.move_ids_without_package[0].partner_id != partner"> |
|||
<strong>Delivery Address</strong> |
|||
</th> |
|||
<th name="th_sm_product" t-if="o.origin"> |
|||
<strong>Order</strong> |
|||
</th> |
|||
<th name="th_sm_ordered" t-if="o.state"> |
|||
<strong>Shipping Date</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<td> |
|||
<div t-if="partner" name="partner_header"> |
|||
<div t-field="partner.commercial_partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone", "vat"], "no_marker": True, "phone_icons": True}'/> |
|||
</div> |
|||
</td> |
|||
<td t-if="o.picking_type_id.code != 'internal' and (not o.move_ids_without_package or not o.move_ids_without_package[0].partner_id or o.move_ids_without_package[0].partner_id == partner) and o.picking_type_id.warehouse_id.partner_id"> |
|||
<div t-field="o.picking_type_id.warehouse_id.partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
|||
</td> |
|||
<td t-if="o.move_ids_without_package and |
|||
o.move_ids_without_package[0].partner_id and |
|||
o.move_ids_without_package[0].partner_id != partner"> |
|||
<div t-field="o.move_ids_without_package[0].partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
|||
</td> |
|||
<td> |
|||
<p t-field="o.origin"/> |
|||
</td> |
|||
<td> |
|||
<t t-if="o.state == 'done'"> |
|||
<p t-field="o.date_done"/> |
|||
</t> |
|||
<t t-if="o.state != 'done'"> |
|||
<p t-field="o.scheduled_date"/> |
|||
</t> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<table class="table table-sm" t-if="o.state!='done'" name="stock_move_table"> |
|||
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"> |
|||
<tr> |
|||
<th name="th_sm_product"> |
|||
<strong>Product</strong> |
|||
</th> |
|||
<th name="th_sm_product"> |
|||
<strong>Image</strong> |
|||
</th> |
|||
<th name="th_sm_ordered"> |
|||
<strong>Ordered</strong> |
|||
</th> |
|||
<th name="th_sm_quantity"> |
|||
<strong>Delivered</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<t t-set="lines" t-value="o.move_ids.filtered(lambda x: x.product_uom_qty)"/> |
|||
<tr t-foreach="lines" t-as="move"> |
|||
<td> |
|||
<span t-field="move.product_id"/> |
|||
<p t-if="move.description_picking != move.product_id.name and move.description_picking != move.product_id.display_name"> |
|||
<span t-field="move.description_picking"/> |
|||
</p> |
|||
</td> |
|||
<td> |
|||
<span t-field="move.order_line_image" t-options='{"widget": "image"}'/> |
|||
</td> |
|||
<td> |
|||
<span t-field="move.product_uom_qty"/> |
|||
<span t-field="move.product_uom"/> |
|||
</td> |
|||
<td> |
|||
<span t-field="move.quantity"/> |
|||
<span t-field="move.product_uom"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<table class="table table-sm mt48" t-if="o.move_line_ids and o.state=='done'" |
|||
name="stock_move_line_table"> |
|||
<t t-set="has_serial_number" t-value="False"/> |
|||
<t t-set="has_serial_number" t-value="o.move_line_ids.mapped('lot_id')" |
|||
groups="stock.group_lot_on_delivery_slip"/> |
|||
<thead> |
|||
<tr> |
|||
<th name="th_sml_product"> |
|||
<strong>Product</strong> |
|||
</th> |
|||
<t name="lot_serial" t-if="has_serial_number"> |
|||
<th> |
|||
Lot/Serial Number |
|||
</th> |
|||
</t> |
|||
<th name="th_sml_qty_ordered" class="text-center" t-if="not has_serial_number"> |
|||
<strong>Ordered</strong> |
|||
</th> |
|||
<th name="th_sml_quantity" class="text-center"> |
|||
<strong>Delivered</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<!-- This part gets complicated with different use cases (additional use cases in extensions of this report): |
|||
1. If serial numbers are used and set to print on delivery slip => print lines as is, otherwise group them by overlapping |
|||
product + description + uom combinations |
|||
2. If any packages are assigned => split products up by package (or non-package) and then apply use case 1 --> |
|||
<!-- If it has destination packages => create sections of corresponding products --> |
|||
<t t-if="o.has_packages" name="has_packages"> |
|||
<t t-set="packages" t-value="o.move_line_ids.mapped('result_package_id')"/> |
|||
<t t-foreach="packages" t-as="package"> |
|||
<t t-call="stock.stock_report_delivery_package_section_line"/> |
|||
<t t-set="package_move_lines" |
|||
t-value="o.move_line_ids.filtered(lambda l: l.result_package_id == package)"/> |
|||
<!-- If printing lots/serial numbers => keep products in original lines --> |
|||
<t t-if="has_serial_number"> |
|||
<tr t-foreach="package_move_lines" t-as="move_line"> |
|||
<t t-call="stock.stock_report_delivery_has_serial_move_line"/> |
|||
</tr> |
|||
</t> |
|||
<!-- If not printing lots/serial numbers => merge lines with same product+description+uom --> |
|||
<t t-else=""> |
|||
<t t-set="aggregated_lines" |
|||
t-value="package_move_lines._get_aggregated_product_quantities(strict=True)"/> |
|||
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/> |
|||
</t> |
|||
</t> |
|||
<!-- Make sure we do another section for package-less products if they exist --> |
|||
<t t-set="move_lines" |
|||
t-value="o.move_line_ids.filtered(lambda l: not l.result_package_id)"/> |
|||
<t t-set="aggregated_lines" |
|||
t-value="o.move_line_ids._get_aggregated_product_quantities(except_package=True)"/> |
|||
<t t-if="move_lines or aggregated_lines" name="no_package_move_lines"> |
|||
<t t-call="stock.stock_report_delivery_no_package_section_line" |
|||
name="no_package_section"/> |
|||
<t t-if="has_serial_number"> |
|||
<tr t-foreach="move_lines" t-as="move_line"> |
|||
<t t-call="stock.stock_report_delivery_has_serial_move_line"/> |
|||
</tr> |
|||
</t> |
|||
<t t-elif="aggregated_lines"> |
|||
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
<!-- No destination packages --> |
|||
<t t-else=""> |
|||
<!-- If printing lots/serial numbers => keep products in original lines --> |
|||
<t t-if="has_serial_number"> |
|||
<tr t-foreach="o.move_line_ids" t-as="move_line"> |
|||
<t t-call="stock.stock_report_delivery_has_serial_move_line"/> |
|||
</tr> |
|||
</t> |
|||
<!-- If not printing lots/serial numbers => merge lines with same product --> |
|||
<t t-else="" name="aggregated_move_lines"> |
|||
<t t-set="aggregated_lines" |
|||
t-value="o.move_line_ids._get_aggregated_product_quantities()"/> |
|||
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<t t-set="backorders" |
|||
t-value="o.backorder_ids.filtered(lambda x: x.state not in ('done', 'cancel'))"/> |
|||
<t t-if="o.backorder_ids and backorders"> |
|||
<p class="mt-5"> |
|||
<span>Remaining quantities not yet delivered:</span> |
|||
</p> |
|||
<table class="table table-sm" name="stock_backorder_table" style="table-layout: fixed;"> |
|||
<thead> |
|||
<tr> |
|||
<th name="th_sb_product"> |
|||
<strong>Product</strong> |
|||
</th> |
|||
<th/> |
|||
<th name="th_sb_quantity" class="text-center"> |
|||
<strong>Quantity</strong> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody t-attf-style="color:#{o.theme_id.customer_text_color} !important;"> |
|||
<t t-foreach="backorders" t-as="backorder"> |
|||
<t t-set="bo_lines" |
|||
t-value="backorder.move_ids.filtered(lambda x: x.product_uom_qty)"/> |
|||
<tr t-foreach="bo_lines" t-as="bo_line"> |
|||
<td class="w-auto"> |
|||
<span t-field="bo_line.product_id"/> |
|||
<p t-if="bo_line.description_picking != bo_line.product_id.name and bo_line.description_picking != bo_line.product_id.display_name"> |
|||
<span t-field="bo_line.description_picking"/> |
|||
</p> |
|||
</td> |
|||
<td/> |
|||
<td class="text-center w-auto"> |
|||
<span t-field="bo_line.product_uom_qty"/> |
|||
<span t-field="bo_line.product_uom"/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
</t> |
|||
<div t-if="o.signature" class="mt32 ml64 mr4" name="signature"> |
|||
<div class="offset-8"> |
|||
<strong>Signature</strong> |
|||
</div> |
|||
<div class="offset-8"> |
|||
<img t-att-src="image_data_uri(o.signature)" style="max-height: 4cm; max-width: 8cm;"/> |
|||
</div> |
|||
<div class="offset-8 text-center"> |
|||
<p t-field="o.partner_id.name"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
|
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 80 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 589 B |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 565 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 967 B |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 502 KiB |
After Width: | Height: | Size: 157 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 73 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 79 KiB |