diff --git a/pos_takeaway/README.rst b/pos_takeaway/README.rst new file mode 100644 index 000000000..81818f449 --- /dev/null +++ b/pos_takeaway/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +POS Restaurant Dine-in/TakeAway +=============================== + +* This module will add the options Dine-in and Take away in Odoo POS. +* A separate tokens will be generated for all Takeaway orders. + +Installation +============ + - www.odoo.com/documentation/15.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.odoo.com/documentation/user/15.0/legal/licenses/licenses.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: +(V15) Raveena @ Cybrosys + +Contacts +-------- +* Mail Contact : odoo@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 +========== +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ \ No newline at end of file diff --git a/pos_takeaway/__init__.py b/pos_takeaway/__init__.py new file mode 100644 index 000000000..3c1444e9b --- /dev/null +++ b/pos_takeaway/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/pos_takeaway/__manifest__.py b/pos_takeaway/__manifest__.py new file mode 100644 index 000000000..31ac31e3a --- /dev/null +++ b/pos_takeaway/__manifest__.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'POS Restaurant Dine-in/TakeAway', + 'version': '15.0.1.0.0', + 'summary': "This module will add the options Dine-in " + "and Take away in Odoo POS.", + 'description': """The POS user can make orders as Dine-in or Take + away and it will create separate token for Take away orders.""", + 'category': 'Point of Sale', + 'author': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': [ + 'point_of_sale', 'pos_restaurant', 'web' + ], + 'data': [ + 'data/ticket_scheduler.xml', + 'views/res_config_settings_views.xml', + 'views/pos_order_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'pos_takeaway/static/src/js/Screens/ProductScreen/ControlButtons/TakeAway.js', + 'pos_takeaway/static/src/js/Screens/ProductScreen/ProductScreen.js', + 'pos_takeaway/static/src/js/Screens/ReceiptScreen/OrderReceipt.js', + 'pos_takeaway/static/src/js/models.js', + ], + 'web.assets_qweb': [ + 'pos_takeaway/static/src/xml/Screens/ProductScreen/ControlButtons/TakeAway.xml', + 'pos_takeaway/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_takeaway/data/ticket_scheduler.xml b/pos_takeaway/data/ticket_scheduler.xml new file mode 100644 index 000000000..6930bbb31 --- /dev/null +++ b/pos_takeaway/data/ticket_scheduler.xml @@ -0,0 +1,16 @@ + + + + + + POS TakeAway Ticket Scheduler + + code + model.ticket_scheduler() + days + 1 + -1 + True + + + \ No newline at end of file diff --git a/pos_takeaway/doc/RELEASE_NOTES.md b/pos_takeaway/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..63676b295 --- /dev/null +++ b/pos_takeaway/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 08.06.2023 +#### Version 15.0.1.0.0 +#### ADD + +- Initial Commit for POS Restaurant Dine-in/Take Away diff --git a/pos_takeaway/models/__init__.py b/pos_takeaway/models/__init__.py new file mode 100644 index 000000000..84cc453b0 --- /dev/null +++ b/pos_takeaway/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() + +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import pos_order +from . import res_config_settings diff --git a/pos_takeaway/models/pos_order.py b/pos_takeaway/models/pos_order.py new file mode 100644 index 000000000..11a57c984 --- /dev/null +++ b/pos_takeaway/models/pos_order.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class PosOrder(models.Model): + _inherit = "pos.order" + + is_takeaway = fields.Boolean(default=False, string="Is a Takeaway Order", + help="Is a Takeaway Order") + token_number = fields.Char(string="Token Number", + help="Token number starts from 1") + + def generate_token(self, uid): + """ + This function check whether the order is a take-away order or a dine-in. + If it is a take-away order, it will create the token number for that + order and returns it. + :param : uid: the pos order id + :return : order.token_number: token number of the pos order having the + order reference uid + """ + + uid = "Order " + uid[0] + order = self.env['pos.order'].search([('pos_reference', 'ilike', uid)]) + order.is_takeaway = True + if not order.token_number and \ + self.env['res.config.settings'].get_values()[ + 'generate_token']: + if self.env['res.config.settings'].get_values()[ + 'pos_token']: + order.token_number = int( + self.env['res.config.settings'].get_values()[ + 'pos_token']) + 1 + else: + order.token_number = 1 + self.env['ir.config_parameter'].sudo().set_param( + 'pos_takeaway.pos_token', + order.token_number) + return order.token_number + + else: + return 0 + + def ticket_scheduler(self): + """This function will reset the Token to 0 by a cron job.""" + + generate_token = self.env['ir.config_parameter'].sudo().get_param( + 'generate_token') + if generate_token: + self.env['ir.config_parameter'].sudo().set_param('pos_token', 0) diff --git a/pos_takeaway/models/res_config_settings.py b/pos_takeaway/models/res_config_settings.py new file mode 100644 index 000000000..3693e9fd6 --- /dev/null +++ b/pos_takeaway/models/res_config_settings.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() + +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + generate_token = fields.Boolean(string="Generate Token", + help="This will generate separate token " + "for all Take Away orders.") + pos_token = fields.Integer(help="The token will be start from 1.", + string="Token") + takeaway = fields.Boolean(string="POS Takeaways", + help="This will enable the Take Away feature " + "on POS.") + + def get_values(self): + """supering the getter to get the takeaway, generate_token + and pos_token fields.""" + res = super(ResConfigSettings, self).get_values() + res.update( + takeaway=self.env['ir.config_parameter'].sudo().get_param( + 'pos_takeaway.takeaway'), + generate_token=self.env['ir.config_parameter'].sudo().get_param( + 'pos_takeaway.generate_token'), + pos_token=self.env['ir.config_parameter'].sudo().get_param( + 'pos_takeaway.pos_token') + ) + return res + + def set_values(self): + """supering the setter to set the takeaway, generate_token + and pos_token fields.""" + res = super(ResConfigSettings, self).set_values() + self.env['ir.config_parameter'].sudo().set_param( + 'pos_takeaway.takeaway', + self.takeaway or False) + self.env['ir.config_parameter'].sudo().set_param( + 'pos_takeaway.generate_token', + self.generate_token or False) + self.env['ir.config_parameter'].sudo().set_param( + 'pos_takeaway.pos_token', + self.pos_token or 0) + return res diff --git a/pos_takeaway/static/description/assets/icons/check.png b/pos_takeaway/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/check.png differ diff --git a/pos_takeaway/static/description/assets/icons/chevron.png b/pos_takeaway/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/chevron.png differ diff --git a/pos_takeaway/static/description/assets/icons/cogs.png b/pos_takeaway/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/cogs.png differ diff --git a/pos_takeaway/static/description/assets/icons/consultation.png b/pos_takeaway/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/consultation.png differ diff --git a/pos_takeaway/static/description/assets/icons/ecom-black.png b/pos_takeaway/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/ecom-black.png differ diff --git a/pos_takeaway/static/description/assets/icons/education-black.png b/pos_takeaway/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/education-black.png differ diff --git a/pos_takeaway/static/description/assets/icons/hotel-black.png b/pos_takeaway/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/hotel-black.png differ diff --git a/pos_takeaway/static/description/assets/icons/license.png b/pos_takeaway/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/license.png differ diff --git a/pos_takeaway/static/description/assets/icons/lifebuoy.png b/pos_takeaway/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_takeaway/static/description/assets/icons/logo.png b/pos_takeaway/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/logo.png differ diff --git a/pos_takeaway/static/description/assets/icons/manufacturing-black.png b/pos_takeaway/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_takeaway/static/description/assets/icons/pos-black.png b/pos_takeaway/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/pos-black.png differ diff --git a/pos_takeaway/static/description/assets/icons/puzzle.png b/pos_takeaway/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/puzzle.png differ diff --git a/pos_takeaway/static/description/assets/icons/restaurant-black.png b/pos_takeaway/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_takeaway/static/description/assets/icons/service-black.png b/pos_takeaway/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/service-black.png differ diff --git a/pos_takeaway/static/description/assets/icons/trading-black.png b/pos_takeaway/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/trading-black.png differ diff --git a/pos_takeaway/static/description/assets/icons/training.png b/pos_takeaway/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/training.png differ diff --git a/pos_takeaway/static/description/assets/icons/update.png b/pos_takeaway/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/update.png differ diff --git a/pos_takeaway/static/description/assets/icons/user.png b/pos_takeaway/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/user.png differ diff --git a/pos_takeaway/static/description/assets/icons/wrench.png b/pos_takeaway/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_takeaway/static/description/assets/icons/wrench.png differ diff --git a/pos_takeaway/static/description/assets/modules/1.png b/pos_takeaway/static/description/assets/modules/1.png new file mode 100644 index 000000000..3ad04ecfd Binary files /dev/null and b/pos_takeaway/static/description/assets/modules/1.png differ diff --git a/pos_takeaway/static/description/assets/modules/2.png b/pos_takeaway/static/description/assets/modules/2.png new file mode 100644 index 000000000..baaef2807 Binary files /dev/null and b/pos_takeaway/static/description/assets/modules/2.png differ diff --git a/pos_takeaway/static/description/assets/modules/3.png b/pos_takeaway/static/description/assets/modules/3.png new file mode 100644 index 000000000..04d502e26 Binary files /dev/null and b/pos_takeaway/static/description/assets/modules/3.png differ diff --git a/pos_takeaway/static/description/assets/modules/4.png b/pos_takeaway/static/description/assets/modules/4.png new file mode 100644 index 000000000..d01ceb1ab Binary files /dev/null and b/pos_takeaway/static/description/assets/modules/4.png differ diff --git a/pos_takeaway/static/description/assets/modules/5.png b/pos_takeaway/static/description/assets/modules/5.png new file mode 100644 index 000000000..230d4dcb3 Binary files /dev/null and b/pos_takeaway/static/description/assets/modules/5.png differ diff --git a/pos_takeaway/static/description/assets/modules/6.png b/pos_takeaway/static/description/assets/modules/6.png new file mode 100644 index 000000000..499b1a72f Binary files /dev/null and b/pos_takeaway/static/description/assets/modules/6.png differ diff --git a/pos_takeaway/static/description/assets/screenshots/hero.gif b/pos_takeaway/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..e7f4e9259 Binary files /dev/null and b/pos_takeaway/static/description/assets/screenshots/hero.gif differ diff --git a/pos_takeaway/static/description/assets/screenshots/pos1.png b/pos_takeaway/static/description/assets/screenshots/pos1.png new file mode 100644 index 000000000..ea82f1c1a Binary files /dev/null and b/pos_takeaway/static/description/assets/screenshots/pos1.png differ diff --git a/pos_takeaway/static/description/assets/screenshots/pos2.png b/pos_takeaway/static/description/assets/screenshots/pos2.png new file mode 100644 index 000000000..cce7e1d86 Binary files /dev/null and b/pos_takeaway/static/description/assets/screenshots/pos2.png differ diff --git a/pos_takeaway/static/description/assets/screenshots/pos3.png b/pos_takeaway/static/description/assets/screenshots/pos3.png new file mode 100644 index 000000000..28d2f5e81 Binary files /dev/null and b/pos_takeaway/static/description/assets/screenshots/pos3.png differ diff --git a/pos_takeaway/static/description/assets/screenshots/pos4.png b/pos_takeaway/static/description/assets/screenshots/pos4.png new file mode 100644 index 000000000..4752ce134 Binary files /dev/null and b/pos_takeaway/static/description/assets/screenshots/pos4.png differ diff --git a/pos_takeaway/static/description/assets/screenshots/pos5.png b/pos_takeaway/static/description/assets/screenshots/pos5.png new file mode 100644 index 000000000..7f8df913c Binary files /dev/null and b/pos_takeaway/static/description/assets/screenshots/pos5.png differ diff --git a/pos_takeaway/static/description/assets/screenshots/pos6.png b/pos_takeaway/static/description/assets/screenshots/pos6.png new file mode 100644 index 000000000..0e9a5549e Binary files /dev/null and b/pos_takeaway/static/description/assets/screenshots/pos6.png differ diff --git a/pos_takeaway/static/description/assets/screenshots/pos7.png b/pos_takeaway/static/description/assets/screenshots/pos7.png new file mode 100644 index 000000000..9ba77d19d Binary files /dev/null and b/pos_takeaway/static/description/assets/screenshots/pos7.png differ diff --git a/pos_takeaway/static/description/banner.png b/pos_takeaway/static/description/banner.png new file mode 100644 index 000000000..7cfa46fb0 Binary files /dev/null and b/pos_takeaway/static/description/banner.png differ diff --git a/pos_takeaway/static/description/icon.png b/pos_takeaway/static/description/icon.png new file mode 100644 index 000000000..1830dc8ce Binary files /dev/null and b/pos_takeaway/static/description/icon.png differ diff --git a/pos_takeaway/static/description/images/checked.png b/pos_takeaway/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/pos_takeaway/static/description/images/checked.png differ diff --git a/pos_takeaway/static/description/images/cybrosys.png b/pos_takeaway/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/pos_takeaway/static/description/images/cybrosys.png differ diff --git a/pos_takeaway/static/description/index.html b/pos_takeaway/static/description/index.html new file mode 100644 index 000000000..4c6cc2d23 --- /dev/null +++ b/pos_takeaway/static/description/index.html @@ -0,0 +1,637 @@ + + + + + + +
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+ +
+
+
+

+ POS Restaurant Dine-in/TakeAway

+

+ This module will add the options Dine-in and Take away in Odoo POS. +

+ +
+
+ + + + +
+
+

+ Overview +

+
+ +
+

+ The POS user can make orders as Dine-in or Take + away, and it will create separate token for Take away orders.

+ +
+
+ +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Dine-In or Take Away

+

+ The POS user can make orders as Dine-in or Take + away

+
+
+ +
+
+ +
+
+

+ Token for Orders

+

Receipt + It will create a separate token for each Take Away orders.

+
+
+ +
+
+ +
+
+

+ Token on Receipt

+

+ The toke number of Take Away order will be printed on the Receipt.

+
+
+ +
+ +
+
+

+ Screenshots +

+
+ +
+

+ Configuration

+

+ You can enable the Take-away feature from the boolean field in POS configuration settings. + Also, you can enable the feature of tokens from here. +

+ +
+
+

+ Place Order as Take Away

+

+ You can create order and click on the 'Take Away' button to make the order Take Away.

+ +
+
+

+ Token on Receipts

+

+ If the order is a Take Away one, you can see the 'Take Away' label and the Token on the receipt.

+ +
+
+

+ Place Order as Dine-In

+

+ You can simply create a normal Order without clicking the 'Take Away' button and it will be a Dine-In order.

+ +
+
+

+ Dine-In Receipts

+

+ The receipt of Dine-in orders will be labelled as 'Dine-In'.

+ +
+
+

+ Filter Dine-In

+

+ You can filter the 'Dine-In' orders with the Dine-In filter available on orders.

+ +
+
+

+ Filter Take Away

+

+ You can filter the 'Take Away' orders with the Take Away filter available on orders.

+ +
+
+ + +
+
+

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?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ +
\ No newline at end of file diff --git a/pos_takeaway/static/src/js/Screens/ProductScreen/ControlButtons/TakeAway.js b/pos_takeaway/static/src/js/Screens/ProductScreen/ControlButtons/TakeAway.js new file mode 100644 index 000000000..c97996310 --- /dev/null +++ b/pos_takeaway/static/src/js/Screens/ProductScreen/ControlButtons/TakeAway.js @@ -0,0 +1,46 @@ +odoo.define('pos_takeaway.SendToTakeaway', function(require) { + 'use strict'; + const PosComponent = require('point_of_sale.PosComponent'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const { useListener } = require('web.custom_hooks'); + const Registries = require('point_of_sale.Registries'); + const models = require("point_of_sale.models"); + models.load_models({ + model: 'res.config.settings', + fields: ['takeaway'], + loaded: function(self, settings){ + if(settings.length){ + var index = settings.length-1 + self.takeaway = settings[index].takeaway; + } + }, + }); +// Extending the PosComponent to enable the takeaway for the order. + class SendToTakeaway extends PosComponent { + constructor() { + super(...arguments); + useListener('click', this.onClick); + } + onClick() { + var selectedOrder = this.env.pos.get_order(); + selectedOrder.initialize_validation_date(); + if(selectedOrder.is_empty()){ + return alert ('Please add product!!'); + }else{ + const sendButton = document.getElementById('takeaway_button_id'); + sendButton.className = "control-button highlight"; + selectedOrder.is_take_way = true; + } + } + }; + SendToTakeaway.template = 'SendToTakeaway'; +// Adds the TakeAway button on ProductScreen + ProductScreen.addControlButton({ + component: SendToTakeaway, + condition: function() { + return this.env.pos.config.module_pos_restaurant && this.env.pos.takeaway; + }, + }); + Registries.Component.add(SendToTakeaway); + return SendToTakeaway; +}); \ No newline at end of file diff --git a/pos_takeaway/static/src/js/Screens/ProductScreen/ProductScreen.js b/pos_takeaway/static/src/js/Screens/ProductScreen/ProductScreen.js new file mode 100644 index 000000000..88c8b8a60 --- /dev/null +++ b/pos_takeaway/static/src/js/Screens/ProductScreen/ProductScreen.js @@ -0,0 +1,19 @@ +odoo.define('pos_takeaway.ProductScreen', function(require) { + 'use strict'; + const ProductScreen = require('point_of_sale.ProductScreen') + const Registries = require('point_of_sale.Registries'); +// Extending ProductScreen to add the button for Takeaway + const TakeawayProductScreen = ProductScreen => + class extends ProductScreen { + mounted() { + var order = this.env.pos.get_order(); + var takeaway = order.is_take_way; + if(takeaway){ + const takeawayButton = document.getElementById('takeaway_button_id'); + takeawayButton.className = "control-button highlight"; + } + } + } + Registries.Component.extend(ProductScreen, TakeawayProductScreen); + return ProductScreen; +}); \ No newline at end of file diff --git a/pos_takeaway/static/src/js/Screens/ReceiptScreen/OrderReceipt.js b/pos_takeaway/static/src/js/Screens/ReceiptScreen/OrderReceipt.js new file mode 100644 index 000000000..0942b1ec8 --- /dev/null +++ b/pos_takeaway/static/src/js/Screens/ReceiptScreen/OrderReceipt.js @@ -0,0 +1,30 @@ +odoo.define('pos_takeaway.OrderReceipt', function(require) { + 'use strict'; + const Registries = require('point_of_sale.Registries'); + const OrderReceipt = require('point_of_sale.OrderReceipt'); + var rpc = require('web.rpc') +// Extends OrderReceipt to assign the takeaway value and the token. + const OrderReceiptToken = OrderReceipt => + class extends OrderReceipt { + async willUpdateProps(nextProps) { + super.willUpdateProps(nextProps) + var self = this; + self.token = 0; + self.is_take_way = self.env.pos.get_order().is_take_way; + self.is_restaurant = self.env.pos.config.module_pos_restaurant; + self.takeaway = self.env.pos.takeaway; + if (self.is_take_way && self.is_restaurant){ + await rpc.query({ + model: 'pos.order', + method: 'generate_token', + args: [,this.env.pos.get_order_with_uid() + ], + }).then(function (result){ + self.token = result + }); + } + } + } + Registries.Component.extend(OrderReceipt, OrderReceiptToken); + return OrderReceipt; +}); \ No newline at end of file diff --git a/pos_takeaway/static/src/js/models.js b/pos_takeaway/static/src/js/models.js new file mode 100644 index 000000000..5b1254976 --- /dev/null +++ b/pos_takeaway/static/src/js/models.js @@ -0,0 +1,17 @@ +odoo.define('pos_takeaway.receipt', function (require) { + 'use strict'; + const models = require('point_of_sale.models'); + models.load_fields('pos.order', 'is_takeaway'); + var _super_order = models.Order.prototype; + models.Order = models.Order.extend({ + initialize: function() { + //@Override + /** sets the is_take_way and is_restaurant values */ + _super_order.initialize.apply(this,arguments); + this.is_restaurant = this.pos.config.module_pos_restaurant || false; + this.is_take_way = this.is_take_way || false; + this.rpc = this.get('rpc'); + this.save_to_db(); + }, + }); +}); \ No newline at end of file diff --git a/pos_takeaway/static/src/xml/Screens/ProductScreen/ControlButtons/TakeAway.xml b/pos_takeaway/static/src/xml/Screens/ProductScreen/ControlButtons/TakeAway.xml new file mode 100644 index 000000000..7fd84c706 --- /dev/null +++ b/pos_takeaway/static/src/xml/Screens/ProductScreen/ControlButtons/TakeAway.xml @@ -0,0 +1,10 @@ + + + + +
+ + Take away +
+
+
\ No newline at end of file diff --git a/pos_takeaway/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml b/pos_takeaway/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml new file mode 100644 index 000000000..198c933bc --- /dev/null +++ b/pos_takeaway/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml @@ -0,0 +1,37 @@ + + + + + + +
--------------------------------
+
+ + Take Away + +
+
+ +
--------------------------------
+
+ + Dine-In + +
+
+ +
--------------------------------
+
+ + Token Number: + + +
+
+
+
+
\ No newline at end of file diff --git a/pos_takeaway/views/pos_order_views.xml b/pos_takeaway/views/pos_order_views.xml new file mode 100644 index 000000000..1973ca6f9 --- /dev/null +++ b/pos_takeaway/views/pos_order_views.xml @@ -0,0 +1,17 @@ + + + + + pos.order.filter.inherit.pos_takeaway + pos.order + + + + + + + + + \ No newline at end of file diff --git a/pos_takeaway/views/res_config_settings_views.xml b/pos_takeaway/views/res_config_settings_views.xml new file mode 100644 index 000000000..8bf7d945e --- /dev/null +++ b/pos_takeaway/views/res_config_settings_views.xml @@ -0,0 +1,48 @@ + + + + + res.config.settings.form.inherit.pos_takeaway + res.config.settings + + + +
+

Other Features

+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
\ No newline at end of file