diff --git a/laundry_management_pos/README.rst b/laundry_management_pos/README.rst new file mode 100755 index 000000000..1e70cbb61 --- /dev/null +++ b/laundry_management_pos/README.rst @@ -0,0 +1,50 @@ +.. 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 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 +============= +Install the Laundry Management module and configur washing types, additional work, and other related data. + +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: (V17) Unnimaya C O, +Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/laundry_management_pos/__init__.py b/laundry_management_pos/__init__.py new file mode 100755 index 000000000..3dc78d42e --- /dev/null +++ b/laundry_management_pos/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (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 models diff --git a/laundry_management_pos/__manifest__.py b/laundry_management_pos/__manifest__.py new file mode 100755 index 000000000..a1d31f39c --- /dev/null +++ b/laundry_management_pos/__manifest__.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (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': '17.0.1.0.0', + 'category': 'Point of Sale', + 'summary': """Launch Automatic Laundry Orders After selling through POS.""", + 'description': """It manages the Point of sale laundry process with assigning + works to workers.We can create Laundry orders with the help of 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': { + 'web.assets_backend': [ + 'laundry_management_pos/static/src/css/pos.css', + ], + 'point_of_sale._assets_pos': [ + 'laundry_management_pos/static/src/xml/button/washing_type_button.xml', + 'laundry_management_pos/static/src/js/button/washing_type_button.js', + 'laundry_management_pos/static/src/js/popup/washing_type_popup.js', + 'laundry_management_pos/static/src/xml/popup/washing_type_popup.xml', + 'laundry_management_pos/static/src/css/pos.css', + 'laundry_management_pos/static/src/js/models.js', + 'laundry_management_pos/static/src/js/order_line.js', + 'laundry_management_pos/static/src/xml/button/product_create_button.xml', + 'laundry_management_pos/static/src/xml/popup/product_create_popup.xml', + 'laundry_management_pos/static/src/js/button/pos_product_screen.js', + 'laundry_management_pos/static/src/js/popup/product_create_popup.js', + 'laundry_management_pos/static/src/xml/pos_receipt.xml' + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/laundry_management_pos/doc/RELEASE_NOTES.md b/laundry_management_pos/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..79b0d4fa2 --- /dev/null +++ b/laundry_management_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 19.05.2025 +#### Version 17.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 100755 index 000000000..72437f96f --- /dev/null +++ b/laundry_management_pos/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (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 +from . import res_config_settings diff --git a/laundry_management_pos/models/laundry_order.py b/laundry_management_pos/models/laundry_order.py new file mode 100755 index 000000000..b4e9c50ad --- /dev/null +++ b/laundry_management_pos/models/laundry_order.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# you can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distrRisvanaibuted 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 performs to computing the total amounts of the LaundryOrder. + + _compute_tax_totals_json(self): + Action performs to computing the total tax amount using the + order-lines tax and amount. + + _invoice_count(self): + Action performs to computing the invoice count based on the + particular Laundry order. + + _work_count(self): + Action performs to computing the work count based on the + particular Laundry order. + + Action_view_laundry_works(self): + Action performs to work details of the LaundryOrder, the + laundry work smart button views are displayed. + + Action_view_invoice(self): + Action performs 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', + string='Total Tax', + 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: + self.invoice_count = self.env['account.move'].search_count( + [('invoice_origin', '=', + self.sale_obj.name)]) + else: + self.invoice_count = self.env['account.move'].search_count([('invoice_origin', + '=', work.name)]) + 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: + self.work_count = self.env['washing.washing'].search_count( + [('laundry_obj.laundry_obj.id', '=', self.id)]) + else: + self.work_count = False + else: + self.work_count = len(work.lines) + + 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 a model laundry_order_line. + It contains fields and the functions for the model + + Methods: + _compute_price_tax(self): + Action performs 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 100755 index 000000000..a0a4aa59c --- /dev/null +++ b/laundry_management_pos/models/pos_config.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (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 100755 index 000000000..6583334f3 --- /dev/null +++ b/laundry_management_pos/models/pos_order.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (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_compare, 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) if washing_type_id else False} + 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) + if order: + order_id = order[0]['id'] + values = self.env['pos.order'].browse(order_id) + lines = [] + for rec in values.lines: + if rec.washing_type_id: + values.write({ + 'laundry_order': True, + }) + 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) + if values.laundry_order: + values.action_pos_order_invoice() + 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 + """ + sign = 1 if self.amount_total >= 0 else -1 + line_values_list = self._prepare_tax_base_line_values(sign=sign) + invoice_lines = [] + for line_values in line_values_list: + line = line_values['record'] + invoice_lines_values = self._get_invoice_lines_values(line_values, + line) + invoice_lines.append((0, None, invoice_lines_values)) + if ( + line.order_id.pricelist_id.discount_policy == 'without_discount' and + float_compare(line.price_unit, line.product_id.lst_price, + precision_rounding=self.currency_id.rounding) < 0): + 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/models/res_config_settings.py b/laundry_management_pos/models/res_config_settings.py new file mode 100755 index 000000000..21c54d8d2 --- /dev/null +++ b/laundry_management_pos/models/res_config_settings.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (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 ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + orderline_washing_type = fields.Boolean( + related="pos_config_id.orderline_washing_type", string='Washing Type', + help='Allow to add Washing type' + ' for customer on OrderLines', readonly=False) diff --git a/laundry_management_pos/static/description/assets/icons/capture (1).png b/laundry_management_pos/static/description/assets/icons/capture (1).png new file mode 100755 index 000000000..8824deafc Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/capture (1).png differ 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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/img.png b/laundry_management_pos/static/description/assets/icons/img.png new file mode 100755 index 000000000..70197f477 Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/img.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 100755 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 100755 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 100755 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/photo-capture.png b/laundry_management_pos/static/description/assets/icons/photo-capture.png new file mode 100755 index 000000000..06c111758 Binary files /dev/null and b/laundry_management_pos/static/description/assets/icons/photo-capture.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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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/Cybrosys R.png b/laundry_management_pos/static/description/assets/misc/Cybrosys R.png new file mode 100755 index 000000000..da4058087 Binary files /dev/null and b/laundry_management_pos/static/description/assets/misc/Cybrosys R.png differ diff --git a/laundry_management_pos/static/description/assets/misc/email.svg b/laundry_management_pos/static/description/assets/misc/email.svg new file mode 100755 index 000000000..15291cdc3 --- /dev/null +++ b/laundry_management_pos/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/laundry_management_pos/static/description/assets/misc/phone.svg b/laundry_management_pos/static/description/assets/misc/phone.svg new file mode 100755 index 000000000..b7bd7f251 --- /dev/null +++ b/laundry_management_pos/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/laundry_management_pos/static/description/assets/misc/star (1) 2.svg b/laundry_management_pos/static/description/assets/misc/star (1) 2.svg new file mode 100755 index 000000000..5ae9f507a --- /dev/null +++ b/laundry_management_pos/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/laundry_management_pos/static/description/assets/misc/support (1) 1.svg b/laundry_management_pos/static/description/assets/misc/support (1) 1.svg new file mode 100755 index 000000000..7d37a8f30 --- /dev/null +++ b/laundry_management_pos/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/laundry_management_pos/static/description/assets/misc/support-email.svg b/laundry_management_pos/static/description/assets/misc/support-email.svg new file mode 100755 index 000000000..eb70370d6 --- /dev/null +++ b/laundry_management_pos/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/laundry_management_pos/static/description/assets/misc/tick-mark.svg b/laundry_management_pos/static/description/assets/misc/tick-mark.svg new file mode 100755 index 000000000..2dbb40187 --- /dev/null +++ b/laundry_management_pos/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/laundry_management_pos/static/description/assets/misc/whatsapp 1.svg b/laundry_management_pos/static/description/assets/misc/whatsapp 1.svg new file mode 100755 index 000000000..0bfaf8fc6 --- /dev/null +++ b/laundry_management_pos/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/laundry_management_pos/static/description/assets/misc/whatsapp.svg b/laundry_management_pos/static/description/assets/misc/whatsapp.svg new file mode 100755 index 000000000..b618aea1d --- /dev/null +++ b/laundry_management_pos/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/laundry_management_pos/static/description/assets/modules/1.png b/laundry_management_pos/static/description/assets/modules/1.png new file mode 100755 index 000000000..10dc39ce4 Binary files /dev/null and b/laundry_management_pos/static/description/assets/modules/1.png differ diff --git a/laundry_management_pos/static/description/assets/modules/2.png b/laundry_management_pos/static/description/assets/modules/2.png new file mode 100755 index 000000000..5f69f822e Binary files /dev/null and b/laundry_management_pos/static/description/assets/modules/2.png differ diff --git a/laundry_management_pos/static/description/assets/modules/3.png b/laundry_management_pos/static/description/assets/modules/3.png new file mode 100755 index 000000000..67d607103 Binary files /dev/null and b/laundry_management_pos/static/description/assets/modules/3.png differ diff --git a/laundry_management_pos/static/description/assets/modules/4.png b/laundry_management_pos/static/description/assets/modules/4.png new file mode 100755 index 000000000..b0b24e39d Binary files /dev/null and b/laundry_management_pos/static/description/assets/modules/4.png differ diff --git a/laundry_management_pos/static/description/assets/modules/5.png b/laundry_management_pos/static/description/assets/modules/5.png new file mode 100755 index 000000000..45f3b578e Binary files /dev/null and b/laundry_management_pos/static/description/assets/modules/5.png differ diff --git a/laundry_management_pos/static/description/assets/modules/6.png b/laundry_management_pos/static/description/assets/modules/6.png new file mode 100755 index 000000000..577bedf87 Binary files /dev/null and b/laundry_management_pos/static/description/assets/modules/6.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/1.png b/laundry_management_pos/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..54be45871 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/1.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/10.png b/laundry_management_pos/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..05b7e56db Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/10.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/11.png b/laundry_management_pos/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..1f593da79 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/11.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/12.png b/laundry_management_pos/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..ab369fd72 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/12.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/13.png b/laundry_management_pos/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..fd3054d78 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/13.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/14.png b/laundry_management_pos/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..9cd0c3190 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/14.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/2.png b/laundry_management_pos/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..580972d6b Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/2.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/3.png b/laundry_management_pos/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..6d6dc8ee5 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/3.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/4.png b/laundry_management_pos/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..51391e2f2 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/4.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/5.png b/laundry_management_pos/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..148b7c123 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/5.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/6.png b/laundry_management_pos/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..b3d26b165 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/6.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/7.png b/laundry_management_pos/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..e12fee3b5 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/7.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/8.png b/laundry_management_pos/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..6f63bd7df Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/8.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/8_1.png b/laundry_management_pos/static/description/assets/screenshots/8_1.png new file mode 100644 index 000000000..a810231d7 Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/8_1.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/9.png b/laundry_management_pos/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..6b187e41e Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/9.png differ diff --git a/laundry_management_pos/static/description/assets/screenshots/9_1.png b/laundry_management_pos/static/description/assets/screenshots/9_1.png new file mode 100644 index 000000000..0004f102e Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/9_1.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..6949ea55e Binary files /dev/null and b/laundry_management_pos/static/description/assets/screenshots/hero.gif differ diff --git a/laundry_management_pos/static/description/banner.jpg b/laundry_management_pos/static/description/banner.jpg new file mode 100644 index 000000000..8b2d03e2f Binary files /dev/null and b/laundry_management_pos/static/description/banner.jpg 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..efc4da40e 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 100755 index 000000000..6d0c9913b --- /dev/null +++ b/laundry_management_pos/static/description/index.html @@ -0,0 +1,951 @@ + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ POS Laundry Management

+

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

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Display Laundry Service in the POS Screen.

+
+
+
+
+
+
+ +
+
+

+ Display Washing Type in the Order lines and Order Receipts.

+
+
+
+
+
+
+ +
+
+

+ Make Invoices Based on the Laundry Orders.

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

+ Enable Washing Type in the POS Settings. +

+

+ Navigate to Settings under Configuration in Point of Sale and enable Washing + Type +

+
+
+
+
+
+
+ +
+
+

+ Laundry Service button in POS Screen. +

+
+
+
+
+
+
+ +
+
+

+ Add Washing Type. +

+

+ Click either Laundry Service button or the custom button in orderline to add + the Washing Type. +

+
+
+
+
+
+
+ +
+
+

+ Washing Type added to the orderline. +

+
+
+
+
+
+
+ +
+
+

+ Washing Type in Receipt +

+
+
+
+
+
+
+ +
+
+

+ Washing Type in Invoice +

+
+
+
+
+
+
+ +
+
+

+ Create Product button in POS Screen +

+
+
+
+
+
+
+ +
+
+

+ Product Popup. +

+
+
+
+
+
+
+ +
+
+

+ Added Product. +

+
+
+
+
+
+
+ +
+
+

+ Laundry Order in Laundry Management module. +

+

+ Navigate to Laundry Order under Laundry Management menu in Laundry + Management module and open the order created from POS. +

+
+
+
+
+
+
+ +
+
+

+ Works in Laundry Order. +

+
+
+
+
+
+
+ +
+
+

+ List view of Works. +

+
+
+
+
+
+
+ +
+
+

+ Invoice in Laundry Order +

+
+
+
+
+
+
+ +
+
+

+ Invoice form view. +

+
+
+
+
+
+
+
    +
  • + Recording + Laundry Order. +
  • +
  • + Make Invoices. +
  • +
  • + Billing Facility + for Extra Works. +
  • +
  • + Detailed Laundry + Work Analysis Report. +
  • +
  • + Configuration + for Washing Type. +
  • +
  • + Assigning Works. +
  • +
  • + Separate View + for Works. +
  • +
  • + Label Printing + for Every Order. +
  • +
  • + Access Rights + From Multiple Level. +
  • +
  • + Config. for + Extra Works (Ironing/Patching etc.) +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:2nd Aug 2024 +
+

+ Initial commit for POS Laundry + Management.

+
+
+
+
+
+
+
+

+ 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/laundry_management_pos/static/src/css/pos.css b/laundry_management_pos/static/src/css/pos.css new file mode 100755 index 000000000..696d8462d --- /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 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: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; + font-size: 20px; +} + +.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: 16px; + border: 1px solid #cacaca; + background: #A9A9A9; + border-radius: 3px; +} +.button-control:hover { + background: #efefef; +} + +.pos .order .orderline .product-name { + padding-top: 11px !important; +} +.pos .order .orderline .info-list { + color: #888; + margin-left: 10px; + padding-bottom: 19px; + font-weight: bold; + font-family: Verdana; +} \ No newline at end of file diff --git a/laundry_management_pos/static/src/js/button/pos_product_screen.js b/laundry_management_pos/static/src/js/button/pos_product_screen.js new file mode 100644 index 000000000..a788d5430 --- /dev/null +++ b/laundry_management_pos/static/src/js/button/pos_product_screen.js @@ -0,0 +1,53 @@ +/**@odoo-module **/ +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 { CreateProductPopup } from "../popup/product_create_popup"; +/** + * OrderlineProductCreateButton is a component responsible for creating a + product and adding it to the order line. +*/ +export class OrderlineProductCreateButton extends Component { + static template = "point_of_sale.ProductCreateButton"; + /** + * Setup function to initialize the component. + */ + setup() { + this.pos = usePos(); + this.popup = useService("popup"); + } + /** + * Getter function to fetch a list of products based on the search criteria. + * @returns {Object[]} List of products. + */ + get products() { + let list; + if (this.state.search && this.state.search.trim() !== "") { + list = this.env.pos.db.search_product_in_category( + 0, + this.state.search.trim() + ); + } else { + list = this.env.pos.db.get_product_by_category(0); + } + return list.sort(function(a, b) { + return a.display_name.localeCompare(b.display_name); + }); + } + /** + * Click event handler for the create product button. + */ + async onClick() { + this.popup.add(CreateProductPopup, { + product: this.props.product, + }) + } +} +/** + * Add the OrderlineProductCreateButton component to the control buttons in + the ProductScreen. + */ +ProductScreen.addControlButton({ + component: OrderlineProductCreateButton, +}); 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..df2086de2 --- /dev/null +++ b/laundry_management_pos/static/src/js/button/washing_type_button.js @@ -0,0 +1,45 @@ +/**@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 { LaundryServiceTypePopup } from "@laundry_management_pos/js/popup/washing_type_popup"; + +export class WashingButton extends Component { + static template = "point_of_sale.WashingButton"; + async setup() { + this.pos = usePos(); + this.popup = useService("popup"); + this.orm = useService("orm"); + await this.loadDataFromWashingTypeModel(); + } + //Click function of opening the popup. + async onClick() { + this.popup.add(LaundryServiceTypePopup, { + title: _t('Laundry Service'), + body: _t('Choose the Washing type'), + service: this.pos.washing_type, + pos: this.pos, + orderline: this.props.line, + }) + } + async loadDataFromWashingTypeModel() { + // Method for loading washing types + const washingTypeData = await this.orm.call( + 'washing.type', + 'search_read', + [], + { + fields: ['name', 'assigned_person', 'amount'] + } + ); + this.pos.washing_type = washingTypeData; + } +} +ProductScreen.addControlButton({ +component: WashingButton, +condition: function () { + return true; + }, +}); diff --git a/laundry_management_pos/static/src/js/models.js b/laundry_management_pos/static/src/js/models.js new file mode 100755 index 000000000..38edd0cd1 --- /dev/null +++ b/laundry_management_pos/static/src/js/models.js @@ -0,0 +1,113 @@ +/** @odoo-module */ +import { Order, Orderline } from "@point_of_sale/app/store/models"; +import { patch } from "@web/core/utils/patch"; + +patch(Order.prototype, { + set_partner(partner) { + this.assert_editable(); + this.partner = partner; + var washing=0 + for (let line of this.orderlines) { + if (line.get_washingType()) + { + washing=1 + } + } + if (washing==0) + { + this.updatePricelistAndFiscalPosition(partner); + } + }, +}); + +patch(Orderline.prototype, { + setup() { + super.setup(...arguments); + this.washingType = this.washingType || arguments[1].washingType; + this.washingType_id = this.washingType_id; + this.washingType_price = this.washingType_id || 0.0; + }, + // Function to set the service type of the Washing + set_washingType(service) { + this.washingType = service.name; + this.washingType_id = service.id; + this.washingType_price = service.amount; + this.price = service.amount; + }, + getDisplayData() { + /**Add the washingType and image**/ + return { + ...super.getDisplayData(), + washingType: this.get_washingType(), + product_id: this.get_product().id, + }; + }, + // Function to get the service type of the Washing + get_washingType(e) { + return this.washingType; + }, + // when we add an new orderline we want to merge it with the last line to see reduce the number of items based on the selected washing types + // in the orderline. This returns true if it makes sense to merge the two + can_be_merged_with(orderline) { + if (orderline.get_washingType() !== this.get_washingType()) { + return false; + } else { + return super.can_be_merged_with(orderline); + } + }, + // Clone the service with order-lines + clone() { + var orderline = super.clone(); + orderline.washingType = this.washingType; + orderline.washingType_id = this.washingType_id; + orderline.washingType_price = this.washingType_price; + if (this.washingType_price) { + orderline.price = this.washingType_price; + } + return orderline; + }, + //Method for exports as JSON + export_as_JSON() { + var json = super.export_as_JSON(); + json.washingType = this.washingType; + json.washingType_id = this.washingType_id; + json.washingType_price = this.washingType_price; + if (this.washingType_price) { + json.price = this.washingType_price; + } + return json; + }, + //Method for adding the washing type details + init_from_JSON(json) { + super.init_from_JSON(...arguments); + this.washingType = json.washingType; + this.washingType_id = json.washingType_id; + this.washingType_price = json.washingType_price; + }, + //Click function of Laundry Service button + click(e) { + this.popup.add(LaundryServiceTypePopup, { + title: _t('Laundry Service'), + body: _t('Choose the Washing type'), + service: this.pos.washing_type, + pos: this.pos, + orderline: this.props.line, + }) + }, + //Override set_partner method to prevent updating price + set_partner(partner) { + this.assert_editable(); + this.partner = partner; + var washing=0 + for (let line of this.currentOrder.orderlines) { + if (line.get_washingType()) + { + washing=1 + } + } + if (washing==0) + { + this.updatePricelistAndFiscalPosition(partner); + } + } +}); 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 100755 index 000000000..001d6f65c --- /dev/null +++ b/laundry_management_pos/static/src/js/order_line.js @@ -0,0 +1,59 @@ +/** @odoo-module */ +import { Orderline } from "@point_of_sale/app/generic_components/orderline/orderline"; +import { patch } from "@web/core/utils/patch"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { useService } from "@web/core/utils/hooks"; +import { _t } from "@web/core/l10n/translation"; +import { LaundryServiceTypePopup } from "@laundry_management_pos/js/popup/washing_type_popup"; + +patch(Orderline.prototype, { + setup() { + super.setup(...arguments); + this.pos = usePos(); + this.popup = useService("popup"); + }, + // Button click function to open the popup + click(e) { + this.popup.add(LaundryServiceTypePopup, { + title: _t('Laundry Service'), + body: _t('Choose the Washing type'), + service: this.pos.washing_type, + pos: this.pos, + orderline: this.props.line, + }) + }, + // Function to set the service type of the Washing + set_washingType(service) { + this.washingType = service.name; + this.washingType_id = service.id; + this.washingType_price = service.amount; + this.price = service.amount; + }, + //Method for removing laundry + remove_laundry() { + this.props.line.washingType = ''; + this.props.line.washingType_id = 0.0; + this.props.line.washingType_price = 0.0; + var order = this.pos.get_order(); + if (order) + { + order.selected_orderline.washingType=''; + order.selected_orderline.washingType_id=0.0; + order.selected_orderline.washingType_price=0.0; + order.updatePricelistAndFiscalPosition(order.partner); + for (const line of order.orderlines) { + if (line.washingType!="") + { + line.price=line.washingType_price + } + } + } + }, + //Override init to add washing type details + init_from_JSON(json) { + super.init_from_JSON(...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/popup/product_create_popup.js b/laundry_management_pos/static/src/js/popup/product_create_popup.js new file mode 100644 index 000000000..f3e063df9 --- /dev/null +++ b/laundry_management_pos/static/src/js/popup/product_create_popup.js @@ -0,0 +1,118 @@ +/**@odoo-module **/ +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { useService } from "@web/core/utils/hooks"; +import { jsonrpc } from "@web/core/network/rpc_service"; +import { _t } from "@web/core/l10n/translation"; +import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup"; +let img = ""; +let base64_img = ""; +/** + * CreateProductPopup is a popup component for creating a new product in the Point of Sale. + */ +export class CreateProductPopup extends AbstractAwaitablePopup { + static template = "CreateProductPopup" + /** + * Setup function to initialize the component. + */ + setup() { + super.setup(); + this.notification = useService("pos_notification"); + this.popup = useService("popup"); + } + /** + * Event handler for changing the image field. + * @param {Event} ev - The event object. + */ + async _onChangeImgField(ev) { + try { + let current = ev.target.files[0]; + const reader = new FileReader(); + reader.readAsDataURL(current); + reader.onload = await + function() { + img = reader.result; + base64_img = reader.result.toString().replace(/^data:(.*,)?/, ""); + const myTimeout = setTimeout(() => { + $("#img_url_tag_create").hide(); + let element = + ""; + $(".product-img-create-popup").append($(element)); + }, 100); + }; + reader.onerror = (error) => + reject(() => { + throw error; + }); + } catch (error) { + throw error; + } + } + /** + * Confirm function to create the product based on the entered details. + * @param {Event} ev - The event object. + */ + async confirm(ev) { + const img = $("#img_field").val(); + const name = $("#display_name").val(); + const price = $("#list_price").val() + const cost = $("#cost_price").val(); + const category = $("#product_category").val(); + const barcode = $("#barcode").val(); + const default_code = $("#default_code").val(); + const type = $("#type").val(); + const values = {}; + if (base64_img) { + values["image_1920"] = base64_img; + } + if (!name) { + this.popup.add(ErrorPopup, { + title: "Error", + body: "Add product name", + }); + return; // Stop execution if name is missing + } + values["name"] = name; + if (cost) { + values["standard_price"] = cost; + } + if (price) { + values["lst_price"] = price; + } + if (category > 0) { + values["pos_categ_ids"] = [[6, false, [category]]]; + } else { + this.popup.add(ErrorPopup, { + title: "Error", + body: "Forgot to select pos category?", + }); + return; // Stop execution if category is missing + } + if (barcode) { + values["barcode"] = barcode; + } + if (default_code) { + values["default_code"] = default_code; + } + if (type) { + values["type"] = type; + } + values["available_in_pos"] = true; + try { + const result = await jsonrpc(`/web/dataset/call_kw/product.product/create`, { + model: "product.product", + method: "create", + args: [values], + kwargs: {}, + }); + if (result) { + this.notification.add(_t("Product Created."), 3000); + this.cancel() + + } else { + this.notification.add(_t("Product Not Created."), 3000); + } + } catch (error) { + throw error; + } + } +} diff --git a/laundry_management_pos/static/src/js/popup/washing_type_popup.js b/laundry_management_pos/static/src/js/popup/washing_type_popup.js new file mode 100644 index 000000000..150d475b0 --- /dev/null +++ b/laundry_management_pos/static/src/js/popup/washing_type_popup.js @@ -0,0 +1,24 @@ +/** @odoo-module */ +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { _lt } from '@web/core/l10n/translation'; +/** + * CustomAlertPopup component for displaying custom messages as an alert popup. + * Inherits from AbstractAwaitablePopup. + */ +export class LaundryServiceTypePopup extends AbstractAwaitablePopup { + // Create a new Popup instance + laundryPopup(event) { + var order = this.props.pos.get_order(); + if (order.selected_orderline && !this.props.orderline) { + order.selected_orderline.set_washingType(this.props.pos.washing_type.find(obj => obj['id'] === parseInt(event.currentTarget.dataset['id']))); + } else if (order.selected_orderline && this.props.orderline) { + order.selected_orderline.set_washingType(this.props.pos.washing_type.find(obj => obj['id'] === parseInt(event.currentTarget.dataset['id']))); + } + super.confirm(); + } +} +LaundryServiceTypePopup.template = 'LaundryServiceTypePopup' +LaundryServiceTypePopup.defaultProps = { + confirmText: _lt('Ok'), + closePopup: _lt("Cancel"), +} diff --git a/laundry_management_pos/static/src/js/product_screen.js b/laundry_management_pos/static/src/js/product_screen.js new file mode 100644 index 000000000..cab956de9 --- /dev/null +++ b/laundry_management_pos/static/src/js/product_screen.js @@ -0,0 +1,42 @@ +/** @odoo-module **/ +import { PosModel } from "@point_of_sale/app/store/models"; +import { patch } from "@web/core/utils/patch"; + +patch(PosModel.prototype, { + //Override select partner method + async selectPartner() { + const currentOrder = this.get_order(); + if (!currentOrder) { + return; + } + const currentPartner = currentOrder.get_partner(); + if (currentPartner && currentOrder.getHasRefundLines()) { + this.popup.add(ErrorPopup, { + title: _t("Can't change customer"), + body: _t( + "This order already has refund lines for %s. We can't change the customer + associated to it. Create a new order for the new customer.", + currentPartner.name + ), + }); + return; + } + const { confirmed, payload: newPartner } = await this.showTempScreen("PartnerListScreen", { + partner: currentPartner, + }); + if (confirmed) { + this.currentOrder.set_partner(newPartner); + var washing=0 + for (let line of this.currentOrder.orderlines) { + if (line.get_washingType()) + { + washing=1 + } + } + if (washing==0) + { + this.currentOrder.updatePricelist(newPartner); + } + } + } +}); 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..3b0235eba --- /dev/null +++ b/laundry_management_pos/static/src/xml/button/product_create_button.xml @@ -0,0 +1,14 @@ + + + + + + + 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..80ed88141 --- /dev/null +++ b/laundry_management_pos/static/src/xml/button/washing_type_button.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/laundry_management_pos/static/src/xml/popup/product_create_popup.xml b/laundry_management_pos/static/src/xml/popup/product_create_popup.xml new file mode 100644 index 000000000..67b68bc4f --- /dev/null +++ b/laundry_management_pos/static/src/xml/popup/product_create_popup.xml @@ -0,0 +1,106 @@ + + + + + + + diff --git a/laundry_management_pos/static/src/xml/popup/washing_type_popup.xml b/laundry_management_pos/static/src/xml/popup/washing_type_popup.xml new file mode 100644 index 000000000..cd5ea10eb --- /dev/null +++ b/laundry_management_pos/static/src/xml/popup/washing_type_popup.xml @@ -0,0 +1,43 @@ + + + + + + + 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 100755 index 000000000..1cbe45b5a --- /dev/null +++ b/laundry_management_pos/static/src/xml/pos_receipt.xml @@ -0,0 +1,39 @@ + + + + + + + + + +
+ + + +
+ + + +
+ + + + +
+
+ + + + +

Laundry Service

+
+
+
------------------------------------------
+
Laundry Person
+
+
+
+
+
diff --git a/laundry_management_pos/views/laundry_order_views.xml b/laundry_management_pos/views/laundry_order_views.xml new file mode 100755 index 000000000..a655a4a38 --- /dev/null +++ b/laundry_management_pos/views/laundry_order_views.xml @@ -0,0 +1,31 @@ + + + + + laundry.order.view.form.inherit.laundry.management.pos + + laundry.order + + + + + + + + + + + + is_invoiced == True or state in ('draft', 'order', 'process') + + + + + + + diff --git a/laundry_management_pos/views/pos_config_views.xml b/laundry_management_pos/views/pos_config_views.xml new file mode 100755 index 000000000..9ac5c14fe --- /dev/null +++ b/laundry_management_pos/views/pos_config_views.xml @@ -0,0 +1,22 @@ + + + + + res.config.settings.view.form.inherit.laundry.management.pos + + res.config.settings + + + + + + +
+ Add Types on order lines to be printed on receipt and invoice. +
+
+
+
+
+
+
diff --git a/laundry_management_pos/views/pos_order_views.xml b/laundry_management_pos/views/pos_order_views.xml new file mode 100755 index 000000000..56f432897 --- /dev/null +++ b/laundry_management_pos/views/pos_order_views.xml @@ -0,0 +1,25 @@ + + + + + pos.order.view.form.inherit.laundry.management.pos + + pos.order + + + + + + + + + + + + +