@ -0,0 +1,44 @@ |
|||||
|
.. 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 |
||||
|
|
||||
|
Purchase Report Format Editor |
||||
|
============================= |
||||
|
This module allows to edit the style of the purchase pdf reports. |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
Lesser General Public License, Version 3 (LGPL v3). |
||||
|
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
Developer : (V18) Nivedhya T, |
||||
|
(V16) Abhin K, |
||||
|
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,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import controllers |
||||
|
from . import models |
@ -0,0 +1,60 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
'name': 'Purchase Report Format Editor', |
||||
|
'version': '18.0.1.0.0', |
||||
|
'category': 'Purchases', |
||||
|
'summary': 'Configure Purchase Report Templates With Different Styles', |
||||
|
'description': "To configure purchase report templates with different " |
||||
|
"styles, you need to design a layout that includes " |
||||
|
"components such as headers, tables, summaries, and " |
||||
|
"footers, and customize the template with suitable fonts " |
||||
|
"and visual elements to match your desired styles.", |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': 'https://www.cybrosys.com', |
||||
|
'depends': ['purchase'], |
||||
|
'data': [ |
||||
|
'security/ir.model.access.csv', |
||||
|
'data/doc_layout_purchase_data.xml', |
||||
|
'views/doc_layout_purchase_views.xml', |
||||
|
'views/base_document_layout_views.xml', |
||||
|
'report/purchase_order_custom_templates.xml', |
||||
|
'report/purchase_order_fantacy_templates.xml', |
||||
|
'report/purchase_order_old_standard_templates.xml', |
||||
|
'report/purchase_order_templates.xml', |
||||
|
'report/purchase_order_custom_quotation_templates.xml', |
||||
|
'report/purchase_order_quotation_fantacy_templates.xml', |
||||
|
'report/purchase_order_quotation_old_standard_templates.xml', |
||||
|
'report/purchase_quotation_templates.xml', |
||||
|
'views/purchase_order_default_templates.xml', |
||||
|
'views/purchase_order_normal_templates.xml', |
||||
|
'views/purchase_order_modern_templates.xml', |
||||
|
'views/purchase_order_old_templates.xml', |
||||
|
], |
||||
|
'images': ['static/description/banner.jpg'], |
||||
|
'license': 'LGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import purchase_format_editor |
@ -0,0 +1,47 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from ast import literal_eval |
||||
|
from odoo.http import Controller, request, route |
||||
|
|
||||
|
|
||||
|
class PurchaseFormatEditor(Controller): |
||||
|
"""The PurchaseFormatEditor class provides the functionality to |
||||
|
download the preview of PDF""" |
||||
|
|
||||
|
@route('/purchase/pdf/preview', type="http", auth="public", |
||||
|
website=True) |
||||
|
def purchase_pdf_preview(self): |
||||
|
"""Then demo pdfs are downloaded using this controller. |
||||
|
The html file from the preview compute field is then converted into |
||||
|
binary pdf and then returns a response to download it""" |
||||
|
value = literal_eval(request.params['params']) |
||||
|
base_doc_layout = request.env['base.document.layout'].sudo().browse( |
||||
|
value) |
||||
|
pdf_data = request.env['ir.actions.report'].sudo()._run_wkhtmltopdf( |
||||
|
[base_doc_layout.preview]) |
||||
|
filename = (f'{base_doc_layout.base_layout_purchase} ' |
||||
|
f'{base_doc_layout.document_layout_purchase_id.name}.pdf') |
||||
|
headers = [('Content-Type', 'application/pdf'), |
||||
|
('Content-Disposition', |
||||
|
f'attachment; filename="{filename}"')] |
||||
|
# Send the PDF content as a response with the headers |
||||
|
return request.make_response(pdf_data, headers=headers) |
@ -0,0 +1,30 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Modern and standard default template is designed here--> |
||||
|
<data noupdate="1"> |
||||
|
<record id="doc_layout_purchase_modern" model="doc.layout.purchase"> |
||||
|
<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="shipping_address_position">left</field> |
||||
|
<field name="company_position">left</field> |
||||
|
<field name="company_text_color">#808080</field> |
||||
|
</record> |
||||
|
<record id="doc_layout_purchase_standard" model="doc.layout.purchase"> |
||||
|
<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="shipping_address_position">right</field> |
||||
|
<field name="company_position">right</field> |
||||
|
<field name="company_text_color">#808080</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,6 @@ |
|||||
|
## Module <purchase_format_editor> |
||||
|
|
||||
|
#### 21.07.2025 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
#### ADD |
||||
|
- Initial commit for Purchase Report Format Editor |
@ -0,0 +1,25 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import base_document_layout |
||||
|
from . import doc_layout_purchase |
||||
|
from . import purchase_order |
||||
|
from . import res_company |
@ -0,0 +1,82 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
|
class BaseDocumentLayout(models.TransientModel): |
||||
|
"""Model is inherited to add required field |
||||
|
and to add function to display the preview""" |
||||
|
_inherit = 'base.document.layout' |
||||
|
|
||||
|
base_layout_purchase = fields.Selection( |
||||
|
related='company_id.base_layout_purchase', |
||||
|
readonly=False, string='Base Layout Purchase', |
||||
|
required=True, |
||||
|
help='Select the base layout for the Purchase module.') |
||||
|
document_layout_purchase_id = fields.Many2one( |
||||
|
related='company_id.document_layout_purchase_id', readonly=False, |
||||
|
string='Document Layout Purchase ID', |
||||
|
help='Choose the document layout for the Purchase module.') |
||||
|
|
||||
|
@api.depends('report_layout_id', 'logo', 'font', 'primary_color', |
||||
|
'secondary_color', 'report_header', 'report_footer', |
||||
|
'base_layout_purchase', 'document_layout_purchase_id') |
||||
|
def _compute_preview(self): |
||||
|
"""Compute a qweb based preview to display on the wizard """ |
||||
|
styles = self._get_asset_style() |
||||
|
for wizard in self: |
||||
|
ir_ui_view = wizard.env['ir.ui.view'] |
||||
|
preview_css = self._get_css_for_preview(styles, wizard.id) |
||||
|
if wizard.report_layout_id: |
||||
|
style = wizard.document_layout_purchase_id |
||||
|
if wizard.base_layout_purchase == 'default': |
||||
|
wizard.preview = ir_ui_view._render_template( |
||||
|
'purchase_format_editor.' |
||||
|
'report_preview_default_purchase', |
||||
|
{'company': wizard, 'preview_css': preview_css,"style": style}) |
||||
|
elif wizard.base_layout_purchase == 'normal': |
||||
|
wizard.preview = ir_ui_view._render_template( |
||||
|
'purchase_format_editor.' |
||||
|
'report_preview_normal_purchase', |
||||
|
{'company': wizard, 'preview_css': preview_css, } |
||||
|
) |
||||
|
elif wizard.base_layout_purchase == 'modern': |
||||
|
wizard.preview = ir_ui_view._render_template( |
||||
|
'purchase_format_editor.' |
||||
|
'report_preview_modern_purchase', |
||||
|
{'company': wizard, 'preview_css': preview_css, } |
||||
|
) |
||||
|
elif wizard.base_layout_purchase == 'old': |
||||
|
wizard.preview = ir_ui_view._render_template( |
||||
|
'purchase_format_editor.' |
||||
|
'report_preview_old_purchase', |
||||
|
{'company': wizard, 'preview_css': preview_css, }) |
||||
|
|
||||
|
def print_pdf(self): |
||||
|
"""This function replaces the existing function to print |
||||
|
the preview of pdf.Returns: self.id to the controller and |
||||
|
the controller makes the response to download the pdf""" |
||||
|
return { |
||||
|
'type': 'ir.actions.act_url', |
||||
|
'target': 'self', |
||||
|
'url': f'/purchase/pdf/preview?params={self.id}', |
||||
|
} |
@ -0,0 +1,85 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class DocLayoutPurchase(models.Model): |
||||
|
"""Model is created to add customizations to the pdf report""" |
||||
|
|
||||
|
_name = "doc.layout.purchase" |
||||
|
_description = "Doc Layout Purchase" |
||||
|
|
||||
|
name = fields.Char(string="Name", help="Name of the record") |
||||
|
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") |
||||
|
shipping_address = fields.Boolean(string="Shipping Address", |
||||
|
default=True, |
||||
|
help="Enable shipping address if " |
||||
|
"required to print on report.") |
||||
|
shipping_address_position = fields.Selection( |
||||
|
selection=[("left", "Left"), ("right", "Right")], |
||||
|
string="Shipping Address position", |
||||
|
help="Select the Customer address position") |
||||
|
company_position = fields.Selection( |
||||
|
selection=[("left", "Left"), ("right", "Right")], |
||||
|
string="Company Address Position", |
||||
|
help="The position of the company address") |
||||
|
purchase_rep = fields.Boolean(string="Purchase Representative", |
||||
|
default=False, |
||||
|
help="Indicates whether the contact is a " |
||||
|
"Purchase Representative.") |
||||
|
description = fields.Boolean(string="Description", default=False, |
||||
|
help=" Indicates whether a description " |
||||
|
"is included.") |
||||
|
code = fields.Boolean(string="Internal Reference", default=False, |
||||
|
help="Indicates whether an internal reference " |
||||
|
"(HSN code) is included.") |
||||
|
tax_value = fields.Boolean(string="Tax", default=False, |
||||
|
help="Indicates whether the tax value is " |
||||
|
"included.") |
||||
|
reference = fields.Boolean(string="Order Reference", default=False, |
||||
|
help="Indicates whether the customer reference " |
||||
|
"(order reference) is included.") |
||||
|
source = fields.Boolean(string="Source", default=False, |
||||
|
help="Indicates whether the source document is " |
||||
|
"included.") |
||||
|
address = fields.Boolean(string="Address", default=False, |
||||
|
help="Indicates whether the address is included.") |
||||
|
city = fields.Boolean(string="City", default=False, |
||||
|
help="Indicates whether the city is included.") |
||||
|
country = fields.Boolean(string="Country", default=False, |
||||
|
help="Indicates whether the Country is included.") |
@ -0,0 +1,39 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class PurchaseOrder(models.Model): |
||||
|
"""Model is inherited to add |
||||
|
theme_id_purchase and base_layout_purchase fields""" |
||||
|
_inherit = 'purchase.order' |
||||
|
|
||||
|
base_layout_purchase = fields.Selection( |
||||
|
selection=[('normal', 'Normal'), ('modern', 'Modern'), |
||||
|
('old', 'Old Standard'), ('default', 'Default')], |
||||
|
string='Base Layout Purchase', help='Select Base Layout of Purchase') |
||||
|
theme_id_purchase = fields.Many2one( |
||||
|
comodel_name='doc.layout.purchase', string="Theme Id Purchase", |
||||
|
related='company_id.document_layout_purchase_id', |
||||
|
help='The theme ID for the purchase document layout. It is related ' |
||||
|
'to the document layout ID of the company. This field helps in ' |
||||
|
'selecting the specific theme for the purchase documents.') |
@ -0,0 +1,38 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ResCompany(models.Model): |
||||
|
"""Model is inherited to add the |
||||
|
base_layout_purchase selection field""" |
||||
|
_inherit = 'res.company' |
||||
|
|
||||
|
base_layout_purchase = fields.Selection( |
||||
|
selection=[('normal', 'Normal'), ('modern', 'Modern'), |
||||
|
('old', 'Old Standard'), ('default', 'Default')], |
||||
|
string="Purchase Order Document Layout", default="default", |
||||
|
help='Select the Layout of the Purchase Order Document') |
||||
|
document_layout_purchase_id = fields.Many2one( |
||||
|
"doc.layout.purchase", |
||||
|
string="Purchase Order Layout Configuration", |
||||
|
help='Configuration of Purchase Order Layout') |
@ -0,0 +1,271 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- This template is used to display a purchase quotation report |
||||
|
in a normal view. It includes the header section with the company logo |
||||
|
and details, such as partner information, address, and VAT number.--> |
||||
|
<template id="custom_template_report_purchase_quotation_normal"> |
||||
|
<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-style="float: {{o.theme_id_purchase.logo_position}}"> |
||||
|
<img t-if="company.logo" |
||||
|
t-attf-src="data:image/png;base64,{{ company.logo }}" |
||||
|
style="max-height: 80px;"/> |
||||
|
</div> |
||||
|
<div t-attf-style="float: {{o.theme_id_purchase.company_position}}; font:14px lucida-console,sans-serif; color:#{o.theme_id_purchase.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 --> |
||||
|
<table class="table table-borderless"> |
||||
|
<tr> |
||||
|
<th scope="col" |
||||
|
t-attf-style="float: {{o.theme_id_purchase.customer_position}};font:15px lucida-console,sans-serif !important;color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<font> |
||||
|
<strong>Customer Address</strong> |
||||
|
</font> |
||||
|
</th> |
||||
|
<span t-if="o.state in ['purchase','done'] and o.date_approve"> |
||||
|
<th scope="col" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<font> |
||||
|
<strong>Order Date</strong> |
||||
|
</font> |
||||
|
</th> |
||||
|
</span> |
||||
|
<span t-if="o.date_order"> |
||||
|
<th scope="col" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<font> |
||||
|
<strong>Order Deadline</strong> |
||||
|
</font> |
||||
|
</th> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.purchase_rep"> |
||||
|
<span t-if="o.user_id"> |
||||
|
<th scope="col" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<font> |
||||
|
<strong>Purchase Representative</strong> |
||||
|
</font> |
||||
|
</th> |
||||
|
</span> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.reference"> |
||||
|
<span t-if="o.partner_ref"> |
||||
|
<th scope="col" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<font> |
||||
|
<strong>Order Reference</strong> |
||||
|
</font> |
||||
|
</th> |
||||
|
</span> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.source"> |
||||
|
<span t-if="o.origin"> |
||||
|
<th scope="col" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<font> |
||||
|
<strong>Source</strong> |
||||
|
</font> |
||||
|
</th> |
||||
|
</span> |
||||
|
</span> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<span style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id"/> |
||||
|
<br/> |
||||
|
<span t-if="o.theme_id_purchase.address"> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.street"/> |
||||
|
<br/> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.street2"/> |
||||
|
<br/> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.city"> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.city"/> |
||||
|
<br/> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.country"> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.country_id"/> |
||||
|
<br/> |
||||
|
</span> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.vat"/> |
||||
|
<br/> |
||||
|
</td> |
||||
|
<span t-if="o.state in ['purchase','done'] and o.date_approve"> |
||||
|
<td> |
||||
|
<font> |
||||
|
<p t-field="o.date_approve"/> |
||||
|
</font> |
||||
|
</td> |
||||
|
</span> |
||||
|
<span t-if="o.date_order"> |
||||
|
<td> |
||||
|
<font> |
||||
|
<p t-field="o.date_order"/> |
||||
|
</font> |
||||
|
</td> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.purchase_rep"> |
||||
|
<span t-if="o.user_id"> |
||||
|
<td> |
||||
|
<font> |
||||
|
<p t-field="o.user_id"/> |
||||
|
</font> |
||||
|
</td> |
||||
|
</span> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.reference"> |
||||
|
<span t-if="o.partner_ref"> |
||||
|
<td> |
||||
|
<font> |
||||
|
<p t-field="o.partner_ref"/> |
||||
|
</font> |
||||
|
</td> |
||||
|
</span> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.source"> |
||||
|
<span t-if="o.origin"> |
||||
|
<td> |
||||
|
<font> |
||||
|
<p t-field="o.origin"/> |
||||
|
</font> |
||||
|
</td> |
||||
|
</span> |
||||
|
</span> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<div class="page"> |
||||
|
<div class="oe_structure"/> |
||||
|
<div class="col-12"> |
||||
|
<div t-attf-style="float: {{o.theme_id_purchase.shipping_address_position}};font:15px lucida-console,sans-serif !important;color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<t t-if="o.dest_address_id"> |
||||
|
<t t-if="o.theme_id_purchase.shipping_address"> |
||||
|
<div> |
||||
|
<strong>Shipping address:</strong> |
||||
|
<div> |
||||
|
<div style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
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> |
||||
|
<br/> |
||||
|
<br/> |
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
</div> |
||||
|
</div> |
||||
|
<h2>Request for Quotation # |
||||
|
<span t-field="o.name"/> |
||||
|
</h2> |
||||
|
<table class="table table-sm o_main_table"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
Description |
||||
|
</th> |
||||
|
<th name="th_date_req" class="text-center" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<strong>Expected Date</strong> |
||||
|
</th> |
||||
|
<th name="th_quantity" class="text-right" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<strong>Qty</strong> |
||||
|
</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<t t-foreach="o.order_line" t-as="order_line"> |
||||
|
<tr t-att-class="'bg-200 font-weight-bold o_line_section' if order_line.display_type == 'line_section' else 'font-italic o_line_note' if order_line.display_type == 'line_note' else ''"> |
||||
|
<t t-if="not order_line.display_type"> |
||||
|
<td t-attf-style="color:#{o.theme_id_purchase.text_color};" |
||||
|
id="product"> |
||||
|
<span t-field="order_line.name"/> |
||||
|
</td> |
||||
|
<td t-attf-style="color:#{o.theme_id_purchase.text_color};" |
||||
|
class="text-center"> |
||||
|
<span t-field="order_line.date_planned"/> |
||||
|
</td> |
||||
|
<td t-attf-style="color:#{o.theme_id_purchase.text_color};" |
||||
|
class="text-right"> |
||||
|
<span t-field="order_line.product_qty"/> |
||||
|
<span t-field="order_line.product_uom" |
||||
|
groups="uom.group_uom"/> |
||||
|
</td> |
||||
|
</t> |
||||
|
<t t-else=""> |
||||
|
<td t-attf-style="color:#{o.theme_id_purchase.text_color};" |
||||
|
colspan="99" |
||||
|
id="section"> |
||||
|
<span t-field="order_line.name"/> |
||||
|
</td> |
||||
|
</t> |
||||
|
</tr> |
||||
|
</t> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
<p t-field="o.notes"/> |
||||
|
<p t-field="o.notes"/> |
||||
|
<div class="oe_structure"/> |
||||
|
</div> |
||||
|
</t> |
||||
|
</template> |
||||
|
<!-- This template is used to generate a purchase quotation report based |
||||
|
on different base layouts. It dynamically selects the appropriate template |
||||
|
based on the 'base_layout_purchase' field of the company associated with the |
||||
|
document. The selected template is then called with the language specified by |
||||
|
the partner associated with the document.--> |
||||
|
<template id="purchase.report_purchasequotation"> |
||||
|
<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.company_id.base_layout_purchase == 'normal'"> |
||||
|
<t t-call="purchase_format_editor.custom_template_report_purchase_quotation_normal" |
||||
|
t-lang="o.partner_id.lang"/> |
||||
|
</t> |
||||
|
<t t-if="o.company_id.base_layout_purchase == 'old'"> |
||||
|
<t t-call="purchase_format_editor.old_std_report_purchase_quotation_document" |
||||
|
t-lang="o.partner_id.lang"/> |
||||
|
</t> |
||||
|
<t t-if="o.company_id.base_layout_purchase == 'modern'"> |
||||
|
<t t-call="purchase_format_editor.custom_template_report_purchase_quotation_modern" |
||||
|
t-lang="o.partner_id.lang"/> |
||||
|
</t> |
||||
|
<t t-if="o.company_id.base_layout_purchase == 'default'"> |
||||
|
<t t-call="purchase_format_editor.report_purchase_quotation_document" |
||||
|
t-lang="o.partner_id.lang"/> |
||||
|
</t> |
||||
|
</t> |
||||
|
</t> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,347 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- This template is used to display a purchase order report in a |
||||
|
custom view. It includes the header section with the company logo and details, |
||||
|
such as partner information, address, and VAT number. It also utilizes the |
||||
|
external layout for a consistent layout structure.--> |
||||
|
<template id="custom_template_report_purchase_order_normal"> |
||||
|
<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> |
||||
|
<t t-call="web.external_layout"> |
||||
|
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/> |
||||
|
<table class="table table-borderless"> |
||||
|
<tr> |
||||
|
<th scope="col" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<font> |
||||
|
<strong>Customer Address</strong> |
||||
|
</font> |
||||
|
</th> |
||||
|
<span t-if="o.state in ['purchase','done'] and o.date_approve"> |
||||
|
<th scope="col" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<font> |
||||
|
<strong>Order Date</strong> |
||||
|
</font> |
||||
|
</th> |
||||
|
</span> |
||||
|
<span t-if="o.date_order"> |
||||
|
<th scope="col" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<font> |
||||
|
<strong>Order Deadline</strong> |
||||
|
</font> |
||||
|
</th> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.purchase_rep"> |
||||
|
<span t-if="o.user_id"> |
||||
|
<th scope="col" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<font> |
||||
|
<strong>Purchase Representative</strong> |
||||
|
</font> |
||||
|
</th> |
||||
|
</span> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.reference"> |
||||
|
<span t-if="o.partner_ref"> |
||||
|
<th scope="col" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<font> |
||||
|
<strong>Order Reference</strong> |
||||
|
</font> |
||||
|
</th> |
||||
|
</span> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.source"> |
||||
|
<span t-if="o.origin"> |
||||
|
<th scope="col" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<font> |
||||
|
<strong>Source</strong> |
||||
|
</font> |
||||
|
</th> |
||||
|
</span> |
||||
|
</span> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<span style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id"/> |
||||
|
<br/> |
||||
|
<span t-if="o.theme_id_purchase.address"> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.street"/> |
||||
|
<br/> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.street2"/> |
||||
|
<br/> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.city"> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.city"/> |
||||
|
<br/> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.country"> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.country_id"/> |
||||
|
<br/> |
||||
|
</span> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.vat"/> |
||||
|
<br/> |
||||
|
</td> |
||||
|
<span t-if="o.state in ['purchase','done'] and o.date_approve"> |
||||
|
<td> |
||||
|
<font> |
||||
|
<p t-field="o.date_approve"/> |
||||
|
</font> |
||||
|
</td> |
||||
|
</span> |
||||
|
<span t-if="o.date_order"> |
||||
|
<td> |
||||
|
<font> |
||||
|
<p t-field="o.date_order"/> |
||||
|
</font> |
||||
|
</td> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.purchase_rep"> |
||||
|
<span t-if="o.user_id"> |
||||
|
<td> |
||||
|
<font> |
||||
|
<p t-field="o.user_id"/> |
||||
|
</font> |
||||
|
</td> |
||||
|
</span> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.reference"> |
||||
|
<span t-if="o.partner_ref"> |
||||
|
<td> |
||||
|
<font> |
||||
|
<p t-field="o.partner_ref"/> |
||||
|
</font> |
||||
|
</td> |
||||
|
</span> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.source"> |
||||
|
<span t-if="o.origin"> |
||||
|
<td> |
||||
|
<font> |
||||
|
<p t-field="o.origin"/> |
||||
|
</font> |
||||
|
</td> |
||||
|
</span> |
||||
|
</span> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<div class="page"> |
||||
|
<div class="oe_structure"/> |
||||
|
<div class="col-12"> |
||||
|
<div |
||||
|
style="font:15px lucida-console,sans-serif !important;color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<t t-if="o.dest_address_id"> |
||||
|
<t t-if="o.theme_id_purchase.shipping_address"> |
||||
|
<div> |
||||
|
<strong>Shipping address:</strong> |
||||
|
<div> |
||||
|
<div style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
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> |
||||
|
<br/> |
||||
|
<br/> |
||||
|
|
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
</div> |
||||
|
</div> |
||||
|
<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> |
||||
|
<table class="table table-sm o_main_table"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
Product |
||||
|
</th> |
||||
|
<span t-if="o.theme_id_purchase.description"> |
||||
|
<th t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
Description |
||||
|
</th> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.code"> |
||||
|
<th class="text-right" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
Internal Reference |
||||
|
</th> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.tax_value"> |
||||
|
<th class="text-right" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
Taxes |
||||
|
</th> |
||||
|
</span> |
||||
|
<th name="th_date_req" class="text-center" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<strong>Date Req.</strong> |
||||
|
</th> |
||||
|
<th name="th_quantity" class="text-right" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<strong>Qty</strong> |
||||
|
</th> |
||||
|
<th name="th_price_unit" class="text-right" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<strong>Unit Price</strong> |
||||
|
</th> |
||||
|
<th name="th_amount" class="text-right" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<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-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''"> |
||||
|
<t t-if="not line.display_type"> |
||||
|
<td t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<span t-field="line.product_id.name"/> |
||||
|
</td> |
||||
|
<span t-if="o.theme_id_purchase.description"> |
||||
|
<td t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<span t-field="line.name"/> |
||||
|
</td> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.code"> |
||||
|
<td class="text-right" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<t t-if="line.product_id.default_code"> |
||||
|
<span t-field="line.product_id.default_code"/> |
||||
|
</t> |
||||
|
</td> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.tax_value"> |
||||
|
<td name="td_taxes" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<span t-esc="', '.join(map(lambda x: x.name, line.taxes_id))"/> |
||||
|
</td> |
||||
|
</span> |
||||
|
<td class="text-center" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<span t-field="line.date_planned"/> |
||||
|
</td> |
||||
|
<td class="text-right" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<span t-field="line.product_qty"/> |
||||
|
<span t-field="line.product_uom.name" |
||||
|
groups="uom.group_uom"/> |
||||
|
</td> |
||||
|
<td class="text-right" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<span t-field="line.price_unit"/> |
||||
|
</td> |
||||
|
<td class="text-right" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<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" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<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" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<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-right"> |
||||
|
<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" style="page-break-inside: avoid;"> |
||||
|
<tbody> |
||||
|
<tr class="border-black o_total"> |
||||
|
<td><strong>TOTAL</strong></td> |
||||
|
<td class="text-right"> |
||||
|
<span t-field="o.amount_untaxed" |
||||
|
t-options='{"widget": "monetary", "display_currency": o.currency_id or o.company_id.currency_id}'/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
<p t-field="o.notes"/> |
||||
|
<div class="oe_structure"/> |
||||
|
</div> |
||||
|
</t> |
||||
|
</template> |
||||
|
<!--This template is used to generate a purchase order report based on |
||||
|
different base layouts. It dynamically selects the appropriate template based |
||||
|
on the 'base_layout_purchase' field of the company associated with the document. |
||||
|
The selected template is then called with the language specified by the partner |
||||
|
associated with the document.--> |
||||
|
<template id="purchase.report_purchaseorder"> |
||||
|
<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.company_id.base_layout_purchase == 'normal'"> |
||||
|
<t t-call="purchase_format_editor.custom_template_report_purchase_order_normal" |
||||
|
t-lang="o.partner_id.lang"/> |
||||
|
</t> |
||||
|
<t t-if="o.company_id.base_layout_purchase == 'old'"> |
||||
|
<t t-call="purchase_format_editor.old_std_report_purchaseorder_document" |
||||
|
t-lang="o.partner_id.lang"/> |
||||
|
</t> |
||||
|
<t t-if="o.company_id.base_layout_purchase == 'modern'"> |
||||
|
<t t-call="purchase_format_editor.custom_template_report_purchaseorder_modern" |
||||
|
t-lang="o.partner_id.lang"/> |
||||
|
</t> |
||||
|
<t t-if="o.company_id.base_layout_purchase == 'default'"> |
||||
|
<t t-call="purchase_format_editor.report_purchaseorder_document" |
||||
|
t-lang="o.partner_id.lang"/> |
||||
|
</t> |
||||
|
</t> |
||||
|
</t> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,305 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- This template is used to display a purchase order report in a modern |
||||
|
view. It includes the header section with the company logo and details, such as |
||||
|
partner information, address, and VAT number.--> |
||||
|
<template id="custom_template_report_purchaseorder_modern"> |
||||
|
<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-style="float: {{o.theme_id_purchase.logo_position}}"> |
||||
|
<img t-if="company.logo" |
||||
|
t-attf-src="data:image/png;base64,{{ company.logo }}" |
||||
|
style="max-height: 80px;"/> |
||||
|
</div> |
||||
|
<div t-attf-style="float: {{o.theme_id_purchase.company_position}}; font:14px lucida-console,sans-serif; color:#{o.theme_id_purchase.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 t-attf-style=" background-color:#{o.theme_id_purchase.base_color};padding:2%"> |
||||
|
<h2> |
||||
|
<span t-if="o.state in ['draft', 'sent', 'to approve']"> |
||||
|
<font t-attf-style="color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
Request for Quotation |
||||
|
</font> |
||||
|
</span> |
||||
|
<span t-if="o.state in ['purchase', 'done']"> |
||||
|
<font t-attf-style="color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
Purchase Order |
||||
|
</font> |
||||
|
</span> |
||||
|
<span t-if="o.state == 'cancel'"> |
||||
|
<font t-attf-style="color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
Cancelled Purchase Order |
||||
|
</font> |
||||
|
</span> |
||||
|
|
||||
|
<font t-attf-style=" color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
<span t-field="o.name"/> |
||||
|
</font> |
||||
|
</h2> |
||||
|
<div class="row mt32 mb32"> |
||||
|
<div class="col-3" |
||||
|
t-if="o.state in ['purchase','done'] and o.date_approve"> |
||||
|
<font t-attf-style="color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
<strong>Order Date:</strong> |
||||
|
<p t-field="o.date_approve"/> |
||||
|
</font> |
||||
|
</div> |
||||
|
<div class="col-3" |
||||
|
t-if="o.date_order"> |
||||
|
<font t-attf-style="color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
<strong>Order Deadline:</strong> |
||||
|
<p t-field="o.date_order"/> |
||||
|
</font> |
||||
|
</div> |
||||
|
<div class="col-3" t-if="o.user_id"> |
||||
|
<div t-if="o.theme_id_purchase.purchase_rep"> |
||||
|
<font t-attf-style="color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
<strong>Purchase Representative</strong> |
||||
|
<p t-field="o.user_id"/> |
||||
|
</font> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-3" t-if="o.partner_ref"> |
||||
|
<div t-if="o.theme_id_purchase.reference"> |
||||
|
<font t-attf-style="color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
<strong>Reference:</strong> |
||||
|
<p t-field="o.partner_ref"/> |
||||
|
</font> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-3" t-if="o.origin"> |
||||
|
<div t-if="o.theme_id_purchase.source"> |
||||
|
<font t-attf-style="color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
<strong>Source:</strong> |
||||
|
<p t-field="o.origin"/> |
||||
|
</font> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div style="padding-top:20px;width:100%"> |
||||
|
<div class="col-12"> |
||||
|
<div t-attf-style="float: {{o.theme_id_purchase.shipping_address_position}};font:15px lucida-console,sans-serif !important;color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<t t-if="o.dest_address_id"> |
||||
|
<t t-if="o.theme_id_purchase.shipping_address"> |
||||
|
<div> |
||||
|
<strong>Shipping address:</strong> |
||||
|
<div> |
||||
|
<div style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
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> |
||||
|
<br/> |
||||
|
<br/> |
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
</div> |
||||
|
<div t-attf-style="float: {{o.theme_id_purchase.customer_position}};font:15px lucida-console,sans-serif !important;color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<strong>Customer Address</strong> |
||||
|
<br/> |
||||
|
<div> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id"/> |
||||
|
<br/> |
||||
|
<span t-if="o.theme_id_purchase.address"> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.street"/> |
||||
|
<br/> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.street2"/> |
||||
|
</span> |
||||
|
<br/> |
||||
|
<span t-if="o.theme_id_purchase.city"> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.city"/> |
||||
|
</span> |
||||
|
<br/> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.state_id"/> |
||||
|
<br/> |
||||
|
<span t-if="o.theme_id_purchase.country"> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.country_id"/> |
||||
|
</span> |
||||
|
<br/> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.vat"/> |
||||
|
</div> |
||||
|
<br/> |
||||
|
<br/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<table class="table table-sm o_main_table"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
Product |
||||
|
</th> |
||||
|
<span t-if="o.theme_id_purchase.description"> |
||||
|
<th t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
Description |
||||
|
</th> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.code"> |
||||
|
<th class="text-right" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
Internal Reference |
||||
|
</th> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.tax_value"> |
||||
|
<th class="text-right" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
Taxes |
||||
|
</th> |
||||
|
</span> |
||||
|
<th name="th_date_req" class="text-center" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<strong>Date Req.</strong> |
||||
|
</th> |
||||
|
<th name="th_quantity" class="text-right" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<strong>Qty</strong> |
||||
|
</th> |
||||
|
<th name="th_price_unit" class="text-right" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<strong>Unit Price</strong> |
||||
|
</th> |
||||
|
<th name="th_amount" class="text-right" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<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-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''"> |
||||
|
<t t-if="not line.display_type"> |
||||
|
<td t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<span t-field="line.product_id.name"/> |
||||
|
</td> |
||||
|
<span t-if="o.theme_id_purchase.description"> |
||||
|
<td t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<span t-field="line.name"/> |
||||
|
</td> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.code"> |
||||
|
<td class="text-right" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<t t-if="line.product_id.default_code"> |
||||
|
<span t-field="line.product_id.default_code"/> |
||||
|
</t> |
||||
|
</td> |
||||
|
</span> |
||||
|
<span t-if="o.theme_id_purchase.tax_value"> |
||||
|
<td name="td_taxes" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<span t-esc="', '.join(map(lambda x: x.name, line.taxes_id))"/> |
||||
|
</td> |
||||
|
</span> |
||||
|
<td class="text-center" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<span t-field="line.date_planned"/> |
||||
|
</td> |
||||
|
<td class="text-right" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<span t-field="line.product_qty"/> |
||||
|
<span t-field="line.product_uom.name" |
||||
|
groups="uom.group_uom"/> |
||||
|
</td> |
||||
|
<td class="text-right" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<span t-field="line.price_unit"/> |
||||
|
</td> |
||||
|
<td class="text-right" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<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" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<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" |
||||
|
t-attf-style="color:#{o.theme_id_purchase.text_color};"> |
||||
|
<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-right"> |
||||
|
<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> |
||||
|
<div id="total" class="row justify-content-end"> |
||||
|
<div class="col-4"> |
||||
|
<table class="table table-sm" style="page-break-inside: avoid;"> |
||||
|
<tbody> |
||||
|
<tr class="border-black o_total"> |
||||
|
<td><strong>TOTAL</strong></td> |
||||
|
<td class="text-right"> |
||||
|
<span t-field="o.amount_untaxed" |
||||
|
t-options='{"widget": "monetary", "display_currency": o.currency_id or o.company_id.currency_id}'/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
<p t-field="o.notes"/> |
||||
|
<div class="oe_structure"/> |
||||
|
</div> |
||||
|
</t> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,108 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<odoo> |
||||
|
<!-- This template is used to display a purchase order report in an |
||||
|
old standard format. It includes the header section with the company logo |
||||
|
and details, such as partner information, address, and VAT number. --> |
||||
|
<template id="old_std_report_purchaseorder_document"> |
||||
|
<t t-call="web.external_layout"> |
||||
|
<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> |
||||
|
|
||||
|
<!-- Header --> |
||||
|
<div class="row"> |
||||
|
<div class="col-6"> |
||||
|
<img t-if="company.logo" |
||||
|
t-att-src="'data:image/png;base64,%s' % company.logo" |
||||
|
style="max-height: 80px;" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<!-- Partner Info --> |
||||
|
<div class="mt32"> |
||||
|
<span t-field="o.partner_id.name"/><br/> |
||||
|
<span t-field="o.partner_id.street"/><br/> |
||||
|
<span t-field="o.partner_id.city"/> |
||||
|
<span t-field="o.partner_id.state_id"/><br/> |
||||
|
<span t-field="o.partner_id.country_id"/><br/> |
||||
|
</div> |
||||
|
|
||||
|
<!-- Purchase Order Info Box --> |
||||
|
<div style="background-color: #f26522; color: white; padding: 15px; margin-top: 30px;"> |
||||
|
<h3>Purchase Order# <span t-field="o.name"/></h3> |
||||
|
<p><strong>Order Date:</strong> <span t-field="o.date_order"/></p> |
||||
|
<p><strong>Order Deadline:</strong> <span t-field="o.date_approve"/></p> |
||||
|
<p><strong>Purchase Representative:</strong> <span t-field="o.user_id"/></p> |
||||
|
</div> |
||||
|
|
||||
|
<!-- Order Lines Table --> |
||||
|
<table class="table table-sm mt32"> |
||||
|
<thead style="background-color: #f26522; color: white;"> |
||||
|
<tr> |
||||
|
<th>Product</th> |
||||
|
<th>Description</th> |
||||
|
<th class="text-right">Quantity</th> |
||||
|
<th class="text-right">Unit Price</th> |
||||
|
<th class="text-right">Taxes</th> |
||||
|
<th class="text-right">Amount</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<t t-foreach="o.order_line" t-as="line"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<span t-field="line.product_id"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<span t-field="line.name"/> |
||||
|
</td> |
||||
|
<td class="text-right"> |
||||
|
<span t-field="line.product_qty"/> |
||||
|
</td> |
||||
|
<td class="text-right"> |
||||
|
<span t-field="line.price_unit"/> |
||||
|
</td> |
||||
|
<td class="text-right"> |
||||
|
<t t-set="tax_names" t-value="' ,'.join([tax.name for tax in line.taxes_id])"/> |
||||
|
<span t-esc="tax_names"/> |
||||
|
</td> |
||||
|
<td class="text-right"> |
||||
|
<span t-field="line.price_subtotal"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</t> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
|
||||
|
<!-- Totals Section --> |
||||
|
<div class="row justify-content-end"> |
||||
|
<div class="col-4"> |
||||
|
<table class="table table-sm"> |
||||
|
<tr> |
||||
|
<td><strong>Subtotal</strong></td> |
||||
|
<td class="text-right"> |
||||
|
<span t-field="o.amount_untaxed" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><strong>Tax 15%</strong></td> |
||||
|
<td class="text-right"> |
||||
|
<span t-field="o.amount_tax" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><strong>Total</strong></td> |
||||
|
<td class="text-right"> |
||||
|
<span t-field="o.amount_total" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> |
||||
|
</td> |
||||
|
|
||||
|
</tr> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</t> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,182 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- This template is used to display a purchase quotation report in a |
||||
|
modern view. It includes the header section with the company logo and details, |
||||
|
such as partner information, address, and VAT number.--> |
||||
|
<template id="custom_template_report_purchase_quotation_modern"> |
||||
|
<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-#{o.theme_id_purchase.logo_position}"> |
||||
|
<img t-if="company.logo" |
||||
|
t-attf-src="data:image/png;base64,{{ company.logo }}" |
||||
|
style="max-height: 80px;"/> |
||||
|
</div> |
||||
|
<div t-attf-class="pull-#{o.theme_id_purchase.company_position}" |
||||
|
t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id_purchase.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"/> |
||||
|
<div class="page"> |
||||
|
<div class="oe_structure"/> |
||||
|
<div t-attf-style=" background-color:#{o.theme_id_purchase.base_color};padding:2%"> |
||||
|
<h2> |
||||
|
<font t-attf-style="color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
Request for Quotation |
||||
|
</font> |
||||
|
<font t-attf-style=" color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
<span t-field="o.name"/> |
||||
|
</font> |
||||
|
</h2> |
||||
|
<div class="row mt32 mb32"> |
||||
|
<div class="col-3" t-if="o.state in ['purchase','done'] and o.date_approve"> |
||||
|
<font t-attf-style="color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
<strong>Order Date:</strong> |
||||
|
<p t-field="o.date_approve"/> |
||||
|
</font> |
||||
|
</div> |
||||
|
<div class="col-3" t-if="o.date_order"> |
||||
|
<font t-attf-style="color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
<strong>Order Deadline:</strong> |
||||
|
<p t-field="o.date_order"/> |
||||
|
</font> |
||||
|
</div> |
||||
|
<div class="col-3" t-if="o.user_id and o.theme_id_purchase.purchase_rep"> |
||||
|
<font t-attf-style="color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
<strong>Purchase Representative</strong> |
||||
|
<p t-field="o.user_id"/> |
||||
|
</font> |
||||
|
</div> |
||||
|
<div class="col-3" t-if="o.partner_ref and o.theme_id_purchase.reference"> |
||||
|
<font t-attf-style="color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
<strong>Reference:</strong> |
||||
|
<p t-field="o.partner_ref"/> |
||||
|
</font> |
||||
|
</div> |
||||
|
<div class="col-3" t-if="o.origin and o.theme_id_purchase.source"> |
||||
|
<font t-attf-style="color:#{o.theme_id_purchase.heading_text_color}"> |
||||
|
<strong>Source:</strong> |
||||
|
<p t-field="o.origin"/> |
||||
|
</font> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div style="padding-top:20px;width:100%"> |
||||
|
<div class="col-12"> |
||||
|
<div t-attf-class="text-#{o.theme_id_purchase.shipping_address_position}" |
||||
|
style="font:15px lucida-console,sans-serif !important;color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<t t-if="o.dest_address_id and o.theme_id_purchase.shipping_address"> |
||||
|
<div> |
||||
|
<strong>Shipping address:</strong> |
||||
|
<div> |
||||
|
<div style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
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> |
||||
|
<br/><br/> |
||||
|
</div> |
||||
|
</t> |
||||
|
</div> |
||||
|
<div t-attf-class="text-#{o.theme_id_purchase.customer_position}" |
||||
|
style="font:15px lucida-console,sans-serif !important;color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<strong>Customer Address</strong> |
||||
|
<br/> |
||||
|
<div> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id"/> |
||||
|
<br/> |
||||
|
<span t-if="o.theme_id_purchase.address"> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.street"/> |
||||
|
<br/> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.street2"/> |
||||
|
</span> |
||||
|
<br/> |
||||
|
<span t-if="o.theme_id_purchase.city"> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.city"/> |
||||
|
</span> |
||||
|
<br/> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.state_id"/> |
||||
|
<br/> |
||||
|
<span t-if="o.theme_id_purchase.country"> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.country_id"/> |
||||
|
</span> |
||||
|
<br/> |
||||
|
<span t-attf-style="color:#{o.theme_id_purchase.customer_text_color} !important;" |
||||
|
t-field="o.partner_id.vat"/> |
||||
|
</div> |
||||
|
<br/><br/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<table class="table table-sm o_main_table"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
Description |
||||
|
</th> |
||||
|
<th class="text-center" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<strong>Expected Date</strong> |
||||
|
</th> |
||||
|
<th class="text-right" |
||||
|
t-attf-style=" background-color:#{o.theme_id_purchase.base_color};color:#{o.theme_id_purchase.heading_text_color};"> |
||||
|
<strong>Qty</strong> |
||||
|
</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<t t-foreach="o.order_line" t-as="order_line"> |
||||
|
<tr t-att-class="'bg-200 font-weight-bold o_line_section' if order_line.display_type == 'line_section' else 'font-italic o_line_note' if order_line.display_type == 'line_note' else ''"> |
||||
|
<t t-if="not order_line.display_type"> |
||||
|
<td t-attf-style="color:#{o.theme_id_purchase.text_color};" id="product"> |
||||
|
<span t-field="order_line.name"/> |
||||
|
</td> |
||||
|
<td t-attf-style="color:#{o.theme_id_purchase.text_color};" class="text-center"> |
||||
|
<span t-field="order_line.date_planned"/> |
||||
|
</td> |
||||
|
<td t-attf-style="color:#{o.theme_id_purchase.text_color};" class="text-right"> |
||||
|
<span t-field="order_line.product_qty"/> |
||||
|
<span t-field="order_line.product_uom" groups="uom.group_uom"/> |
||||
|
</td> |
||||
|
</t> |
||||
|
<t t-else=""> |
||||
|
<td t-attf-style="color:#{o.theme_id_purchase.text_color};" colspan="99" id="section"> |
||||
|
<span t-field="order_line.name"/> |
||||
|
</td> |
||||
|
</t> |
||||
|
</tr> |
||||
|
</t> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
<p t-field="o.notes"/> |
||||
|
<div class="oe_structure"/> |
||||
|
</div> |
||||
|
</t> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,97 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- This template is used to display a purchase quotation report in an |
||||
|
old standard format. It includes the header section with the company logo |
||||
|
and details, such as partner information, address, and VAT number. --> |
||||
|
<template id="old_std_report_purchase_quotation_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> |
||||
|
|
||||
|
<!-- Company Info Section --> |
||||
|
<div class="header row mt32 mb32"> |
||||
|
<div class="page-header col-12"> |
||||
|
<div style="float: left;"> |
||||
|
<img t-if="company.logo" t-attf-src="data:image/png;base64,{{ company.logo }}" style="max-height: 80px;"/> |
||||
|
</div> |
||||
|
<div style="float: right; text-align: right; font:14px lucida-console,sans-serif;"> |
||||
|
<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/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<t t-call="web.external_layout"> |
||||
|
<div class="pt-5"> |
||||
|
<!-- Partner Info Section --> |
||||
|
<div class="row" style="margin-bottom: 20px;"> |
||||
|
<div class="col-6"> |
||||
|
<span t-field="o.partner_id" style="font-weight: bold;"/><br/> |
||||
|
<span t-field="o.partner_id.state_id"/><br/> |
||||
|
<span t-field="o.partner_id.country_id"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<!-- Orange Header Section --> |
||||
|
<div style="background-color: #f26522; color: white; padding: 20px;"> |
||||
|
<h3>Request for Quotation: |
||||
|
<span t-field="o.name"/></h3> |
||||
|
<p><strong>Date Deadline: |
||||
|
</strong> <span t-field="o.date_order"/></p> |
||||
|
<p><strong>Purchase Representative: |
||||
|
</strong> <span t-field="o.user_id"/></p> |
||||
|
</div> |
||||
|
|
||||
|
<!-- Line Items Table --> |
||||
|
<table class="table table-sm o_main_table" style="margin-top: 20px;"> |
||||
|
<thead style="background-color: #f26522; color: white; margin-top: 20px;"> |
||||
|
<tr> |
||||
|
<th>Product</th> |
||||
|
<th>Date Req.</th> |
||||
|
<th class="text-right">Qty</th> |
||||
|
<th class="text-right">Unit Price</th> |
||||
|
<th class="text-right">Amount</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<t t-foreach="o.order_line" t-as="line"> |
||||
|
<tr t-if="not line.display_type"> |
||||
|
<td><span t-field="line.product_id.name"/></td> |
||||
|
<td><span t-field="line.date_planned"/></td> |
||||
|
<td class="text-right"> |
||||
|
<span t-field="line.product_qty"/> |
||||
|
</td> |
||||
|
<td class="text-right"> |
||||
|
<span t-field="line.price_unit"/> |
||||
|
</td> |
||||
|
<td class="text-right"> |
||||
|
<span t-field="line.price_subtotal" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</t> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
|
||||
|
<!-- Total Section --> |
||||
|
<div class="row justify-content-end"> |
||||
|
<div class="col-4"> |
||||
|
<table class="table table-sm"> |
||||
|
<tr> |
||||
|
<td><strong>Total</strong></td> |
||||
|
<td class="text-right"> |
||||
|
<span t-field="o.amount_untaxed" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</t> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,197 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- This template is used to generate a purchase order document. |
||||
|
It includes an external layout for consistent formatting. The template also |
||||
|
sets the context with the partner's language. The address information of the |
||||
|
partner is displayed, including the address, name, phone number, |
||||
|
and VAT number.--> |
||||
|
<template id="report_purchaseorder_document"> |
||||
|
<t t-call="web.external_layout"> |
||||
|
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/> |
||||
|
<t t-set="address"> |
||||
|
<div t-field="o.partner_id" |
||||
|
t-options='{"widget": "contact", "fields": ["address", "name", "phone", "vat"], "no_marker": True, "phone_icons": True}'/> |
||||
|
</t> |
||||
|
<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> |
||||
|
<div class="page"> |
||||
|
<div class="oe_structure"/> |
||||
|
|
||||
|
<div class="mt-4"> |
||||
|
<t t-set="layout_document_title"> |
||||
|
<t t-if="o.state in ['draft', 'sent', 'to approve']"> |
||||
|
Request for Quotation # |
||||
|
<span t-field="o.name"/> |
||||
|
</t> |
||||
|
<t t-if="o.state in ['purchase', 'done']">Purchase Order |
||||
|
# |
||||
|
<span t-field="o.name"/> |
||||
|
</t> |
||||
|
<t t-if="o.state == 'cancel'">Cancelled Purchase Order # |
||||
|
<span t-field="o.name"/> |
||||
|
</t> |
||||
|
</t> |
||||
|
</div> |
||||
|
|
||||
|
<div id="informations" class="row mb-4"> |
||||
|
<div t-if="o.user_id" class="col"> |
||||
|
<strong>Buyer</strong> |
||||
|
<div t-field="o.user_id"/> |
||||
|
</div> |
||||
|
<div t-if="o.partner_ref" class="col"> |
||||
|
<strong>Your Order Reference</strong> |
||||
|
<div t-field="o.partner_ref"/> |
||||
|
</div> |
||||
|
<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" |
||||
|
t-options="{'date_only': 'true'}" class="m-0"/> |
||||
|
</div> |
||||
|
<div t-elif="o.date_order" class="col-2 bm-2"> |
||||
|
<strong>Order Deadline:</strong> |
||||
|
<p t-field="o.date_order" |
||||
|
t-options="{'date_only': 'true'}" class="m-0"/> |
||||
|
</div> |
||||
|
<div t-if="o.date_planned" class="col-2 bm-2"> |
||||
|
<strong>Expected Arrival:</strong> |
||||
|
<p t-field="o.date_planned" |
||||
|
t-options="{'date_only': 'true'}" class="m-0"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<table class="o_has_total_table table o_main_table table-borderless"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th name="th_description" class="text-start"> |
||||
|
<strong>Description</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_discount" class="text-end"> |
||||
|
<strong>Disc.</strong> |
||||
|
</th> |
||||
|
<th name="th_taxes" class="text-end"> |
||||
|
<strong>Taxes</strong> |
||||
|
</th> |
||||
|
<th name="th_subtotal" 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"/> |
||||
|
|
||||
|
<tr t-att-class="'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" class="text-start"> |
||||
|
<span t-field="line.name"/> |
||||
|
</td> |
||||
|
<td class="text-end"> |
||||
|
<span t-field="line.product_qty"/> |
||||
|
<span t-field="line.product_uom.name" |
||||
|
groups="uom.group_uom"/> |
||||
|
<span t-if="line.product_packaging_id"> |
||||
|
( |
||||
|
<span t-field="line.product_packaging_qty" |
||||
|
t-options='{"widget": "integer"}'/> |
||||
|
<span t-field="line.product_packaging_id"/> |
||||
|
) |
||||
|
</span> |
||||
|
</td> |
||||
|
<td class="text-end"> |
||||
|
<span t-field="line.price_unit"/> |
||||
|
</td> |
||||
|
<td class="text-end"> |
||||
|
<span class="text-align-bottom"><span |
||||
|
t-field="line.discount"/>% |
||||
|
</span> |
||||
|
</td> |
||||
|
<td class="text-end"> |
||||
|
<span t-out="', '.join([(tax.invoice_label or tax.name) for tax in line.taxes_id])"/> |
||||
|
</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-out="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 mt-n3"> |
||||
|
<div class="col-4"> |
||||
|
<table class="o_total_table table table-borderless"> |
||||
|
<t t-call="purchase.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"/> |
||||
|
|
||||
|
<strong>Payment Terms:</strong> |
||||
|
<span t-field="o.payment_term_id" class="mt-4"></span> |
||||
|
|
||||
|
<t t-set="base_address" |
||||
|
t-value="o.env['ir.config_parameter'].sudo().get_param('web.base.url')"/> |
||||
|
<t t-set="portal_url" |
||||
|
t-value="base_address + '/my/purchase/' + str(o.id) + '#portal_connect_software_modal'"/> |
||||
|
<div t-if="any(u._is_portal() for u in o.partner_id.user_ids)" |
||||
|
class="text-center"> |
||||
|
<a t-att-href="portal_url">Connect your software</a> |
||||
|
with |
||||
|
<t t-out="o.company_id.name"/> |
||||
|
to create quotes automatically. |
||||
|
</div> |
||||
|
</div> |
||||
|
</t> |
||||
|
</template> |
||||
|
<template id="document_tax_totals" |
||||
|
inherit_id="account.document_tax_totals_template" |
||||
|
primary="True"></template> |
||||
|
|
||||
|
</odoo> |
@ -0,0 +1,78 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- This template is used to generate a purchase quotation document. |
||||
|
It utilizes an external layout for consistent formatting. The context is set |
||||
|
with the partner's language. The address information of the partner is |
||||
|
displayed, including the address, name, phone number, and VAT number. --> |
||||
|
<template id="report_purchase_quotation_document"> |
||||
|
<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 t-field="o.partner_id" |
||||
|
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
||||
|
<p t-if="o.partner_id.vat"><t |
||||
|
t-esc="o.company_id.account_fiscal_country_id.vat_label or 'Tax ID'"/> |
||||
|
: |
||||
|
<span t-field="o.partner_id.vat"/> |
||||
|
</p> |
||||
|
</t> |
||||
|
<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> |
||||
|
<div class="page"> |
||||
|
<div class="oe_structure"/> |
||||
|
<h2>Request for Quotation |
||||
|
<span t-field="o.name"/> |
||||
|
</h2> |
||||
|
<table class="table table-sm"> |
||||
|
<thead> |
||||
|
<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-right"> |
||||
|
<strong>Qty</strong> |
||||
|
</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<t t-foreach="o.order_line" t-as="order_line"> |
||||
|
<tr t-att-class="'bg-200 font-weight-bold o_line_section' if order_line.display_type == 'line_section' else 'font-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-right"> |
||||
|
<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> |
||||
|
<p t-field="o.notes"/> |
||||
|
<div class="oe_structure"/> |
||||
|
</div> |
||||
|
</t> |
||||
|
</template> |
||||
|
</odoo> |
|
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 172 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 193 KiB |
After Width: | Height: | Size: 93 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 91 KiB |
After Width: | Height: | Size: 97 KiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 100 KiB |
After Width: | Height: | Size: 155 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 58 KiB |