diff --git a/employee_check_list/README.rst b/employee_check_list/README.rst new file mode 100644 index 000000000..f97e108b8 --- /dev/null +++ b/employee_check_list/README.rst @@ -0,0 +1,41 @@ +Employee Check List +=================== +This module is used to remembering the employee's entry and exit progress. + + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: Nimisha Murali@cybrosys(V13) +* Developer: Aiswarya J P@cybrosys(V15) + +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/employee_check_list/__init__.py b/employee_check_list/__init__.py new file mode 100644 index 000000000..b6ce483db --- /dev/null +++ b/employee_check_list/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import models + diff --git a/employee_check_list/__manifest__.py b/employee_check_list/__manifest__.py new file mode 100644 index 000000000..8b1a5aa7b --- /dev/null +++ b/employee_check_list/__manifest__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions(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': 'Employee Checklist', + 'version': '15.0.1.0.0', + 'summary': """Manages Employee's Entry & Exit Process""", + 'description': """This module is used to remembering the employee's entry and exit progress.""", + 'category': 'Generic Modules/Human Resources', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'employee_documents_expiry'], + 'data': [ + 'views/employee_form_inherit_view.xml', + 'views/checklist_view.xml', + 'views/settings_view.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} + diff --git a/employee_check_list/doc/RELEASE_NOTES.md b/employee_check_list/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..9121fdfe5 --- /dev/null +++ b/employee_check_list/doc/RELEASE_NOTES.md @@ -0,0 +1,9 @@ +## Module + +#### 07.10.2021 +#### Version 15.0.1.0.0 +#### ADD +Initial commit for Employee Check List + + + diff --git a/employee_check_list/models/__init__.py b/employee_check_list/models/__init__.py new file mode 100644 index 000000000..2e5ae5287 --- /dev/null +++ b/employee_check_list/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions(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 employee_master_inherit +from . import settings diff --git a/employee_check_list/models/employee_master_inherit.py b/employee_check_list/models/employee_master_inherit.py new file mode 100644 index 000000000..0cb16560a --- /dev/null +++ b/employee_check_list/models/employee_master_inherit.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions(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, api + + +class EmployeeMasterInherit(models.Model): + _inherit = 'hr.employee' + + @api.depends('exit_checklist_ids') + def exit_progress(self): + for each in self: + total_len = self.env['employee.checklist'].search_count([('document_type', '=', 'exit')]) + entry_len = len(each.exit_checklist_ids) + if total_len != 0: + each.exit_progress = (entry_len * 100) / total_len + + @api.depends('entry_checklist_ids') + def entry_progress(self): + for each in self: + total_len = self.env['employee.checklist'].search_count([('document_type', '=', 'entry')]) + entry_len = len(each.entry_checklist_ids) + if total_len != 0: + each.entry_progress = (entry_len*100) / total_len + + entry_checklist_ids = fields.Many2many('employee.checklist', 'entry_obj_ids', 'check_hr_rel', 'hr_check_rel', + string='Entry Process', + domain=[('document_type', '=', 'entry')]) + exit_checklist_ids = fields.Many2many('employee.checklist', 'exit_obj_ids', 'exit_hr_rel', 'hr_exit_rel', + string='Exit Process', + domain=[('document_type', '=', 'exit')]) + entry_progress = fields.Float(compute=entry_progress, string='Entry Progress', store=True, default=0.0) + exit_progress = fields.Float(compute=exit_progress, string='Exit Progress', store=True, default=0.0) + maximum_rate = fields.Integer(default=100) + check_list_enable = fields.Boolean(invisible=True, copy=False) + + +class EmployeeDocumentInherit(models.Model): + _inherit = 'hr.employee.document' + + @api.model + def create(self, vals): + result = super(EmployeeDocumentInherit, self).create(vals) + if result.document_name.document_type == 'entry': + result.employee_ref.write({'entry_checklist_ids': [(4, result.document_name.id)]}) + if result.document_name.document_type == 'exit': + result.employee_ref.write({'exit_checklist_ids': [(4, result.document_name.id)]}) + return result + + def unlink(self): + for result in self: + if result.document_name.document_type == 'entry': + result.employee_ref.write({'entry_checklist_ids': [(5, result.document_name.id)]}) + if result.document_name.document_type == 'exit': + result.employee_ref.write({'exit_checklist_ids': [(5, result.document_name.id)]}) + res = super(EmployeeDocumentInherit, self).unlink() + return res + + +class EmployeeChecklistInherit(models.Model): + _inherit = 'employee.checklist' + + entry_obj_ids = fields.Many2many('hr.employee', 'entry_checklist_ids', 'hr_check_rel', 'check_hr_rel', + invisible=1) + exit_obj_ids = fields.Many2many('hr.employee', 'exit_checklist_ids', 'hr_exit_rel', 'exit_hr_rel', + invisible=1) diff --git a/employee_check_list/models/settings.py b/employee_check_list/models/settings.py new file mode 100644 index 000000000..7bcb513eb --- /dev/null +++ b/employee_check_list/models/settings.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions(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, api + + +class HRSettings(models.TransientModel): + _inherit = 'res.config.settings' + + enable_checklist = fields.Boolean(string='Enable Checklist Progress in Kanban?', default=False) + + @api.model + def get_values(self): + res = super(HRSettings, self).get_values() + config = self.env['ir.config_parameter'].sudo() + enable_checklist = config.get_param('employee_check_list.enable_checklist', default=False) + res.update( + enable_checklist=enable_checklist + ) + return res + + def set_values(self): + super(HRSettings, self).set_values() + self.env['ir.config_parameter'].sudo().set_param('employee_check_list.enable_checklist', + self.enable_checklist) + emp_obj = self.env['hr.employee'].search([]) + for rec in emp_obj: + rec.write({'check_list_enable': self.enable_checklist}) + + diff --git a/employee_check_list/static/description/assets/icons/check.png b/employee_check_list/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/employee_check_list/static/description/assets/icons/check.png differ diff --git a/employee_check_list/static/description/assets/icons/chevron.png b/employee_check_list/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/employee_check_list/static/description/assets/icons/chevron.png differ diff --git a/employee_check_list/static/description/assets/icons/cogs.png b/employee_check_list/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/employee_check_list/static/description/assets/icons/cogs.png differ diff --git a/employee_check_list/static/description/assets/icons/consultation.png b/employee_check_list/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/employee_check_list/static/description/assets/icons/consultation.png differ diff --git a/employee_check_list/static/description/assets/icons/ecom-black.png b/employee_check_list/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/employee_check_list/static/description/assets/icons/ecom-black.png differ diff --git a/employee_check_list/static/description/assets/icons/education-black.png b/employee_check_list/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/employee_check_list/static/description/assets/icons/education-black.png differ diff --git a/employee_check_list/static/description/assets/icons/hotel-black.png b/employee_check_list/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/employee_check_list/static/description/assets/icons/hotel-black.png differ diff --git a/employee_check_list/static/description/assets/icons/license.png b/employee_check_list/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/employee_check_list/static/description/assets/icons/license.png differ diff --git a/employee_check_list/static/description/assets/icons/lifebuoy.png b/employee_check_list/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/employee_check_list/static/description/assets/icons/lifebuoy.png differ diff --git a/employee_check_list/static/description/assets/icons/logo.png b/employee_check_list/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/employee_check_list/static/description/assets/icons/logo.png differ diff --git a/employee_check_list/static/description/assets/icons/manufacturing-black.png b/employee_check_list/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/employee_check_list/static/description/assets/icons/manufacturing-black.png differ diff --git a/employee_check_list/static/description/assets/icons/pos-black.png b/employee_check_list/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/employee_check_list/static/description/assets/icons/pos-black.png differ diff --git a/employee_check_list/static/description/assets/icons/puzzle.png b/employee_check_list/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/employee_check_list/static/description/assets/icons/puzzle.png differ diff --git a/employee_check_list/static/description/assets/icons/restaurant-black.png b/employee_check_list/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/employee_check_list/static/description/assets/icons/restaurant-black.png differ diff --git a/employee_check_list/static/description/assets/icons/service-black.png b/employee_check_list/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/employee_check_list/static/description/assets/icons/service-black.png differ diff --git a/employee_check_list/static/description/assets/icons/trading-black.png b/employee_check_list/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/employee_check_list/static/description/assets/icons/trading-black.png differ diff --git a/employee_check_list/static/description/assets/icons/training.png b/employee_check_list/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/employee_check_list/static/description/assets/icons/training.png differ diff --git a/employee_check_list/static/description/assets/icons/update.png b/employee_check_list/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/employee_check_list/static/description/assets/icons/update.png differ diff --git a/employee_check_list/static/description/assets/icons/user.png b/employee_check_list/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/employee_check_list/static/description/assets/icons/user.png differ diff --git a/employee_check_list/static/description/assets/icons/wrench.png b/employee_check_list/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/employee_check_list/static/description/assets/icons/wrench.png differ diff --git a/employee_check_list/static/description/assets/modules/1.png b/employee_check_list/static/description/assets/modules/1.png new file mode 100644 index 000000000..9aeec92c9 Binary files /dev/null and b/employee_check_list/static/description/assets/modules/1.png differ diff --git a/employee_check_list/static/description/assets/modules/2.png b/employee_check_list/static/description/assets/modules/2.png new file mode 100644 index 000000000..6bd27b8b5 Binary files /dev/null and b/employee_check_list/static/description/assets/modules/2.png differ diff --git a/employee_check_list/static/description/assets/modules/3.png b/employee_check_list/static/description/assets/modules/3.png new file mode 100644 index 000000000..4e4ea0e51 Binary files /dev/null and b/employee_check_list/static/description/assets/modules/3.png differ diff --git a/employee_check_list/static/description/assets/modules/4.png b/employee_check_list/static/description/assets/modules/4.png new file mode 100644 index 000000000..164c1e5cd Binary files /dev/null and b/employee_check_list/static/description/assets/modules/4.png differ diff --git a/employee_check_list/static/description/assets/modules/5.png b/employee_check_list/static/description/assets/modules/5.png new file mode 100644 index 000000000..7d02e0662 Binary files /dev/null and b/employee_check_list/static/description/assets/modules/5.png differ diff --git a/employee_check_list/static/description/assets/modules/6.png b/employee_check_list/static/description/assets/modules/6.png new file mode 100644 index 000000000..0c9bb377e Binary files /dev/null and b/employee_check_list/static/description/assets/modules/6.png differ diff --git a/employee_check_list/static/description/assets/screenshots/1checklist.png b/employee_check_list/static/description/assets/screenshots/1checklist.png new file mode 100644 index 000000000..4c348ceb7 Binary files /dev/null and b/employee_check_list/static/description/assets/screenshots/1checklist.png differ diff --git a/employee_check_list/static/description/assets/screenshots/2checklist.png b/employee_check_list/static/description/assets/screenshots/2checklist.png new file mode 100644 index 000000000..b8b5697c6 Binary files /dev/null and b/employee_check_list/static/description/assets/screenshots/2checklist.png differ diff --git a/employee_check_list/static/description/assets/screenshots/3checklist.png b/employee_check_list/static/description/assets/screenshots/3checklist.png new file mode 100644 index 000000000..6822e6722 Binary files /dev/null and b/employee_check_list/static/description/assets/screenshots/3checklist.png differ diff --git a/employee_check_list/static/description/assets/screenshots/4checklist.png b/employee_check_list/static/description/assets/screenshots/4checklist.png new file mode 100644 index 000000000..2d48a97e9 Binary files /dev/null and b/employee_check_list/static/description/assets/screenshots/4checklist.png differ diff --git a/employee_check_list/static/description/assets/screenshots/5checklist.png b/employee_check_list/static/description/assets/screenshots/5checklist.png new file mode 100644 index 000000000..357d36443 Binary files /dev/null and b/employee_check_list/static/description/assets/screenshots/5checklist.png differ diff --git a/employee_check_list/static/description/assets/screenshots/6checklist.png b/employee_check_list/static/description/assets/screenshots/6checklist.png new file mode 100644 index 000000000..e2cf50138 Binary files /dev/null and b/employee_check_list/static/description/assets/screenshots/6checklist.png differ diff --git a/employee_check_list/static/description/assets/screenshots/hero.png b/employee_check_list/static/description/assets/screenshots/hero.png new file mode 100644 index 000000000..6a108e76f Binary files /dev/null and b/employee_check_list/static/description/assets/screenshots/hero.png differ diff --git a/employee_check_list/static/description/banner.png b/employee_check_list/static/description/banner.png new file mode 100644 index 000000000..0bad2f051 Binary files /dev/null and b/employee_check_list/static/description/banner.png differ diff --git a/employee_check_list/static/description/icon.png b/employee_check_list/static/description/icon.png new file mode 100644 index 000000000..ec2d79f87 Binary files /dev/null and b/employee_check_list/static/description/icon.png differ diff --git a/employee_check_list/static/description/index.html b/employee_check_list/static/description/index.html new file mode 100644 index 000000000..c6e230130 --- /dev/null +++ b/employee_check_list/static/description/index.html @@ -0,0 +1,646 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ Employee Exit/Entry Checklist

+

+ Manages Employees Entry & Exit Process +

+ +
+
+ + + + +
+
+

+ Overview +

+
+ +
+

+ A well functioning human resource department will lay down a number procedure and process before an + employee during joining/resigning time. It may be submission/Return of a certificate or attending a + conference etc. A person has to undergo all these checklist items before being admitted/resigned. + The module simplifies the process by providing you a checklist to mark the proceedings. It will also + display the PercentPie of the checklist items completed. +

+ +
+
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ + Managing entry/exit process.

+ +
+
+ +
+
+ +
+
+

+ + Automatic process on document attachments.

+ +
+
+ +
+
+ +
+
+

+ + Option to enable Gauge widget for employee Kanban.

+ +
+
+ +
+
+ +
+
+

+ + Entry/Exit Percentpie in employee form view.

+ +
+
+ +
+
+ +
+
+

+ + Entry Progressbar in employee tree view.

+ +
+
+ +
+ +
+
+

+ Screenshots +

+
+ +
+

+ Entry/Exit Checklist

+

+ Screenshots of the entry and exit checklists is shown below. +

+ + + +
+ +
+

+ Employee From View With PercentPie

+

+ Entry and exit progrss are shown in the employee form view with PercentPie +

+ +
+ +
+

+ Employee Tree View With Progressbar

+

+ Extra column added in employee tree view with progressbar. +

+ +
+ +
+

+ Employee Kanban View with Gauge

+

+ Kanban view now has a gauge to show the progress of each employee. +

+ +
+ +
+

+ Configuration

+

+ Configuration view is shown below. +

+ +
+ +
+ + +
+
+

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/employee_check_list/views/checklist_view.xml b/employee_check_list/views/checklist_view.xml new file mode 100644 index 000000000..2ec59d0da --- /dev/null +++ b/employee_check_list/views/checklist_view.xml @@ -0,0 +1,36 @@ + + + + + Entry Checklist + ir.actions.act_window + employee.checklist + tree,form + [('document_type', '=', 'entry')] + {"default_document_type":'entry'} + +

+ Click to create a New Entry Checklist +

+
+
+ + + Exit Checklist + ir.actions.act_window + employee.checklist + tree,form + [('document_type', '=', 'exit')] + {"default_document_type":'exit'} + +

+ Click to create a New Exit Checklist +

+
+
+ + + +
\ No newline at end of file diff --git a/employee_check_list/views/employee_form_inherit_view.xml b/employee_check_list/views/employee_form_inherit_view.xml new file mode 100644 index 000000000..dd0557334 --- /dev/null +++ b/employee_check_list/views/employee_form_inherit_view.xml @@ -0,0 +1,66 @@ + + + + + hr.employee.form.view + hr.employee + + + +
+ + +
+
+ + + + + + + + + + + + + +
+
+ + + hr.employee.tree.view + hr.employee + + + + + + + + + + + hr.employee.kanban.view + hr.employee + + + + + + + + + +
  • + Entry Progress + + +
  • +
    +
    +
    + +
    \ No newline at end of file diff --git a/employee_check_list/views/settings_view.xml b/employee_check_list/views/settings_view.xml new file mode 100644 index 000000000..c8c71460c --- /dev/null +++ b/employee_check_list/views/settings_view.xml @@ -0,0 +1,30 @@ + + + + + + HR Settings + res.config.settings + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    \ No newline at end of file diff --git a/product_return_pos/README.md b/product_return_pos/README.md new file mode 100644 index 000000000..64b0b4513 --- /dev/null +++ b/product_return_pos/README.md @@ -0,0 +1,50 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--1-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Product Return In POS +===================== +POS Order Return. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: Anusha P P@cybrosys + Version 13: Nimisha Murali@cybrosys + Version 14: Jibin James@cybrosys + Version 15: Aiswarya J P@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/product_return_pos/__init__.py b/product_return_pos/__init__.py new file mode 100644 index 000000000..afe5fa815 --- /dev/null +++ b/product_return_pos/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Anusha P P (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/product_return_pos/__manifest__.py b/product_return_pos/__manifest__.py new file mode 100644 index 000000000..fc8b34d67 --- /dev/null +++ b/product_return_pos/__manifest__.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies(). +# Author: Anusha P P (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': 'Product Return In POS', + 'version': '15.0.1.0.0', + 'category': 'Point of Sale', + 'summary': 'POS Order Return', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'images': ['static/description/banner.png'], + 'website': 'https://www.cybrosys.com', + 'depends': ['point_of_sale'], + 'data': [ + 'views/return.xml', + ], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, + 'assets': { + 'point_of_sale.assets': [ + 'product_return_pos/static/src/css/pos_return.css', + 'product_return_pos/static/src/js/pos_return.js', + 'product_return_pos/static/src/js/return.js', + 'product_return_pos/static/src/js/models.js', + 'product_return_pos/static/src/js/order_list_screen.js' + ], + 'web.assets_qweb': [ + 'product_return_pos/static/src/xml/pos_return.xml', + ], + }, +} + + diff --git a/product_return_pos/doc/RELEASE_NOTES.md b/product_return_pos/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..c3ee07c1e --- /dev/null +++ b/product_return_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,8 @@ +## Module + +#### 08.11.2021 +#### Version 15.0.1.0.0 +##### ADD +- Initial Commit. + + diff --git a/product_return_pos/models/__init__.py b/product_return_pos/models/__init__.py new file mode 100644 index 000000000..7b5f6316d --- /dev/null +++ b/product_return_pos/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Anusha P P (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 pos_return diff --git a/product_return_pos/models/pos_return.py b/product_return_pos/models/pos_return.py new file mode 100644 index 000000000..8b9104008 --- /dev/null +++ b/product_return_pos/models/pos_return.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Anusha P P (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, api, fields + + +class PosOrderReturn(models.Model): + _inherit = 'pos.order' + + return_ref = fields.Char(string='Return Ref', readonly=True, copy=False) + return_status = fields.Selection([ + ('nothing_return', 'Nothing Returned'), + ('partialy_return', 'Partialy Returned'), + ('fully_return', 'Fully Returned') + ], string="Return Status", default='nothing_return', + readonly=True, copy=False, help="Return status of Order") + + @api.model + def get_lines(self, ref): + result = [] + order_id = self.search([('pos_reference', '=', ref)], limit=1) + if order_id: + lines = self.env['pos.order.line'].search([('order_id', '=', order_id.id)]) + for line in lines: + if line.qty - line.returned_qty > 0: + new_vals = { + 'product_id': line.product_id.id, + 'product': line.product_id.name, + 'qty': line.qty - line.returned_qty, + 'price_unit': line.price_unit, + 'discount': line.discount, + 'line_id': line.id, + } + result.append(new_vals) + + return [result] + + def _order_fields(self, ui_order): + order = super(PosOrderReturn, self)._order_fields(ui_order) + if 'return_ref' in ui_order.keys() and ui_order['return_ref']: + order['return_ref'] = ui_order['return_ref'] + parent_order = self.search([('pos_reference', '=', ui_order['return_ref'])], limit=1) + + updated_lines = ui_order['lines'] + ret = 0 + qty = 0 + for uptd in updated_lines: + line = self.env['pos.order.line'].search([('order_id', '=', parent_order.id), + ('id', '=', uptd[2]['line_id'])], limit=1) + if line: + line.returned_qty += -(uptd[2]['qty']) + for line in parent_order.lines: + qty += line.qty + ret += line.returned_qty + if qty-ret == 0: + if parent_order: + parent_order.return_status = 'fully_return' + print(parent_order.return_status) + elif ret: + if qty > ret: + if parent_order: + parent_order.return_status = 'partialy_return' + + return order + + +class PosOrderLineReturn(models.Model): + _inherit = 'pos.order.line' + + returned_qty = fields.Integer(string='Returned Qty', digits=0, readonly=True) diff --git a/product_return_pos/static/description/assets/icons/check.png b/product_return_pos/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/product_return_pos/static/description/assets/icons/check.png differ diff --git a/product_return_pos/static/description/assets/icons/chevron.png b/product_return_pos/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/product_return_pos/static/description/assets/icons/chevron.png differ diff --git a/product_return_pos/static/description/assets/icons/cogs.png b/product_return_pos/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/product_return_pos/static/description/assets/icons/cogs.png differ diff --git a/product_return_pos/static/description/assets/icons/consultation.png b/product_return_pos/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/product_return_pos/static/description/assets/icons/consultation.png differ diff --git a/product_return_pos/static/description/assets/icons/ecom-black.png b/product_return_pos/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/product_return_pos/static/description/assets/icons/ecom-black.png differ diff --git a/product_return_pos/static/description/assets/icons/education-black.png b/product_return_pos/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/product_return_pos/static/description/assets/icons/education-black.png differ diff --git a/product_return_pos/static/description/assets/icons/hotel-black.png b/product_return_pos/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/product_return_pos/static/description/assets/icons/hotel-black.png differ diff --git a/product_return_pos/static/description/assets/icons/license.png b/product_return_pos/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/product_return_pos/static/description/assets/icons/license.png differ diff --git a/product_return_pos/static/description/assets/icons/lifebuoy.png b/product_return_pos/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/product_return_pos/static/description/assets/icons/lifebuoy.png differ diff --git a/product_return_pos/static/description/assets/icons/manufacturing-black.png b/product_return_pos/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/product_return_pos/static/description/assets/icons/manufacturing-black.png differ diff --git a/product_return_pos/static/description/assets/icons/pos-black.png b/product_return_pos/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/product_return_pos/static/description/assets/icons/pos-black.png differ diff --git a/product_return_pos/static/description/assets/icons/puzzle.png b/product_return_pos/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/product_return_pos/static/description/assets/icons/puzzle.png differ diff --git a/product_return_pos/static/description/assets/icons/restaurant-black.png b/product_return_pos/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/product_return_pos/static/description/assets/icons/restaurant-black.png differ diff --git a/product_return_pos/static/description/assets/icons/service-black.png b/product_return_pos/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/product_return_pos/static/description/assets/icons/service-black.png differ diff --git a/product_return_pos/static/description/assets/icons/trading-black.png b/product_return_pos/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/product_return_pos/static/description/assets/icons/trading-black.png differ diff --git a/product_return_pos/static/description/assets/icons/training.png b/product_return_pos/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/product_return_pos/static/description/assets/icons/training.png differ diff --git a/product_return_pos/static/description/assets/icons/update.png b/product_return_pos/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/product_return_pos/static/description/assets/icons/update.png differ diff --git a/product_return_pos/static/description/assets/icons/user.png b/product_return_pos/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/product_return_pos/static/description/assets/icons/user.png differ diff --git a/product_return_pos/static/description/assets/icons/wrench.png b/product_return_pos/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/product_return_pos/static/description/assets/icons/wrench.png differ diff --git a/product_return_pos/static/description/assets/modules/custom_fields_image.png b/product_return_pos/static/description/assets/modules/custom_fields_image.png new file mode 100644 index 000000000..8189b153b Binary files /dev/null and b/product_return_pos/static/description/assets/modules/custom_fields_image.png differ diff --git a/product_return_pos/static/description/assets/modules/dynamic_image.png b/product_return_pos/static/description/assets/modules/dynamic_image.png new file mode 100644 index 000000000..f55c47e0f Binary files /dev/null and b/product_return_pos/static/description/assets/modules/dynamic_image.png differ diff --git a/product_return_pos/static/description/assets/modules/export_image.png b/product_return_pos/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..9aeec92c9 Binary files /dev/null and b/product_return_pos/static/description/assets/modules/export_image.png differ diff --git a/product_return_pos/static/description/assets/modules/global_image.png b/product_return_pos/static/description/assets/modules/global_image.png new file mode 100644 index 000000000..67c50267b Binary files /dev/null and b/product_return_pos/static/description/assets/modules/global_image.png differ diff --git a/product_return_pos/static/description/assets/modules/list_view_image.png b/product_return_pos/static/description/assets/modules/list_view_image.png new file mode 100644 index 000000000..510d36ae9 Binary files /dev/null and b/product_return_pos/static/description/assets/modules/list_view_image.png differ diff --git a/product_return_pos/static/description/assets/modules/product_return_image.png b/product_return_pos/static/description/assets/modules/product_return_image.png new file mode 100644 index 000000000..3afc14722 Binary files /dev/null and b/product_return_pos/static/description/assets/modules/product_return_image.png differ diff --git a/product_return_pos/static/description/assets/screenshots/hero.png b/product_return_pos/static/description/assets/screenshots/hero.png new file mode 100644 index 000000000..16b1be7d1 Binary files /dev/null and b/product_return_pos/static/description/assets/screenshots/hero.png differ diff --git a/product_return_pos/static/description/assets/screenshots/screenshot1.png b/product_return_pos/static/description/assets/screenshots/screenshot1.png new file mode 100644 index 000000000..1a192a9c5 Binary files /dev/null and b/product_return_pos/static/description/assets/screenshots/screenshot1.png differ diff --git a/product_return_pos/static/description/assets/screenshots/screenshot2.png b/product_return_pos/static/description/assets/screenshots/screenshot2.png new file mode 100644 index 000000000..14f21785f Binary files /dev/null and b/product_return_pos/static/description/assets/screenshots/screenshot2.png differ diff --git a/product_return_pos/static/description/assets/screenshots/screenshot3.png b/product_return_pos/static/description/assets/screenshots/screenshot3.png new file mode 100644 index 000000000..bfc179e2e Binary files /dev/null and b/product_return_pos/static/description/assets/screenshots/screenshot3.png differ diff --git a/product_return_pos/static/description/assets/screenshots/screenshot4.png b/product_return_pos/static/description/assets/screenshots/screenshot4.png new file mode 100644 index 000000000..28a2dede1 Binary files /dev/null and b/product_return_pos/static/description/assets/screenshots/screenshot4.png differ diff --git a/product_return_pos/static/description/assets/screenshots/screenshot5.png b/product_return_pos/static/description/assets/screenshots/screenshot5.png new file mode 100644 index 000000000..56e9b695b Binary files /dev/null and b/product_return_pos/static/description/assets/screenshots/screenshot5.png differ diff --git a/product_return_pos/static/description/banner.png b/product_return_pos/static/description/banner.png new file mode 100644 index 000000000..be8dd200b Binary files /dev/null and b/product_return_pos/static/description/banner.png differ diff --git a/product_return_pos/static/description/icon.png b/product_return_pos/static/description/icon.png new file mode 100644 index 000000000..4f4849ae4 Binary files /dev/null and b/product_return_pos/static/description/icon.png differ diff --git a/product_return_pos/static/description/index.html b/product_return_pos/static/description/index.html new file mode 100644 index 000000000..44fb02439 --- /dev/null +++ b/product_return_pos/static/description/index.html @@ -0,0 +1,569 @@ +
    +
    +
    +

    + Product Return In POS

    +

    + Manages Product Return From POS Frontend +

    + +
    +
    + + + + +
    +
    +

    + Overview +

    +
    + +
    +

    + This app will help you to return the products from the POS user interface.

    + +
    +
    + +
    +
    +

    + Features +

    +
    + +
    +
    + +
    +
    +

    + Manage Returns from POS Interface

    +

    + Manage Product Return through POS interface.

    +
    +
    + +
    +
    + +
    +
    +

    + Track Return Reference and Status.

    +

    + Possible to track return reference and status.

    +
    +
    +
    + +
    +
    +

    + Screenshots +

    +
    + +
    +

    + Create a normal order

    + + +
    + +
    +

    + Click on Return button In order to return products

    + + + +
    + + +
    +

    + Select the order and click on Return

    + +
    + + +
    +

    + Return some of the products

    + +
    + +
    +

    + We get the return reference and status of the return from backend also

    + +
    + +
    + + +
    +
    +

    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?

    +
    +
    +
    + + +
    + +
    + + +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    +
    +
    + + +
    \ No newline at end of file diff --git a/product_return_pos/static/src/css/pos_return.css b/product_return_pos/static/src/css/pos_return.css new file mode 100644 index 000000000..01ffa4168 --- /dev/null +++ b/product_return_pos/static/src/css/pos_return.css @@ -0,0 +1,56 @@ +.ticket-screen .return-button { + color: #f0f0f0; + display: inline-block; + box-sizing: border-box; + -moz-box-sizing: border-box; + /* height: 20px; */ + padding: 4px 8px; + margin: 3px; + margin-bottom: 0px; + margin-right: 2px; + padding-top: 0px; + background: #8b8b8b; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + vertical-align: top; + line-height: 20px; + text-align: center; + box-shadow: 0px -5px 10px -6px rgb(82,82,82) inset; + cursor: pointer; + min-width: 45px; +} +.ticket-screen .order-list tr.highlight{ + transition: all 150ms linear; + background: rgb(110,200,155) !important; + color: white; +} +.ticket-screen .order-list td tr.lowlight{ + transition: all 150ms linear; + background: rgb(216, 238, 227); +} +.ticket-screen .order-list tr.lowlight:nth-child(even){ + transition: all 150ms linear; + background: rgb(227, 246, 237); +} + +.return-screen .searchbox{ + right: auto; + margin-left: 50px; + margin-top:8px; + left: 25%; +} +.ticket-screen .refreshbutton{ + right: 10px; + margin-right: 5px; + margin-top:8px; + left: auto; +} +.reprint_order_screen .searchbox input{ + width: 120px; +} + +.ticket-screen .order-list{ + font-size: 15px; + width: 100%; + line-height: 40px; +} \ No newline at end of file diff --git a/product_return_pos/static/src/js/models.js b/product_return_pos/static/src/js/models.js new file mode 100644 index 000000000..9609b4ade --- /dev/null +++ b/product_return_pos/static/src/js/models.js @@ -0,0 +1,162 @@ +odoo.define('product_return_pos.models',function(require) { + "use strict"; + +var models = require('point_of_sale.models'); +var gui = require('point_of_sale.Gui'); +var core = require('web.core'); +var QWeb = core.qweb; +var rpc = require('web.rpc'); +var _t = require('web.core')._t; +var session = require('web.session'); + +models.load_models({ + model: 'pos.order', + fields: ['name', 'partner_id','date_order','amount_total', 'amount_tax', + 'pos_reference','lines','state','session_id','company_id','return_ref','return_status'], + loaded: function(self, orders){ + + self.orders = orders; + } + }, + { + model: 'pos.order.line', + fields: ['product_id','qty','price_unit','price_subtotal_incl','order_id','discount','returned_qty'], + loaded: function(self,order_lines){ + + self.order_line = []; + for (var i = 0; i < order_lines.length; i++) { + self.order_line[i] = order_lines[i]; + } + } +}); + +var _super_orderline = models.Orderline; +models.Orderline = models.Orderline.extend({ + + set_line_id: function(line_id){ + this.line_id = line_id; + }, + export_as_JSON: function(){ + var json = _super_orderline.prototype.export_as_JSON.apply(this,arguments); + json.line_id = this.line_id; + return json; + }, + init_from_JSON: function(json){ + _super_orderline.prototype.init_from_JSON.apply(this,arguments); + this.line_id = json.line_id; + }, +}); + +var _super = models.Order; +models.Order = models.Order.extend({ + + add_product: function (product, options) { + + + var order = this.pos.get_order(); + _super.prototype.add_product.call(this, product, options); + if (options !== undefined) { + if (options.extras !== undefined) { + for (var prop in options.extras) { + if (prop === 'return_ref') { + this.return_ref = options.extras['return_ref'] + this.trigger('change', this); + } + if (prop === 'label') { + order.selected_orderline.set_line_id(options.extras['label']); + } + + } + + } + + } + + }, + + export_as_JSON: function(){ + var json = _super.prototype.export_as_JSON.apply(this,arguments); + json.return_ref = this.return_ref; + return json; + }, + init_from_JSON: function(json){ + _super.prototype.init_from_JSON.apply(this,arguments); + this.return_ref = json.return_ref; + } + +}); + +models.PosModel.extend({ + _save_to_server: function (orders, options) { + if (!orders || !orders.length) { + var result = $.Deferred(); + result.resolve([]); + return result; + } + var fields = _.find(this.models,function(model){ return model.model === 'pos.order'; }).fields; + options = options || {}; + + var self = this; + var timeout = typeof options.timeout === 'number' ? options.timeout : 7500 * orders.length; + + // Keep the order ids that are about to be sent to the + // backend. In between create_from_ui and the success callback + // new orders may have been added to it. + var order_ids_to_sync = _.pluck(orders, 'id'); + + // we try to send the order. shadow prevents a spinner if it takes too long. (unless we are sending an invoice, + // then we want to notify the user that we are waiting on something ) + var args = [_.map(orders, function (order) { + order.to_invoice = options.to_invoice || false; + return order; + })]; + return rpc.query({ + model: 'pos.order', + method: 'create_from_ui', + args: args, + kwargs: {context: session.user_context}, + }, { + timeout: timeout, + shadow: !options.to_invoice + }) + .then(function (server_ids) { + _.each(order_ids_to_sync, function (order_id) { + self.db.remove_order(order_id); + }); + self.set('failed',false); + if (server_ids.length != 0){ + for (var item in server_ids){ + rpc.query({ + model: 'pos.order', + method: 'search_read', + args: [[['id', '=', server_ids[item]]], fields], + limit: 1, + }) + .then(function (order){ + self.orders.unshift(order[0]); + }); + } + } + self.load_server_data(); + return server_ids; + }).catch(function (type, error){ + if(error.code === 200 ){ // Business Logic Error, not a connection problem + //if warning do not need to display traceback!! + if (error.data.exception_type == 'warning') { + delete error.data.debug; + } + + // Hide error if already shown before ... + if ((!self.get('failed') || options.show_error) && !options.to_invoice) { + this.showpopup('error-traceback',{ + 'title': error.data.message, + 'body': error.data.debug + }); + } + self.set('failed',error); + } + console.error('Failed to send orders:', orders); + }); + }, +}); +}); \ No newline at end of file diff --git a/product_return_pos/static/src/js/order_list_screen.js b/product_return_pos/static/src/js/order_list_screen.js new file mode 100644 index 000000000..d258d462b --- /dev/null +++ b/product_return_pos/static/src/js/order_list_screen.js @@ -0,0 +1,196 @@ +odoo.define('product_return_pos.order_list_screen',function(require) { + "use strict"; + +var models = require('point_of_sale.models'); +var gui = require('point_of_sale.Gui'); +var core = require('web.core'); +var QWeb = core.qweb; +var rpc = require('web.rpc'); +var _t = require('web.core')._t; +var session = require('web.session'); + const ControlButtonsMixin = require('point_of_sale.ControlButtonsMixin'); + const NumberBuffer = require('point_of_sale.NumberBuffer'); + const { onChangeOrder, useBarcodeReader } = require('point_of_sale.custom_hooks'); + const { useState , useRef} = owl.hooks; + const PosComponent = require('point_of_sale.PosComponent'); + const Registries = require('point_of_sale.Registries'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const { useListener } = require('web.custom_hooks'); + const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); + const IndependentToOrderScreen = require('point_of_sale.IndependentToOrderScreen'); + const { posbus } = require('point_of_sale.utils'); + const { Gui } = require('point_of_sale.Gui'); + + + class OrderListScreenWidget extends IndependentToOrderScreen { + constructor() { + super(...arguments); + useListener('filter-selected', this._onFilterSelected); + useListener('search', this._onSearch); + this.searchDetails = {}; + this.filter = null; + this._initializeSearchFieldConstants(); + } + + mounted() { + var self = this; + this.render(); + var orders = this.env.pos.orders; + var search_timeout = null; + } + back() { + this.close(); + } + reload(){ + window.location.reload(); + } + + return_click(order){ + this.return_order(order); + } + get ordersList() { + const filterCheck = (order) => { + return true; + }; + const { fieldName, searchTerm } = this.searchDetails; + const searchField = this._searchFields[fieldName]; + const searchCheck = (order) => { + if (!searchField) return true; + const repr = searchField.repr(order); + if (repr === null) return true; + if (!searchTerm) return true; + return repr && repr.toString().toLowerCase().includes(searchTerm.toLowerCase()); + }; + const predicate = (order) => { + return filterCheck(order) && searchCheck(order); + }; + + return this.orderList.filter(predicate); + } + _onFilterSelected(event) { + this.filter = event.detail.filter; + this.render(); + } + get orderList() { + return this.env.pos.orders; + } + get _searchFields() { + const fields = { + + RECEIPT_NUMBER: { + repr: (order) => order.name, + displayName: this.env._t('Receipt Number'), + modelField: 'pos_reference', + }, + + DATE: { + repr: (order) => order.date_order, + displayName: this.env._t('Date'), + modelField: 'date_order', + }, + CUSTOMER: { + repr: (order) => order.partner_id[1], + displayName: this.env._t('Customer'), + modelField: 'partner_id.display_name', + }, + RETURN_REF: { + repr: (order) => order.return_ref, + displayName: this.env._t('Return Ref'), + modelField: 'return_ref', + }, + + }; + return fields; + } + _onSearch(event) { + const searchDetails = event.detail; + Object.assign(this.searchDetails, searchDetails); + this.render(); + } + get searchBarConfig() { + return { + searchFields: new Map( + Object.entries(this._searchFields).map(([key, val]) => [key, val.displayName]) + ), + filter: { show: true, options: this.filterOptions }, + defaultSearchDetails: this.searchDetails, + }; + } + get filterOptions() { + const orderStates = this._getOrderStates(); + return orderStates; + } + _getOrderStates() { + const states = new Map(); + states.set('All Orders', { + text: this.env._t('All Orders'), + }); + return states; + } + getStatus(order) { + const screen = order.get_screen_data(); + return this._getOrderStates().get(this.__screenToStatusMap[screen.name]).text; + + } + get _screenToStatusMap() { + return { + ProductScreen: 'Ongoing', + PaymentScreen: 'Payment', + ReceiptScreen: 'Receipt', + }; + } + + _initializeSearchFieldConstants() { + this.constants = {}; + Object.assign(this.constants, { + searchFieldNames: Object.keys(this._searchFields), + screenToStatusMap: this._screenToStatusMap, + }); + } + + render_list(orders){ + var contents = this.el.querySelector('.order-list-contents'); + contents.innerHTML = ""; + for(var i = 0, len = Math.min(orders.length,1000); i < len; i++){ + var order = orders[i]; + var orderline_html = this.env.qweb.render('OrderLine',{widget: this, order:order}); + var orderline = document.createElement('tbody'); + orderline.innerHTML = orderline_html; + orderline = orderline.childNodes[1]; + contents.appendChild(orderline); + } + } + + return_order(order_id){ + var self = this; + var client = '' + if (order_id.partner_id){ + client = order_id.partner_id[0]; + } + if (order_id && order_id.return_status ==='fully_return'){ + Gui.showPopup('ErrorPopup',{ + 'title': "ERROR", + 'body': "This is a fully returned order",}); + } + else if (order_id && order_id.return_ref) { + + Gui.showPopup('ErrorPopup',{ + 'title': "ERROR", + 'body': "This is a returned order",}); + } + else{ + Gui.showPopup('ReturnWidget',{ref: order_id.pos_reference,client:client}); + + } + + } + + + } + OrderListScreenWidget.template = 'OrderListScreenWidget'; + + Registries.Component.add(OrderListScreenWidget); + + return OrderListScreenWidget; + +}); \ No newline at end of file diff --git a/product_return_pos/static/src/js/pos_return.js b/product_return_pos/static/src/js/pos_return.js new file mode 100644 index 000000000..b02d30732 --- /dev/null +++ b/product_return_pos/static/src/js/pos_return.js @@ -0,0 +1,147 @@ +odoo.define('product_return_pos.pos_return',function(require) { + "use strict"; + +var models = require('point_of_sale.models'); +var gui = require('point_of_sale.Gui'); +var core = require('web.core'); +var QWeb = core.qweb; +var rpc = require('web.rpc'); +var _t = require('web.core')._t; +var session = require('web.session'); + const ControlButtonsMixin = require('point_of_sale.ControlButtonsMixin'); + const NumberBuffer = require('point_of_sale.NumberBuffer'); + const { onChangeOrder, useBarcodeReader } = require('point_of_sale.custom_hooks'); + const { useState, useRef ,useSubEnv} = owl.hooks; + const PosComponent = require('point_of_sale.PosComponent'); + const Registries = require('point_of_sale.Registries'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const { useListener } = require('web.custom_hooks'); + const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); + + + + class ReturnWidget extends AbstractAwaitablePopup { + constructor() { + super(...arguments); + this.state = useState({ inputValue: this.props.startingValue }); + this.inputRef = useRef('input'); + useSubEnv({ attribute_components: [] }); + + } + mounted() { + this.render_list() + } + + render_list(){ + $("#table-body").empty(); + var lines = []; + var pos_reference = this.props.ref + rpc.query({ + model: 'pos.order', + method: 'get_lines', + args: [pos_reference], + }).then(function (result) { + lines = result[0]; + for(var j=0;j < lines.length; j++){ + var product_line = lines[j]; + var rows = ""; + var id = product_line.product_id + var price_unit = product_line.price_unit; + var name =product_line.product; + var qty = product_line.qty; + var line_id = product_line.line_id; + var discount = product_line.discount; + rows += "" + id + "" + price_unit +" " + name + "" + qty + "" + discount + "" + line_id + ""; + $(rows).appendTo("#list tbody"); + var rows = document.getElementById('list').rows; + for (var row = 0; row < rows.length; row++) { + var cols = rows[row].cells; + cols[0].style.display = 'none'; + cols[1].style.display = 'none'; + cols[5].style.display = 'none'; + + } + + } + var table = document.getElementById('list'); + var tr = table.getElementsByTagName("tr"); + for (var i = 1; i < tr.length; i++) { + var td = document.createElement('td'); + var input = document.createElement('input'); + input.setAttribute("type", "text"); + input.setAttribute("value", 0); + input.setAttribute("id", "text"+i); + td.appendChild(input); + tr[i].appendChild(td); + + } + }).catch(function () { + alert("NO DATA") + }); + } + click_confirm() { + var self = this; + var myTable = document.getElementById('list').tBodies[0]; + var count = 0; + var c = 1; + + for (r=0, n = myTable.rows.length; r < n; r++) { + var row = myTable.rows[r] + var return_qty = document.getElementById("text"+c).value + if (row.cells[3].innerHTML < return_qty){ + count +=1 + } + c = c+1 + } + if (count > 0){ + alert('Please check the Returned Quantity,it is higher than purchased') + } + else{ + c = 1; + // OrderSuper.prototype.set_client.call(this, this.client); + for (var r=0, n = myTable.rows.length; r < n; r++) { + row = myTable.rows[r] + return_qty = document.getElementById("text"+c).value; + var product = this.env.pos.db.get_product_by_id(row.cells[0].innerHTML); + if (!product) { + return; + } + + if (return_qty > 0){ + this.env.pos.get_order().add_product(product, { + price: row.cells[1].innerHTML, + quantity: -(return_qty), + discount:row.cells[4].innerHTML, + merge: false, + extras: {return_ref: this.props.ref, + label:row.cells[5].innerHTML}, + }); + + } + c = c+1 + + } + + if (this.props.client){ + this.env.pos.get_order().set_client(this.env.pos.db.get_partner_by_id(this.props.client)); + } + + } + this.trigger('close-popup'); + this.showScreen('ProductScreen') + + } + + } + ReturnWidget.template = 'ReturnWidget'; + ReturnWidget.defaultProps = { + confirmText: 'Return', + cancelText: 'Cancel', + title: 'Confirm ?', + body: '', + }; + + Registries.Component.add(ReturnWidget); + + return ReturnWidget; +}); \ No newline at end of file diff --git a/product_return_pos/static/src/js/return.js b/product_return_pos/static/src/js/return.js new file mode 100644 index 000000000..610c95c8e --- /dev/null +++ b/product_return_pos/static/src/js/return.js @@ -0,0 +1,43 @@ +odoo.define('product_return_pos.return',function(require) { + "use strict"; + + +var models = require('point_of_sale.models'); +var gui = require('point_of_sale.Gui'); +var core = require('web.core'); +var QWeb = core.qweb; +var rpc = require('web.rpc'); +var _t = require('web.core')._t; +var session = require('web.session'); + const NumberBuffer = require('point_of_sale.NumberBuffer'); + const { onChangeOrder, useBarcodeReader } = require('point_of_sale.custom_hooks'); + const PosComponent = require('point_of_sale.PosComponent'); + const Registries = require('point_of_sale.Registries'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const { useListener } = require('web.custom_hooks'); + const { useState, useRef } = owl.hooks; + const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); + + + class ReturnButton extends PosComponent { + constructor() { + super(...arguments); + useListener('click', this.button_click); + } + button_click() { + var orders = this.env.pos.orders; + this.showScreen('OrderListScreenWidget',{orders:orders}); + } + } + ReturnButton.template = 'ReturnButton'; + ProductScreen.addControlButton({ + component: ReturnButton, + condition: function () { + return true; + }, + position: ['before', 'SetPricelistButton'], + }); + + Registries.Component.add(ReturnButton); + return ReturnButton; + }); \ No newline at end of file diff --git a/product_return_pos/static/src/xml/pos_return.xml b/product_return_pos/static/src/xml/pos_return.xml new file mode 100644 index 000000000..db2ef6651 --- /dev/null +++ b/product_return_pos/static/src/xml/pos_return.xml @@ -0,0 +1,107 @@ + + + + +
    + + Return +
    +
    + + +
    + + + + + + + + Return + +
    +
    + + +
    +
    +
    + + + Cancel + + + + + + + Refresh + + +
    +
    +
    +
    Date
    +
    Receipt Number
    +
    Customer
    +
    Return Ref
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + + + + + +
    +
    +
    +
    +
    +
    +
    + + + + +
    \ No newline at end of file diff --git a/product_return_pos/views/return.xml b/product_return_pos/views/return.xml new file mode 100644 index 000000000..623f5124e --- /dev/null +++ b/product_return_pos/views/return.xml @@ -0,0 +1,31 @@ + + + + + pos.order.form.extend + pos.order + + + + + + + + + + + + + + pos.order.tree.extend + pos.order + + + + + + + + + + \ No newline at end of file