diff --git a/pos_invoice_automate/README.rst b/pos_invoice_automate/README.rst new file mode 100644 index 000000000..e46133160 --- /dev/null +++ b/pos_invoice_automate/README.rst @@ -0,0 +1,43 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +POS Automate Invoice +==================== +POS Automate Invoice + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: Noorjahan @cybrosys + +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: ``__ + + diff --git a/pos_invoice_automate/__init__.py b/pos_invoice_automate/__init__.py new file mode 100644 index 000000000..69f10b833 --- /dev/null +++ b/pos_invoice_automate/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/pos_invoice_automate/__manifest__.py b/pos_invoice_automate/__manifest__.py new file mode 100644 index 000000000..5df1da854 --- /dev/null +++ b/pos_invoice_automate/__manifest__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +{ + 'name': 'POS Automate Invoice', + 'version': '15.0.1.0.0', + 'summary': """To manage the POS Invoice Automatically""", + 'description': """To manage the POS Invoice Automatically""", + 'category': 'Sales', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'depends': ['point_of_sale'], + 'website': 'https://www.cybrosys.com', + 'data': [ + 'data/send_mail_template.xml', + 'data/send_mail_cron.xml', + 'views/pos_config.xml', + 'views/pos_order.xml' + ], + 'assets': { + 'point_of_sale.assets': [ + 'pos_invoice_automate/static/src/js/models.js', + 'pos_invoice_automate/static/src/js/PaymentScreen.js', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_invoice_automate/data/send_mail_cron.xml b/pos_invoice_automate/data/send_mail_cron.xml new file mode 100644 index 000000000..acf01ce70 --- /dev/null +++ b/pos_invoice_automate/data/send_mail_cron.xml @@ -0,0 +1,9 @@ + + + + POS: Send Invoice By Email + + code + False + + \ No newline at end of file diff --git a/pos_invoice_automate/data/send_mail_template.xml b/pos_invoice_automate/data/send_mail_template.xml new file mode 100644 index 000000000..b0946243a --- /dev/null +++ b/pos_invoice_automate/data/send_mail_template.xml @@ -0,0 +1,26 @@ + + + + + Invoice + + Invoice {{ object.name }} + {{ object.partner_id.id }} + +
+

+ Dear , +

+ Here is the invoice for your Order +
+ Best regards, +
+ +

+
+
+ {{ object.partner_id.lang }} + +
+
+
\ No newline at end of file diff --git a/pos_invoice_automate/doc/RELEASE_NOTES.md b/pos_invoice_automate/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..84eef015a --- /dev/null +++ b/pos_invoice_automate/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 11.08.2022 +#### Version 15.0.1.0.0 +#### ADD + +Initial Commit. \ No newline at end of file diff --git a/pos_invoice_automate/models/__init__.py b/pos_invoice_automate/models/__init__.py new file mode 100644 index 000000000..9ae0693bd --- /dev/null +++ b/pos_invoice_automate/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import pos_config +from . import pos_order diff --git a/pos_invoice_automate/models/pos_config.py b/pos_invoice_automate/models/pos_config.py new file mode 100644 index 000000000..ac178f818 --- /dev/null +++ b/pos_invoice_automate/models/pos_config.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields + + +class PosConfig(models.Model): + _inherit = 'pos.config' + + button_operation = fields.Selection(selection=[ + ('download', 'Download'), + ('send', 'Send By Email'), + ('download_send_mail', 'Download & Send By Email') + ], string='Button Operation', help='The invoice button operation') + interval = fields.Integer(help='Time interval for the cron scheduler') + period = fields.Selection(selection=[ + ('minutes', 'Minute'), + ('hours', 'Hour'), + ('days', 'Day'), + ('weeks', 'Week'), + ('months', 'Months') + ], string='Period', help='Period for the cron scheduler') + is_started = fields.Boolean(default=False, help='Is the cron is started') + is_stopped = fields.Boolean(default=True, help='Is the cron is stopped') + invoice_auto_check = fields.Boolean( + help='Check to enable the invoice button') + + def start_cron(self): + """Start the cron scheduler""" + self.is_started = True + self.is_stopped = False + send_mail_ir_cron = self.env.ref( + 'pos_invoice_automate.ir_cron_send_invoice') + send_mail_ir_cron.write({ + 'interval_number': self.interval, + 'interval_type': self.period, + 'active': True, + 'numbercall': 1, + 'code': 'model._send_mail(%s)' % (self.id) + }) + + def stop_cron(self): + """Stop the cron scheduler""" + self.is_stopped = True + self.is_started = False + send_mail_ir_cron = self.env.ref( + 'pos_invoice_automate.ir_cron_send_invoice') + send_mail_ir_cron.write({ + 'active': False, + }) + + def _send_mail(self, config): + """Send invoice by Email""" + point_of_sale = self.env['pos.config'].browse(config) + for order in point_of_sale.mapped( + 'session_ids').mapped('order_ids').filtered( + lambda x: x.state == 'invoiced' and not x.is_send): + order.send_mail_invoice() diff --git a/pos_invoice_automate/models/pos_order.py b/pos_invoice_automate/models/pos_order.py new file mode 100644 index 000000000..e863e23dc --- /dev/null +++ b/pos_invoice_automate/models/pos_order.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import base64 +from odoo import models, fields + + +class PosOrder(models.Model): + _inherit = 'pos.order' + + is_send = fields.Boolean(string='Is invoice send?', + help='Is the invoice is send or not') + + def send_mail_invoice(self): + """Send invoice by email""" + if not self.account_move: + self.action_pos_order_invoice() + template = self.env.ref('pos_invoice_automate.send_mail_template') + email_values = { + 'email_to': self.partner_id.email, + 'email_from': self.env.user.partner_id.email, + } + attachment_invoice = self.env['ir.attachment'].search([ + ('res_model', '=', 'account.move'), + ('res_id', '=', self.account_move.id)]) + if not attachment_invoice: + invoice = self.env.ref( + 'account.account_invoices').sudo()._render_qweb_pdf( + self.account_move.id) + invoice_report = base64.b64encode(invoice[0]) + values = { + 'name': "Invoice" + self.name, + 'type': 'binary', + 'datas': invoice_report, + 'store_fname': invoice_report, + 'mimetype': 'application/pdf', + } + attachment_invoice = self.env['ir.attachment'].sudo().create( + values) + template.attachment_ids = [(6, 0, [attachment_invoice.id])] + self.env['mail.template'].browse(template.id).send_mail( + self.id, email_values=email_values, force_send=True) + self.is_send = True + return True diff --git a/pos_invoice_automate/static/description/assets/icons/check.png b/pos_invoice_automate/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/check.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/chevron.png b/pos_invoice_automate/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/chevron.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/cogs.png b/pos_invoice_automate/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/cogs.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/consultation.png b/pos_invoice_automate/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/consultation.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/ecom-black.png b/pos_invoice_automate/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/ecom-black.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/education-black.png b/pos_invoice_automate/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/education-black.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/hotel-black.png b/pos_invoice_automate/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/hotel-black.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/license.png b/pos_invoice_automate/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/license.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/lifebuoy.png b/pos_invoice_automate/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/logo.png b/pos_invoice_automate/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/logo.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/manufacturing-black.png b/pos_invoice_automate/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/pos-black.png b/pos_invoice_automate/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/pos-black.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/puzzle.png b/pos_invoice_automate/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/puzzle.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/restaurant-black.png b/pos_invoice_automate/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/service-black.png b/pos_invoice_automate/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/service-black.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/trading-black.png b/pos_invoice_automate/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/trading-black.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/training.png b/pos_invoice_automate/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/training.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/update.png b/pos_invoice_automate/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/update.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/user.png b/pos_invoice_automate/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/user.png differ diff --git a/pos_invoice_automate/static/description/assets/icons/wrench.png b/pos_invoice_automate/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_invoice_automate/static/description/assets/icons/wrench.png differ diff --git a/pos_invoice_automate/static/description/assets/modules/approval_image.png b/pos_invoice_automate/static/description/assets/modules/approval_image.png new file mode 100644 index 000000000..84fe94e80 Binary files /dev/null and b/pos_invoice_automate/static/description/assets/modules/approval_image.png differ diff --git a/pos_invoice_automate/static/description/assets/modules/budget_image.png b/pos_invoice_automate/static/description/assets/modules/budget_image.png new file mode 100644 index 000000000..fe6aa6fe4 Binary files /dev/null and b/pos_invoice_automate/static/description/assets/modules/budget_image.png differ diff --git a/pos_invoice_automate/static/description/assets/modules/export_image.png b/pos_invoice_automate/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..4e4ea0e51 Binary files /dev/null and b/pos_invoice_automate/static/description/assets/modules/export_image.png differ diff --git a/pos_invoice_automate/static/description/assets/modules/magento_image.png b/pos_invoice_automate/static/description/assets/modules/magento_image.png new file mode 100644 index 000000000..39de0820f Binary files /dev/null and b/pos_invoice_automate/static/description/assets/modules/magento_image.png differ diff --git a/pos_invoice_automate/static/description/assets/modules/mobile_service_shop_pro.png b/pos_invoice_automate/static/description/assets/modules/mobile_service_shop_pro.png new file mode 100644 index 000000000..68d11114c Binary files /dev/null and b/pos_invoice_automate/static/description/assets/modules/mobile_service_shop_pro.png differ diff --git a/pos_invoice_automate/static/description/assets/modules/pos_image.png b/pos_invoice_automate/static/description/assets/modules/pos_image.png new file mode 100644 index 000000000..c5932894b Binary files /dev/null and b/pos_invoice_automate/static/description/assets/modules/pos_image.png differ diff --git a/pos_invoice_automate/static/description/assets/modules/shopify_image.png b/pos_invoice_automate/static/description/assets/modules/shopify_image.png new file mode 100644 index 000000000..c6d92c16d Binary files /dev/null and b/pos_invoice_automate/static/description/assets/modules/shopify_image.png differ diff --git a/pos_invoice_automate/static/description/assets/screenshots/hero.png b/pos_invoice_automate/static/description/assets/screenshots/hero.png new file mode 100644 index 000000000..599a8e35f Binary files /dev/null and b/pos_invoice_automate/static/description/assets/screenshots/hero.png differ diff --git a/pos_invoice_automate/static/description/assets/screenshots/invoice1.png b/pos_invoice_automate/static/description/assets/screenshots/invoice1.png new file mode 100644 index 000000000..3c20700b9 Binary files /dev/null and b/pos_invoice_automate/static/description/assets/screenshots/invoice1.png differ diff --git a/pos_invoice_automate/static/description/assets/screenshots/invoice2.png b/pos_invoice_automate/static/description/assets/screenshots/invoice2.png new file mode 100644 index 000000000..4c626dc57 Binary files /dev/null and b/pos_invoice_automate/static/description/assets/screenshots/invoice2.png differ diff --git a/pos_invoice_automate/static/description/assets/screenshots/invoice3.png b/pos_invoice_automate/static/description/assets/screenshots/invoice3.png new file mode 100644 index 000000000..796d1cee4 Binary files /dev/null and b/pos_invoice_automate/static/description/assets/screenshots/invoice3.png differ diff --git a/pos_invoice_automate/static/description/assets/screenshots/invoice4.png b/pos_invoice_automate/static/description/assets/screenshots/invoice4.png new file mode 100644 index 000000000..6322a7b1c Binary files /dev/null and b/pos_invoice_automate/static/description/assets/screenshots/invoice4.png differ diff --git a/pos_invoice_automate/static/description/assets/screenshots/invoice5.png b/pos_invoice_automate/static/description/assets/screenshots/invoice5.png new file mode 100644 index 000000000..a3c8c88de Binary files /dev/null and b/pos_invoice_automate/static/description/assets/screenshots/invoice5.png differ diff --git a/pos_invoice_automate/static/description/assets/screenshots/invoice6.png b/pos_invoice_automate/static/description/assets/screenshots/invoice6.png new file mode 100644 index 000000000..43c2e99bd Binary files /dev/null and b/pos_invoice_automate/static/description/assets/screenshots/invoice6.png differ diff --git a/pos_invoice_automate/static/description/banner.png b/pos_invoice_automate/static/description/banner.png new file mode 100644 index 000000000..8fad28492 Binary files /dev/null and b/pos_invoice_automate/static/description/banner.png differ diff --git a/pos_invoice_automate/static/description/icon.png b/pos_invoice_automate/static/description/icon.png new file mode 100644 index 000000000..a8a9ef0e7 Binary files /dev/null and b/pos_invoice_automate/static/description/icon.png differ diff --git a/pos_invoice_automate/static/description/index.html b/pos_invoice_automate/static/description/index.html new file mode 100644 index 000000000..9975fbfc7 --- /dev/null +++ b/pos_invoice_automate/static/description/index.html @@ -0,0 +1,635 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ POS Automate Invoice

+

+ This module helps in managing the POS invoice automatically +

+ +
+
+ + + + +
+
+

+ Overview +

+
+ +
+

+ This module is helps to manage the invoice process in POS automatically. + The invoice button in the POS Screen will be automatically enabled based on the configuration. + Also based on the Point of Sale Configuration able to manage the invoice button operation.

+ +
+
+ +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Enable the invoice button in the POS Payment Screen Automatically

+ +
+
+
+
+ +
+
+

+ Different operations like Download, Send By Email, Download and Send By Email for Invoice button

+ +
+
+ +
+
+ +
+
+

+ Send Invoices automatically via Cron Scheduler

+ +
+
+ +
+
+ +
+
+

+ Able to set the time interval of Cron Scheduler

+ +
+
+ +
+
+ +
+
+

+ Send Invoice By Email

+ +
+
+ +
+ +
+
+

+ Screenshots +

+
+
+

+ Enable Auto check of Invoice Button

+

+ When you install the module, a configuration option in the Point Of Sale is added to enable the auto check of invoice button

+ +
+ +
+

+ Invoice Button Enabled

+

+ The invoice button is automatically enabled in the Payment Screen +

+ +
+ +
+

+ Configuration of Invoice button operation

+

+ Download, Send by Email, Download and Send by Email option for invoice button +

+ +
+ + +
+

+ Invoice Send By Email

+ +
+ +
+

+ Send Invoices automatically via Cron Scheduler and able to set interval for the cron scheduler

+ +
+ +
+

+ Send By Email button in Backend

+ +
+ +
+ + +
+
+

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?

+
+
+
+ + +
+ +
+ +
+ +
+ WhatsApp +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/pos_invoice_automate/static/src/js/PaymentScreen.js b/pos_invoice_automate/static/src/js/PaymentScreen.js new file mode 100644 index 000000000..9cf9bfec2 --- /dev/null +++ b/pos_invoice_automate/static/src/js/PaymentScreen.js @@ -0,0 +1,20 @@ +odoo.define('pos_invoice_automate.PaymentScreen', function (require) { + 'use strict'; + + const PaymentScreen = require('point_of_sale.PaymentScreen'); + const Registries = require('point_of_sale.Registries'); + + const PosInvoiceAutomatePaymentScreen = (PaymentScreen) => + class extends PaymentScreen { + constructor() { + super(...arguments); + if(this.env.pos.config.invoice_auto_check){ + this.currentOrder.set_to_invoice(true); + } + } + }; + + Registries.Component.extend(PaymentScreen, PosInvoiceAutomatePaymentScreen); + + return PaymentScreen; +}); diff --git a/pos_invoice_automate/static/src/js/models.js b/pos_invoice_automate/static/src/js/models.js new file mode 100644 index 000000000..d7d7c73a1 --- /dev/null +++ b/pos_invoice_automate/static/src/js/models.js @@ -0,0 +1,74 @@ +odoo.define('pos_invoice_automate.PosModel', function(require) { + "use strict"; + + var models = require('point_of_sale.models'); + var rpc = require('web.rpc'); + + models.PosModel = models.PosModel.extend({ + push_and_invoice_order: function (order) { + var self = this; + return new Promise((resolve, reject) => { + if (!order.get_client()) { + reject({ code: 400, message: 'Missing Customer', data: {} }); + } else { + var order_id = self.db.add_order(order.export_as_JSON()); + self.flush_mutex.exec(async () => { + try { + const server_ids = await self._flush_orders([self.db.get_order(order_id)], { + timeout: 30000, + to_invoice: true, + }); + if (server_ids.length) { + const [orderWithInvoice] = await self.rpc({ + method: 'read', + model: 'pos.order', + args: [server_ids, ['account_move']], + kwargs: { load: false }, + }); + if (self.config.button_operation == 'download'){ + await self.do_action('account.account_invoices', { + additional_context: { + active_ids: [orderWithInvoice.account_move], + }, + }) + .catch(() => { + reject({ code: 401, message: 'Backend Invoice', data: { order: order } }); + }); + } + else if (self.config.button_operation == 'send'){ + const order = await self.rpc({ + method: 'send_mail_invoice', + model: 'pos.order', + args: [server_ids], + }); + } + else if (self.config.button_operation == 'download_send_mail'){ + await self.do_action('account.account_invoices', { + additional_context: { + active_ids: [orderWithInvoice.account_move], + }, + }) + .catch(() => { + reject({ code: 401, message: 'Backend Invoice', data: { order: order } }); + }); + const order = await self.rpc({ + method: 'send_mail_invoice', + model: 'pos.order', + args: [server_ids], + }); + } + + } else { + reject({ code: 401, message: 'Backend Invoice', data: { order: order } }); + } + resolve(server_ids); + } catch (error) { + reject(error); + } + }); + } + }); + }, + +}); +}); \ No newline at end of file diff --git a/pos_invoice_automate/views/pos_config.xml b/pos_invoice_automate/views/pos_config.xml new file mode 100644 index 000000000..6327eaf22 --- /dev/null +++ b/pos_invoice_automate/views/pos_config.xml @@ -0,0 +1,56 @@ + + + + pos.config.form.view.inherited + pos.config + + + +
+
+ +
+
+ +
+ Auto check the invoice button +
+
+
+
+
+ Button Operation +
+ Invoice button operation +
+
+ +
+
+
+
+
+ Send By Email Cron +
+ Select Interval for cron and click on start/stop button to start or stop cron +
+
+ + + + +
+
+
+ +
+
+
+ +
\ No newline at end of file diff --git a/pos_invoice_automate/views/pos_order.xml b/pos_invoice_automate/views/pos_order.xml new file mode 100644 index 000000000..757516b30 --- /dev/null +++ b/pos_invoice_automate/views/pos_order.xml @@ -0,0 +1,14 @@ + + + + pos.order.form.view.inherit + pos.order + + + + +