Browse Source

Jun 15: [FIX] Bug Fixed 'custom_receipts_for_pos'

pull/331/head
RisvanaCybro 11 months ago
parent
commit
9c623e81ee
  1. 10
      custom_receipts_for_pos/README.rst
  2. 21
      custom_receipts_for_pos/__init__.py
  3. 23
      custom_receipts_for_pos/__manifest__.py
  4. 190
      custom_receipts_for_pos/data/pos_receipt_data.xml
  5. 5
      custom_receipts_for_pos/doc/RELEASE_NOTES.md
  6. 6
      custom_receipts_for_pos/models/__init__.py
  7. 21
      custom_receipts_for_pos/models/pos_config.py
  8. 7
      custom_receipts_for_pos/models/pos_receipt.py
  9. 6
      custom_receipts_for_pos/models/pos_session.py
  10. 31
      custom_receipts_for_pos/models/res_config_settings.py
  11. 3
      custom_receipts_for_pos/security/ir.model.access.csv
  12. BIN
      custom_receipts_for_pos/static/description/assets/screenshots/1.png
  13. BIN
      custom_receipts_for_pos/static/description/assets/screenshots/2.png
  14. BIN
      custom_receipts_for_pos/static/description/assets/screenshots/3.png
  15. BIN
      custom_receipts_for_pos/static/description/assets/screenshots/4.png
  16. BIN
      custom_receipts_for_pos/static/description/assets/screenshots/5.png
  17. BIN
      custom_receipts_for_pos/static/description/assets/screenshots/6.png
  18. BIN
      custom_receipts_for_pos/static/description/assets/screenshots/7.png
  19. BIN
      custom_receipts_for_pos/static/description/assets/screenshots/hero.gif
  20. 156
      custom_receipts_for_pos/static/description/index.html
  21. 29
      custom_receipts_for_pos/static/src/js/receipt_design.js
  22. 12
      custom_receipts_for_pos/static/src/xml/order_receipt.xml
  23. 15
      custom_receipts_for_pos/views/point_of_sale_views.xml
  24. 29
      custom_receipts_for_pos/views/pos_config_views.xml
  25. 23
      custom_receipts_for_pos/views/pos_receipt_views.xml
  26. 8
      custom_receipts_for_pos/views/res_config_settings_views.xml

10
custom_receipts_for_pos/README.rst

@ -2,10 +2,9 @@
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
POS Receipt Designs
===================
POS Receipt Design
===================
Option to select the customised Receipts for each POS
Company
-------
@ -13,7 +12,10 @@ Company
Credits
-------
Developer: Sadique Kottekkat @cybrosys, Contact: odoo@cybrosys.com
Developer: (V14) Syamili K,
(V15) Sajna Sherin T,
(V16 & V17) Sadique Kottekkat, Abhishek E T @cybrosys
Contact: odoo@cybrosys.com
Contacts
--------

21
custom_receipts_for_pos/__init__.py

@ -1,22 +1,23 @@
# -*- coding: utf-8 -*-
#############################################################################
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Sadique Kottekkat (<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 free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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.
# GNU Affero General Public License 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/>.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
#############################################################################
################################################################################
from . import models

23
custom_receipts_for_pos/__manifest__.py

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
###################################################################################
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Sadique Kottekkat (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
@ -19,30 +19,31 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
################################################################################
{
'name': 'POS Receipt Design',
'version': '17.0.1.0.1',
'version': '17.0.1.0.2',
'category': 'Point of Sale',
'summary': """POS Receipt, Receipt Design, POS Receipt Template, Design Report, Custom Receipt,POS Report, Customis Receipt, Odoo17, Odoo Apps """,
'description': "Option to select the customised Receipts for each POS,"
"So we can easily updated the Recipet Design for better styles",
'summary': "POS Receipt, Receipt Design, POS Receipt Template, Design "
"Report, Custom Receipt, POS Report, Customise Receipt, Odoo17, "
"Odoo Apps",
'description': "Option to select the customised Receipts for each POS. So, "
"we can easily updated the Receipt Design for better styles",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': "https://www.cybrosys.com",
'website': 'https://www.cybrosys.com',
'depends': ['base', 'point_of_sale'],
'data': [
'security/ir.model.access.csv',
'data/pos_receipt_views_data.xml',
'views/point_of_sale_views.xml',
'data/pos_receipt_data.xml',
'views/pos_receipt_views.xml',
'views/res_config_settings_views.xml',
],
'assets': {
'point_of_sale._assets_pos': [
'custom_receipts_for_pos/static/src/js/receipt_design.js',
'custom_receipts_for_pos/static/src/xml/receipt_design_template_views.xml',
'custom_receipts_for_pos/static/src/xml/order_receipt.xml',
],
},
'images': ['static/description/banner.png'],

190
custom_receipts_for_pos/data/pos_receipt_views_data.xml → custom_receipts_for_pos/data/pos_receipt_data.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Sub Categories -->
<!-- Examples for receipt design: which can be used or modified -->
<record id="pos_receipt_design1" model="pos.receipt">
<field name="name">Design 1</field>
<field name="design_receipt"><![CDATA[<div class="pos-receipt">
@ -38,78 +38,74 @@
<br />
</t>
<div>
<table class='receipt-orderlines' style="font-size:15px; border-style: double;
border-left: none;border-right: none;border-bottom: none;width: 100%;">
<colgroup>
<col width='40%' />
<col width='30%' />
<col width='30%' />
</colgroup>
<tr style="border-bottom: 1px dashed black;">
<th style="text-align:left;">Product</th>
<th style="text-align:center;">Qty</th>
<th style="text-align:center;">Amount</th>
</tr>
<tr t-foreach="props.orderlines" t-as="orderline" t-key="index_orderlines">
<td style="padding-top: 1%;padding-bottom: 1%;">
<t t-esc="orderline.get_product().display_name"/>
<t t-if="orderline.get_discount() > 0">
<div style="font-size: 12px;font-style: italic;color: #808080;">
<t t-esc="orderline.get_discount()"/>% discount
</div>
</t>
<t t-if="orderline.customerNote">
<div style="font-size: 14px;" t-esc="orderline.customerNote"/>
</t>
</td>
<td class="pos-center-align">
<t t-esc="orderline.get_quantity_str_with_unit()"/>
</td>
<td class="pos-center-align">
<t t-esc="orderline.get_display_price()"/>
</td>
</tr>
<table class='receipt-orderlines' style="font-size:15px; border-style:double; border-left:none; border-right:none; border-bottom:none; width:100%;">
<colgroup>
<col width='40%' />
<col width='30%' />
<col width='30%' />
</colgroup>
<tr style="border-bottom:1px dashed black;">
<th style="text-align:left;">Product</th>
<th style="text-align:right;">Qty</th>
<th style="text-align:right;">Amount</th>
</tr>
<tr t-foreach="props.orderlines" t-as="orderline" t-key="index_orderlines">
<td style="padding-top:1%; padding-bottom:1%; text-align:left;">
<t t-esc="orderline.get_product().display_name"/>
<t t-if="orderline.get_discount() > 0">
<div style="font-size:12px; font-style:italic; color:#808080;">
<t t-esc="orderline.get_discount()"/>% discount
</div>
</t>
<t t-if="orderline.customerNote">
<div style="font-size:14px;" t-esc="orderline.customerNote"/>
</t>
</td>
<td style="text-align:right; font-size:14px;">
<t t-esc="orderline.get_quantity_str_with_unit()"/>
</td>
<td style="text-align:right; font-size:14px;">
<t t-esc="env.utils.formatCurrency(orderline.get_display_price())"/>
</td>
</tr>
</table>
</div>
<br />
<div style="padding-top: 6px;">
<div style="padding-top:6px;">
<!-- Subtotal -->
<t t-set='taxincluded' t-value='Math.abs(props.receipt.amount_total - props.receipt.total_with_tax) &lt;= 0.000001' />
<t t-if='!taxincluded'>
<br/>
<div style="font-weight: 700; font-size: 14px; border-top:1px dashed;"><span style="margin-left: 40%;">Subtotal : </span><span t-esc='props.receipt.amount_total' class="pos-receipt-right-align"/></div>
<div style="font-weight:700; font-size:14px; border-top:1px dashed;"><span style="margin-left:40%;">Subtotal : </span><span t-esc='env.utils.formatCurrency(props.data.total_without_tax)' class="pos-receipt-right-align"/></div>
<t t-foreach='props.receipt.tax_details' t-as='tax' t-key="index_tax_details">
<div style="font-weight: 700; font-size: 14px;">
<span style="margin-left: 40%;"><t t-esc='tax.name' /></span>
<span t-esc='tax.amount' class="pos-receipt-right-align"/>
<div style="font-weight:700; font-size:14px;">
<span style="margin-left:40%;"><t t-esc='tax.name' /></span>
<span t-esc='env.utils.formatCurrency(tax.amount)' class="pos-receipt-right-align"/>
</div>
</t>
</t>
<!-- Total -->
<br/>
<div style="font-weight: 700; font-size: 14px;">
<span style="margin-left: 40%;">TOTAL : </span>
<span t-esc='props.receipt.amount_total' class="pos-receipt-right-align"/>
<div style="font-weight:700; font-size:14px;">
<span style="margin-left:40%;">TOTAL : </span>
<span t-esc='env.utils.formatCurrency(props.receipt.amount_total)' class="pos-receipt-right-align"/>
</div>
</div>
<div class='before-footer' />
<br/>
<br/>
<br/><br/>
<!-- Footer -->
<div class="pos-receipt-order-data">
<div><t t-esc="props.receipt.name" /></div>
<t t-if="props.receipt.date">
<div><t t-esc="props.receipt.date" /></div>
</t>
<t t-else="">
<div><t t-esc="props.receipt.date" /></div>
</t>
<div class="pos-receipt-order-data">
<div><t t-esc="props.receipt.name" />
</div>
<t t-if="props.receipt.date">
<div><t t-esc="props.receipt.date" /></div>
</t>
<t t-else="">
<div><t t-esc="props.receipt.date" /></div>
</t>
</div>
<br/><br/>
<div style="font-size: 14px; text-align: center;">
<div style="font-size:14px; text-align:center;">
Thank You... Please Visit Again ...
</div>
</div>]]></field>
@ -117,13 +113,13 @@
<record id="pos_receipt_design2_demo" model="pos.receipt">
<field name="name">Design 2</field>
<field name="design_receipt"><![CDATA[<div class="pos-receipt">
<div style="font-size:13px; text-align: center;">
<div style="font-size:13px; text-align:center;">
<t t-esc="env.services.pos.company.name"/><br />
Phone: <t t-esc="env.services.pos.company.phone || ''"/><br />
Phone:<t t-esc="env.services.pos.company.phone || ''"/><br />
</div>
<br/>
<div style="font-size:13px; text-align: center;">
<div style="font-size:13px; text-align:center;">
Date :
<t t-if="props.receipt.date">
<t t-esc="props.receipt.date"/>
@ -135,10 +131,10 @@
Order : <t t-esc="props.order[0].name"/><br />
</div>
<br />
<div style="font-size:13px; text-align: center;">
<div style="font-size:13px; text-align:center;">
Cashier : <t t-esc='props.receipt.headerData.cashier' /><br />
<t t-if="props.order[0].partner">
Customer : <t t-esc='props.order[0].partner.name' style="font-style: bold" />
Customer : <t t-esc='props.order[0].partner.name' style="font-style:bold" />
</t>
<br />
</div>
@ -150,104 +146,104 @@
<br />
</t>
<div>
<table class='receipt-orderlines' style="font-size:15px; border-style: double;
border-left: none;border-right: none;border-bottom: none;width: 100%;">
<table class='receipt-orderlines' style="font-size:15px; border-style:double;
border-left:none; border-right:none; border-bottom:none; width:100%;">
<colgroup>
<col width='40%' />
<col width='30%' />
<col width='30%' />
</colgroup>
<tr style="border-bottom: 1px dashed black;">
<tr style="border-bottom:1px dashed black;">
<th style="text-align:left;">Product</th>
<th style="text-align:center;">Qty</th>
<th style="text-align:center;">Amount</th>
<th style="text-align:right;">Qty</th>
<th style="text-align:right;">Amount</th>
</tr>
<tr t-foreach="props.orderlines" t-as="orderline" t-key="index_props_orderlines">
<td style="padding-top: 1%;padding-bottom: 1%;">
<td style="padding-top:1%; padding-bottom:1%; text-align:left;">
<t t-esc="orderline.get_product().display_name"/>
<t t-if="orderline.get_discount() > 0">
<div style="font-size: 12px;font-style: italic;color: #808080;">
<div style="font-size:12px; font-style:italic; color:#808080;">
<t t-esc="orderline.get_discount()"/>% discount
</div>
</t>
<t t-if="orderline.customerNote">
<div style="font-size: 14px;" t-esc="orderline.customerNote"/>
<div style="font-size:14px;" t-esc="orderline.customerNote"/>
</t>
</td>
<td class="pos-center-align">
<td style="text-align:right;">
<t t-esc="orderline.get_quantity_str_with_unit()"/>
</td>
<td class="pos-center-align">
<t t-esc="orderline.get_display_price()"/>
<td style="text-align:right;">
<t t-esc="env.utils.formatCurrency(orderline.get_display_price())"/>
</td>
</tr>
</table>
</div>
<br />
<div style="padding-top: 6px;">
<div style="padding-top:6px;">
<!-- Subtotal -->
<t t-set='taxincluded' t-value='Math.abs(props.receipt.amount_total - props.receipt.total_with_tax) &lt;= 0.000001' />
<t t-if='!taxincluded'>
<br/>
<div style="font-weight: 700; font-size: 14px; border-top:1px dashed;"><span style="margin-left: 40%;">Subtotal : </span><span t-esc='props.receipt.amount_total' class="pos-receipt-right-align"/></div>
<div style="font-weight:700; font-size:14px; border-top:1px dashed;"><span style="margin-left:40%;">Subtotal : </span><span t-esc='env.utils.formatCurrency(props.data.total_without_tax)' class="pos-receipt-right-align"/></div>
<t t-foreach='props.receipt.tax_details' t-as='tax' t-key="index_tax_details">
<div style="font-weight: 700; font-size: 14px;">
<span style="margin-left: 40%;"><t t-esc='tax.name' /></span>
<span t-esc='tax.amount' class="pos-receipt-right-align"/>
<div style="font-weight:700; font-size:14px;">
<span style="margin-left:40%;"><t t-esc='tax.name' /></span>
<span t-esc='env.utils.formatCurrency(tax.amount)' class="pos-receipt-right-align"/>
</div>
</t>
</t>
<!-- Total -->
<br/>
<div style="font-weight: 700; font-size: 14px;">
<span style="margin-left: 40%;">TOTAL : </span>
<span t-esc='props.receipt.amount_total' class="pos-receipt-right-align"/>
<div style="font-weight:700; font-size:14px;">
<span style="margin-left:40%;">TOTAL : </span>
<span t-esc='env.utils.formatCurrency(props.receipt.amount_total)' class="pos-receipt-right-align"/>
</div>
<br/><br/>
</div>
<!-- Payment Lines -->
<t t-foreach='props.paymentlines' t-as='line' t-key="index_paymentlines">
<div style="font-size: 14px;border-top:1px dashed;padding-top: 5px;">
<span style="margin-left: 40%;"><t t-esc='line.name' /></span>
<span t-esc='line.get_amount()' class="pos-receipt-right-align"/>
<div style="font-size:14px; border-top:1px dashed; padding-top:5px;">
<span style="margin-left:40%;"><t t-esc='line.name' /></span>
<span t-esc='env.utils.formatCurrency(line.get_amount())' class="pos-receipt-right-align"/>
</div>
</t>
<br/>
<div class="receipt-change" style="font-size: 14px;">
<span style="margin-left: 40%;">CHANGE : </span>
<span t-esc='props.receipt.change' class="pos-receipt-right-align"/>
<div class="receipt-change" style="font-size:14px;">
<span style="margin-left:40%;">CHANGE : </span>
<span t-esc='env.utils.formatCurrency(props.receipt.change)' class="pos-receipt-right-align"/>
</div>
<br/>
<!-- Extra Payment Info -->
<t t-if='props.receipt.total_discount'>
<div style="font-size: 14px; border-top:1px dashed;padding-top: 5px;">
<span style="margin-left: 40%;">Discounts : </span>
<span t-esc='props.receipt.total_discount' class="pos-receipt-right-align"/>
<div style="font-size:14px; border-top:1px dashed; padding-top:5px;">
<span style="margin-left:40%;">Discounts : </span>
<span t-esc='env.utils.formatCurrency(props.receipt.total_discount)' class="pos-receipt-right-align"/>
</div>
</t>
<t t-if='taxincluded'>
<t t-foreach='props.receipt.tax_details' t-as='tax' t-key="index_receipt_tax_details">
<div style="font-size: 14px;">
<span style="margin-left: 40%;"><t t-esc='tax.name' /></span>
<span t-esc='tax.amount' class="pos-receipt-right-align"/>
<div style="font-size:14px;">
<span style="margin-left:40%;"><t t-esc='tax.name' /></span>
<span t-esc='env.utils.formatCurrency(tax.amount)' class="pos-receipt-right-align"/>
</div>
</t>
<div style="font-size: 14px;">
<span style="margin-left: 40%;">Total Taxes : </span>
<span t-esc='props.receipt.total_tax' class="pos-receipt-right-align"/>
<div style="font-size:14px;">
<span style="margin-left:40%;">Total Taxes : </span>
<span t-esc='penv.utils.formatCurrency(rops.receipt.total_tax)' class="pos-receipt-right-align"/>
</div>
</t>
<div class='before-footer' />
<!-- Footer -->
<div t-if='props.receipt.footer_html' style="text-align: center; font-size: 14px;">
<div t-if='props.receipt.footer_html' style="text-align:center; font-size:14px;">
<t t-raw='props.receipt.footer_html'/>
</div>
<div t-if='!props.receipt.footer_html and props.receipt.footer' style="text-align: center;font-size: 14px;">
<div t-if='!props.receipt.footer_html and props.receipt.footer' style="text-align:center; font-size:14px;">
<br/>
<t t-esc='props.receipt.footer'/>
<br/><br/>
</div>
<div class='after-footer' style="font-size: 14px;">
<div class='after-footer' style="font-size:14px;">
<t t-foreach='props.paymentlines' t-as='line' t-key="index_payment">
<t t-if='line.ticket'>
<br />
@ -258,7 +254,7 @@
</t>
</div>
<br/><br/>
<div style="font-size: 14px; text-align: center;">
<div style="font-size:14px; text-align:center;">
Thank You... Please Visit Again ...
</div>
</div>]]></field>

5
custom_receipts_for_pos/doc/RELEASE_NOTES.md

@ -9,3 +9,8 @@
#### Version 17.0.1.0.1
##### BUGFIX
- Fixed the error in printing the receipt
#### 15.06.2024
#### Version 17.0.1.0.2
##### BUGFIX
- Fix the receipt selection for each point of sales

6
custom_receipts_for_pos/models/__init__.py

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
###################################################################################
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Sadique Kottekkat (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
@ -19,7 +19,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
################################################################################
from .import pos_receipt
from .import pos_config
from .import res_config_settings

21
custom_receipts_for_pos/models/pos_config.py

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
###############################################################################
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Sadique Kottekkat (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
@ -19,22 +19,23 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###############################################################################
################################################################################
from odoo import fields, models
class PosConfig(models.Model):
"""
This is an Odoo model for Point of Sale (POS).
It inherits from the 'pos.config' model and extends its functionality.
It inherits the 'pos.config' model to add new fields.
"""
_inherit = "pos.config"
_inherit = 'pos.config'
receipt_design = fields.Many2one('pos.receipt',
string="Receipt Design",
help="Choose any receipt design")
receipt_design = fields.Many2one('pos.receipt', string='Receipt Design',
help='Choose any receipt design',
default=lambda self: self.env[
'pos.receipt'].search([], limit=1))
design_receipt = fields.Text(related='receipt_design.design_receipt',
string='Receipt XML')
is_custom_receipt = fields.Boolean(string='Is Custom Receipt',
help='Boolean indicating the receipt'
' design is custom or not')
help='Indicates the receipt design is '
'custom or not')

7
custom_receipts_for_pos/models/pos_receipt.py

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
###############################################################################
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Sadique Kottekkat (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
@ -19,7 +19,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###############################################################################
################################################################################
from odoo import fields, models
@ -30,6 +30,7 @@ class PosReceipt(models.Model):
receipt design.
"""
_name = 'pos.receipt'
_description = 'POS Receipts'
name = fields.Char(string='Name', help='Name of the pos receipt')
design_receipt = fields.Text(string='Receipt XML',

6
custom_receipts_for_pos/models/pos_session.py

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
###############################################################################
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Sadique Kottekkat (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
@ -19,7 +19,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###############################################################################
################################################################################
from odoo import models

31
custom_receipts_for_pos/models/res_config_settings.py

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
###############################################################################
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Sadique Kottekkat (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
@ -19,8 +19,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###############################################################################
from odoo import api, fields, models
################################################################################
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
@ -31,23 +31,10 @@ class ResConfigSettings(models.TransientModel):
"""
_inherit = 'res.config.settings'
pos_receipt_design = fields.Many2one(related='pos_config_id.receipt_design',
string="Receipt Design",
help="Choose any receipt design",
compute='_compute_pos_is_custom_receipt',
readonly=False, store=True,
default=lambda self: self.env['pos.receipt'].search([], limit=1))
pos_receipt_design = fields.Many2one(
related='pos_config_id.receipt_design', readonly=False,
string='Receipt Design', help='Choose any receipt design')
pos_design_receipt = fields.Text(related='pos_config_id.design_receipt',
string='Receipt XML')
pos_is_custom_receipt = fields.Boolean(related='pos_config_id.'
'is_custom_receipt',
readonly=False, store=True)
@api.depends('pos_is_custom_receipt', 'pos_config_id')
def _compute_pos_is_custom_receipt(self):
"""The compute function for finding the Receipt status"""
for res_config in self:
if res_config.pos_is_custom_receipt:
res_config.pos_receipt_design = res_config.pos_config_id.receipt_design
else:
res_config.pos_receipt_design = False
pos_is_custom_receipt = fields.Boolean(
related='pos_config_id.is_custom_receipt', readonly=False, store=True)

3
custom_receipts_for_pos/security/ir.model.access.csv

@ -1,3 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_pos_receipt,access_pos_receipt,model_pos_receipt,base.group_user,1,1,1,1
access_pos_receipt_user,access.pos.receipt.user,model_pos_receipt,base.group_user,1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_pos_receipt access_pos_receipt_user access_pos_receipt access.pos.receipt.user model_pos_receipt base.group_user 1 1 1 1

BIN
custom_receipts_for_pos/static/description/assets/screenshots/1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 111 KiB

BIN
custom_receipts_for_pos/static/description/assets/screenshots/2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 63 KiB

BIN
custom_receipts_for_pos/static/description/assets/screenshots/3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 39 KiB

BIN
custom_receipts_for_pos/static/description/assets/screenshots/4.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 116 KiB

BIN
custom_receipts_for_pos/static/description/assets/screenshots/5.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

After

Width:  |  Height:  |  Size: 194 KiB

BIN
custom_receipts_for_pos/static/description/assets/screenshots/6.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 97 KiB

BIN
custom_receipts_for_pos/static/description/assets/screenshots/7.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 92 KiB

BIN
custom_receipts_for_pos/static/description/assets/screenshots/hero.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 KiB

After

Width:  |  Height:  |  Size: 224 KiB

156
custom_receipts_for_pos/static/description/index.html

@ -60,13 +60,13 @@
</div>
<div class="row py-4">
<div class="col-md-6 col-sm-12 p-3">
<div class="d-flex h-100" style="padding: 30px;border-radius: 12px;
<div class="d-flex h-100" style="padding: 30px;border-radius: 12px;
background: #FFF;
box-shadow: 1px 2px 3px 0px rgba(0, 0, 0, 0.25); ">
box-shadow: 1px 2px 3px 0px rgba(0, 0, 0, 0.25);">
<div style="width: 36px; height: 36px; border-radius: 50%; background: #714B67;
display: flex; justify-content: center; align-items: center;
margin-right: 10px; flex-shrink: 0;">
<i class="fa-solid fa-star " style="color: #fff;font-size:14px;"></i>
<i class="fa-solid fa-star" style="color: #fff;font-size:14px;"></i>
</div>
<div>
<p style="color: #1A202C;font-weight: 600;
@ -77,13 +77,13 @@
</div>
</div>
<div class="col-md-6 col-sm-12 p-3">
<div class="d-flex h-100" style="padding: 30px;border-radius: 12px;
<div class="d-flex h-100" style="padding: 30px;border-radius: 12px;
background: #FFF;
box-shadow: 1px 2px 3px 0px rgba(0, 0, 0, 0.25); ">
box-shadow: 1px 2px 3px 0px rgba(0, 0, 0, 0.25);">
<div style="width: 36px; height: 36px; border-radius: 50%; background: #714B67;
display: flex; justify-content: center; align-items: center;
margin-right: 10px; flex-shrink: 0;">
<i class="fa-solid fa-star " style="color: #fff;font-size:14px;"></i>
<i class="fa-solid fa-star" style="color: #fff;font-size:14px;"></i>
</div>
<div>
<p style="color: #1A202C;font-weight: 600;
@ -94,13 +94,13 @@
</div>
</div>
<div class="col-md-6 col-sm-12 p-3">
<div class="d-flex h-100" style="padding: 30px;border-radius: 12px;
<div class="d-flex h-100" style="padding: 30px;border-radius: 12px;
background: #FFF;
box-shadow: 1px 2px 3px 0px rgba(0, 0, 0, 0.25); ">
box-shadow: 1px 2px 3px 0px rgba(0, 0, 0, 0.25);">
<div style="width: 36px; height: 36px; border-radius: 50%; background: #714B67;
display: flex; justify-content: center; align-items: center;
margin-right: 10px; flex-shrink: 0;">
<i class="fa-solid fa-star " style="color: #fff;font-size:14px;"></i>
<i class="fa-solid fa-star" style="color: #fff;font-size:14px;"></i>
</div>
<div>
<p style="color: #1A202C;font-weight: 600;
@ -111,13 +111,13 @@
</div>
</div>
<div class="col-md-6 col-sm-12 p-3">
<div class="d-flex h-100" style="padding: 30px;border-radius: 12px;
<div class="d-flex h-100" style="padding: 30px;border-radius: 12px;
background: #FFF;
box-shadow: 1px 2px 3px 0px rgba(0, 0, 0, 0.25); ">
box-shadow: 1px 2px 3px 0px rgba(0, 0, 0, 0.25);">
<div style="width: 36px; height: 36px; border-radius: 50%; background: #714B67;
display: flex; justify-content: center; align-items: center;
margin-right: 10px; flex-shrink: 0; ">
<i class="fa-solid fa-star " style="color: #fff;font-size:14px;"></i>
margin-right: 10px; flex-shrink: 0;">
<i class="fa-solid fa-star" style="color: #fff;font-size:14px;"></i>
</div>
<div>
<p style="color: #1A202C;font-weight: 600;
@ -131,22 +131,22 @@
</div>
<div class="container rounded" >
<ul class="nav nav-tabs d-flex" style="width: fit-content;margin: 0 auto;gap: 1rem;">
<li class="col text-center py-2 text-nowrap "
<li class="col text-center py-2 text-nowrap"
style="color: #fff; background-color: #714B67;border-radius: 6px 6px 0px 0px;"><a
class="active show" data-toggle="tab" href="#tab1"
style="color: #fff;font-weight: 500; background-color: #714B67; text-decoration: none;">
<i class="fa-regular fa-image pr-2" style="color: #fff;"></i>
<i class="fa-regular fa-image pr-2" style="color: #fff;"></i>
Screenshots</a></li>
<li class="col text-center py-2 text-nowrap "
<li class="col text-center py-2 text-nowrap"
style="color: #fff; background-color: #714B67;border-radius: 6px 6px 0px 0px;"><a
data-toggle="tab" href="#tab2"
style="color: #fff;font-weight: 500; text-decoration: none;"><i
class="fa-solid fa-star pr-2" style="color: #fff;"></i>Features</a></li>
<li class="col text-center py-2 text-nowrap "
style="color: #fff;font-weight: 500; text-decoration: none;"><i
class="fa-solid fa-star pr-2" style="color: #fff;"></i>Features</a></li>
<li class="col text-center py-2 text-nowrap"
style="color: #fff; background-color: #714B67;border-radius: 6px 6px 0px 0px;"><a
data-toggle="tab" href="#tab3"
style="color: #fff;font-weight: 500; text-decoration: none; background-color: #714B67;"><i
class="fa-solid fa-book-open pr-2" style="color: #fff;"></i>Released Notes</a></li>
class="fa-solid fa-book-open pr-2" style="color: #fff;"></i>Released Notes</a></li>
</ul>
<div class="tab-content" style="background-color: rgba(121, 113, 119, 0.04);">
<div id="tab1" class="tab-pane fade in active show">
@ -170,7 +170,7 @@
</div>
<div class="col-lg-12 py-2" style="padding: 1rem 4rem !important;">
<div
style="border: 1px solid #d8d6d6; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
style="border: 1px solid #d8d6d6; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<div class="row justify-content-center p-3 w-100 m-0">
<img src="assets/screenshots/2.png" class="img-responsive" width="100%" height="auto">
</div>
@ -191,7 +191,7 @@
</div>
<div class="col-lg-12 py-2" style="padding: 1rem 4rem !important;">
<div
style="border: 1px solid #d8d6d6; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
style="border: 1px solid #d8d6d6; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<div class="row justify-content-center p-3 w-100 m-0">
<img src="assets/screenshots/4.png" class="img-responsive" width="100%" height="auto">
</div>
@ -209,7 +209,7 @@
</div>
<div class="col-lg-12 py-2" style="padding: 1rem 4rem !important;">
<div
style="border: 1px solid #d8d6d6; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
style="border: 1px solid #d8d6d6; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<div class="row justify-content-center p-3 w-100 m-0">
<img src="assets/screenshots/5.png" class="img-responsive" width="100%" height="auto">
</div>
@ -227,7 +227,7 @@
</div>
<div class="col-lg-12 py-2" style="padding: 1rem 4rem !important;">
<div
style="border: 1px solid #d8d6d6; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
style="border: 1px solid #d8d6d6; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<div class="row justify-content-center p-3 w-100 m-0">
<img src="assets/screenshots/6.png" class="img-responsive" width="30%" height="auto">
<img src="assets/screenshots/7.png" class="img-responsive" width="30%" height="auto">
@ -277,13 +277,37 @@
style="font-weight: 500;background-color: #fff; border-radius: 4px; padding: 1rem; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<div class="d-flex mb-3" style="font-size: 0.8rem; font-weight: 500;"><span>Version
17.0.1.0.0</span><span class="px-2">|</span><span
style="color: #714B67;font-weight: 600;">Released on:05th Feb 2024</span>
style="color: #714B67;font-weight: 600;">Released on: February 05, 2024</span>
</div>
<p class="m-0"
style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Initial Commit for POS Receipt Designs.</p>
</div>
</div>
<div class="col-mg-12 active" style="padding: 1rem 4rem;">
<div class="py-3"
style="font-weight: 500;background-color: #fff; border-radius: 4px; padding: 1rem; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<div class="d-flex mb-3" style="font-size: 0.8rem; font-weight: 500;"><span>Version
17.0.1.0.0</span><span class="px-2">|</span><span
style="color: #714B67;font-weight: 600;">Released on: April 17, 2024</span>
</div>
<p class="m-0"
style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Fixed the error in printing the receipt.</p>
</div>
</div>
<div class="col-mg-12 active" style="padding: 1rem 4rem;">
<div class="py-3"
style="font-weight: 500;background-color: #fff; border-radius: 4px; padding: 1rem; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<div class="d-flex mb-3" style="font-size: 0.8rem; font-weight: 500;"><span>Version
17.0.1.0.0</span><span class="px-2">|</span><span
style="color: #714B67;font-weight: 600;">Released on: May 21, 2024</span>
</div>
<p class="m-0"
style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Fix the receipt selection for each point of sales.</p>
</div>
</div>
</div>
</div>
</div>
@ -300,11 +324,11 @@
<div class="p-3">
<a href="https://apps.odoo.com/apps/modules/17.0/invoice_format_editor/" style="color: #000; text-decoration: none;">
<div style="border:1px solid #CBCBCB !important;border-radius: 4px;">
<div style="width: 300px; ">
<div style="width: 300px;">
<img src="assets/modules/1.png" alt="" width="100%" height="auto">
</div>
<p class="text-center pt-2 text-black font-weight-bold">Manufacturing Reports</p>
<p class="text-center pt-2 text-black font-weight-bold">Odoo17 Invoice Format Editor</p>
</div>
</a>
</div>
@ -313,11 +337,11 @@
<div class="p-3">
<a href="https://apps.odoo.com/apps/modules/17.0/pos_book_order/" style="color: #000; text-decoration: none;">
<div style="border:1px solid #CBCBCB !important;border-radius: 4px;">
<div style="width: 300px; ">
<div style="width: 300px;">
<img src="assets/modules/2.png" alt="" width="100%" height="auto">
</div>
<p class="text-center pt-2 text-black font-weight-bold">Print Work Order Details</p>
<p class="text-center pt-2 text-black font-weight-bold">POS Booking Order</p>
</div>
</a>
</div>
@ -326,11 +350,11 @@
<div class="p-3">
<a href="https://apps.odoo.com/apps/modules/17.0/pos_magnify_image/" style="color: #000; text-decoration: none;">
<div style="border:1px solid #CBCBCB !important;border-radius: 4px;">
<div style="width: 300px; ">
<div style="width: 300px;">
<img src="assets/modules/3.png" alt="" width="100%" height="auto">
</div>
<p class="text-center pt-2 text-black font-weight-bold">Show Total Cost On BOM</p>
<p class="text-center pt-2 text-black font-weight-bold">Pos Product Magnify Image</p>
</div>
</a>
</div>
@ -343,11 +367,11 @@
<div class="p-3">
<a href="https://apps.odoo.com/apps/modules/17.0/pos_mrp_order/" style="color: #000; text-decoration: none;">
<div style="border:1px solid #CBCBCB !important;border-radius: 4px;">
<div style="width: 300px; ">
<div style="width: 300px;">
<img src="assets/modules/4.png" alt="" width="100%" height="auto">
</div>
<p class="text-center pt-2 text-black font-weight-bold">Simple Manufacturing Orders</p>
<p class="text-center pt-2 text-black font-weight-bold">Make MRP Orders from POS</p>
</div>
</a>
</div>
@ -360,7 +384,7 @@
<img src="assets/modules/5.png" alt="" width="100%" height="auto">
</div>
<p class="text-center pt-2 text-black font-weight-bold">BOM Multiple Product Selection</p>
<p class="text-center pt-2 text-black font-weight-bold">Service Charges POS</p>
</div>
</a>
</div>
@ -372,7 +396,7 @@
<div style="width: 300px;">
<img src="assets/modules/6.png" alt="" width="100%" height="auto">
</div>
<p class="text-center pt-2 text-black font-weight-bold"> Catch Weight Management: Manufacturing</p>
<p class="text-center pt-2 text-black font-weight-bold">Make MRP Orders from POS</p>
</div>
</a>
</div>
@ -401,9 +425,9 @@
<div class="row py-3">
<div class="col-md-4 col-sm-6 px-4 py-4">
<div
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; position: relative;border-radius: 4px;">
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; position: relative;border-radius: 4px;">
<div style="position: absolute; top: 0%; left: 50%; transform: translate(-50%, -50%);">
<div style="background-color:#13EA36 ; border-radius: 50%; padding: 15px; width: 68px;
<div style="background-color:#13EA36 ; border-radius: 50%; padding: 15px; width: 68px;
height: 68px; display: inline-block; box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);">
<img src="assets/icons/cogs.png" alt="service-icon" width="38px" height="auto">
</div>
@ -415,7 +439,7 @@
<div
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; position: relative;border-radius: 4px;">
<div style="position: absolute; top: 0%; left: 50%; transform: translate(-50%, -50%);">
<div style="background-color:#DBC711; border-radius: 50%; padding: 15px; width: 68px;
<div style="background-color:#DBC711; border-radius: 50%; padding: 15px; width: 68px;
height: 68px; display: inline-block; box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);">
<img src="assets/icons/wrench.png" alt="service-icon" width="38px" height="auto">
</div>
@ -425,9 +449,9 @@
</div>
<div class="col-md-4 col-sm-6 px-4 py-4">
<div
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; position: relative; border-radius: 4px;">
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; position: relative; border-radius: 4px;">
<div style="position: absolute; top: 0%; left: 50%; transform: translate(-50%, -50%);">
<div style="background-color:#FF6B6B ; border-radius: 50%; padding: 15px; width: 68px;
<div style="background-color:#FF6B6B ; border-radius: 50%; padding: 15px; width: 68px;
height: 68px; display: inline-block; box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);">
<img src="assets/icons/lifebuoy.png" alt="service-icon" width="38px" height="auto">
</div>
@ -439,7 +463,7 @@
<div
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; position: relative; border-radius: 4px;">
<div style="position: absolute; top: 0%; left: 50%; transform: translate(-50%, -50%);">
<div style="background-color:#FFA801 ; border-radius: 50%; padding: 15px; width: 68px;
<div style="background-color:#FFA801 ; border-radius: 50%; padding: 15px; width: 68px;
height: 68px; display: inline-block; box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);">
<img src="assets/icons/user.png" alt="service-icon" width="38px" height="auto">
</div>
@ -449,10 +473,10 @@
</div>
<div class="col-md-4 col-sm-6 px-4 py-4">
<div
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; position: relative; border-radius: 4px;">
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; position: relative; border-radius: 4px;">
<div style="position: absolute; top: 0%; left: 50%; transform: translate(-50%, -50%);">
<div style="background-color:#54A0FF; border-radius: 50%; padding: 15px; width: 68px;
<div style="background-color:#54A0FF; border-radius: 50%; padding: 15px; width: 68px;
height: 68px; display: inline-block; box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);">
<img src="assets/icons/puzzle.png" alt="service-icon" width="38px" height="auto">
</div>
@ -462,9 +486,9 @@
</div>
<div class="col-md-4 col-sm-6 px-4 py-4">
<div
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; position: relative;border-radius: 4px;">
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; position: relative;border-radius: 4px;">
<div style="position: absolute; top: 0%; left: 50%; transform: translate(-50%, -50%);">
<div style="background-color:#6D7680 ; border-radius: 50%; padding: 15px; width: 68px;
<div style="background-color:#6D7680 ; border-radius: 50%; padding: 15px; width: 68px;
height: 68px; display: inline-block; box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);">
<img src="assets/icons/update.png" alt="service-icon" width="38px" height="auto">
</div>
@ -474,9 +498,9 @@
</div>
<div class="col-md-4 col-sm-6 px-4 py-4">
<div
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; position: relative;border-radius: 4px;">
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; position: relative;border-radius: 4px;">
<div style="position: absolute; top: 0%; left: 50%; transform: translate(-50%, -50%);">
<div style="background-color:#786FA6 ; border-radius: 50%; padding: 15px; width: 68px;
<div style="background-color:#786FA6 ; border-radius: 50%; padding: 15px; width: 68px;
height: 68px; display: inline-block; box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);">
<img src="assets/icons/consultation.png" alt="service-icon" width="38px" height="auto">
</div>
@ -488,7 +512,7 @@
<div
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px;position: relative;border-radius: 4px;">
<div style="position: absolute; top: 0%; left: 50%; transform: translate(-50%, -50%);">
<div style="background-color:#F8A5C2 ; border-radius: 50%; padding: 15px; width: 68px;
<div style="background-color:#F8A5C2 ; border-radius: 50%; padding: 15px; width: 68px;
height: 68px; display: inline-block; box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);">
<img src="assets/icons/training.png" alt="service-icon" width="38px" height="auto">
</div>
@ -498,9 +522,9 @@
</div>
<div class="col-md-4 col-sm-6 px-4 py-4">
<div
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; position: relative;border-radius: 4px;">
style="background-color: #fff; padding: 25px; text-align: center; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px; position: relative;border-radius: 4px;">
<div style="position: absolute; top: 0%; left: 50%; transform: translate(-50%, -50%);">
<div style="background-color:#E6BE26; border-radius: 50%; padding: 15px; width: 68px;
<div style="background-color:#E6BE26; border-radius: 50%; padding: 15px; width: 68px;
height: 68px; display: inline-block; box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);">
<img src="assets/icons/license.png" alt="service-icon" width="38px" height="auto">
</div>
@ -519,35 +543,35 @@
<div class="container">
<div class="row my-5 py-4">
<div class="col-md-3 col-sm-6 p-0">
<div class="d-flex flex-column h-100 "
style="border-right: 1px solid rgb(209, 209, 209); border-bottom: 1px solid rgb(209, 209, 209); padding: 30px; box-shadow: 6px 0 10px rgba(228, 227, 227, 0.373);">
<div class="d-flex flex-column h-100"
style="border-right: 1px solid rgb(209, 209, 209); border-bottom: 1px solid rgb(209, 209, 209); padding: 30px; box-shadow: 6px 0 10px rgba(228, 227, 227, 0.373);">
<img src="assets/icons/trading-black.png" width="42px" height="auto" alt="">
<p style="color: #714B67;font-weight: 600; margin-top: 10px;
font-size: 1.2rem; margin-bottom: 2px;">Trading</p>
<p>Easily procure and sell your products</p>
</div>
</div>
<div class="col-md-3 col-sm-6 p-0">
<div class="col-md-3 col-sm-6 p-0">
<div class="d-flex flex-column h-100"
style="border-right: 1px solid rgb(209, 209, 209);border-bottom: 1px solid rgb(209, 209, 209); padding: 30px;">
style="border-right: 1px solid rgb(209, 209, 209);border-bottom: 1px solid rgb(209, 209, 209); padding: 30px;">
<img src="assets/icons/pos-black.png" width="42px" height="auto" alt="">
<p style="color: #714B67;font-weight: 600; margin-top: 10px;
font-size: 1.2rem; margin-bottom: 2px;">POS</p>
<p>Easy configuration and convivial experience</p>
</div>
</div>
<div class="col-md-3 col-sm-6 p-0">
<div class="col-md-3 col-sm-6 p-0">
<div class="d-flex flex-column h-100"
style="border-right: 1px solid rgb(209, 209, 209);border-bottom: 1px solid rgba(0, 0, 0, 0.2); padding: 30px; box-shadow: 0 5px 10px rgba(228, 227, 227, 0.373)">
style="border-right: 1px solid rgb(209, 209, 209);border-bottom: 1px solid rgba(0, 0, 0, 0.2); padding: 30px; box-shadow: 0 5px 10px rgba(228, 227, 227, 0.373)">
<img src="assets/icons/education-black.png" width="42px" height="auto" alt="">
<p style="color: #714B67;font-weight: 600; margin-top: 10px;
font-size: 1.2rem; margin-bottom: 2px;">Education</p>
<p>A platform for educational management</p>
</div>
</div>
<div class="col-md-3 col-sm-6 p-0">
<div class="col-md-3 col-sm-6 p-0">
<div class="d-flex flex-column h-100"
style="border-bottom: 1px solid rgb(209, 209, 209); padding: 30px; ">
style="border-bottom: 1px solid rgb(209, 209, 209); padding: 30px;">
<img src="assets/icons/manufacturing-black.png" width="42px" height="auto" alt="">
<p style="color: #714B67;font-weight: 600; margin-top: 10px;
font-size: 1.2rem; margin-bottom: 2px;">Manufacturing</p>
@ -556,34 +580,34 @@
</div>
<div class="col-md-3 col-sm-6 p-0">
<div class="d-flex flex-column h-100"
style="border-right: 1px solid rgb(209, 209, 209); padding: 30px;">
style="border-right: 1px solid rgb(209, 209, 209); padding: 30px;">
<img src="assets/icons/ecom-black.png" width="42px" height="auto" alt="">
<p style="color: #714B67;font-weight: 600; margin-top: 10px;
font-size: 1.2rem; margin-bottom: 2px;">E-commerce & Website</p>
<p>Mobile friendly, awe-inspiring product pages</p>
</div>
</div>
<div class="col-md-3 col-sm-6 p-0">
<div class="col-md-3 col-sm-6 p-0">
<div class="d-flex flex-column h-100"
style="border-right: 1px solid rgb(209, 209, 209); padding: 30px;box-shadow: 0 -5px 10px rgba(228, 227, 227, 0.373);">
style="border-right: 1px solid rgb(209, 209, 209); padding: 30px;box-shadow: 0 -5px 10px rgba(228, 227, 227, 0.373);">
<img src="assets/icons/service-black.png" width="42px" height="auto" alt="">
<p style="color: #714B67;font-weight: 600; margin-top: 10px;
font-size: 1.2rem; margin-bottom: 2px;">Service Management</p>
<p>Keep track of services and invoice</p>
</div>
</div>
<div class="col-md-3 col-sm-6 p-0">
<div class="col-md-3 col-sm-6 p-0">
<div class="d-flex flex-column h-100"
style="border-right: 1px solid rgb(209, 209, 209); padding: 30px; ">
style="border-right: 1px solid rgb(209, 209, 209); padding: 30px;">
<img src="assets/icons/restaurant-black.png" width="42px" height="auto" alt="">
<p style="color: #714B67;font-weight: 600; margin-top: 10px;
font-size: 1.2rem; margin-bottom: 2px;">Restaurant</p>
<p>Run your bar or restaurant methodically</p>
</div>
</div>
<div class="col-md-3 col-sm-6 p-0">
<div class="col-md-3 col-sm-6 p-0">
<div class="d-flex flex-column h-100"
style=" padding: 30px;box-shadow: -5px 0 10px rgba(228, 227, 227, 0.373);">
style=" padding: 30px;box-shadow: -5px 0 10px rgba(228, 227, 227, 0.373);">
<img src="assets/icons/hotel-black.png" width="42px" height="auto" alt="">
<p style="color: #714B67;font-weight: 600; margin-top: 10px;
font-size: 1.2rem; margin-bottom: 2px;">Hotel Management</p>
@ -599,7 +623,7 @@
</div>
<div class="container my-5">
<div class="row" style="background-color: #FFFAFE;">
<div class="col-md-6 pb-4 d-flex align-items-center justify-content-center"
<div class="col-md-6 pb-4 d-flex align-items-center justify-content-center"
style="border-right: 1px solid #D9D9D9;">
<div style="padding: 30px;">
<div class="d-flex align-items-center">

29
custom_receipts_for_pos/static/src/js/receipt_design.js

@ -1,40 +1,37 @@
/** @odoo-module */
import { OrderReceipt } from "@point_of_sale/app/screens/receipt_screen/receipt/order_receipt";
import { patch } from "@web/core/utils/patch";
import { Orderline } from "@point_of_sale/app/generic_components/orderline/orderline";
import { useState, Component, xml } from "@odoo/owl";
import { useService } from "@web/core/utils/hooks";
patch(OrderReceipt.prototype, {
setup(){
super.setup();
this.state = useState({
template: true,
})
this.state = useState({
template: true,
})
this.pos = useState(useService("pos"));
},
get templateProps() {
return {
data: this.props.data,
order: this.pos.orders,
receipt: this.pos.orders[0].export_for_printing(),
orderlines:this.pos.orders[0].get_orderlines(),
paymentlines:this.pos.orders[0].get_paymentlines()
}
data: this.props.data,
order: this.pos.orders,
receipt: this.pos.orders[0].export_for_printing(),
orderlines:this.pos.orders[0].get_orderlines(),
paymentlines:this.pos.orders[0].get_paymentlines()
};
},
get templateComponent() {
var mainRef = this
var mainRef = this;
return class extends Component {
setup() {}
static template = xml`${mainRef.pos.config.design_receipt}`
}
};
},
get isTrue() {
if (this.env.services.pos.config.is_custom_receipt == false) {
return true
}
else {
return false
return true;
}
return false;
}
});

12
custom_receipts_for_pos/static/src/xml/receipt_design_template_views.xml → custom_receipts_for_pos/static/src/xml/order_receipt.xml

@ -10,12 +10,12 @@
<t t-set="line" t-value="scope.line"/>
<Orderline line="omit(scope.line, 'customerNote')"
class="{ 'pe-none': true }">
<li t-if="line.customerNote"
class="customer-note w-100 p-2 my-1 rounded text-break">
<i class="fa fa-sticky-note me-1" role="img"
aria-label="Customer Note" title="Customer Note"/>
<t t-esc="line.customerNote"/>
</li>
<li t-if="line.customerNote"
class="customer-note w-100 p-2 my-1 rounded text-break">
<i class="fa fa-sticky-note me-1" role="img"
aria-label="Customer Note" title="Customer Note"/>
<t t-esc="line.customerNote"/>
</li>
<ul t-if="line.pack_lot_lines">
<li t-foreach="line.pack_lot_lines" t-as="lot"
t-key="lot.cid">

15
custom_receipts_for_pos/views/point_of_sale_views.xml

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--Inherit the menu for pos receipt-->
<record id="action_pos_receipt" model="ir.actions.act_window">
<field name="name">Receipt Designs</field>
<field name="res_model">pos.receipt</field>
<field name="view_mode">tree,form</field>
<field name="target">current</field>
</record>
<menuitem
id="menu_pos_receipt"
parent="point_of_sale.menu_point_config_product"
action="action_pos_receipt"
sequence="50"/>
</odoo>

29
custom_receipts_for_pos/views/pos_config_views.xml

@ -1,29 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<!--Inherit pos.config for giving the fields in configuration for custom
receipt design-->
<record id="pos_config_receipt_view" model="ir.ui.view">
<field name="name">pos.config.view</field>
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.pos_config_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='order_reference']" position="after">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="is_custom_receipt"/>
</div>
<div class="o_setting_right_pane">
<label for="receipt_design"/>
<div class="text-muted">
Use Custom Receipt Design
</div>
<div class="content-group mt16">
<field name="receipt_design"
attrs="{'invisible': [('is_custom_receipt', '=', False)]}"/>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

23
custom_receipts_for_pos/views/pos_receipt_views.xml

@ -1,22 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!--Inherit pos.receipt for giving the fields of name and design_receipt-->
<record id="pos_receipt_form" model="ir.ui.view">
<field name="name">pos.receipt.form</field>
<!-- Form view for the model `pos.receipt` -->
<record id="pos_receipt_view_form" model="ir.ui.view">
<field name="name">pos.receipt.view.form</field>
<field name="model">pos.receipt</field>
<field name="arch" type="xml">
<form string="Receipt Designs">
<sheet>
<group>
<field name="name"/>
<field name="design_receipt" widget="ace" options="{'mode': 'xml'}"
/>
<field name="design_receipt" widget="code" options="{'mode': 'xml'}"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="pos_receipt_tree" model="ir.ui.view">
<!-- Tree view for the model `pos.receipt` -->
<record id="pos_receipt_view_tree" model="ir.ui.view">
<field name="name">pos.receipt.view.tree</field>
<field name="model">pos.receipt</field>
<field name="arch" type="xml">
<tree string="Receipt Designs">
@ -24,4 +25,14 @@
</tree>
</field>
</record>
<!-- Add action window for `pos.receipt` -->
<record id="pos_receipt_action" model="ir.actions.act_window">
<field name="name">Receipt Designs</field>
<field name="res_model">pos.receipt</field>
<field name="view_mode">tree,form</field>
<field name="target">current</field>
</record>
<!-- Add menu for `pos.receipt` -->
<menuitem name="Receipt Designs" id="pos_receipt_menu_action" parent="point_of_sale.menu_point_config_product"
action="pos_receipt_action" sequence="50"/>
</odoo>

8
custom_receipts_for_pos/views/res_config_settings_views.xml

@ -3,7 +3,7 @@
<!--Inherit res.config.settings for giving the fields in configuration
settings-->
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.point_of_sale</field>
<field name="name">res.config.settings.view.form.inherit.custom.receipts.for.pos</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="95"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
@ -20,12 +20,10 @@
Use Custom Receipt Design
</div>
<div class="content-group mt16">
<field name="pos_receipt_design"
invisible="not pos_is_custom_receipt"/>
<field name="pos_receipt_design" invisible="not pos_is_custom_receipt" required="pos_is_custom_receipt"/>
</div>
<div class="content-group mt16">
<field name="pos_design_receipt"
invisible="1"/>
<field name="pos_design_receipt" invisible="1"/>
</div>
</div>
</div>

Loading…
Cancel
Save