diff --git a/pos_book_order/README.rst b/pos_book_order/README.rst new file mode 100644 index 000000000..a8d0cea59 --- /dev/null +++ b/pos_book_order/README.rst @@ -0,0 +1,48 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://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: (v17) Ranjith R @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..8af1102ce --- /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: Ranjith R (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..10db4fcd7 --- /dev/null +++ b/pos_book_order/__manifest__.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Ranjith R (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': '17.0.1.0.0', + 'category': 'Point of Sale', + 'summary': """From a POS session, users can create pickup or + delivery orders, which they can then confirm as POS orders.""", + '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.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'point_of_sale'], + 'data': ['security/ir.model.access.csv', + 'data/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': [ + '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', + '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', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': 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..980ae70b4 --- /dev/null +++ b/pos_book_order/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 11.01.2024 +#### Version 17.0.1.0.0 +##### ADD +- Initial Commit for POS Booking Order + diff --git a/pos_book_order/models/__init__.py b/pos_book_order/models/__init__.py new file mode 100644 index 000000000..7d2d26b65 --- /dev/null +++ b/pos_book_order/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ranjith R (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_config +from . import pos_order diff --git a/pos_book_order/models/book_order.py b/pos_book_order/models/book_order.py new file mode 100644 index 000000000..29f2851f5 --- /dev/null +++ b/pos_book_order/models/book_order.py @@ -0,0 +1,192 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ranjith R (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 +from odoo.fields import Command + + +class BookOrder(models.Model): + """ + Model for managing booked orders in the POS system. + """ + _name = 'book.order' + _description = "Point of Sale Booked Orders" + + @api.model + def _amount_line_tax(self, line, fiscal_position_id): + """ Calculates the tax amount of the order line. + :param line: Order line record + :param fiscal_position_id: Fiscal position account for order + :return float: Total tax amount as float + """ + 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) + + name = fields.Char(string='Booking Ref', readonly=True, + help="Name of the booked order", + copy=False, default='/') + company_id = fields.Many2one('res.company', string='Company', + help="Company of the booked order", + default=lambda self: self.env.user.company_id) + date_quotation = fields.Datetime(string='Quotation Date', + help="Quotation created date", + readonly=True, index=True, + default=fields.Datetime.now) + date_order = fields.Date(string='Order Date', help="Order created date", + readonly=True, index=True, + default=fields.Date.today()) + amount_tax = fields.Float(compute='_compute_amount_all', string='Taxes', + help="Tax amount for the order", + dig06its=0, default=1.2) + amount_total = fields.Float(compute='_compute_amount_all', string='Total', + help="Total amount of the order", + digits=0) + book_line_ids = fields.One2many('book.order.line', + 'order_id', + help="Order Line of book orders", + string='Order Lines', + copy=True) + partner_id = fields.Many2one('res.partner', string='Customer', + help="Partner of the order", + change_default=True, index=True) + state = fields.Selection([('draft', 'New'), + ('confirmed', 'Confirmed')], + string='Status', readonly=True, copy=False, + help="Current status of the order", + default='draft') + note = fields.Text(string='Internal Notes', + help="Enter any notes regarding 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="Picking date of the order") + deliver_date = fields.Datetime(string='Deliver Date', readonly=True, + help="Delivering date of the order") + phone = fields.Char('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 the order") + + @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 = self.env.company.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) + + def action_confirm(self): + """ Function to confirm the book order""" + self.write({ + 'state': 'confirmed', + }) + + @api.model + def create_booked_order(self, partner, phone, address, date, price_list, + product, note, pickup_date, delivery_date): + """ 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 + """ + order = self.create({ + 'partner_id': partner, + 'phone': phone, + 'delivery_address': address, + 'pricelist_id': price_list if price_list else False, + 'date_quotation': fields.Date.today(), + 'book_line_ids': [Command.create({ + '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_date: + order.write({'pickup_date': pickup_date + ' 00:00:00'}) + if delivery_date: + order.write({'deliver_date': delivery_date + ' 00:00:00'}) + + @api.model + def all_orders(self): + """ To fetch all draft stage orders to PoS Booked orders screen + :return dict: A list of dictionaries containing information + about each order + """ + 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..aecfb98da --- /dev/null +++ b/pos_book_order/models/book_order_line.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ranjith R (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="Company of the booked order", + default=lambda self: self.env.user.company_id) + product_id = fields.Many2one('product.product', + help="Select products for ordering", + string='Product', + domain=[('sale_ok', '=', True)], + required=True, change_default=True) + price_unit = fields.Float(string='Unit Price', + help="Unite price of selected product", digits=0) + qty = fields.Float(string='Quantity', default=1, + help="Enter how much quantity of product want ") + price_subtotal = fields.Float(compute='_compute_amount_line_all', + digits=0, + help="Sub total amount of each order line" + "without tax", + string='Subtotal w/o Tax') + price_subtotal_incl = fields.Float(compute='_compute_amount_line_all', + digits=0, string='Subtotal', + help="Sub total amount of each order " + "line with tax") + discount = fields.Float(string='Discount (%)', digits=0, default=0.0, + help="You can apply discount for each product") + order_id = fields.Many2one('book.order', string='Order Ref', + help="Relation to book order field", + ondelete='cascade') + tax_ids = fields.Many2many('account.tax', string='Taxes', + readonly=True, help="Taxes for each line") + tax_after_fiscal_position_ids = fields.Many2many( + 'account.tax', 'account_tax_rel', 'uid', + 'tag_id', string='Taxes', help="Fiscal position after entering " + "the tax") + + @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 = self.env.company.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..b52f613bf --- /dev/null +++ b/pos_book_order/models/pos_config.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ranjith R (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 pos") diff --git a/pos_book_order/models/pos_order.py b/pos_book_order/models/pos_order.py new file mode 100644 index 000000000..3f269381a --- /dev/null +++ b/pos_book_order/models/pos_order.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ranjith R (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="Booked order reference for the pos order") + + @api.model + def _order_fields(self, ui_order): + """Overriding to pass 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.get('is_booked'): + order_fields['booking_ref_id'] = ui_order.get('booked_data')['id'] + self.env['book.order'].browse( + ui_order.get('booked_data')['id']).write( + {'state': 'confirmed'}) + return order_fields \ No newline at end of file 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/capture (1).png b/pos_book_order/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/pos_book_order/static/description/assets/icons/capture (1).png differ 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/img.png b/pos_book_order/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/pos_book_order/static/description/assets/icons/img.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/photo-capture.png b/pos_book_order/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/pos_book_order/static/description/assets/icons/photo-capture.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/Cybrosys R.png b/pos_book_order/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/pos_book_order/static/description/assets/misc/Cybrosys R.png differ diff --git a/pos_book_order/static/description/assets/misc/email.svg b/pos_book_order/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/pos_book_order/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_book_order/static/description/assets/misc/phone.svg b/pos_book_order/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/pos_book_order/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/pos_book_order/static/description/assets/misc/star (1) 2.svg b/pos_book_order/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/pos_book_order/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_book_order/static/description/assets/misc/support (1) 1.svg b/pos_book_order/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/pos_book_order/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_book_order/static/description/assets/misc/support-email.svg b/pos_book_order/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/pos_book_order/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/pos_book_order/static/description/assets/misc/tick-mark.svg b/pos_book_order/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/pos_book_order/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/pos_book_order/static/description/assets/misc/whatsapp 1.svg b/pos_book_order/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/pos_book_order/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_book_order/static/description/assets/misc/whatsapp.svg b/pos_book_order/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/pos_book_order/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_book_order/static/description/assets/modules/1.jpg b/pos_book_order/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..08bbafeb6 Binary files /dev/null and b/pos_book_order/static/description/assets/modules/1.jpg 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..a1209a01f 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.jpg b/pos_book_order/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..3d171226b Binary files /dev/null and b/pos_book_order/static/description/assets/modules/3.jpg differ diff --git a/pos_book_order/static/description/assets/modules/4.jpg b/pos_book_order/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..1f3f2e27f Binary files /dev/null and b/pos_book_order/static/description/assets/modules/4.jpg differ diff --git a/pos_book_order/static/description/assets/modules/5.jpg b/pos_book_order/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..0db717519 Binary files /dev/null and b/pos_book_order/static/description/assets/modules/5.jpg differ diff --git a/pos_book_order/static/description/assets/modules/6.jpg b/pos_book_order/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..cd62a577c Binary files /dev/null and b/pos_book_order/static/description/assets/modules/6.jpg differ diff --git a/pos_book_order/static/description/assets/modules/m1.png b/pos_book_order/static/description/assets/modules/m1.png new file mode 100644 index 000000000..5ecc4d883 Binary files /dev/null and b/pos_book_order/static/description/assets/modules/m1.png differ diff --git a/pos_book_order/static/description/assets/modules/m2.png b/pos_book_order/static/description/assets/modules/m2.png new file mode 100644 index 000000000..89ff6c635 Binary files /dev/null and b/pos_book_order/static/description/assets/modules/m2.png differ diff --git a/pos_book_order/static/description/assets/modules/m3.png b/pos_book_order/static/description/assets/modules/m3.png new file mode 100644 index 000000000..fd1f87699 Binary files /dev/null and b/pos_book_order/static/description/assets/modules/m3.png differ diff --git a/pos_book_order/static/description/assets/modules/m4.png b/pos_book_order/static/description/assets/modules/m4.png new file mode 100644 index 000000000..5514bb8d4 Binary files /dev/null and b/pos_book_order/static/description/assets/modules/m4.png differ diff --git a/pos_book_order/static/description/assets/modules/m5.png b/pos_book_order/static/description/assets/modules/m5.png new file mode 100644 index 000000000..38ea1f663 Binary files /dev/null and b/pos_book_order/static/description/assets/modules/m5.png differ diff --git a/pos_book_order/static/description/assets/modules/m6.png b/pos_book_order/static/description/assets/modules/m6.png new file mode 100644 index 000000000..f52b99646 Binary files /dev/null and b/pos_book_order/static/description/assets/modules/m6.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..84bda6b5d 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..094671974 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..f25f380b4 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..822763a4d 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..42e610280 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..e9f2f92f1 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..02f8cbe4b 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..f77ae972c 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..dd83399ad 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..15afb9e74 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..a45440ebd 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.png b/pos_book_order/static/description/banner.png new file mode 100644 index 000000000..6dffe78cc Binary files /dev/null and b/pos_book_order/static/description/banner.png 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..13fd8cd48 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..c63ffb72b --- /dev/null +++ b/pos_book_order/static/description/index.html @@ -0,0 +1,691 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ POS Booking Order

+

+ Book orders for customers in the POS +

+
+ +
+
+
+
+
+

Key Highlights +

+
+
+
+
+
+ +
+
+

Booking orders from Shop,Bar/Restaurant in POS.

+

Option to enter booking from customers in pos. +

+
+
+
+
+
+
+ +
+
+

Available both pickup and delivery options.

+

Can choose type order both pickup and delivery. +

+
+
+
+
+
+
+ +
+
+

Shows booked order details in order receipt and order.

+

Details of the booking are printed in receipt +

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

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.

+
+
+
+
+
+
+ +
+
+

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

+
+
+
+
+
+
+ +
+
+

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

+
+
+
+
+
+
+ +
+
+

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

+
+
+
+
+
+
+ +
+
+

Non-confirmed booked orders are can see here.

+
+
+
+
+
+
+ +
+
+

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

+
+
+
+
+
+
+ +
+
+

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

+
+
+
+
+
+
+ +
+
+

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

+
+
+
+ +
+
+
+ +
+
+

Confirmed or paid booked orders are highlighted.

+
+
+
+
+
+
+ +
+
+

The Book order ref will be updated on PoS Order

+
+
+
+
+
+
+
    +
  • + Booking orders from Shop,Bar/Restaurant in POS. +
  • +
  • + Available both pickup and delivery options. +
  • +
  • + Shows booked order details in order receipt and order. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:11th Jan 2024 +
+

+ + Initial Commit for POS Booking Order.

+
+
+
+
+
+
+
+

Related Products

+
+
+ +
+
+

Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

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 + 99456767686
+
+
+
+
+
+
+
+
+ + + + + + 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..8b7650984 --- /dev/null +++ b/pos_book_order/static/src/js/BookOrderButton.js @@ -0,0 +1,59 @@ +/** @odoo-module **/ +/* + * This file is used to register the a new button for booking orders with selected partner and products. + */ + /** @odoo-module **/ + +import { _t } from "@web/core/l10n/translation"; +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { useService } from "@web/core/utils/hooks"; +import { Component } from "@odoo/owl"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { BookOrderPopup } from "./BookOrderPopup"; +import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup"; + + + +export class BookOrderButton extends Component { + static template = "pos_book_order.BookOrderButton"; + + setup() { + this.pos = usePos(); + this.popup = useService("popup"); + } + async 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=this.pos.selectedOrder + var order_lines = order.orderlines; + var partner = order.partner + if (partner == null) { + this.pos.popup.add(ErrorPopup, { + title: _t("Please Select the Customer"), + body: _t( + "You need to select a customer for using this option" + ), + }); + } else if (order_lines.length == 0) { + this.pos.popup.add(ErrorPopup, { + title: _t("Order line is empty"), + body: _t( + "Please select at least one product" + ), + }); + } else { + await this.pos.popup.add(BookOrderPopup, { + title: _t("Book Order"), + partner:partner, + order:order, + currentDate: new Date().toISOString().split('T')[0], + }); + } + } +} + +ProductScreen.addControlButton({ + component: BookOrderButton, + condition: function () { + return this.pos.config.enable; + }, +}); 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..5762020dd --- /dev/null +++ b/pos_book_order/static/src/js/BookOrderPopup.js @@ -0,0 +1,81 @@ +/** @odoo-module */ + +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { _t } from "@web/core/l10n/translation"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { useRef } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; + + +/** + * This class represents a custom popup for capturing signatures in the Point of Sale. + * It extends the AbstractAwaitablePopup class. + */ +export class BookOrderPopup extends AbstractAwaitablePopup { + static template = "pos_book_order.BookOrderPopup"; + static defaultProps = { + confirmText: _t("Save"), + cancelText: _t("Discard"), + clearText: _t("Clear"), + title: "", + body: "", + }; + setup() { + super.setup(); + this.pos = usePos(); + this.orm = useService("orm"); + this.order = this.pos.selectedOrder + this.pickup_date = useRef("pickUpDate") + this.order_note= useRef("orderNote") + this.delivery_date= useRef("deliveryDate") + this.pickup= useRef("pickup_radio") + this.delivery= useRef("deliver_radio") + this.Method_pickup= useRef("Method_pickup") + this.Method_deliver= useRef("Method_deliver") + } + showHide(){ + if(this.pickup.el.checked){ + this.Method_pickup.el.style.display='block' + this.Method_deliver.el.style.display='none' + } + if(this.delivery.el.checked){ + this.Method_pickup.el.style.display='none' + this.Method_deliver.el.style.display='block' + } + console.log(this.delivery.el.checked) + console.log(this.pickup.el.checked) + } + + async confirm() { + // on clicking confirm button of popup a new book order with draft stage will created from the backend + var pickup_date = this.pickup_date.el.value; + var delivery_date = this.delivery_date.el.value; + var order_note = this.order_note.el.value; + var partner = this.order.partner.id; + var address = this.order.partner.address; + var phone = this.order.partner.phone; + var date = this.order.date_order; + var line = this.order.orderlines; + if(this.order.pricelist){ + var price_list = this.order.pricelist.id; + } + else{ + var price_list = false; + } + 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 this.orm.call( + "book.order", "create_booked_order", [partner, phone, address, date, price_list,product, order_note, pickup_date, delivery_date], {} + ) + this.cancel(); + } + +} 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..80bbae63b --- /dev/null +++ b/pos_book_order/static/src/js/BookedOrdersButton.js @@ -0,0 +1,31 @@ +/** @odoo-module **/ +/* + * This file is used to register the a new button to see booked orders data. + */ +import { Component } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; + +class BookedOrdersButton extends Component { +static template = 'pos_book_order.BookedOrdersButton'; + setup() { + this.orm = useService("orm"); + this.pos = usePos(); + } + async onClick() { + // fetch all booked order in draft stage to screen + var self = this + await this.orm.call( + "book.order", "all_orders", [], {} + ).then(function(result) { + self.pos.showScreen('BookedOrdersScreen', { + data: result + }); + }) + } +} +ProductScreen.addControlButton({ + component: BookedOrdersButton, + condition: () => true +}) 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..acf888e28 --- /dev/null +++ b/pos_book_order/static/src/js/BookedOrdersScreen.js @@ -0,0 +1,43 @@ +/** @odoo-module **/ +/* + * This file is used to register a new screen for Booked orders. + */ +import { registry } from "@web/core/registry"; +import { TicketScreen } from "@point_of_sale/app/screens/ticket_screen/ticket_screen"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { useService } from "@web/core/utils/hooks"; + +class BookedOrdersScreen extends TicketScreen { + static template = "pos_book_order.BookedOrdersScreen"; + setup() { + super.setup(); + this.pos = usePos(); + this.orm = useService("orm"); + } + back() { + // on clicking the back button it will redirected Product screen + this.pos.showScreen('ProductScreen'); + } + async _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 + await this.orm.call('book.order', 'action_confirm',[data.id],{}) + var order=this.pos.add_new_order(); + for (var i of data.products) { + var product = self.pos.db.get_product_by_id(i['id']) + var qty = i['qty'] + order.add_product(product, { + quantity: qty, + price: i['price'] + }) + } + var partner_id = data.partner_id + order.set_partner(this.pos.db.get_partner_by_id(partner_id)); + this.pos.selectedOrder.is_booked = true + this.pos.selectedOrder.booked_data = data + this.pos.selectedOrder.booking_ref_id = data.id + this.pos.showScreen('ProductScreen'); + } +} +registry.category("pos_screens").add("BookedOrdersScreen", BookedOrdersScreen); 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..7877dc118 --- /dev/null +++ b/pos_book_order/static/src/js/models.js @@ -0,0 +1,46 @@ +/** @odoo-module **/ +/* + * This file is used to add some fields to order class for some reference. + */ + +import { Order } from "@point_of_sale/app/store/models"; +import { patch } from "@web/core/utils/patch"; + +patch(Order.prototype, { + /** + * Override the setup method to initialize custom signature properties. + * @param {Object} options - Options passed to the setup method. + */ + setup(options) { + super.setup(...arguments); + if (options.json) { + this.booking_ref_id= options.json.booking_ref_id || false; + this.is_booked = options.json.is_booked || false; + this.booked_data = options.json.booked_data || undefined; + } + }, + /** + * Initialize the order object from a JSON representation. + * @param {Object} json - JSON data representing the order. + */ + init_from_JSON(json) { + super.init_from_JSON(...arguments); + // this function is overrided for assigning json value to this + super.init_from_JSON(...arguments); + this.booking_ref_id= json.booking_ref_id; + this.is_booked = json.is_booked; + this.booked_data = json.booked_data + }, + /** + * Export the order object as a JSON representation. + * @returns {Object} JSON data representing the order. + */ + export_as_JSON() { + // this function is overrided for assign this to json for new field + const json = super.export_as_JSON(...arguments); + json.booking_ref_id=this.booking_ref_id + json.booked_data = this.booked_data; + json.is_booked = this.is_booked; + return json; + }, +}); 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..29a25c20e --- /dev/null +++ b/pos_book_order/static/src/xml/BookOrderPopup.xml @@ -0,0 +1,132 @@ + + + + +