diff --git a/laundry_management/README.rst b/laundry_management/README.rst new file mode 100755 index 000000000..c84674a8e --- /dev/null +++ b/laundry_management/README.rst @@ -0,0 +1,41 @@ +Laundry Management v15 +====================== +This module helps you to manage laundry service. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: Jesni Banu@cybrosys + Nilmar Shereef@cybrosys + Version 13: Nimisha Murali@cybrosys + Version 14: Minhaj T @cybrosys + Version 15: Gion @cybrosys + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/laundry_management/__init__.py b/laundry_management/__init__.py new file mode 100755 index 000000000..81be42017 --- /dev/null +++ b/laundry_management/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Jesni Banu and Nilmar Shereef(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import models +from . import reports diff --git a/laundry_management/__manifest__.py b/laundry_management/__manifest__.py new file mode 100755 index 000000000..c24120d40 --- /dev/null +++ b/laundry_management/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Jesni Banu and Nilmar Shereef(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +{ + 'name': 'Laundry Management', + 'version': '15.0.1.0.0', + 'summary': """Complete Laundry Service Management""", + 'description': 'This module is very useful to manage all process of laundry service', + "category": "Industries", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'mail', 'sale', 'account', 'uom'], + 'data': [ + 'data/data.xml', + 'security/laundry_security.xml', + 'security/ir.model.access.csv', + 'views/laundry_view.xml', + 'views/washing_view.xml', + 'views/config_view.xml', + 'views/laundry_report.xml', + 'views/laundry_label.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/laundry_management/data/data.xml b/laundry_management/data/data.xml new file mode 100755 index 000000000..457e4f5b7 --- /dev/null +++ b/laundry_management/data/data.xml @@ -0,0 +1,8 @@ + + + + Laundry Service + service + order + + \ No newline at end of file diff --git a/laundry_management/doc/RELEASE_NOTES.md b/laundry_management/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..e25b2cfa0 --- /dev/null +++ b/laundry_management/doc/RELEASE_NOTES.md @@ -0,0 +1,10 @@ +## Module + +#### 20.12.2021 +#### Version 15.0.1.0.0 +#### ADD +Initial commit for Laundry Management + + + + diff --git a/laundry_management/models/__init__.py b/laundry_management/models/__init__.py new file mode 100755 index 000000000..6868859f5 --- /dev/null +++ b/laundry_management/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Jesni Banu and Nilmar Shereef(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import laundry diff --git a/laundry_management/models/laundry.py b/laundry_management/models/laundry.py new file mode 100755 index 000000000..e5f056b93 --- /dev/null +++ b/laundry_management/models/laundry.py @@ -0,0 +1,472 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Jesni Banu and Nilmar Shereef(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +import time +from datetime import datetime +from odoo import models, fields, api, _ +from odoo.exceptions import UserError + + +class LaundryManagement(models.Model): + _name = 'laundry.order' + _inherit = 'mail.thread' + _description = "Laundry Order" + _order = 'order_date desc, id desc' + + @api.model + def create(self, vals): + vals['name'] = self.env['ir.sequence'].next_by_code('laundry.order') + return super(LaundryManagement, self).create(vals) + + @api.depends('order_lines') + def get_total(self): + total = 0 + for obj in self: + for each in obj.order_lines: + total += each.amount + obj.total_amount = total + + def confirm_order(self): + self.state = 'order' + sale_obj = self.env['sale.order'].create( + {'partner_id': self.partner_id.id, + 'partner_invoice_id': self.partner_invoice_id.id, + 'partner_shipping_id': self.partner_shipping_id.id}) + self.sale_obj = sale_obj + product_id = self.env.ref('laundry_management.laundry_service') + self.env['sale.order.line'].create({'product_id': product_id.id, + 'name': 'Laundry Service', + 'price_unit': self.total_amount, + 'order_id': sale_obj.id + }) + for each in self: + 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': 'draft', + 'washing_date': datetime.now().strftime( + '%Y-%m-%d %H:%M:%S')}) + + def create_invoice(self): + if self.sale_obj.state in ['draft', 'sent']: + self.sale_obj.action_confirm() + self.invoice_status = self.sale_obj.invoice_status + return { + 'name': 'Create Invoice', + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'sale.advance.payment.inv', + 'type': 'ir.actions.act_window', + 'context': {'laundry_sale_obj': self.sale_obj.id}, + 'target': 'new' + } + + def return_dress(self): + self.state = 'return' + + def cancel_order(self): + self.state = 'cancel' + + def _invoice_count(self): + wrk_ordr_ids = self.env['account.move'].search([('invoice_origin', '=', self.sale_obj.name)]) + self.invoice_count = len(wrk_ordr_ids) + + def _work_count(self): + 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 + + def action_view_laundry_works(self): + + work_obj = self.env['washing.washing'].search( + [('laundry_obj.laundry_obj.id', '=', self.id)]) + work_ids = [] + for each in work_obj: + work_ids.append(each.id) + view_id = self.env.ref('laundry_management.washing_form_view').id + if work_ids: + if len(work_ids) <= 1: + value = { + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'washing.washing', + 'view_id': view_id, + 'type': 'ir.actions.act_window', + 'name': _('Works'), + 'res_id': work_ids and work_ids[0] + } + else: + value = { + 'domain': str([('id', 'in', work_ids)]), + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'washing.washing', + 'view_id': False, + 'type': 'ir.actions.act_window', + 'name': _('Works'), + # 'res_id': work_ids + } + return value + + def action_view_invoice(self): + + inv_obj = self.env['account.move'].search( + [('invoice_origin', '=', self.sale_obj.name)]) + inv_ids = [] + for each in inv_obj: + inv_ids.append(each.id) + view_id = self.env.ref('account.view_move_form').id + if inv_ids: + if len(inv_ids) <= 1: + value = { + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'account.move', + 'view_id': view_id, + 'type': 'ir.actions.act_window', + 'name': _('Invoice'), + 'res_id': inv_ids and inv_ids[0] + } + else: + value = { + 'domain': str([('id', 'in', inv_ids)]), + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'account.move', + 'view_id': False, + 'type': 'ir.actions.act_window', + 'name': _('Invoice'), + 'res_id': inv_ids + } + + return value + + name = fields.Char(string="Label", copy=False) + invoice_status = fields.Selection([ + ('upselling', 'Upselling Opportunity'), + ('invoiced', 'Fully Invoiced'), + ('to invoice', 'To Invoice'), + ('no', 'Nothing to Invoice') + ], string='Invoice Status', invisible=1, related='sale_obj.invoice_status', + store=True) + sale_obj = fields.Many2one('sale.order', invisible=1) + invoice_count = fields.Integer(compute='_invoice_count', + string='# Invoice') + work_count = fields.Integer(compute='_work_count', string='# Works') + partner_id = fields.Many2one('res.partner', string='Customer', + readonly=True, + states={'draft': [('readonly', False)], + 'order': [('readonly', False)]}, + required=True, + change_default=True, index=True, + track_visibility='always') + partner_invoice_id = fields.Many2one('res.partner', + string='Invoice Address', + readonly=True, required=True, + states={ + 'draft': [('readonly', False)], + 'order': [('readonly', False)]}, + help="Invoice address for current sales order.") + partner_shipping_id = fields.Many2one('res.partner', + string='Delivery Address', + readonly=True, required=True, + states={ + 'draft': [('readonly', False)], + 'order': [('readonly', False)]}, + help="Delivery address for current sales order.") + order_date = fields.Datetime(string="Date", + default=datetime.now().strftime( + '%Y-%m-%d %H:%M:%S')) + laundry_person = fields.Many2one('res.users', string='Laundry Person', + required=1) + order_lines = fields.One2many('laundry.order.line', 'laundry_obj', + required=1, ondelete='cascade') + total_amount = fields.Float(compute='get_total', string='Total', store=1) + currency_id = fields.Many2one("res.currency", string="Currency") + note = fields.Text(string='Terms and conditions') + state = fields.Selection([ + ('draft', 'Draft'), + ('order', 'Laundry Order'), + ('process', 'Processing'), + ('done', 'Done'), + ('return', 'Returned'), + ('cancel', 'Cancelled'), + ], string='Status', readonly=True, copy=False, index=True, + track_visibility='onchange', default='draft') + + +class LaundryManagementLine(models.Model): + _name = 'laundry.order.line' + + @api.depends('washing_type', 'extra_work', 'qty') + def get_amount(self): + for obj in self: + total = obj.washing_type.amount * obj.qty + for each in obj.extra_work: + total += each.amount * obj.qty + obj.amount = total + + product_id = fields.Many2one('product.product', string='Dress', required=1) + qty = fields.Integer(string='No of items', required=1) + description = fields.Text(string='Description') + washing_type = fields.Many2one('washing.type', string='Washing Type', + required=1) + extra_work = fields.Many2many('washing.work', string='Extra Work') + amount = fields.Float(compute='get_amount', string='Amount') + laundry_obj = fields.Many2one('laundry.order', invisible=1) + state = fields.Selection([ + ('draft', 'Draft'), + ('wash', 'Washing'), + ('extra_work', 'Make Over'), + ('done', 'Done'), + ('cancel', 'Cancelled'), + ], string='Status', readonly=True, copy=False, index=True, default='draft') + + +class WashingType(models.Model): + _name = 'washing.type' + + name = fields.Char(string='Name', required=1) + assigned_person = fields.Many2one('res.users', string='Assigned Person', + required=1) + amount = fields.Float(string='Service Charge', required=1) + + +class ExtraWork(models.Model): + _name = 'washing.work' + + name = fields.Char(string='Name', required=1) + assigned_person = fields.Many2one('res.users', string='Assigned Person', + required=1) + amount = fields.Float(string='Service Charge', required=1) + + +class Washing(models.Model): + _name = 'washing.washing' + + def start_wash(self): + if not self.laundry_works: + self.laundry_obj.state = 'wash' + self.laundry_obj.laundry_obj.state = 'process' + for each in self: + for obj in each.product_line: + self.env['sale.order.line'].create( + {'product_id': obj.product_id.id, + 'name': obj.name, + 'price_unit': obj.price_unit, + 'order_id': each.laundry_obj.laundry_obj.sale_obj.id, + 'product_uom_qty': obj.quantity, + 'product_uom': obj.uom_id.id, + }) + self.state = 'process' + + def set_to_done(self): + self.state = 'done' + f = 0 + if not self.laundry_works: + if self.laundry_obj.extra_work: + for each in self.laundry_obj.extra_work: + self.create({'name': each.name, + 'user_id': each.assigned_person.id, + 'description': self.laundry_obj.description, + 'laundry_obj': self.laundry_obj.id, + 'state': 'draft', + 'laundry_works': True, + 'washing_date': datetime.now().strftime( + '%Y-%m-%d %H:%M:%S')}) + self.laundry_obj.state = 'extra_work' + laundry_obj = self.search([('laundry_obj.laundry_obj', '=', + self.laundry_obj.laundry_obj.id)]) + for each in laundry_obj: + if each.state != 'done' or each.state == 'cancel': + f = 1 + break + if f == 0: + self.laundry_obj.laundry_obj.state = 'done' + laundry_obj1 = self.search([('laundry_obj', '=', self.laundry_obj.id)]) + f1 = 0 + for each in laundry_obj1: + if each.state != 'done' or each.state == 'cancel': + f1 = 1 + break + if f1 == 0: + self.laundry_obj.state = 'done' + + @api.depends('product_line') + def get_total(self): + total = 0 + for obj in self: + for each in obj.product_line: + total += each.subtotal + obj.total_amount = total + + name = fields.Char(string='Work') + laundry_works = fields.Boolean(default=False, invisible=1) + user_id = fields.Many2one('res.users', string='Assigned Person') + washing_date = fields.Datetime(string='Date') + description = fields.Text(string='Description') + state = fields.Selection([ + ('draft', 'Draft'), + ('process', 'Process'), + ('done', 'Done'), + ('cancel', 'Cancelled'), + ], string='Status', readonly=True, copy=False, index=True, default='draft') + laundry_obj = fields.Many2one('laundry.order.line', invisible=1) + product_line = fields.One2many('wash.order.line', 'wash_obj', + string='Products', ondelete='cascade') + total_amount = fields.Float(compute='get_total', string='Grand Total') + + +class SaleOrderInherit(models.Model): + _name = 'wash.order.line' + + @api.depends('price_unit', 'quantity') + def compute_amount(self): + total = 0 + for obj in self: + total += obj.price_unit * obj.quantity + obj.subtotal = total + + wash_obj = fields.Many2one('washing.washing', string='Order Reference', + ondelete='cascade') + name = fields.Text(string='Description', required=True) + uom_id = fields.Many2one('uom.uom', 'Unit of Measure ', required=True) + quantity = fields.Integer(string='Quantity') + product_id = fields.Many2one('product.product', string='Product') + price_unit = fields.Float('Unit Price', default=0.0, + related='product_id.list_price') + subtotal = fields.Float(compute='compute_amount', string='Subtotal', + readonly=True, store=True) + + +class LaundryManagementInvoice(models.TransientModel): + _inherit = 'sale.advance.payment.inv' + + def create_invoices(self): + context = self._context + if context.get('laundry_sale_obj'): + sale_orders = self.env['sale.order'].browse( + context.get('laundry_sale_obj')) + else: + sale_orders = self.env['sale.order'].browse( + self._context.get('active_ids', [])) + if self.advance_payment_method == 'delivered': + sale_orders._create_invoices() + elif self.advance_payment_method == 'all': + sale_orders._create_invoices()(final=True) + else: + # Create deposit product if necessary + if not self.product_id: + vals = self._prepare_deposit_product() + self.product_id = self.env['product.product'].create(vals) + self.env['ir.values'].sudo().set_default( + 'sale.config.settings', 'deposit_product_id_setting', + self.product_id.id) + + sale_line_obj = self.env['sale.order.line'] + for order in sale_orders: + if self.advance_payment_method == 'percentage': + amount = order.amount_untaxed * self.amount / 100 + else: + amount = self.amount + if self.product_id.invoice_policy != 'order': + raise UserError(_( + 'The product used to invoice a down payment should have an invoice policy set to "Ordered' + ' quantities". Please update your deposit product to be able to create a deposit invoice.')) + if self.product_id.type != 'service': + raise UserError(_( + "The product used to invoice a down payment should be of type 'Service'. Please use another " + "product or update this product.")) + taxes = self.product_id.taxes_id.filtered( + lambda + r: not order.company_id or r.company_id == order.company_id) + if order.fiscal_position_id and taxes: + tax_ids = order.fiscal_position_id.map_tax(taxes).ids + else: + tax_ids = taxes.ids + so_line = sale_line_obj.create({ + 'name': _('Advance: %s') % (time.strftime('%m %Y'),), + 'price_unit': amount, + 'product_uom_qty': 0.0, + 'order_id': order.id, + 'discount': 0.0, + 'product_uom': self.product_id.uom_id.id, + 'product_id': self.product_id.id, + 'tax_id': [(6, 0, tax_ids)], + }) + self._create_invoice(order, so_line, amount) + if self._context.get('open_invoices', False): + return sale_orders.action_view_invoice() + return {'type': 'ir.actions.act_window_close'} + + def _create_invoice(self, order, so_line, amount): + if ( + self.advance_payment_method == 'percentage' and self.amount <= 0.00) or ( + self.advance_payment_method == 'fixed' and self.fixed_amount <= 0.00): + raise UserError( + _('The value of the down payment amount must be positive.')) + if self.advance_payment_method == 'percentage': + amount = order.amount_untaxed * self.amount / 100 + name = _("Down payment of %s%%") % (self.amount,) + else: + amount = self.fixed_amount + name = _('Down Payment') + + invoice_vals = { + 'move_type': 'out_invoice', + 'invoice_origin': order.name, + 'invoice_user_id': order.user_id.id, + 'narration': order.note, + 'partner_id': order.partner_invoice_id.id, + 'fiscal_position_id': order.fiscal_position_id.id or order.partner_id.property_account_position_id.id, + 'partner_shipping_id': order.partner_shipping_id.id, + 'currency_id': order.pricelist_id.currency_id.id, + 'invoice_payment_ref': order.client_order_ref, + 'invoice_payment_term_id': order.payment_term_id.id, + 'team_id': order.team_id.id, + 'campaign_id': order.campaign_id.id, + 'medium_id': order.medium_id.id, + 'source_id': order.source_id.id, + 'invoice_line_ids': [(0, 0, { + 'name': name, + 'price_unit': amount, + 'quantity': 1.0, + 'product_id': self.product_id.id, + 'sale_line_ids': [(6, 0, [so_line.id])], + 'analytic_tag_ids': [(6, 0, so_line.analytic_tag_ids.ids)], + 'analytic_account_id': order.analytic_account_id.id or False, + })], + } + if order.fiscal_position_id: + invoice_vals['fiscal_position_id'] = order.fiscal_position_id.id + invoice = self.env['account.move'].create(invoice_vals) + invoice.message_post_with_view('mail.message_origin_link', + values={'self': invoice, + 'origin': order}, + subtype_id=self.env.ref( + 'mail.mt_note').id) + return invoice diff --git a/laundry_management/reports/__init__.py b/laundry_management/reports/__init__.py new file mode 100755 index 000000000..5deb7ab66 --- /dev/null +++ b/laundry_management/reports/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Jesni Banu and Nilmar Shereef(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import laundry_report diff --git a/laundry_management/reports/laundry_report.py b/laundry_management/reports/laundry_report.py new file mode 100755 index 000000000..a90833dd6 --- /dev/null +++ b/laundry_management/reports/laundry_report.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Jesni Banu and Nilmar Shereef(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import models, fields, tools + + +class DifferedCheckHistory(models.Model): + _name = "report.laundry.order" + _description = "Laundry Order Analysis" + _auto = False + + name = fields.Char(string="Label") + invoice_status = fields.Selection([ + ('upselling', 'Upselling Opportunity'), + ('invoiced', 'Fully Invoiced'), + ('to invoice', 'To Invoice'), + ('no', 'Nothing to Invoice') + ], string='Invoice Status', store=True) + partner_id = fields.Many2one('res.partner', string='Customer') + partner_invoice_id = fields.Many2one('res.partner', string='Invoice Address') + partner_shipping_id = fields.Many2one('res.partner', string='Delivery Address') + order_date = fields.Datetime(string="Date") + laundry_person = fields.Many2one('res.users', string='Laundry Person') + total_amount = fields.Float(string='Total') + currency_id = fields.Many2one("res.currency", string="Currency") + state = fields.Selection([ + ('draft', 'Draft'), + ('order', 'Laundry Order'), + ('process', 'Processing'), + ('done', 'Done'), + ('return', 'Returned'), + ('cancel', 'Cancelled'), + ], string='Status') + + _order = 'name desc' + + def _select(self): + select_str = """ + SELECT + (select 1 ) AS nbr, + t.id as id, + t.name as name, + t.invoice_status as invoice_status, + t.partner_id as partner_id, + t.partner_invoice_id as partner_invoice_id, + t.partner_shipping_id as partner_shipping_id, + t.order_date as order_date, + t.laundry_person as laundry_person, + t.total_amount as total_amount, + t.currency_id as currency_id, + t.state as state + """ + return select_str + + def _group_by(self): + group_by_str = """ + GROUP BY + t.id, + name, + invoice_status, + partner_id, + partner_invoice_id, + partner_shipping_id, + order_date, + laundry_person, + total_amount, + currency_id, + state + """ + return group_by_str + + def init(self): + tools.sql.drop_view_if_exists(self._cr, 'report_laundry_order') + self._cr.execute(""" + CREATE view report_laundry_order as + %s + FROM laundry_order t + %s + """ % (self._select(), self._group_by())) diff --git a/laundry_management/security/ir.model.access.csv b/laundry_management/security/ir.model.access.csv new file mode 100755 index 000000000..2433d0414 --- /dev/null +++ b/laundry_management/security/ir.model.access.csv @@ -0,0 +1,19 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +laundry_model_access_right_user,laundry_model_access_right,model_laundry_order,laundry_group_user,1,1,0,0 +laundry_model_access_right_manager,laundry_model_access_right1,model_laundry_order,laundry_group_manager,1,1,1,1 +laundry_order_line_model_access_right_user,laundry_order_line_model_access_right,model_laundry_order_line,laundry_group_user,1,1,0,0 +laundry_order_line_model_access_right_manager,laundry_order_line_model_access_right1,model_laundry_order_line,laundry_group_manager,1,1,1,1 +laundry_washing_type_model_access_right_user,laundry_washing_type_model_access_right,model_washing_type,laundry_group_user,1,0,0,0 +laundry_washing_type_model_access_right_manager,laundry_washing_type_model_access_right1,model_washing_type,laundry_group_manager,1,1,1,1 +laundry_washing_work_model_access_right_user,laundry_model_washing_work_access_right,model_washing_work,laundry_group_user,1,0,0,0 +laundry_washing_work_model_access_right_manager,laundry_model_washing_work_access_right1,model_washing_work,laundry_group_manager,1,1,1,1 +laundry_washing_washing_model_access_right_user,laundry_model_washing_washing_access_right,model_washing_washing,laundry_group_user,1,1,1,0 +laundry_washing_washing_model_access_right_manager,laundry_model_washing_washing_access_right1,model_washing_washing,laundry_group_manager,1,1,1,1 +laundry_wash_order_line_model_access_right_user,laundry_model_wash_order_line_access_right,model_wash_order_line,laundry_group_user,1,1,1,0 +laundry_wash_order_line_model_access_right_manager,laundry_model_wash_order_line_access_right1,model_wash_order_line,laundry_group_manager,1,1,1,1 +laundry_report_laundry_order_model_access_right_user,laundry_model_report_laundry_order_access_right,model_report_laundry_order,laundry_group_user,1,0,0,0 +laundry_report_laundry_order_model_access_right_manager,laundry_model_report_laundry_order_access_right1,model_report_laundry_order,laundry_group_manager,1,1,1,1 +laundry_report_laundry_order_model_access_right_manager1,laundry_model_report_laundry_order_access_right11,sale.model_sale_order,laundry_group_manager,1,1,1,1 +laundry_report_laundry_order_model_access_right_manager12,laundry_model_report_laundry_order_access_right112,sale.model_sale_order_line,laundry_group_manager,1,1,1,1 +laundry_report_laundry_order_model_access_right_manager11,laundry_model_report_laundry_order_access_right111,sale.model_sale_order,laundry_group_user,1,1,1,1 +laundry_report_laundry_order_model_access_right_manager112,laundry_model_report_laundry_order_access_right1112,sale.model_sale_order_line,laundry_group_user,1,1,1,1 \ No newline at end of file diff --git a/laundry_management/security/laundry_security.xml b/laundry_management/security/laundry_security.xml new file mode 100755 index 000000000..b07069253 --- /dev/null +++ b/laundry_management/security/laundry_security.xml @@ -0,0 +1,34 @@ + + + + + Laundry + 18 + + + User + + + + + Manager + + + + + + laundry manager: full access + + [(1,'=',1)] + + + + user: own document only + + [('laundry_person.id','=',user.id)] + + + + + + diff --git a/laundry_management/static/description/assets/icons/chevron.png b/laundry_management/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/laundry_management/static/description/assets/icons/chevron.png differ diff --git a/laundry_management/static/description/assets/icons/cogs.png b/laundry_management/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/laundry_management/static/description/assets/icons/cogs.png differ diff --git a/laundry_management/static/description/assets/icons/consultation.png b/laundry_management/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/laundry_management/static/description/assets/icons/consultation.png differ diff --git a/laundry_management/static/description/assets/icons/ecom-black.png b/laundry_management/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/laundry_management/static/description/assets/icons/ecom-black.png differ diff --git a/laundry_management/static/description/assets/icons/education-black.png b/laundry_management/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/laundry_management/static/description/assets/icons/education-black.png differ diff --git a/laundry_management/static/description/assets/icons/hotel-black.png b/laundry_management/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/laundry_management/static/description/assets/icons/hotel-black.png differ diff --git a/laundry_management/static/description/assets/icons/license.png b/laundry_management/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/laundry_management/static/description/assets/icons/license.png differ diff --git a/laundry_management/static/description/assets/icons/lifebuoy.png b/laundry_management/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/laundry_management/static/description/assets/icons/lifebuoy.png differ diff --git a/laundry_management/static/description/assets/icons/manufacturing-black.png b/laundry_management/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/laundry_management/static/description/assets/icons/manufacturing-black.png differ diff --git a/laundry_management/static/description/assets/icons/pos-black.png b/laundry_management/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/laundry_management/static/description/assets/icons/pos-black.png differ diff --git a/laundry_management/static/description/assets/icons/puzzle.png b/laundry_management/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/laundry_management/static/description/assets/icons/puzzle.png differ diff --git a/laundry_management/static/description/assets/icons/restaurant-black.png b/laundry_management/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/laundry_management/static/description/assets/icons/restaurant-black.png differ diff --git a/laundry_management/static/description/assets/icons/service-black.png b/laundry_management/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/laundry_management/static/description/assets/icons/service-black.png differ diff --git a/laundry_management/static/description/assets/icons/trading-black.png b/laundry_management/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/laundry_management/static/description/assets/icons/trading-black.png differ diff --git a/laundry_management/static/description/assets/icons/training.png b/laundry_management/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/laundry_management/static/description/assets/icons/training.png differ diff --git a/laundry_management/static/description/assets/icons/update.png b/laundry_management/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/laundry_management/static/description/assets/icons/update.png differ diff --git a/laundry_management/static/description/assets/icons/user.png b/laundry_management/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/laundry_management/static/description/assets/icons/user.png differ diff --git a/laundry_management/static/description/assets/icons/wrench.png b/laundry_management/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/laundry_management/static/description/assets/icons/wrench.png differ diff --git a/laundry_management/static/description/banner.png b/laundry_management/static/description/banner.png new file mode 100644 index 000000000..026ca78d3 Binary files /dev/null and b/laundry_management/static/description/banner.png differ diff --git a/laundry_management/static/description/icon.png b/laundry_management/static/description/icon.png new file mode 100644 index 000000000..be8931d41 Binary files /dev/null and b/laundry_management/static/description/icon.png differ diff --git a/laundry_management/static/description/images/checked.png b/laundry_management/static/description/images/checked.png new file mode 100644 index 000000000..e6c63d582 Binary files /dev/null and b/laundry_management/static/description/images/checked.png differ diff --git a/laundry_management/static/description/images/hero.png b/laundry_management/static/description/images/hero.png new file mode 100644 index 000000000..5a75a1ad1 Binary files /dev/null and b/laundry_management/static/description/images/hero.png differ diff --git a/laundry_management/static/description/images/laundry1.png b/laundry_management/static/description/images/laundry1.png new file mode 100644 index 000000000..afd09d013 Binary files /dev/null and b/laundry_management/static/description/images/laundry1.png differ diff --git a/laundry_management/static/description/images/laundry10.png b/laundry_management/static/description/images/laundry10.png new file mode 100644 index 000000000..d12613f4a Binary files /dev/null and b/laundry_management/static/description/images/laundry10.png differ diff --git a/laundry_management/static/description/images/laundry11.png b/laundry_management/static/description/images/laundry11.png new file mode 100644 index 000000000..94a63169e Binary files /dev/null and b/laundry_management/static/description/images/laundry11.png differ diff --git a/laundry_management/static/description/images/laundry2.png b/laundry_management/static/description/images/laundry2.png new file mode 100644 index 000000000..8092ebfcb Binary files /dev/null and b/laundry_management/static/description/images/laundry2.png differ diff --git a/laundry_management/static/description/images/laundry3.png b/laundry_management/static/description/images/laundry3.png new file mode 100644 index 000000000..00a61fafd Binary files /dev/null and b/laundry_management/static/description/images/laundry3.png differ diff --git a/laundry_management/static/description/images/laundry4.png b/laundry_management/static/description/images/laundry4.png new file mode 100644 index 000000000..d23e0e11b Binary files /dev/null and b/laundry_management/static/description/images/laundry4.png differ diff --git a/laundry_management/static/description/images/laundry5.png b/laundry_management/static/description/images/laundry5.png new file mode 100644 index 000000000..c07acb4c2 Binary files /dev/null and b/laundry_management/static/description/images/laundry5.png differ diff --git a/laundry_management/static/description/images/laundry6.png b/laundry_management/static/description/images/laundry6.png new file mode 100644 index 000000000..518a83331 Binary files /dev/null and b/laundry_management/static/description/images/laundry6.png differ diff --git a/laundry_management/static/description/images/laundry7.png b/laundry_management/static/description/images/laundry7.png new file mode 100644 index 000000000..1e3fa52e2 Binary files /dev/null and b/laundry_management/static/description/images/laundry7.png differ diff --git a/laundry_management/static/description/images/laundry8.png b/laundry_management/static/description/images/laundry8.png new file mode 100644 index 000000000..855159d31 Binary files /dev/null and b/laundry_management/static/description/images/laundry8.png differ diff --git a/laundry_management/static/description/images/laundry9.png b/laundry_management/static/description/images/laundry9.png new file mode 100644 index 000000000..9c8ac2523 Binary files /dev/null and b/laundry_management/static/description/images/laundry9.png differ diff --git a/laundry_management/static/description/images/logo.png b/laundry_management/static/description/images/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/laundry_management/static/description/images/logo.png differ diff --git a/laundry_management/static/description/images/modules/barcode_image.png b/laundry_management/static/description/images/modules/barcode_image.png new file mode 100644 index 000000000..156043839 Binary files /dev/null and b/laundry_management/static/description/images/modules/barcode_image.png differ diff --git a/laundry_management/static/description/images/modules/barcode_scan_image.png b/laundry_management/static/description/images/modules/barcode_scan_image.png new file mode 100644 index 000000000..4be2248a4 Binary files /dev/null and b/laundry_management/static/description/images/modules/barcode_scan_image.png differ diff --git a/laundry_management/static/description/images/modules/export_image.png b/laundry_management/static/description/images/modules/export_image.png new file mode 100644 index 000000000..4e4ea0e51 Binary files /dev/null and b/laundry_management/static/description/images/modules/export_image.png differ diff --git a/laundry_management/static/description/images/modules/hide_image.png b/laundry_management/static/description/images/modules/hide_image.png new file mode 100644 index 000000000..be440eb23 Binary files /dev/null and b/laundry_management/static/description/images/modules/hide_image.png differ diff --git a/laundry_management/static/description/images/modules/ip_image.png b/laundry_management/static/description/images/modules/ip_image.png new file mode 100644 index 000000000..0841c9749 Binary files /dev/null and b/laundry_management/static/description/images/modules/ip_image.png differ diff --git a/laundry_management/static/description/images/modules/payment_image.png b/laundry_management/static/description/images/modules/payment_image.png new file mode 100644 index 000000000..ee36ed365 Binary files /dev/null and b/laundry_management/static/description/images/modules/payment_image.png differ diff --git a/laundry_management/static/description/index.html b/laundry_management/static/description/index.html new file mode 100644 index 000000000..c5bde0fb1 --- /dev/null +++ b/laundry_management/static/description/index.html @@ -0,0 +1,706 @@ +
+
+
+
+ +
+
+
+ Community +
+ +
+
+
+
+ +
+
+ +
+
+

Laundry Management

+

+ Helps You To Manage Laundry Service +

+ +
+
+ + + +
+
+

Overview

+
+

+ This is an industrial specific module by Cybrosys Technologies for Laundry Management. It + manages the laundry process with assigning works to workers. +

+
+
+ + + + +
+
+

Key Features

+
+
+ + +
+ +
+ +

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

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

Screenshots

+
+ + +
+
+

+ 01

+
+
+

+ Recording Laundry Order +

+

+ + Laundry Management -> Laundry Management -> Laundry Order
+ + When you install this module, an extra menu Laundry Management will created in main + menu. Youcan see the different sub menus under the main menu. Here you can create + Laundry Order via clicking the 'Create' button. There you can specify the customer, + laundry person, order lines with washing type and Extra works for your order.s + +

+ +
+
+ + +

+ When you confirm the Laundry Order the corresponding works will created under the + assigned person. There you can add extra products also. It will also add in Billing. +

+ + + + + + +
+
+

+ 02

+
+
+

+ Laundry Label +

+

+ You can print label for each order from the print menu +

+ +
+
+ + + + +
+
+

+ 03

+
+
+

+ Laundry Works +

+

+ + Laundry Management -> Laundry Management -> Laundry Works
+ + This is the Separate Laundry Works Form. Here you can see the work status of Laundry + Works +

+ +
+
+ +

+ If there is any extra works , it will created as work When you finish the main work. Then we can + see the status of that order line is become 'Make Over' +

+ + + + +
+
+

+ 04

+
+
+

+ Invoice +

+

+ You can create Invoice via the button 'Create Invoice' when the order reaches to 'Done' + state. +

+ +
+
+ + +

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

+ + + + + +
+
+

+ 05

+
+
+

+ Configuration +

+

+ + You can configure washing types from the menu Laundry Management -> Configuration -> + Washing Type by specifying the name, assigned person and service charge +

+ +
+
+ +

+ + You can configure additional works from the menu Laundry Management -> Configuration -> + Additional Works by specifying the name, assigned person and service charge +

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

Suggested Products

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

Our Services

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

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

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

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

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

+ An + all-inclusive + hotel management application

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

Need Help?

+
+
+
+ + +
+ +
+ +
+ +
+ WhatsApp +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/laundry_management/views/config_view.xml b/laundry_management/views/config_view.xml new file mode 100755 index 000000000..d0964cc70 --- /dev/null +++ b/laundry_management/views/config_view.xml @@ -0,0 +1,90 @@ + + + + + + washing.type.form + washing.type + +
+ + + + + + + + + + + +
+
+
+ + + washing.type.tree + washing.type + + + + + + + + + + + Washing Type + ir.actions.act_window + washing.type + tree,form + + + + washing.work.form + washing.work + +
+ + + + + + + + + + + +
+
+
+ + + washing.work.tree + washing.work + + + + + + + + + + + Additional Works + ir.actions.act_window + washing.work + tree,form + + + + + + + + +
+
\ No newline at end of file diff --git a/laundry_management/views/laundry_label.xml b/laundry_management/views/laundry_label.xml new file mode 100755 index 000000000..9c611fdfd --- /dev/null +++ b/laundry_management/views/laundry_label.xml @@ -0,0 +1,47 @@ + + + + + + + + + + diff --git a/laundry_management/views/laundry_report.xml b/laundry_management/views/laundry_report.xml new file mode 100755 index 000000000..f2086e03d --- /dev/null +++ b/laundry_management/views/laundry_report.xml @@ -0,0 +1,27 @@ + + + + + + report.laundry.order.pivot + report.laundry.order + + + + + + + + + Laundry Order Analysis + report.laundry.order + pivot + {'group_by_no_leaf':1,'group_by':[]} + This report allows you to analyse the performance of your Laundry Mangement. + + + + + + + \ No newline at end of file diff --git a/laundry_management/views/laundry_view.xml b/laundry_management/views/laundry_view.xml new file mode 100755 index 000000000..5a135f393 --- /dev/null +++ b/laundry_management/views/laundry_view.xml @@ -0,0 +1,122 @@ + + + + + + Laundry Order Code + laundry.order + + LO + + + + laundry.order.form + laundry.order + +
+
+
+ +
+ + +
+
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +
+ + + + + + laundry.order.tree + laundry.order + + + + + + + + + + + + + + Laundry Management + ir.actions.act_window + laundry.order + tree,form + [] + +

+ Click to create a New Order. +

+
+
+ + + + + + + \ No newline at end of file diff --git a/laundry_management/views/washing_view.xml b/laundry_management/views/washing_view.xml new file mode 100755 index 000000000..1a1c6b72a --- /dev/null +++ b/laundry_management/views/washing_view.xml @@ -0,0 +1,77 @@ + + + + + + washing.washing.form + washing.washing + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + washing.washing.tree + washing.washing + + + + + + + + + + + + Washing + ir.actions.act_window + washing.washing + tree,form + [('user_id','=', uid)] + + + + + + \ No newline at end of file