diff --git a/laundry_management_pos/README.rst b/laundry_management_pos/README.rst new file mode 100644 index 000000000..e51787da9 --- /dev/null +++ b/laundry_management_pos/README.rst @@ -0,0 +1,50 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +POS Laundry Management +====================== +* From the POS we need to generate Laundry orders in the back end with out close the current window. +* Automatically create Laundry order form POS sale. +* We can assign which products make Laundry order Automatically. +* We can assign which Service type make Laundry order. + + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License v3.0 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + + +Credits +------- +* Developer: (V15) Risvana A R, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/laundry_management_pos/__init__.py b/laundry_management_pos/__init__.py new file mode 100644 index 000000000..26e4e297a --- /dev/null +++ b/laundry_management_pos/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Risvana A 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import controllers +from . import models + + diff --git a/laundry_management_pos/__manifest__.py b/laundry_management_pos/__manifest__.py new file mode 100644 index 000000000..15f124d5f --- /dev/null +++ b/laundry_management_pos/__manifest__.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Risvana A 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': "POS Laundry Management", + 'version': '15.0.1.0.0', + 'category': 'Point of Sale', + 'summary': """Launch Automatic Laundry Orders After selling Through POS.""", + 'description': """Launch automatic Laundry Orders after selling through POS""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['point_of_sale', 'laundry_management'], + 'data': [ + 'views/pos_config_views.xml', + 'views/laundry_order_views.xml', + 'views/pos_order_views.xml', + ], + 'assets': { + 'point_of_sale.assets': [ + 'laundry_management_pos/static/src/css/pos.css', + 'laundry_management_pos/static/src/js/product_img.js', + 'laundry_management_pos/static/src/js/models.js', + 'laundry_management_pos/static/src/js/order_line.js', + 'laundry_management_pos/static/src/js/pos_receipt.js', + 'laundry_management_pos/static/src/js/button/product_create_button.js', + 'laundry_management_pos/static/src/js/button/washing_type_button.js', + 'laundry_management_pos/static/src/js/screen/product_create_popup.js', + 'laundry_management_pos/static/src/js/screen/washing_type_popup.js', + ], + 'web.assets_qweb': [ + 'laundry_management_pos/static/src/xml/product_img.xml', + 'laundry_management_pos/static/src/xml/pos_receipt.xml', + 'laundry_management_pos/static/src/xml/button/product_create_button.xml', + 'laundry_management_pos/static/src/xml/button/washing_type_button.xml', + 'laundry_management_pos/static/src/xml/screen/product_create_popup.xml', + 'laundry_management_pos/static/src/xml/screen/washing_type_popup.xml', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/laundry_management_pos/controllers/__init__.py b/laundry_management_pos/controllers/__init__.py new file mode 100644 index 000000000..980d6cdd8 --- /dev/null +++ b/laundry_management_pos/controllers/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Risvana A 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import laundry_management_pos diff --git a/laundry_management_pos/controllers/laundry_management_pos.py b/laundry_management_pos/controllers/laundry_management_pos.py new file mode 100644 index 000000000..af92b6f6b --- /dev/null +++ b/laundry_management_pos/controllers/laundry_management_pos.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Author: Risvana A 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo import http +from odoo.http import request + + +class PosProductCreation(http.Controller): + """Class PosProductCreation is used to create a product from the POS Screen""" + @http.route('/create_product', type="json", auth="none") + def create_product(self, category, name, price, product_reference, + unit_measure, product_categories): + """Used for creating product from the point of sale view + that easily create a new product from the point of sale""" + categories = { + 'Consumable': 'consu', + 'Service': 'service', + 'Storable': 'product' + } + request.env['product.template'].sudo().create({ + 'name': name, + 'detailed_type': categories.get(category, ''), + 'default_code': product_reference, + 'list_price': float(price), + 'uom_id': int(unit_measure), + 'uom_po_id': int(unit_measure), + 'categ_id': int(product_categories), + 'available_in_pos': True, + }) diff --git a/laundry_management_pos/doc/RELEASE_NOTES.md b/laundry_management_pos/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..daa8fef36 --- /dev/null +++ b/laundry_management_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 16.10.2023 +#### Version 15.0.1.0.0 +#### ADD +- Initial commit for POS Laundry Management diff --git a/laundry_management_pos/models/__init__.py b/laundry_management_pos/models/__init__.py new file mode 100644 index 000000000..661053f80 --- /dev/null +++ b/laundry_management_pos/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Risvana A 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import laundry_order +from . import pos_config +from . import pos_order + diff --git a/laundry_management_pos/models/laundry_order.py b/laundry_management_pos/models/laundry_order.py new file mode 100644 index 000000000..1ad43b53d --- /dev/null +++ b/laundry_management_pos/models/laundry_order.py @@ -0,0 +1,226 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Risvana A 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +import json +from odoo import api, fields, models, _ + + +class LaundryOrder(models.Model): + """ This class is inherited for model laundry_order. + It contains fields and the functions for the model + + Methods: + _compute_amount_all(self): + Action perform to computing the total amounts of the LaundryOrder. + + _compute_tax_totals_json(self): + Action perform to computing the total tax amount using the order-lines tax and amount. + + _invoice_count(self): + Action perform to computing the invoice count based on the particular Laundry order. + + _work_count(self): + Action perform to computing the work count based on the particular Laundry order. + + action_view_laundry_works(self): + Action perform to works details of the LaundryOrder , the laundry work smart button views are displayed. + + action_view_invoice(self): + Action perform to Invoice details of the LaundryOrder when opening the smart button we can view the invoice details. + """ + _inherit = 'laundry.order' + + order_ref = fields.Char(string='Order Ref', + help='Reference field for order') + pos_reference = fields.Char(string='Receipt Number', + help='Reference field for POS') + is_invoiced = fields.Boolean(string='Is Invoiced', invisible=1, + help='Boolean field for checking and ' + 'adding the invoices') + pos_order = fields.Boolean(string='Is POS order', + help='Boolean field for pos order ' + 'identification') + pos_order_id = fields.Many2one('pos.order', string='POS order', + help='Relating the many2one field for pos.order') + tax_totals_json = fields.Char(compute='_compute_tax_totals_json', + help='For computing the tax ') + amount_untaxed = fields.Monetary(string='Untaxed Amount', + compute='_compute_amount_all', + help='For computing the untaxed amount') + amount_tax = fields.Monetary(string='Taxes', compute='_compute_amount_all', + help='Compute the tax amounts') + total_amount = fields.Monetary(string='Total', store=True, + compute='_compute_amount_all', + help='Compute the total amount') + + @api.depends('order_lines') + def _compute_amount_all(self): + """ + Compute the total amounts of the LaundryOrder. + """ + for order in self: + amount_untaxed = amount_tax = 0.0 + for line in order.order_lines: + amount_untaxed += line.amount + amount_tax += line.price_tax + order.update({ + 'amount_untaxed': amount_untaxed, + 'amount_tax': amount_tax, + 'total_amount': amount_untaxed + amount_tax, + }) + + @api.depends('order_lines.tax_ids', 'order_lines.amount', + 'total_amount') + def _compute_tax_totals_json(self): + """ computing the total tax amount using the order-lines + tax and amount""" + def compute_taxes(order_lines): + price = order_lines.amount + orders = order_lines.laundry_obj + return order_lines.tax_ids._origin.compute_all(price, + orders.currency_id, + product= + order_lines.product_id, + partner= + orders.partner_shipping_id) + + for order in self: + tax_lines_data = self.env['account.move']._prepare_tax_lines_data_for_totals_from_object( + order.order_lines, compute_taxes) + tax_totals = self.env['account.move']._get_tax_totals( + order.partner_id, tax_lines_data, order.order_lines.amount, + order.total_amount, order.currency_id) + order.tax_totals_json = json.dumps(tax_totals) + + def _invoice_count(self): + """Computing the invoice count based on the particular Laundry order + override the _invoice_count function""" + work = self.env['pos.order'].search( + [('name', '=', self.order_ref)]) + if not work: + wrk_ordr_ids = self.env['account.move'].search([('invoice_origin', '=', + self.sale_obj.name)]) + self.invoice_count = len(wrk_ordr_ids) + else: + work_orders = self.env['account.move'].search([('invoice_origin', + '=', work.name)]) + self.invoice_count = len(work_orders) + self.is_invoiced = True + + def _work_count(self): + """Computing the work count based on the particular Laundry order + override the _work_count function""" + work = self.env['pos.order'].search( + [('name', '=', self.order_ref)]) + if not work: + if self.id: + wrk_ordr_ids = self.env['washing.washing'].search([('laundry_obj.laundry_obj.id', '=', self.id)]) + self.work_count = len(wrk_ordr_ids) + else: + self.work_count = False + else: + self.work_count = len(work.lines) + + def action_view_laundry_works(self): + """ + works details of the LaundryOrder , the laundry work + smart button views are displayed here. + """ + result = super().action_view_laundry_works() + pos_orders = self.env['pos.order'].search( + [('name', '=', self.order_ref)]) + pos_order_ids = pos_orders.mapped('id') + view_id = self.env.ref('laundry_management.washing_form_view').id + if pos_orders and len(pos_orders.lines) <= 1: + return { + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'washing.washing', + 'view_id': view_id, + 'type': 'ir.actions.act_window', + 'name': _('Works'), + 'res_id': pos_order_ids and pos_order_ids[0] + } + + return result + + def action_view_invoice(self): + """ + Invoice details of the LaundryOrder when opening the smart button + we can view the invoice details. + """ + result = super(LaundryOrder, self).action_view_invoice() + work = self.env['pos.order'].search( + [('name', '=', self.order_ref)]) + invoice = self.env['account.move'].search( + [('invoice_origin', '=', work.name)]) + invoice_ids = invoice.mapped('id') + view_id = self.env.ref('account.view_move_form').id + if invoice and len(invoice_ids) <= 1: + return { + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'account.move', + 'view_id': view_id, + 'type': 'ir.actions.act_window', + 'name': _('Invoice'), + 'res_id': invoice_ids and invoice_ids[0] + } + return result + + +class LaundryOrderLine(models.Model): + """ This class is inherited for model laundry_order_line. + It contains fields and the functions for the model + + Methods: + _compute_price_tax(self): + Action perform to compute the subtotal amounts of the LaundryOrder line. + + """ + _inherit = 'laundry.order.line' + + # washing_type field is updated with the module Laundry Management + washing_type = fields.Many2one('washing.type', string='Washing Type', + required=False, + help='The many2one field for relating' + ' to the washing type') + tax_ids = fields.Many2many('account.tax', string='Taxes', + help='The many2one field for relating to ' + 'the account tax') + price_tax = fields.Float(compute='_compute_price_tax', string='Total Tax', + help='The compute field for calculating price ' + 'tax') + + @api.depends('qty', 'washing_type', 'extra_work', 'tax_ids') + def _compute_price_tax(self): + """ + Compute the amounts of the LaundryOrder line ie used to calculate subtotal amount with the quantity of product and the washing types. + """ + for line in self: + price = line.washing_type.amount + taxes = line.tax_ids.compute_all(price, + line.laundry_obj.currency_id, + line.qty, + product=line.product_id, + partner=line.laundry_obj.partner_shipping_id) + line.update({ + 'price_tax': taxes['total_included'] - taxes['total_excluded'], + }) diff --git a/laundry_management_pos/models/pos_config.py b/laundry_management_pos/models/pos_config.py new file mode 100644 index 000000000..92da22539 --- /dev/null +++ b/laundry_management_pos/models/pos_config.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Risvana A 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo import fields, models + + + +class PosConfig(models.Model): + """ This class is inherited for model pos_config. + It contains field for the model + """ + + _inherit = 'pos.config' + + orderline_washing_type = fields.Boolean(string='Washing Type', + help='Allow to add Washing type' + ' for customer on OrderLines') diff --git a/laundry_management_pos/models/pos_order.py b/laundry_management_pos/models/pos_order.py new file mode 100644 index 000000000..f4762bf87 --- /dev/null +++ b/laundry_management_pos/models/pos_order.py @@ -0,0 +1,166 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Risvana A 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from datetime import datetime +from odoo import api, fields, models, _ +from odoo.tools import float_repr + + + +class PosOrderLine(models.Model): + """ This class is inherited for model pos_order_line. + It contains field and the functions for the model + + Methods: + _export_for_ui(self, orderline): + Supering the export_for_ui function for generating the washing type in the order line for the model. + + _order_line_fields(self, line, session_id): + Action perform to adding order-line details in the pos orders. + """ + _inherit = 'pos.order.line' + + washing_type_id = fields.Many2one('washing.type', + String='Washing Type', + help='The many2one filed that related' + ' to the washing type') + + def _export_for_ui(self, orderline): + """super the exporting function in the pos order line""" + result = super()._export_for_ui(orderline) + + result['washing_type_id'] = \ + orderline.washing_type.read(fields=['name'])[0] + return result + + def _order_line_fields(self, line, session_id): + """ + Adding order-line details in the pos orders + """ + result = super()._order_line_fields(line, session_id) + vals = result[2] + washing_type_id = line[2].get('washingType_id') + new_values = {'washing_type_id': int(washing_type_id)} + vals.update(new_values) + return result + + +class PosOrder(models.Model): + """ This class is inherited for model pos_order. + It contains fields and the functions for the model + + Methods: + create_from_ui(self, orders, draft=False): + Supering the create_from_ui that create and update Orders from the frontend PoS application line for the model. + + _prepare_invoice_lines(self): + Action perform to create Invoice for the corresponding POS order + + """ + _inherit = "pos.order" + + orderline_washing_type = fields.Boolean(string='Washing Type in orderline', + related='session_id.config_id.orderline_washing_type', + help='Related to the type in the pos session washing type id') + laundry_order = fields.Boolean('Laundry', + help='Field for calling the invoice' + ' functionality') + + @api.model + def create_from_ui(self, orders, draft=False): + """ Create and update Orders from the frontend PoS application. + """ + order = super(PosOrder, self).create_from_ui(orders=orders, + draft=draft) + + order_id = order[0]['id'] + values = self.env['pos.order'].browse(order_id) + values.write({ + 'laundry_order': True, + }) + if values.laundry_order: + values.action_pos_order_invoice() + lines = [] + for rec in values.lines: + vals = (0, 0, { + 'product_id': rec.product_id.id, + 'description': rec.full_product_name, + 'qty': rec.qty, + 'state': 'done', + 'tax_ids': [(6, 0, rec.tax_ids.ids)], + 'washing_type': rec.washing_type_id.id, + 'amount': rec.price_subtotal_incl, + }) + lines.append(vals) + + laundry_order = self.env['laundry.order'].sudo().create({ + 'order_ref': values.name, + 'pos_order_id': values.id, + 'pos_reference': values.pos_reference, + 'partner_id': values.partner_id.id, + 'partner_invoice_id': values.partner_id.id, + 'partner_shipping_id': values.partner_id.id, + 'laundry_person': values.user_id.id, + 'state': 'done', + 'order_lines': lines, + }) + for each in laundry_order: + for obj in each.order_lines: + self.env['washing.washing'].create( + {'name': obj.product_id.name + '-Washing', + 'user_id': obj.washing_type.assigned_person.id, + 'description': obj.description, + 'laundry_obj': obj.id, + 'state': 'done', + 'washing_date': datetime.now().strftime( + '%Y-%m-%d %H:%M:%S')}) + + return order + + def _prepare_invoice_lines(self): + """ + Invoice for the corresponding POS order + """ + invoice_lines = [] + for line in self.lines: + invoice_lines.append((0, None, self._prepare_invoice_line(line))) + if line.order_id.pricelist_id.discount_policy == 'without_discount'\ + and line.price_unit != line.product_id.lst_price: + invoice_lines.append((0, None, { + 'name': _('Price discount from %s -> %s', + float_repr(line.product_id.lst_price, + self.currency_id.decimal_places), + float_repr(line.price_unit, + self.currency_id.decimal_places)), + 'display_type': 'line_note', + })) + if line.customer_note: + invoice_lines.append((0, None, { + 'name': line.customer_note, + 'display_type': 'line_note', + })) + + if line.washing_type_id: + invoice_lines.append((0, None, { + 'name': line.washing_type_id.name, + 'display_type': 'line_note', + })) + + return invoice_lines diff --git a/laundry_management_pos/static/description/assets/icons/check.png b/laundry_management_pos/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/check.png differ diff --git a/laundry_management_pos/static/description/assets/icons/chevron.png b/laundry_management_pos/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/chevron.png differ diff --git a/laundry_management_pos/static/description/assets/icons/cogs.png b/laundry_management_pos/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/cogs.png differ diff --git a/laundry_management_pos/static/description/assets/icons/consultation.png b/laundry_management_pos/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/consultation.png differ diff --git a/laundry_management_pos/static/description/assets/icons/ecom-black.png b/laundry_management_pos/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/ecom-black.png differ diff --git a/laundry_management_pos/static/description/assets/icons/education-black.png b/laundry_management_pos/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/education-black.png differ diff --git a/laundry_management_pos/static/description/assets/icons/hotel-black.png b/laundry_management_pos/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/hotel-black.png differ diff --git a/laundry_management_pos/static/description/assets/icons/license.png b/laundry_management_pos/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/license.png differ diff --git a/laundry_management_pos/static/description/assets/icons/lifebuoy.png b/laundry_management_pos/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/lifebuoy.png differ diff --git a/laundry_management_pos/static/description/assets/icons/manufacturing-black.png b/laundry_management_pos/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/manufacturing-black.png differ diff --git a/laundry_management_pos/static/description/assets/icons/pos-black.png b/laundry_management_pos/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/pos-black.png differ diff --git a/laundry_management_pos/static/description/assets/icons/puzzle.png b/laundry_management_pos/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/puzzle.png differ diff --git a/laundry_management_pos/static/description/assets/icons/restaurant-black.png b/laundry_management_pos/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/restaurant-black.png differ diff --git a/laundry_management_pos/static/description/assets/icons/service-black.png b/laundry_management_pos/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/service-black.png differ diff --git a/laundry_management_pos/static/description/assets/icons/trading-black.png b/laundry_management_pos/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/trading-black.png differ diff --git a/laundry_management_pos/static/description/assets/icons/training.png b/laundry_management_pos/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/training.png differ diff --git a/laundry_management_pos/static/description/assets/icons/update.png b/laundry_management_pos/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/update.png differ diff --git a/laundry_management_pos/static/description/assets/icons/user.png b/laundry_management_pos/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/user.png differ diff --git a/laundry_management_pos/static/description/assets/icons/wrench.png b/laundry_management_pos/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/wrench.png differ diff --git a/laundry_management_pos/static/description/assets/misc/categories.png b/laundry_management_pos/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/categories.png differ diff --git a/laundry_management_pos/static/description/assets/misc/check-box.png b/laundry_management_pos/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/check-box.png differ diff --git a/laundry_management_pos/static/description/assets/misc/compass.png b/laundry_management_pos/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/compass.png differ diff --git a/laundry_management_pos/static/description/assets/misc/corporate.png b/laundry_management_pos/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/corporate.png differ diff --git a/laundry_management_pos/static/description/assets/misc/customer-support.png b/laundry_management_pos/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/customer-support.png differ diff --git a/laundry_management_pos/static/description/assets/misc/cybrosys-logo.png b/laundry_management_pos/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/cybrosys-logo.png differ diff --git a/laundry_management_pos/static/description/assets/misc/features.png b/laundry_management_pos/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/features.png differ diff --git a/laundry_management_pos/static/description/assets/misc/logo.png b/laundry_management_pos/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/logo.png differ diff --git a/laundry_management_pos/static/description/assets/misc/pictures.png b/laundry_management_pos/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/pictures.png differ diff --git a/laundry_management_pos/static/description/assets/misc/pie-chart.png b/laundry_management_pos/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/pie-chart.png differ diff --git a/laundry_management_pos/static/description/assets/misc/right-arrow.png b/laundry_management_pos/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/right-arrow.png differ diff --git a/laundry_management_pos/static/description/assets/misc/star.png b/laundry_management_pos/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/star.png differ diff --git a/laundry_management_pos/static/description/assets/misc/support.png b/laundry_management_pos/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/support.png differ diff --git a/laundry_management_pos/static/description/assets/misc/whatsapp.png b/laundry_management_pos/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/whatsapp.png differ diff --git a/laundry_management_pos/static/description/assets/modules/barcode.png b/laundry_management_pos/static/description/assets/modules/barcode.png new file mode 100644 index 000000000..f7be9edcf Binary files /dev/null and b/laundry_management_pos/static/description/assets/modules/barcode.png differ diff --git a/laundry_management_pos/static/description/assets/modules/custom_receipts_for_pos.jpg b/laundry_management_pos/static/description/assets/modules/custom_receipts_for_pos.jpg new file mode 100644 index 000000000..e7985dc61 Binary files /dev/null and b/laundry_management_pos/static/description/assets/modules/custom_receipts_for_pos.jpg differ diff --git a/laundry_management_pos/static/description/assets/modules/low_stocks_product_alert.png b/laundry_management_pos/static/description/assets/modules/low_stocks_product_alert.png new file mode 100644 index 000000000..6a0795416 Binary files /dev/null and b/laundry_management_pos/static/description/assets/modules/low_stocks_product_alert.png differ diff --git a/laundry_management_pos/static/description/assets/modules/mrp_pos.png b/laundry_management_pos/static/description/assets/modules/mrp_pos.png new file mode 100644 index 000000000..20eb5f70c Binary files /dev/null and b/laundry_management_pos/static/description/assets/modules/mrp_pos.png differ diff --git a/laundry_management_pos/static/description/assets/modules/pos_order.jpg b/laundry_management_pos/static/description/assets/modules/pos_order.jpg new file mode 100644 index 000000000..31f0a1878 Binary files /dev/null and b/laundry_management_pos/static/description/assets/modules/pos_order.jpg differ diff --git a/laundry_management_pos/static/description/assets/modules/pos_order_line_image.png b/laundry_management_pos/static/description/assets/modules/pos_order_line_image.png new file mode 100644 index 000000000..3f285a8e0 Binary files /dev/null and b/laundry_management_pos/static/description/assets/modules/pos_order_line_image.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/hero.gif b/laundry_management_pos/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..83cc58920 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/hero.gif differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos0.png b/laundry_management_pos/static/description/assets/screenshots/pos0.png new file mode 100644 index 000000000..722fa6786 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos0.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos1.png b/laundry_management_pos/static/description/assets/screenshots/pos1.png new file mode 100644 index 000000000..af68595f3 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos1.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos10.png b/laundry_management_pos/static/description/assets/screenshots/pos10.png new file mode 100644 index 000000000..aa05f8c90 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos10.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos11.png b/laundry_management_pos/static/description/assets/screenshots/pos11.png new file mode 100644 index 000000000..23efbf4dc Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos11.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos12.png b/laundry_management_pos/static/description/assets/screenshots/pos12.png new file mode 100644 index 000000000..1fbaf2b04 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos12.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos13.png b/laundry_management_pos/static/description/assets/screenshots/pos13.png new file mode 100644 index 000000000..8379f8696 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos13.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos14.png b/laundry_management_pos/static/description/assets/screenshots/pos14.png new file mode 100644 index 000000000..ff752c366 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos14.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos15.png b/laundry_management_pos/static/description/assets/screenshots/pos15.png new file mode 100644 index 000000000..9df65b63d Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos15.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos2.png b/laundry_management_pos/static/description/assets/screenshots/pos2.png new file mode 100644 index 000000000..4a4a3d30c Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos2.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos3.png b/laundry_management_pos/static/description/assets/screenshots/pos3.png new file mode 100644 index 000000000..6beb32cb6 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos3.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos4.png b/laundry_management_pos/static/description/assets/screenshots/pos4.png new file mode 100644 index 000000000..8760f126b Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos4.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos5.png b/laundry_management_pos/static/description/assets/screenshots/pos5.png new file mode 100644 index 000000000..8a1520c4a Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos5.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos6.png b/laundry_management_pos/static/description/assets/screenshots/pos6.png new file mode 100644 index 000000000..971d7a6c7 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos6.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos7.png b/laundry_management_pos/static/description/assets/screenshots/pos7.png new file mode 100644 index 000000000..31263e68a Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos7.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos8.png b/laundry_management_pos/static/description/assets/screenshots/pos8.png new file mode 100644 index 000000000..bb17c69ba Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos8.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/pos9.png b/laundry_management_pos/static/description/assets/screenshots/pos9.png new file mode 100644 index 000000000..c32b772e1 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/pos9.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/wage.png b/laundry_management_pos/static/description/assets/screenshots/wage.png new file mode 100644 index 000000000..47faca811 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/wage.png differ diff --git a/laundry_management_pos/static/description/banner.png b/laundry_management_pos/static/description/banner.png new file mode 100644 index 000000000..e0871db55 Binary files /dev/null and b/laundry_management_pos/static/description/banner.png differ diff --git a/laundry_management_pos/static/description/icon.png b/laundry_management_pos/static/description/icon.png new file mode 100644 index 000000000..f66040011 Binary files /dev/null and b/laundry_management_pos/static/description/icon.png differ diff --git a/laundry_management_pos/static/description/index.html b/laundry_management_pos/static/description/index.html new file mode 100644 index 000000000..9d92af8bc --- /dev/null +++ b/laundry_management_pos/static/description/index.html @@ -0,0 +1,793 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ POS Laundry Management

+

+ A Module For Configuring the Point of Sale in Laundry + Management.

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ In the POS Laundry Management App, It manages the Point of sale laundry + process with assigning works to workers.We can create Laundry orders + with the help of POS. Before installing this module, Install the Laundry + management module in the Odoo App Store +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Display Laundry Service in the POS Screen. +
+
+ + Create Product from the POS Screen. +
+
+ + Display Washing Type in the Order lines and Order Receipts +
+
+ + Recording Laundry Order. +
+
+ + Make Invoices Based on the Laundry Orders. +
+
+ + Configuration for Washing Type. +
+
+ + Assigning Laundry Works. +
+
+ + Separate View for Works. +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+ +
+
+ +
+

+ Enable Washing Type in the configuration Settings. +

+

+ Go to Point of Sale >> Configuration >> Point of Sale and + choose one Point of Sale. Enable washing type.

+ +
+
+

+ POS Screen view. +

+

+ User can start the session and display the POS screen with a + Button Laundry service and create product.

+ +
+
+

+ Choose product. +

+

+ Choose Service Product and you can Use the Custom button for selection the services.

+ + +
+
+

+ Select Laundry Service. +

+

+ Users can select the laundry service for the product and set + the corresponding price. If we are setting up the entire order + to get the same service, we can use the laundry service button + or we can use the plus button on each of the order lines it can + provide the different products have different Service. +

+ +
+
+

+ Orderline View. +

+

+ we can add the Laundry service name in the order lines and also + there has a remove option in the order lines. +

+ +
+
+

+ Validate Payment With Invoice. +

+

+ Make the payment with invoice.Also created a laundry order with + invoices +

+ +
+
+

+ POS Receipt. +

+

+ Laundry Service Mentioned in the POS Receipt +

+ +
+
+

+ POS Invoice. +

+ +

+ Print POS Invoice with Laundry Service +

+ +
+
+

+ POS Orders. +

+ +
+
+

+ POS Product Creation. +

+

+ We can Create a product using a custom button "Create Product" in the pos screen +

+ +
+
+

+ Created Products. +

+

+ The Newly created Product has displayed in the Product + Screen.

+ +
+
+

+ Laundry Management Order. +

+

+ When created a Laundry Management Order from the POS Order +

+ +
+
+

+ Laundry Management Order Form view. +

+

+ You can see all the Works and Invoice through the smart button + "Works" and "Invoice" from the Laundry Order form. +

+ +
+
+

+ Work Order View. +

+

+ In the form view shows the work details, assigned persons and + work status . +

+ +
+
+

+ Invoice View. +

+

+ In the Invoice form view shows the Invoice details and status. +

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

Suggested Products

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

+ Our Services +

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

+ Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

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

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

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

+ An + all-inclusive + hotel management application

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

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ + + + + + + + + + + diff --git a/laundry_management_pos/static/src/css/pos.css b/laundry_management_pos/static/src/css/pos.css new file mode 100644 index 000000000..ed0fd829e --- /dev/null +++ b/laundry_management_pos/static/src/css/pos.css @@ -0,0 +1,112 @@ +.pos .numpad button { + color: #2F4F4F; + background: #D3D6D6; + border-color: #2F4F4F; +} +.pos .control-button { + display: none; +} + +.pos button.button.set-customer{ + padding-left: 0px; + padding-right: 0px; + color: black; + } +.pos .actionpad .button.set-customer.decentered{ + padding-left: 0px; + padding-right: 0px; + color: black; + } +.pos .button-control { + background: #A9A9A9; + color: black; + border: none; + border-radius: 0; + border-top: 1px solid; + border-left: 1px solid; + border-bottom: 1px solid; + border-right: 1px solid; + border-color: white; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + flex-grow: 1; + height: 60px; +} +.pos .order .orderline .pos_product_image{ + float:left; + margin:auto; +} +.pos .order { + padding-top: 0px !important; +} +.pos .order .orderline .product-name { + padding-top: 5px; +} +.pos .order .orderline .info-list { + margin-left: 15px; + padding-bottom: 10px; + font-weight: bold; + font-family: Verdana; +} +.pos .order .orderline .product-name{ + padding:0; + display:inline-block; + font-weight: bold; + font-family: Verdana; + width:80%; + overflow:hidden; + text-overflow: ellipsis; +} +.pos .actionpad .button.pay { + height: calc(var(--btn-height-size) * 3); + color: black; +} +.pos .order .orderline .price{ + padding:0; + font-weight: bold; + font-family: Verdana; + float:right; +} +.salesperson-scroll{ + height: 270px; + overflow: auto; +} + +.salesperson { + border-collapse: collapse; + width: 100%; +} + +.salesperson td{ + text-align: left; + border: 1px solid #ddd; + padding: 8px; +} + +.salesperson tr:nth-child(even){background-color: #f2f2f2;} + +.salesperson tr:hover {background-color: #ddd;} + +.orderline-salesperson{ + padding:5; + float:right; +} +.orderline-laundry{ + padding:5; + float:left; +} +.pos .products-widget .products-widget-control{ + display: none; +} +.pos button, .pos a.button { + display: inline-block; + cursor: pointer; + padding: 4px 10px; + font-size: 11px; + border: 1px solid #cacaca; + background: #A9A9A9; + border-radius: 3px; +} +.button-control:hover { + background: #efefef; +} diff --git a/laundry_management_pos/static/src/js/button/product_create_button.js b/laundry_management_pos/static/src/js/button/product_create_button.js new file mode 100644 index 000000000..b1272c8d4 --- /dev/null +++ b/laundry_management_pos/static/src/js/button/product_create_button.js @@ -0,0 +1,69 @@ +odoo.define('laundry_management_pos.product_create_button', function(require) { + 'use strict'; + +const PosComponent = require('point_of_sale.PosComponent'); +const ProductScreen = require('point_of_sale.ProductScreen'); +const { useListener } = require('web.custom_hooks'); +const Registries = require('point_of_sale.Registries'); +const ajax = require('web.ajax'); + +// Extending the PosComponent that used to create a button in the POS View +class ProductCreateButton extends PosComponent { + constructor() { + super(...arguments); + useListener('click', this.onClick); + } + async onClick() { + var self = this; + const { + confirmed, + payload + } = await this.showPopup('ProductCreatePopup', { + title: this.env._t('POS Product Creation'), + body: this.env._t('You can Create The product.'), + }); + if (confirmed) { + console.log(payload, 'payload') + var product_category = payload[0]; + var product_name = payload[1]; + var product_reference = payload[2]; + var product_price = payload[3]; + var unit_measure = payload[4]; + var product_categories = payload[5]; + var pos_categories = payload[6]; + if (!product_name){ + return this.showPopup('ErrorPopup', { + title: _('A Unit Of Measure Is Required'), + }); + } + if (!unit_measure){ + return this.showPopup('ErrorPopup', { + title: _('A Unit Of Measure Is Required'), + }); + } + ajax.jsonRpc('/create_product', 'call', { + 'category': product_category, + 'name': product_name, + 'price': product_price, + 'product_reference': product_reference, + 'unit_measure': unit_measure, + 'product_categories': product_categories, + 'pos_categories': pos_categories + }).then(function(response) {}); + } + } +} +// Create a new Button that used to Display the Product Information +ProductCreateButton.template = 'ProductCreateButton'; +ProductScreen.addControlButton({ + component: ProductCreateButton, + condition: function() { + return true; + }, + position: ['before', 'SetPricelistButton'], +}); + +Registries.Component.add(ProductCreateButton); + +return ProductCreateButton; +}); \ No newline at end of file diff --git a/laundry_management_pos/static/src/js/button/washing_type_button.js b/laundry_management_pos/static/src/js/button/washing_type_button.js new file mode 100644 index 000000000..2e4411d4b --- /dev/null +++ b/laundry_management_pos/static/src/js/button/washing_type_button.js @@ -0,0 +1,52 @@ +odoo.define('laundry_management_pos.LaundryServiceType', function (require) { + "use strict"; +const { Gui } = require('point_of_sale.Gui'); +const { useListener } = require('web.custom_hooks'); +const PosComponent = require('point_of_sale.PosComponent'); +const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); +const Registries = require('point_of_sale.Registries'); +const ProductItem = require('point_of_sale.ProductItem'); +const ProductScreen = require('point_of_sale.ProductScreen'); +var models = require('point_of_sale.models'); +var rpc = require('web.rpc'); + +models.load_models({ +model: 'washing.type', +fields: ['name','assigned_person', 'amount'], +loaded: function(self, washing_type) { + self.washing_type = washing_type; + } +}) + +class LaundryServiceButton extends PosComponent{ + constructor() { + super(...arguments); + useListener('click', this.onClick); + } + + //Generate popup + async onClick() { + var core = require('web.core'); + var _t = core._t; + this.showPopup("LaundryServiceTypePopup", { + title : _t("Laundry Service"), + confirmText: _t("Exit"), + service: this.env.pos.washing_type, + pos: this.env.pos, + }); + } +} + +LaundryServiceButton.template = 'LaundryServiceButton'; + +//Add popup button and set visibility + ProductScreen.addControlButton({ + component: LaundryServiceButton, + condition: function() { + return this.env.pos.config.orderline_washing_type; + }, +}); +Registries.Component.add(LaundryServiceButton); + +return LaundryServiceButton; +}); diff --git a/laundry_management_pos/static/src/js/models.js b/laundry_management_pos/static/src/js/models.js new file mode 100644 index 000000000..6c9e933d5 --- /dev/null +++ b/laundry_management_pos/static/src/js/models.js @@ -0,0 +1,61 @@ +odoo.define('laundry_management_pos.modelsorderline', function (require) { +"use strict"; + +var models = require('point_of_sale.models'); +var rpc = require('web.rpc'); +var _super_orderline = models.Orderline.prototype; + +models.Orderline = models.Orderline.extend({ + initialize: function(attr, options) { +// It is possible that this orderline is initialized using `init_from_JSON`, + _super_orderline.initialize.call(this,attr,options); + this.washingType = this.washingType || options.washingType; + this.washingType_id = this.washingType_id || 0.0; + this.washingType_price = this.washingType_id.amount || 0.0; + }, + +// Function to set the service type of the Washing + set_washingType: function(service) { + this.washingType = service.value; + this.washingType_id = service.id; + this.washingType_price = service.id.amount; + this.trigger('change',this); + }, +// Function to get the service type of the Washing + get_washingType: function(service) { + return this.washingType; + }, + +// Used to merge the services with Order-line + can_be_merged_with: function(orderline) { + if (orderline.get_washingType() !== this.get_washingType()) { + return false; + } else { + return _super_orderline.can_be_merged_with.apply(this,arguments); + } + }, + +// clone the service with order-lines + clone: function(){ + var orderline = _super_orderline.clone.call(this); + orderline.washingType = this.washingType; + orderline.washingType_id = this.washingType_id; + orderline.washingType_price = this.washingType_price; + return orderline; + }, + export_as_JSON: function(){ + var json = _super_orderline.export_as_JSON.call(this); + json.washingType = this.washingType; + json.washingType_id = this.washingType_id; + json.washingType_price = this.washingType_price; + return json; + }, + init_from_JSON: function(json){ + _super_orderline.init_from_JSON.apply(this,arguments); + this.washingType = json.washingType; + this.washingType_id = json.washingType_id; + this.washingType_price = json.washingType_price; + }, +}); + +}); diff --git a/laundry_management_pos/static/src/js/order_line.js b/laundry_management_pos/static/src/js/order_line.js new file mode 100644 index 000000000..75f19fe16 --- /dev/null +++ b/laundry_management_pos/static/src/js/order_line.js @@ -0,0 +1,36 @@ +odoo.define('laundry_management_pos.orderline', function(require) { + 'use strict'; + +const Orderline = require('point_of_sale.Orderline'); +const Registries = require('point_of_sale.Registries'); + +var models = require('point_of_sale.models'); + +// Extend the order-line used to add popup items +const PosResOrderline = Orderline => + + class extends Orderline { + + click(){ + this.showPopup("LaundryServiceTypePopup", { + title : this.env._t("Laundry Service"), + service: this.env.pos.washing_type, + pos: this.env.pos, + orderline: this.props.line, + + }); + + } + + // function to remove the service from the Laundry Process + remove_laundry(){ + this.props.line.washingType = ''; + this.props.line.washingType_id = 0.0; + this.props.line.trigger('change',this.props.line); + } + }; + +Registries.Component.extend(Orderline, PosResOrderline); + +return Orderline; +}); \ No newline at end of file diff --git a/laundry_management_pos/static/src/js/pos_receipt.js b/laundry_management_pos/static/src/js/pos_receipt.js new file mode 100644 index 000000000..1b4d0acc7 --- /dev/null +++ b/laundry_management_pos/static/src/js/pos_receipt.js @@ -0,0 +1,16 @@ +odoo.define('laundry_management_pos.receipt', function(require){ + "use strict"; +var models = require('point_of_sale.models'); +var _super_orderline = models.Orderline.prototype; + +// Extends the order-line used to add the Washing Details in the order receipts +models.Orderline = models.Orderline.extend({ + +// Used to add the Washing Details in the order receipt + export_for_printing: function(){ + var line = _super_orderline.export_for_printing.apply(this, arguments); + line.service_type = this.get_washingType(); + return line; + } +}); +}); \ No newline at end of file diff --git a/laundry_management_pos/static/src/js/product_img.js b/laundry_management_pos/static/src/js/product_img.js new file mode 100644 index 000000000..1631fa615 --- /dev/null +++ b/laundry_management_pos/static/src/js/product_img.js @@ -0,0 +1,15 @@ +odoo.define('laundry_management_pos.pos_order_line', function(require) { +"use strict"; + +var models = require('point_of_sale.models'); + +// Extend the order lines for getting the product images +models.Orderline = models.Orderline.extend({ + +// Product images uploading to the particular field + get_product_image: function(){ + const product = this.product; + return `/web/image?model=product.product&field=image_128&id=${product.id}&write_date=${product.write_date}&unique=1`; + }, +}); +}); \ No newline at end of file diff --git a/laundry_management_pos/static/src/js/screen/product_create_popup.js b/laundry_management_pos/static/src/js/screen/product_create_popup.js new file mode 100644 index 000000000..39f55eb8f --- /dev/null +++ b/laundry_management_pos/static/src/js/screen/product_create_popup.js @@ -0,0 +1,51 @@ +odoo.define('laundry_management_pos.product_create_popup', function(require) { + 'use strict'; + +const { useState, useRef } = owl.hooks; +const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); +const Registries = require('point_of_sale.Registries'); + +// Extension of AbstractAwaitablePopup that allows to create a product Create popup +class ProductCreatePopup extends AbstractAwaitablePopup { + constructor() { + super(...arguments); + this.state = useState({ + typeValue: this.props.startingValue, + productValue: this.props.startingValue, + priceValue: this.props.priceValue, + productRef: this.props.startingValue + }); + } + getPayload() { + var selected_vals = []; + var category = this.state.typeValue; + var product = this.state.productValue; + var product_reference = this.state.productRef; + var price = this.state.priceValue; + var unit = this.state.unitValue; + var product_category = this.state.categoryValue; + selected_vals.push(category); + selected_vals.push(product); + selected_vals.push(product_reference); + selected_vals.push(price); + selected_vals.push(unit); + selected_vals.push(product_category); + return selected_vals + } +} +ProductCreatePopup.template = 'ProductCreatePopup'; +ProductCreatePopup.defaultProps = { + confirmText: 'Ok', + cancelText: 'Cancel', + array: [], + title: 'Create ?', + body: '', + startingValue: '', + priceValue: 1, + list: [], +}; + +Registries.Component.add(ProductCreatePopup); + +return ProductCreatePopup; +}); diff --git a/laundry_management_pos/static/src/js/screen/washing_type_popup.js b/laundry_management_pos/static/src/js/screen/washing_type_popup.js new file mode 100644 index 000000000..1f5f286a7 --- /dev/null +++ b/laundry_management_pos/static/src/js/screen/washing_type_popup.js @@ -0,0 +1,40 @@ +odoo.define('laundry_management_pos.LaundryServiceTypePopup', function(require) { + 'use strict'; +const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); +const Registries = require('point_of_sale.Registries'); +const PosComponent = require('point_of_sale.PosComponent'); +const ControlButtonsMixin = require('point_of_sale.ControlButtonsMixin'); +const NumberBuffer = require('point_of_sale.NumberBuffer'); +const { useListener } = require('web.custom_hooks'); +const { onChangeOrder, useBarcodeReader } = require('point_of_sale.custom_hooks'); +const { useState, useRef } = owl.hooks; + +class LaundryServiceTypePopup extends AbstractAwaitablePopup { +constructor() { + super(...arguments); +} + +// Create a new Popup instance +laundryPopup(event){ + var order = this.props.pos.get_order(); + if (!this.props.orderline) { + order.selected_orderline.set_washingType(event.currentTarget.dataset); + } + else{ + this.props.orderline.set_washingType(event.currentTarget.dataset); + this.props.orderline.trigger('change',this.props.orderline); + } + this.trigger('close-popup'); + } + +} +//Create Service popup +LaundryServiceTypePopup.template = 'LaundryServiceTypePopup'; +LaundryServiceTypePopup.defaultProps = { + confirmText: 'Ok', + cancelText: 'Cancel', +}; +Registries.Component.add(LaundryServiceTypePopup); + +return LaundryServiceTypePopup; +}); diff --git a/laundry_management_pos/static/src/xml/button/product_create_button.xml b/laundry_management_pos/static/src/xml/button/product_create_button.xml new file mode 100644 index 000000000..f62747446 --- /dev/null +++ b/laundry_management_pos/static/src/xml/button/product_create_button.xml @@ -0,0 +1,13 @@ + + + + + + + + \ No newline at end of file diff --git a/laundry_management_pos/static/src/xml/button/washing_type_button.xml b/laundry_management_pos/static/src/xml/button/washing_type_button.xml new file mode 100644 index 000000000..2ae718749 --- /dev/null +++ b/laundry_management_pos/static/src/xml/button/washing_type_button.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + diff --git a/laundry_management_pos/static/src/xml/pos_receipt.xml b/laundry_management_pos/static/src/xml/pos_receipt.xml new file mode 100644 index 000000000..2d947852f --- /dev/null +++ b/laundry_management_pos/static/src/xml/pos_receipt.xml @@ -0,0 +1,57 @@ + + + + + +
+

+
+
+
+ + + +
+ Assigned person:
+
+
+
+
+ + + + + + + + +

Laundry Service

+
+
+ + + + + +
+
--------------------------------
+
Laundry Person
+
+
+ +
+
+
+
+
+
+

+
+
+
+ + + + diff --git a/laundry_management_pos/static/src/xml/product_img.xml b/laundry_management_pos/static/src/xml/product_img.xml new file mode 100644 index 000000000..82015f9d1 --- /dev/null +++ b/laundry_management_pos/static/src/xml/product_img.xml @@ -0,0 +1,11 @@ + + \ No newline at end of file diff --git a/laundry_management_pos/static/src/xml/screen/product_create_popup.xml b/laundry_management_pos/static/src/xml/screen/product_create_popup.xml new file mode 100644 index 000000000..7e9ef5168 --- /dev/null +++ b/laundry_management_pos/static/src/xml/screen/product_create_popup.xml @@ -0,0 +1,95 @@ + + + + + + + \ No newline at end of file diff --git a/laundry_management_pos/static/src/xml/screen/washing_type_popup.xml b/laundry_management_pos/static/src/xml/screen/washing_type_popup.xml new file mode 100644 index 000000000..c7f8822aa --- /dev/null +++ b/laundry_management_pos/static/src/xml/screen/washing_type_popup.xml @@ -0,0 +1,42 @@ + + + + + + + \ No newline at end of file diff --git a/laundry_management_pos/views/laundry_order_views.xml b/laundry_management_pos/views/laundry_order_views.xml new file mode 100644 index 000000000..85ba2ac92 --- /dev/null +++ b/laundry_management_pos/views/laundry_order_views.xml @@ -0,0 +1,39 @@ + + + + + laundry.order.view.form.inherit.laundry + + laundry.order + + + + + + + + + + + + + + + + + + + {'invisible': ['|', ('is_invoiced', '=', True), ('state', 'in', ('draft', 'order', 'process'))]} + + + + + + + \ No newline at end of file diff --git a/laundry_management_pos/views/pos_config_views.xml b/laundry_management_pos/views/pos_config_views.xml new file mode 100644 index 000000000..5e578c9d0 --- /dev/null +++ b/laundry_management_pos/views/pos_config_views.xml @@ -0,0 +1,26 @@ + + + + pos.config.view.form.inherits.washing.types + + pos.config + + +
+
+ +
+
+
+
+
+
+
+
diff --git a/laundry_management_pos/views/pos_order_views.xml b/laundry_management_pos/views/pos_order_views.xml new file mode 100644 index 000000000..5a15a629c --- /dev/null +++ b/laundry_management_pos/views/pos_order_views.xml @@ -0,0 +1,27 @@ + + + + pos.order.view.form.inherit.order.lines + + pos.order + + + + + + + + + + + + + + + +