diff --git a/pos_book_order/README.rst b/pos_book_order/README.rst new file mode 100644 index 000000000..1b6db86b2 --- /dev/null +++ b/pos_book_order/README.rst @@ -0,0 +1,48 @@ +.. 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 Booking Order +================= +The module helps you to book orders from Shop,Bar/Restaurant in POS.User can create pickup or delivery orders,later confirm booked orders to POS orders + +Configuration +============= +No additional configuration required + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +GNU Affero General Public License v3.0 (AGPL v3) +(http://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: (v15) Raneesha M K @cybrosys + (v12) Varsha Vivek @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: ``__ \ No newline at end of file diff --git a/pos_book_order/__init__.py b/pos_book_order/__init__.py new file mode 100644 index 000000000..084f44af0 --- /dev/null +++ b/pos_book_order/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Raneesha M K (odoo@cybrosys.com) +# +# 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_book_order/__manifest__.py b/pos_book_order/__manifest__.py new file mode 100644 index 000000000..c809e47f1 --- /dev/null +++ b/pos_book_order/__manifest__.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Raneesha M K (odoo@cybrosys.com) +# +# 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 Booking Order', + 'version': '15.0.1.0.0', + 'summary': """Users can now book pickup or delivery orders directly + from the Point of Sale (POS) session, later can confirm as POS order.""", + 'description': """The module helps you to book orders from Shop, + Bar/Restaurant in POS.User can create pickup or delivery + orders,later confirm booked orders to POS orders.""", + 'category': 'Point of Sale', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'point_of_sale'], + 'images': ['static/description/banner.jpg'], + 'data': ['security/ir.model.access.csv', + 'data/ir_sequence_data.xml', + 'views/pos_config_views.xml', + 'views/book_order_views.xml', + 'views/pos_order_views.xml' + ], + 'assets': { + 'point_of_sale.assets': [ + '/pos_book_order/static/src/js/BookOrderPopup.js', + '/pos_book_order/static/src/js/BookOrderButton.js', + '/pos_book_order/static/src/js/BookedOrdersButton.js', + '/pos_book_order/static/src/js/BookedOrdersScreen.js', + '/pos_book_order/static/src/js/models.js', + ], + 'web.assets_qweb': [ + '/pos_book_order/static/src/xml/Buttons.xml', + '/pos_book_order/static/src/xml/BookOrderPopup.xml', + '/pos_book_order/static/src/xml/BookedOrdersScreen.xml', + '/pos_book_order/static/src/xml/OrderReceipt.xml', + ] + }, + 'license': 'AGPL-3', + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/pos_book_order/data/ir_sequence_data.xml b/pos_book_order/data/ir_sequence_data.xml new file mode 100644 index 000000000..55ffba243 --- /dev/null +++ b/pos_book_order/data/ir_sequence_data.xml @@ -0,0 +1,11 @@ + + + + + Book Order + book.order + POS/BO/ + 4 + + + \ No newline at end of file diff --git a/pos_book_order/doc/RELEASE_NOTES.md b/pos_book_order/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..5db95d8a0 --- /dev/null +++ b/pos_book_order/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 26.06.2023 +#### Version 15.0.1.0.0 +##### ADD +- Initial Commit for POS Booking Order \ No newline at end of file diff --git a/pos_book_order/models/__init__.py b/pos_book_order/models/__init__.py new file mode 100644 index 000000000..6836d8976 --- /dev/null +++ b/pos_book_order/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Raneesha M K (odoo@cybrosys.com) +# +# 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 book_order +from . import book_order_line +from . import pos_order +from . import pos_config diff --git a/pos_book_order/models/book_order.py b/pos_book_order/models/book_order.py new file mode 100644 index 000000000..2cc809c6f --- /dev/null +++ b/pos_book_order/models/book_order.py @@ -0,0 +1,178 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Raneesha M K (odoo@cybrosys.com) +# +# 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 . +# +############################################################################### +import datetime +from odoo import api, fields, models + + +class BookOrder(models.Model): + """ + Model for managing booked orders in the POS system. + """ + _name = 'book.order' + _description = "Point of Sale Booked Orders" + + name = fields.Char(string='Booking Ref', readonly=True, + help="Order reference of book order", copy=False, + default='/') + company_id = fields.Many2one('res.company', string='Company', + readonly=True, help="Current company", + default=lambda self: self.env.user.company_id) + date_quotation = fields.Datetime(string='Quotation Date', + help="Quotation crated date", + readonly=True, default=fields.Datetime.now) + date_order = fields.Date(string='Order Date', help="Ordered date", + readonly=True, index=True, + default=fields.Date.today()) + amount_tax = fields.Float(compute='_compute_amount_all', string='Taxes', + digits=0, default=1.2, + help="Total amount of order with tax") + amount_total = fields.Float(compute='_compute_amount_all', string='Total', + digits=0, help="Total amount of order") + book_line_ids = fields.One2many('book.order.line', 'order_id', + string='Order Lines', + help="Order line of booked orders", + copy=True) + partner_id = fields.Many2one('res.partner', string='Customer', + help="Whose we try to create order", + change_default=True, index=True) + state = fields.Selection([('draft', 'New'), ('confirmed', 'Confirmed')], + string="Status", + readonly=True, default='draft', + help="Stages of booked order") + note = fields.Text(string='Internal Notes', + help="Description about book order") + fiscal_position_id = fields.Many2one('account.fiscal.position', + help="Fiscal position account " + "for order", + string='Fiscal Position') + pickup_date = fields.Datetime(string='Pickup Date', readonly=True, + help="Pickup date of the booked order") + deliver_date = fields.Datetime(string='Deliver Date', readonly=True, + help="Delivery date of the booked order") + phone = fields.Char(string="Contact no", + help='Phone of customer for delivery') + delivery_address = fields.Char(string="Delivery Address", + help='Address of customer for delivery') + pricelist_id = fields.Many2one('product.pricelist', string='Pricelist', + help="Pricelist of order from session") + + @api.model + def _amount_line_tax(self, line, fiscal_position_id): + """ Calculates the tax amount of the order line""" + taxes = line.tax_ids.filtered( + lambda t: t.company_id.id == line.order_id.company_id.id) + taxes = fiscal_position_id.map_tax(taxes) + price = line.price_unit * (1 - (line.discount or 0.0) / 100.0) + taxes = taxes.compute_all(price, + line.order_id.pricelist_id.currency_id, + line.qty, product=line.product_id, + partner=line.order_id.partner_id or False)[ + 'taxes'] + return sum(tax.get('amount', 0.0) for tax in taxes) + + @api.depends('book_line_ids.price_subtotal_incl', 'book_line_ids.discount') + def _compute_amount_all(self): + """ To compute total amount with tax and without tax """ + for order in self: + order.amount_tax = 0.0 + currency = order.pricelist_id.currency_id + order.amount_tax = currency.round( + sum(self._amount_line_tax(line, order.fiscal_position_id) for + line in order.book_line_ids)) + amount_untaxed = currency.round( + sum(line.price_subtotal for line in order.book_line_ids)) + order.amount_total = order.amount_tax + amount_untaxed + + @api.model + def create(self, vals): + """ Inherited create function to generate sequence number + for booker orders + :return record: created record + """ + if vals.get('name', '/') == '/': + vals['name'] = self.env['ir.sequence'].next_by_code( + 'book.order') or '/' + return super(BookOrder, self).create(vals) + + @api.model + def create_booked_order(self, partner, phone, address, date, price_list, + product, note, pickup, delivery): + """ It creates a booked order based on the value in the booking popup + in PoS ui. + partner(int): id of partner + phone(string): contact number of customer + address(string): contact address of the customer + date(date): ordered date + price_list(int): price list id of order + product(dict): dictionary values with product ids and quantity + note(string): Order note + pickup(date): pickup date of the booked order + delivery(date): delivery date of the booked order + """ + book_date = (datetime.datetime.fromisoformat(date[:-1])).strftime( + '%Y-%m-%d %H:%M:%S') + order = self.create({ + 'partner_id': partner, + 'phone': phone, + 'delivery_address': address, + 'pricelist_id': price_list, + 'date_quotation': book_date, + 'book_line_ids': [(0, 0, { + 'product_id': product['product_id'][i], + 'qty': product['qty'][i], + 'price_unit': product['price'][i], + }) for i in range(len(product['product_id']))], + 'note': note, + }) + if pickup: + order.write({'pickup_date': pickup + ' 00:00:00'}) + if delivery: + order.write({'deliver_date': delivery + ' 00:00:00'}) + + @api.model + def all_orders(self): + """To fetch all draft stage orders to PoS Booked orders screen + dict: returns dictionary of values with orders details + """ + values = [] + for rec in self.search([('state', '=', 'draft')]): + products = [] + for line in rec.book_line_ids: + products.append({ + 'id': line.product_id.id, + 'qty': line.qty, + 'price': line.price_unit + }) + values.append({'id': rec.id, + 'name': rec.name, + 'partner_id': rec.partner_id.id, + 'partner_name': rec.partner_id.name, + 'address': rec.delivery_address, + 'note': rec.note, + 'phone': rec.phone, + 'date': rec.date_quotation, + 'pickup': rec.pickup_date, + 'deliver': rec.deliver_date, + 'products': products, + 'total': rec.amount_total + }) + return values diff --git a/pos_book_order/models/book_order_line.py b/pos_book_order/models/book_order_line.py new file mode 100644 index 000000000..4a880cbd1 --- /dev/null +++ b/pos_book_order/models/book_order_line.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Raneesha M K (odoo@cybrosys.com) +# +# 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 api, fields, models + + +class BookOrderLine(models.Model): + """ For managing order lines of booked order""" + _name = "book.order.line" + _description = "Lines of Point of Sale Booked Order" + _rec_name = "product_id" + + company_id = fields.Many2one('res.company', string='Company', + help="Choose the company booked order", + default=lambda self: self.env.user.company_id) + product_id = fields.Many2one('product.product', + string='Product', + help="Select product for order", + domain=[('sale_ok', '=', True)], + required=True, change_default=True) + price_unit = fields.Float(string='Unit Price', + help="Unit price of selected product", + digits=0) + qty = fields.Float(string="Quantity", default=1, + help="Quantity of each product") + price_subtotal = fields.Float(compute='_compute_amount_line_all', + digits=0, + help="Total amount without tax of each line", + string='Subtotal w/o Tax') + price_subtotal_incl = fields.Float(compute='_compute_amount_line_all', + digits=0, string='Subtotal', + help="Total amount with tax" + " of each line") + discount = fields.Float(string='Discount (%)', digits=0, default=0.0, + help="Discount of each orderline") + order_id = fields.Many2one('book.order', string='Order Ref', + help="Relation to book.order", + ondelete='cascade') + tax_ids = fields.Many2many('account.tax', string='Taxes', readonly=True, + help="Taxes of each orderline") + tax_after_fiscal_position_ids = fields.Many2many('account.tax', + 'account_tax_rel', 'uid', + 'tag_id', string='Taxes', + help="Taxes of orderline " + "after setting " + "fiscal position") + + @api.depends('price_unit', 'tax_ids', 'qty', 'discount', 'product_id') + def _compute_amount_line_all(self): + """ To compute tax included and excluded subtotal in each line""" + for line in self: + currency = line.order_id.pricelist_id.currency_id + taxes = line.tax_ids.filtered( + lambda tax: tax.company_id.id == line.order_id.company_id.id) + fiscal_position_id = line.order_id.fiscal_position_id + if fiscal_position_id: + taxes = fiscal_position_id.map_tax(taxes, line.product_id, + line.order_id.partner_id) + price = line.price_unit * (1 - (line.discount or 0.0) / 100.0) + line.price_subtotal = line.price_subtotal_incl = price * line.qty + if taxes: + taxes = taxes.compute_all(price, currency, line.qty, + product=line.product_id, + partner=line.order_id.partner_i + or False) + line.price_subtotal = taxes['total_excluded'] + line.price_subtotal_incl = taxes['total_included'] + + line.price_subtotal = currency.round(line.price_subtotal) + line.price_subtotal_incl = currency.round(line.price_subtotal_incl) diff --git a/pos_book_order/models/pos_config.py b/pos_book_order/models/pos_config.py new file mode 100644 index 000000000..be906410c --- /dev/null +++ b/pos_book_order/models/pos_config.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Raneesha M K (odoo@cybrosys.com) +# +# 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 PosConfig(models.Model): + """POS configuration settings""" + _inherit = 'pos.config' + + enable = fields.Boolean(string="Enable Book Orders", + help="Enable if you want to book order " + "from session") diff --git a/pos_book_order/models/pos_order.py b/pos_book_order/models/pos_order.py new file mode 100644 index 000000000..61b624f92 --- /dev/null +++ b/pos_book_order/models/pos_order.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Raneesha M K (odoo@cybrosys.com) +# +# 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 api, fields, models + + +class PosOrder(models.Model): + """Inherited model for pos order,all confirmed booking orders are converted + as pos orders""" + _inherit = 'pos.order' + + booking_ref_id = fields.Many2one('book.order', string='Booking Ref', + help="Reference of the booked " + "order of each order.") + + @api.model + def _order_fields(self, ui_order): + """Passing value of booked order ref to PoS order + ui_order(dict): dictionary of pos order field values + dict: returns dictionary of pos order field values + """ + order_fields = super(PosOrder, self)._order_fields(ui_order) + if ui_order['is_booked']: + order_fields['booking_ref_id'] = ui_order['booked_data']['id'] + self.env['book.order'].browse(ui_order['booked_data']['id']).write( + {'state': 'confirmed'}) + return order_fields diff --git a/pos_book_order/security/ir.model.access.csv b/pos_book_order/security/ir.model.access.csv new file mode 100644 index 000000000..aff419253 --- /dev/null +++ b/pos_book_order/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_book_order,access.book.order,model_book_order,point_of_sale.group_pos_user,1,1,1,1 +access_book_order_line,access.book.order.line,model_book_order_line,point_of_sale.group_pos_user,1,1,1,1 diff --git a/pos_book_order/static/description/assets/icons/check.png b/pos_book_order/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_book_order/static/description/assets/icons/check.png differ diff --git a/pos_book_order/static/description/assets/icons/chevron.png b/pos_book_order/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_book_order/static/description/assets/icons/chevron.png differ diff --git a/pos_book_order/static/description/assets/icons/cogs.png b/pos_book_order/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_book_order/static/description/assets/icons/cogs.png differ diff --git a/pos_book_order/static/description/assets/icons/consultation.png b/pos_book_order/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_book_order/static/description/assets/icons/consultation.png differ diff --git a/pos_book_order/static/description/assets/icons/ecom-black.png b/pos_book_order/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_book_order/static/description/assets/icons/ecom-black.png differ diff --git a/pos_book_order/static/description/assets/icons/education-black.png b/pos_book_order/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_book_order/static/description/assets/icons/education-black.png differ diff --git a/pos_book_order/static/description/assets/icons/hotel-black.png b/pos_book_order/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_book_order/static/description/assets/icons/hotel-black.png differ diff --git a/pos_book_order/static/description/assets/icons/license.png b/pos_book_order/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_book_order/static/description/assets/icons/license.png differ diff --git a/pos_book_order/static/description/assets/icons/lifebuoy.png b/pos_book_order/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_book_order/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_book_order/static/description/assets/icons/manufacturing-black.png b/pos_book_order/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_book_order/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_book_order/static/description/assets/icons/pos-black.png b/pos_book_order/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_book_order/static/description/assets/icons/pos-black.png differ diff --git a/pos_book_order/static/description/assets/icons/puzzle.png b/pos_book_order/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_book_order/static/description/assets/icons/puzzle.png differ diff --git a/pos_book_order/static/description/assets/icons/restaurant-black.png b/pos_book_order/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_book_order/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_book_order/static/description/assets/icons/service-black.png b/pos_book_order/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_book_order/static/description/assets/icons/service-black.png differ diff --git a/pos_book_order/static/description/assets/icons/trading-black.png b/pos_book_order/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_book_order/static/description/assets/icons/trading-black.png differ diff --git a/pos_book_order/static/description/assets/icons/training.png b/pos_book_order/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_book_order/static/description/assets/icons/training.png differ diff --git a/pos_book_order/static/description/assets/icons/update.png b/pos_book_order/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_book_order/static/description/assets/icons/update.png differ diff --git a/pos_book_order/static/description/assets/icons/user.png b/pos_book_order/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_book_order/static/description/assets/icons/user.png differ diff --git a/pos_book_order/static/description/assets/icons/wrench.png b/pos_book_order/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_book_order/static/description/assets/icons/wrench.png differ diff --git a/pos_book_order/static/description/assets/misc/categories.png b/pos_book_order/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/pos_book_order/static/description/assets/misc/categories.png differ diff --git a/pos_book_order/static/description/assets/misc/check-box.png b/pos_book_order/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/pos_book_order/static/description/assets/misc/check-box.png differ diff --git a/pos_book_order/static/description/assets/misc/compass.png b/pos_book_order/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/pos_book_order/static/description/assets/misc/compass.png differ diff --git a/pos_book_order/static/description/assets/misc/corporate.png b/pos_book_order/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/pos_book_order/static/description/assets/misc/corporate.png differ diff --git a/pos_book_order/static/description/assets/misc/customer-support.png b/pos_book_order/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/pos_book_order/static/description/assets/misc/customer-support.png differ diff --git a/pos_book_order/static/description/assets/misc/cybro_logo.png b/pos_book_order/static/description/assets/misc/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/pos_book_order/static/description/assets/misc/cybro_logo.png differ diff --git a/pos_book_order/static/description/assets/misc/cybrosys-logo.png b/pos_book_order/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/pos_book_order/static/description/assets/misc/cybrosys-logo.png differ diff --git a/pos_book_order/static/description/assets/misc/features.png b/pos_book_order/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/pos_book_order/static/description/assets/misc/features.png differ diff --git a/pos_book_order/static/description/assets/misc/logo.png b/pos_book_order/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_book_order/static/description/assets/misc/logo.png differ diff --git a/pos_book_order/static/description/assets/misc/pictures.png b/pos_book_order/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/pos_book_order/static/description/assets/misc/pictures.png differ diff --git a/pos_book_order/static/description/assets/misc/pie-chart.png b/pos_book_order/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/pos_book_order/static/description/assets/misc/pie-chart.png differ diff --git a/pos_book_order/static/description/assets/misc/right-arrow.png b/pos_book_order/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/pos_book_order/static/description/assets/misc/right-arrow.png differ diff --git a/pos_book_order/static/description/assets/misc/star.png b/pos_book_order/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/pos_book_order/static/description/assets/misc/star.png differ diff --git a/pos_book_order/static/description/assets/misc/support.png b/pos_book_order/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/pos_book_order/static/description/assets/misc/support.png differ diff --git a/pos_book_order/static/description/assets/misc/whatsapp.png b/pos_book_order/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/pos_book_order/static/description/assets/misc/whatsapp.png differ diff --git a/pos_book_order/static/description/assets/modules/1.png b/pos_book_order/static/description/assets/modules/1.png new file mode 100644 index 000000000..9d38a9e97 Binary files /dev/null and b/pos_book_order/static/description/assets/modules/1.png differ diff --git a/pos_book_order/static/description/assets/modules/2.png b/pos_book_order/static/description/assets/modules/2.png new file mode 100644 index 000000000..d939a2827 Binary files /dev/null and b/pos_book_order/static/description/assets/modules/2.png differ diff --git a/pos_book_order/static/description/assets/modules/3.png b/pos_book_order/static/description/assets/modules/3.png new file mode 100644 index 000000000..667c6aba4 Binary files /dev/null and b/pos_book_order/static/description/assets/modules/3.png differ diff --git a/pos_book_order/static/description/assets/modules/4.png b/pos_book_order/static/description/assets/modules/4.png new file mode 100644 index 000000000..20eb5f70c Binary files /dev/null and b/pos_book_order/static/description/assets/modules/4.png differ diff --git a/pos_book_order/static/description/assets/modules/5.png b/pos_book_order/static/description/assets/modules/5.png new file mode 100644 index 000000000..3f285a8e0 Binary files /dev/null and b/pos_book_order/static/description/assets/modules/5.png differ diff --git a/pos_book_order/static/description/assets/modules/6.png b/pos_book_order/static/description/assets/modules/6.png new file mode 100644 index 000000000..6d589b993 Binary files /dev/null and b/pos_book_order/static/description/assets/modules/6.png differ diff --git a/pos_book_order/static/description/assets/screenshots/Screenshot1.png b/pos_book_order/static/description/assets/screenshots/Screenshot1.png new file mode 100644 index 000000000..adcdcdcd7 Binary files /dev/null and b/pos_book_order/static/description/assets/screenshots/Screenshot1.png differ diff --git a/pos_book_order/static/description/assets/screenshots/Screenshot10.png b/pos_book_order/static/description/assets/screenshots/Screenshot10.png new file mode 100644 index 000000000..b6642e5e4 Binary files /dev/null and b/pos_book_order/static/description/assets/screenshots/Screenshot10.png differ diff --git a/pos_book_order/static/description/assets/screenshots/Screenshot2.png b/pos_book_order/static/description/assets/screenshots/Screenshot2.png new file mode 100644 index 000000000..de0dda96e Binary files /dev/null and b/pos_book_order/static/description/assets/screenshots/Screenshot2.png differ diff --git a/pos_book_order/static/description/assets/screenshots/Screenshot3.png b/pos_book_order/static/description/assets/screenshots/Screenshot3.png new file mode 100644 index 000000000..4e4ab97bb Binary files /dev/null and b/pos_book_order/static/description/assets/screenshots/Screenshot3.png differ diff --git a/pos_book_order/static/description/assets/screenshots/Screenshot4.png b/pos_book_order/static/description/assets/screenshots/Screenshot4.png new file mode 100644 index 000000000..69210198f Binary files /dev/null and b/pos_book_order/static/description/assets/screenshots/Screenshot4.png differ diff --git a/pos_book_order/static/description/assets/screenshots/Screenshot5.png b/pos_book_order/static/description/assets/screenshots/Screenshot5.png new file mode 100644 index 000000000..6f362a828 Binary files /dev/null and b/pos_book_order/static/description/assets/screenshots/Screenshot5.png differ diff --git a/pos_book_order/static/description/assets/screenshots/Screenshot6.png b/pos_book_order/static/description/assets/screenshots/Screenshot6.png new file mode 100644 index 000000000..d8c363940 Binary files /dev/null and b/pos_book_order/static/description/assets/screenshots/Screenshot6.png differ diff --git a/pos_book_order/static/description/assets/screenshots/Screenshot7.png b/pos_book_order/static/description/assets/screenshots/Screenshot7.png new file mode 100644 index 000000000..0c94d11ad Binary files /dev/null and b/pos_book_order/static/description/assets/screenshots/Screenshot7.png differ diff --git a/pos_book_order/static/description/assets/screenshots/Screenshot8.png b/pos_book_order/static/description/assets/screenshots/Screenshot8.png new file mode 100644 index 000000000..7d366828c Binary files /dev/null and b/pos_book_order/static/description/assets/screenshots/Screenshot8.png differ diff --git a/pos_book_order/static/description/assets/screenshots/Screenshot9.png b/pos_book_order/static/description/assets/screenshots/Screenshot9.png new file mode 100644 index 000000000..00a1550f1 Binary files /dev/null and b/pos_book_order/static/description/assets/screenshots/Screenshot9.png differ diff --git a/pos_book_order/static/description/assets/screenshots/hero.gif b/pos_book_order/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..2c69293c4 Binary files /dev/null and b/pos_book_order/static/description/assets/screenshots/hero.gif differ diff --git a/pos_book_order/static/description/banner.jpg b/pos_book_order/static/description/banner.jpg new file mode 100644 index 000000000..31f0a1878 Binary files /dev/null and b/pos_book_order/static/description/banner.jpg differ diff --git a/pos_book_order/static/description/icon.png b/pos_book_order/static/description/icon.png new file mode 100644 index 000000000..d2fb84b18 Binary files /dev/null and b/pos_book_order/static/description/icon.png differ diff --git a/pos_book_order/static/description/index.html b/pos_book_order/static/description/index.html new file mode 100644 index 000000000..b3f8c6573 --- /dev/null +++ b/pos_book_order/static/description/index.html @@ -0,0 +1,672 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + +

+ POS Booking Order +

+

+ Book orders for customers in POS

+ + +
+ +
+
+ +
+

+ Explore This + Module

+
+ + + +
+
+ +
+

+ Overview +

+
+
+
+ The module facilitates seamless booking of orders from shops, bars, and + restaurants in the Point of Sale (POS) system. Users have the + flexibility to create pickup or delivery orders, and subsequently + confirm the booked orders into POS orders. +
+
+ + +
+
+ +
+

+ Features +

+
+
+
+
+ + POS booking orders for Odoo15. +
+
+ + Booking orders from Shop,Bar/Restaurant in POS. +
+
+ + Available both pickup and delivery options. +
+
+ + Shows booked order details in order receipt and order. +
+
+
+ + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Enable Booking Orders + from the POS settings

+

+ Go to PoS Settings -> + Enable Booking orders. After enabling this, the options to book + orders and screen of booked orders will show in POS + session.

+ +
+
+

+ Booking Order button and Booked orders Screen

+

+ While clicking the booking order button it will open a + popup,that will book the order.

+ +
+

+ Booking Order Popup

+

+ We have two options for the booking order are picking or + delivery.Upon selecting the pickup option, + it shows a field to enter pickup date.

+ +
+
+

+ Fields to enter delivery date & address

+

+ When selected deliver option, it displays two fields to + enter delivery date and delivery address.

+ +
+
+

+ Booked Orders Screen

+

+ Not confirmed booked orders are can see here.

+ +
+
+

+ Can view order lines & customer assigned with order details + on confirming POS order

+ +
+
+

+ Order Receipt for pickup orders

+

+ In the case of picking order, the order receipt will be + shown as below.

+ +
+
+

+ Order Receipt for delivery orders

+

+ In the case of delivery order, the order receipt will be + shown as below. Delivery date and address are specified

+ +
+
+

+ The Backend view of the booked orders

+

+ Confirmed or paid booked orders are highlighted.

+ +
+
+

+ The PoS Order

+

+ The Book order ref will be updated on PoS Order

+ +
+
+
+ + +
+
+ +
+

+ Related + 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

+
+
+
+
+ + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need + help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on + WhatsApp!

+ +

+ +91 8606827707

+
+
+
+
+
+
+
+ +
+
+
+
+ \ No newline at end of file diff --git a/pos_book_order/static/src/js/BookOrderButton.js b/pos_book_order/static/src/js/BookOrderButton.js new file mode 100644 index 000000000..1eea070b8 --- /dev/null +++ b/pos_book_order/static/src/js/BookOrderButton.js @@ -0,0 +1,36 @@ +/** @odoo-module **/ +/* + * This file is used to register the a new button for booking orders with selected partner and products. + */ +import PosComponent from 'point_of_sale.PosComponent'; +import Registries from 'point_of_sale.Registries'; +import ProductScreen from 'point_of_sale.ProductScreen'; + +class BookOrderButton extends PosComponent { + onClick() { + // By clicking the booking order button, it will check whether at least one product and the selected customer or not, after that it will display popup. + var order_lines = this.env.pos.get_order().orderlines; + var partner = this.env.pos.get_order().get_client() + if (partner == null) { + this.showPopup('ErrorPopup', { + 'title': "Please Select the Customer", + 'body': "You need to select a customer for using this option", + }); + } else if (order_lines.length == 0) { + this.showPopup('ErrorPopup', { + 'title': "Orderline is empty", + 'body': "Please select at least one product", + }); + } else { + this.showPopup('BookOrderPopup', { + partner: partner, + }); + } + } +} +BookOrderButton.template = 'BookOrderButton'; +ProductScreen.addControlButton({ + component: BookOrderButton, + condition: () => true, +}); +Registries.Component.add(BookOrderButton); \ No newline at end of file diff --git a/pos_book_order/static/src/js/BookOrderPopup.js b/pos_book_order/static/src/js/BookOrderPopup.js new file mode 100644 index 000000000..3e4687ca9 --- /dev/null +++ b/pos_book_order/static/src/js/BookOrderPopup.js @@ -0,0 +1,46 @@ +/** @odoo-module **/ +/* + * This file is used to register the a new popup to book pickup and deliver orders. + */ +import AbstractAwaitablePopup from 'point_of_sale.AbstractAwaitablePopup'; +import Registries from 'point_of_sale.Registries'; +const rpc = require('web.rpc'); +import {Gui} from 'point_of_sale.Gui'; + +class BookOrderPopup extends AbstractAwaitablePopup { + setup() { + super.setup() + this.order = this.env.pos.get_order() + } + async onConfirm() { + // On clicking confirm button of popup a new book order with draft stage will created from the backend + var pickup_date = this.el.querySelector('#pickup_date').value; + var delivery_date = this.el.querySelector('#deliver_date').value; + var order_note = this.el.querySelector('.order_note').value; + var partner = this.order.get_client().id; + var address = this.el.querySelector('#delivery_address').value; + var phone = this.el.querySelector('#phone').value; + var date = this.order.creation_date; + var line = this.order.get_orderlines(); + var price_list = this.order.pricelist.id; + var product = { + 'product_id': [], + 'qty': [], + 'price':[] + }; + for (var i = 0; i < line.length; i++) { + product['product_id'].push(line[i].product.id) + product['qty'].push(line[i].quantity) + product['price'].push(line[i].price) + }; + await rpc.query({ + // This call for is creating a book order in the backend based on the value in popup + model: 'book.order', + method: 'create_booked_order', + args: [partner, phone, address, date, price_list, product, order_note, pickup_date, delivery_date] + }) + this.cancel(); + } +} +BookOrderPopup.template = 'BookOrderPopup'; +Registries.Component.add(BookOrderPopup); \ No newline at end of file diff --git a/pos_book_order/static/src/js/BookedOrdersButton.js b/pos_book_order/static/src/js/BookedOrdersButton.js new file mode 100644 index 000000000..63a4369f8 --- /dev/null +++ b/pos_book_order/static/src/js/BookedOrdersButton.js @@ -0,0 +1,29 @@ +/** @odoo-module **/ +/* + * This file is used to register the a new button to see booked orders data. + */ +import PosComponent from 'point_of_sale.PosComponent'; +import Registries from 'point_of_sale.Registries'; +import ProductScreen from 'point_of_sale.ProductScreen'; +const rpc = require('web.rpc'); + +class BookedOrdersButton extends PosComponent { + async onClick() { + // Fetch all booked order in draft stage to screen + var self = this + await rpc.query({ + model: 'book.order', + method: 'all_orders', + }).then(function(result) { + self.showScreen('BookedOrdersScreen', { + data: result + }); + }) + } +} +BookedOrdersButton.template = 'BookedOrdersButton'; +ProductScreen.addControlButton({ + component: BookedOrdersButton, + condition: () => true +}) +Registries.Component.add(BookedOrdersButton); \ No newline at end of file diff --git a/pos_book_order/static/src/js/BookedOrdersScreen.js b/pos_book_order/static/src/js/BookedOrdersScreen.js new file mode 100644 index 000000000..17d420391 --- /dev/null +++ b/pos_book_order/static/src/js/BookedOrdersScreen.js @@ -0,0 +1,39 @@ +/** @odoo-module **/ +/* + * This file is used to register a new screen for Booked orders. + */ +import Registries from 'point_of_sale.Registries'; +import TicketScreen from 'point_of_sale.TicketScreen'; +import {useListener} from "@web/core/utils/hooks"; + +class BookedOrdersScreen extends TicketScreen { + setup() { + super.setup(); + useListener('click-confirm', this._Confirm); + } + back() { + // on clicking the back button it will redirected Product screen + this.showScreen('ProductScreen'); + } + _Confirm(ev) { + // On clicking confirm button on each order a order will create with corresponding partner and products,user can do the payment + var self = this + var data = ev.detail + this.env.pos.add_new_order(); + for (var i of data.products) { + var product = self.env.pos.db.get_product_by_id(i['id']) + var qty = i['qty'] + this.env.pos.get_order().add_product(product, { + quantity: qty, + price: i['price'] + }) + } + var partner_id = data.partner_id + this.env.pos.get_order().set_client(this.env.pos.db.get_partner_by_id(partner_id)); + this.env.pos.get_order().is_booked = true + this.env.pos.get_order().booked_data = data + this.showScreen('ProductScreen'); + } +} +BookedOrdersScreen.template = 'BookedOrdersScreen'; +Registries.Component.add(BookedOrdersScreen); \ No newline at end of file diff --git a/pos_book_order/static/src/js/models.js b/pos_book_order/static/src/js/models.js new file mode 100644 index 000000000..177115939 --- /dev/null +++ b/pos_book_order/static/src/js/models.js @@ -0,0 +1,32 @@ +/* + * This file is used to add some fields to order class for some reference. +*/ +odoo.define('pos_book_order.ModelExtend', function (require) { + "use strict"; +var models = require('point_of_sale.models'); + + var super_order_model = models.Order.prototype; + models.Order = models.Order.extend({ + initialize: function (attributes, options) { + super_order_model.initialize.apply(this, arguments); + if (options.json) { + this.is_booked = options.json.is_booked || false; + this.booked_data = options.json.booked_data || undefined; + } + }, + init_from_JSON: function (json){ + // This function is overrided for assigning json value to this + super_order_model.init_from_JSON.apply(this, arguments); + this.is_booked = json.is_booked; + this.booked_data = json.booked_data + }, + export_as_JSON:function(){ + // This function is overrided for assign this to json for new field + const json = super_order_model.export_as_JSON.apply(this, arguments); + json.booked_data = this.booked_data; + json.is_booked = this.is_booked; + return json; + } + + }); +}); \ No newline at end of file diff --git a/pos_book_order/static/src/xml/BookOrderPopup.xml b/pos_book_order/static/src/xml/BookOrderPopup.xml new file mode 100644 index 000000000..736f59e66 --- /dev/null +++ b/pos_book_order/static/src/xml/BookOrderPopup.xml @@ -0,0 +1,150 @@ + + + + +