diff --git a/custom_receipts_for_pos/README.rst b/custom_receipts_for_pos/README.rst new file mode 100644 index 000000000..f3a2d10ab --- /dev/null +++ b/custom_receipts_for_pos/README.rst @@ -0,0 +1,42 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Custom Receipts For POS +======================= +Option to select the customised receipts for each POS + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License v3.0 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developer: (V14) Syamili 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 `__ + +Further information +=================== +HTML Description: ``__ \ No newline at end of file diff --git a/custom_receipts_for_pos/__init__.py b/custom_receipts_for_pos/__init__.py new file mode 100644 index 000000000..c5d3dd3d8 --- /dev/null +++ b/custom_receipts_for_pos/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Syamili K () +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +from . import models diff --git a/custom_receipts_for_pos/__manifest__.py b/custom_receipts_for_pos/__manifest__.py new file mode 100644 index 000000000..4b9d2ae54 --- /dev/null +++ b/custom_receipts_for_pos/__manifest__.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Syamili K () +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +{ + 'name': 'Custom Receipts For POS', + 'version': '14.0.1.0.0', + 'category': 'Point of Sale', + 'summary': """Customisable receipt for POS""", + 'description': "This module IS used for to select the customised receipts " + "for POS.", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'point_of_sale'], + 'data': [ + 'security/ir.model.access.csv', + 'data/pos_receipt_data.xml', + 'views/pos_receipt_views.xml', + 'views/pos_config_views.xml', + 'views/assets.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/custom_receipts_for_pos/data/pos_receipt_data.xml b/custom_receipts_for_pos/data/pos_receipt_data.xml new file mode 100644 index 000000000..404d1e69b --- /dev/null +++ b/custom_receipts_for_pos/data/pos_receipt_data.xml @@ -0,0 +1,150 @@ + + + + + Design + +
+ + +
+
+ +

+ +

+
+
+
+ +
+ +
+
+ +
Tel: + +
+
+ +
: + +
+
+ +
+ +
+
+ +
+ +
+
+ + + + +
+ +
+
+
--------------------------------
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + +
+ Product + Qty + Unit Price + + Amount +
+ + + + + + + +
+
+
+ Total : + + +
+
+ +
+ + +
+
+
+
+ Change + +
+
+ +
+ Discounts + +
+
+
+ Total Taxes + +
+
+ +
Date : + +
+
+ +
--------------------------------
+
+
Served by + +
+
+
+
+ Thank you. Please visit + again!! + +
+
+
+
+
\ No newline at end of file diff --git a/custom_receipts_for_pos/doc/RELEASE_NOTES.md b/custom_receipts_for_pos/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..0f2f24b42 --- /dev/null +++ b/custom_receipts_for_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 18.07.2023 +#### Version 14.0.1.0.0 +#### ADD +- Initial Commit for Custom Receipts For POS diff --git a/custom_receipts_for_pos/models/__init__.py b/custom_receipts_for_pos/models/__init__.py new file mode 100644 index 000000000..b533a647c --- /dev/null +++ b/custom_receipts_for_pos/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Syamili K () +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +from . import pos_config +from . import pos_receipt diff --git a/custom_receipts_for_pos/models/pos_config.py b/custom_receipts_for_pos/models/pos_config.py new file mode 100644 index 000000000..7d93ce279 --- /dev/null +++ b/custom_receipts_for_pos/models/pos_config.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Syamili K () +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +from odoo import fields, models + + +class PosConfig(models.Model): + """Add new fields in pos.config for enable the option and then select + any design.""" + _inherit = "pos.config" + + receipt_design_id = fields.Many2one('pos.receipt', string="Receipt Design", + help="Choose any receipt design", + required=True) + design_receipt = fields.Text(related='receipt_design_id.design_receipt', + string='Receipt XML', + help="Write xml code for generate new receipt " + "design") + is_custom_receipt = fields.Boolean(string='Custom Receipt', + help="Enable option for use customised " + "design.") diff --git a/custom_receipts_for_pos/models/pos_receipt.py b/custom_receipts_for_pos/models/pos_receipt.py new file mode 100644 index 000000000..433633ea0 --- /dev/null +++ b/custom_receipts_for_pos/models/pos_receipt.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Syamili K () +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +from odoo import fields, models + + +class PosReceipt(models.Model): + """New model for create POS receipt designs.""" + _name = 'pos.receipt' + _description = 'POS Receipt' + + name = fields.Char(string='Name', help="Provide a name for record") + design_receipt = fields.Text(string='Receipt XML', + help='Add your customised receipt design ' + 'for POS') diff --git a/custom_receipts_for_pos/security/ir.model.access.csv b/custom_receipts_for_pos/security/ir.model.access.csv new file mode 100644 index 000000000..868b07ca4 --- /dev/null +++ b/custom_receipts_for_pos/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_pos_receipt,access.pos.receipt,model_pos_receipt,base.group_user,1,1,1,1 diff --git a/custom_receipts_for_pos/static/description/assets/icons/check.png b/custom_receipts_for_pos/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/check.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/chevron.png b/custom_receipts_for_pos/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/chevron.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/cogs.png b/custom_receipts_for_pos/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/cogs.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/consultation.png b/custom_receipts_for_pos/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/consultation.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/ecom-black.png b/custom_receipts_for_pos/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/ecom-black.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/education-black.png b/custom_receipts_for_pos/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/education-black.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/hotel-black.png b/custom_receipts_for_pos/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/hotel-black.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/license.png b/custom_receipts_for_pos/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/license.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/lifebuoy.png b/custom_receipts_for_pos/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/lifebuoy.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/logo.png b/custom_receipts_for_pos/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/logo.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/manufacturing-black.png b/custom_receipts_for_pos/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/manufacturing-black.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/pos-black.png b/custom_receipts_for_pos/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/pos-black.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/puzzle.png b/custom_receipts_for_pos/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/puzzle.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/restaurant-black.png b/custom_receipts_for_pos/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/restaurant-black.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/service-black.png b/custom_receipts_for_pos/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/service-black.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/trading-black.png b/custom_receipts_for_pos/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/trading-black.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/training.png b/custom_receipts_for_pos/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/training.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/update.png b/custom_receipts_for_pos/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/update.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/user.png b/custom_receipts_for_pos/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/user.png differ diff --git a/custom_receipts_for_pos/static/description/assets/icons/wrench.png b/custom_receipts_for_pos/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/icons/wrench.png differ diff --git a/custom_receipts_for_pos/static/description/assets/modules/1.png b/custom_receipts_for_pos/static/description/assets/modules/1.png new file mode 100644 index 000000000..dd2b204a3 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/modules/1.png differ diff --git a/custom_receipts_for_pos/static/description/assets/modules/2.png b/custom_receipts_for_pos/static/description/assets/modules/2.png new file mode 100644 index 000000000..77027975a Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/modules/2.png differ diff --git a/custom_receipts_for_pos/static/description/assets/modules/3.png b/custom_receipts_for_pos/static/description/assets/modules/3.png new file mode 100644 index 000000000..c69345cd3 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/modules/3.png differ diff --git a/custom_receipts_for_pos/static/description/assets/modules/4.png b/custom_receipts_for_pos/static/description/assets/modules/4.png new file mode 100644 index 000000000..3112016bc Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/modules/4.png differ diff --git a/custom_receipts_for_pos/static/description/assets/modules/5.png b/custom_receipts_for_pos/static/description/assets/modules/5.png new file mode 100644 index 000000000..a24c1d8b3 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/modules/5.png differ diff --git a/custom_receipts_for_pos/static/description/assets/modules/6.png b/custom_receipts_for_pos/static/description/assets/modules/6.png new file mode 100644 index 000000000..3dd28d536 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/modules/6.png differ diff --git a/custom_receipts_for_pos/static/description/assets/screenshots/pos.gif b/custom_receipts_for_pos/static/description/assets/screenshots/pos.gif new file mode 100644 index 000000000..b115334c0 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/screenshots/pos.gif differ diff --git a/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_1.png b/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_1.png new file mode 100644 index 000000000..fee9026b2 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_1.png differ diff --git a/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_2.png b/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_2.png new file mode 100644 index 000000000..c3bf8aac4 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_2.png differ diff --git a/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_3.png b/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_3.png new file mode 100644 index 000000000..919ca931f Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_3.png differ diff --git a/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_4.png b/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_4.png new file mode 100644 index 000000000..6f8f41651 Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_4.png differ diff --git a/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_5.png b/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_5.png new file mode 100644 index 000000000..2296dc2ed Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_5.png differ diff --git a/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_6.png b/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_6.png new file mode 100644 index 000000000..9e024a7bc Binary files /dev/null and b/custom_receipts_for_pos/static/description/assets/screenshots/pos_receipt_design_6.png differ diff --git a/custom_receipts_for_pos/static/description/banner.jpg b/custom_receipts_for_pos/static/description/banner.jpg new file mode 100644 index 000000000..da9eea8e7 Binary files /dev/null and b/custom_receipts_for_pos/static/description/banner.jpg differ diff --git a/custom_receipts_for_pos/static/description/cybro_logo.png b/custom_receipts_for_pos/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/custom_receipts_for_pos/static/description/cybro_logo.png differ diff --git a/custom_receipts_for_pos/static/description/icon.png b/custom_receipts_for_pos/static/description/icon.png new file mode 100644 index 000000000..eb4a168f5 Binary files /dev/null and b/custom_receipts_for_pos/static/description/icon.png differ diff --git a/custom_receipts_for_pos/static/description/index.html b/custom_receipts_for_pos/static/description/index.html new file mode 100644 index 000000000..f2fcc0f92 --- /dev/null +++ b/custom_receipts_for_pos/static/description/index.html @@ -0,0 +1,604 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+ +
+
+
+

+ Custom Receipts For POS

+

+ Option to select the customised Receipts for POS.

+ +
+
+ + + +
+
+

+ Overview +

+
+ +
+

+ In this module POS Receipt Design user can add receipt designs from the backend, and we can choose the receipt designs for each POS, + And we can view the different receipts for each POS.

+
+
+
+
+

+ Features +

+
+ +
+
+ +
+
+

+ User can add the receipt designs from the backend in the menu Receipt Designs.

+
+
+ +
+
+ +
+
+

+ User can choose whether the current pos needs custom receipt design

+
+
+ +
+
+ +
+
+

+ We can see that chosen receipt in frontend of the POS .

+
+
+ +
+
+ +
+
+

+ We can edit the receipt design from the backend of the POS.

+
+
+ + +
+ +
+
+

+ Screenshots +

+
+
+

+ Default Receipt of POS

+

+ This is the default receipt of POS. +

+ +
+
+

+ Receipt Designs

+

+ We can add the Receipt designs from the backend in the menu 'Receipt Designs'. +

+ +


+ We can create Receipt designs from here. +

+ +


+ Here we can give name and XML code for our design. +

+ +
+ +
+

+ Choose receipt design for POS.

+

+ We can choose the receipt design for each POS from the backend of the pos. +

+ +
+ +
+

+ Chosen receipt in the frontend

+

+ We can see the chosen receipts for the POS in the frontend of the POS, It will vary as per we're choosing from the Backend for each POS. +

+ +
+ +
+ +
+
+

Suggested Products

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

Our Services

+
+
+ +
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + + +
+
+
+

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

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

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
diff --git a/custom_receipts_for_pos/static/src/js/order_receipt.js b/custom_receipts_for_pos/static/src/js/order_receipt.js new file mode 100644 index 000000000..8ceda0d0b --- /dev/null +++ b/custom_receipts_for_pos/static/src/js/order_receipt.js @@ -0,0 +1,44 @@ +odoo.define('custom_receipts_for_pos.design_receipt',function(require){ + "use strict" + const Registries = require('point_of_sale.Registries'); + var PosDB = require("point_of_sale.DB"); + const OrderReceipt = require('point_of_sale.OrderReceipt'); + const { onMounted } = owl.hooks; + /*The function is used to add method init to an existing object PosDB.*/ + PosDB.include({ + init:function(options) + { + this._super(options); + this.receipt_design_id=null; + }, + }) + /* Extends OrderReceipt to add new designs for receipt, here call the + template of customised record and add to the registry.*/ + const PosResOrderReceipt = OrderReceipt => + class extends OrderReceipt { + constructor() { + super(...arguments); + onMounted(() =>{ + if(this.env.pos.config.is_custom_receipt){ + var receipt_design_id=this.env.pos.config.design_receipt + var order=this._receiptEnv.order; + var data={ + widget:this.env, + pos:order.pos, + order:order, + receipt:order.export_for_printing(), + orderlines:order.get_orderlines(), + paymentlines:order.get_paymentlines(), + moment:moment, + }; + var xmlDoc=new DOMParser().parseFromString(receipt_design_id,"text/xml"); + var newXmlStr=new XMLSerializer().serializeToString(xmlDoc); + var qweb=new QWeb2.Engine(); + qweb.add_template(''+newXmlStr+''); + var receipt=qweb.render('receipt_design_id',data);$('div.pos-receipt').replaceWith(receipt); + } + }) + } + } + Registries.Component.extend(OrderReceipt, PosResOrderReceipt) +}); \ No newline at end of file diff --git a/custom_receipts_for_pos/views/assets.xml b/custom_receipts_for_pos/views/assets.xml new file mode 100644 index 000000000..b3ae697fb --- /dev/null +++ b/custom_receipts_for_pos/views/assets.xml @@ -0,0 +1,9 @@ + + + +