diff --git a/salesperson_pos_order_line/README.rst b/salesperson_pos_order_line/README.rst new file mode 100644 index 000000000..2bb565c1f --- /dev/null +++ b/salesperson_pos_order_line/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https ://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Salesperson on POS Order Line +======================================= +This module is used to set salespersons on pos order line + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer : (V15) Mruthul Raj, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if +your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/salesperson_pos_order_line/__init__.py b/salesperson_pos_order_line/__init__.py new file mode 100644 index 000000000..f777a8395 --- /dev/null +++ b/salesperson_pos_order_line/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mruthul Raj (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/salesperson_pos_order_line/__manifest__.py b/salesperson_pos_order_line/__manifest__.py new file mode 100644 index 000000000..4e7bd3cf3 --- /dev/null +++ b/salesperson_pos_order_line/__manifest__.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mruthul Raj (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': 'Salesperson on POS Order Line', + 'version': '15.0.1.0.0', + 'category': 'Point of Sale', + 'summary': 'Set salespersons on POS order lines', + 'description': 'This module allows you to assign salespersons to order' + 'lines in the Point of Sale (POS)', + 'author': 'Cybrosys Techno solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'point_of_sale'], + 'data': [ + 'views/pos_order_views.xml', + ], + 'assets': { + 'point_of_sale.assets': [ + 'salesperson_pos_order_line/static/src/js/pos_orderline.js', + 'salesperson_pos_order_line/static/src/js/pos_screen.js', + 'salesperson_pos_order_line/static/src/js/pos_popup.js', + ], + 'web.assets_qweb': [ + 'salesperson_pos_order_line/static/src/xml/orderline_templates.xml', + 'salesperson_pos_order_line/static/src/xml/pos_popup_templates.xml', + 'salesperson_pos_order_line/static/src/xml/pos_screen_templates.xml', + 'salesperson_pos_order_line/static/src/xml/receipt_templates.xml', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/salesperson_pos_order_line/doc/RELEASE_NOTES.md b/salesperson_pos_order_line/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..5d5623936 --- /dev/null +++ b/salesperson_pos_order_line/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 16.08.2023 +#### Version 15.0.1.0.0 +#### ADD +- Initial commit for Salesperson on POS Order Line diff --git a/salesperson_pos_order_line/models/__init__.py b/salesperson_pos_order_line/models/__init__.py new file mode 100644 index 000000000..4ffb46c15 --- /dev/null +++ b/salesperson_pos_order_line/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mruthul Raj (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_order +from . import pos_session diff --git a/salesperson_pos_order_line/models/pos_order.py b/salesperson_pos_order_line/models/pos_order.py new file mode 100644 index 000000000..29e56a2a1 --- /dev/null +++ b/salesperson_pos_order_line/models/pos_order.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mruthul Raj (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import fields, models + + +class PosOrderLine(models.Model): + """ + This class inherits the pos.order.line model to add a custom field 'sales_persons'. + """ + _inherit = 'pos.order.line' + + sales_persons = fields.Char(string='Salesperson', + help="Name of the salesperson associated with this POS order line.") diff --git a/salesperson_pos_order_line/models/pos_session.py b/salesperson_pos_order_line/models/pos_session.py new file mode 100644 index 000000000..1cb073b6c --- /dev/null +++ b/salesperson_pos_order_line/models/pos_session.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mruthul Raj (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 + + +class PosSession(models.Model): + """ + This class inherits the pos.session model and adds custom functionality + related to POS UI models and res.users. + """ + + _inherit = 'pos.session' + + def _pos_ui_models_to_load(self): + """ + Returns a list of models to load for the POS UI with 'res.users' + added to the list. + """ + result = super()._pos_ui_models_to_load() + result.append('res.users') + return result + + def _loader_params_res_users(self): + """ + Returns a dictionary of loader parameters for the 'res.users' model. + """ + return { + 'search_params': { + 'fields': ['name'], + }, + } + + def _get_pos_ui_res_users(self, params): + """ + Returns a list of dictionaries containing the names of all users in the + 'res.users' model. + """ + return self.env['res.users'].search_read(**params['search_params']) diff --git a/salesperson_pos_order_line/static/description/assets/icons/cogs.png b/salesperson_pos_order_line/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/cogs.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/consultation.png b/salesperson_pos_order_line/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/consultation.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/ecom-black.png b/salesperson_pos_order_line/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/ecom-black.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/education-black.png b/salesperson_pos_order_line/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/education-black.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/hotel-black.png b/salesperson_pos_order_line/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/hotel-black.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/license.png b/salesperson_pos_order_line/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/license.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/lifebuoy.png b/salesperson_pos_order_line/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/lifebuoy.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/manufacturing-black.png b/salesperson_pos_order_line/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/manufacturing-black.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/pos-black.png b/salesperson_pos_order_line/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/pos-black.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/puzzle.png b/salesperson_pos_order_line/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/puzzle.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/restaurant-black.png b/salesperson_pos_order_line/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/restaurant-black.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/service-black.png b/salesperson_pos_order_line/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/service-black.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/trading-black.png b/salesperson_pos_order_line/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/trading-black.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/training.png b/salesperson_pos_order_line/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/training.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/update.png b/salesperson_pos_order_line/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/update.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/user.png b/salesperson_pos_order_line/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/user.png differ diff --git a/salesperson_pos_order_line/static/description/assets/icons/wrench.png b/salesperson_pos_order_line/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/icons/wrench.png differ diff --git a/salesperson_pos_order_line/static/description/assets/misc/categories.png b/salesperson_pos_order_line/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/misc/categories.png differ diff --git a/salesperson_pos_order_line/static/description/assets/misc/check-box.png b/salesperson_pos_order_line/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/misc/check-box.png differ diff --git a/salesperson_pos_order_line/static/description/assets/misc/compass.png b/salesperson_pos_order_line/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/misc/compass.png differ diff --git a/salesperson_pos_order_line/static/description/assets/misc/corporate.png b/salesperson_pos_order_line/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/misc/corporate.png differ diff --git a/salesperson_pos_order_line/static/description/assets/misc/customer-support.png b/salesperson_pos_order_line/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/misc/customer-support.png differ diff --git a/salesperson_pos_order_line/static/description/assets/misc/cybrosys-logo.png b/salesperson_pos_order_line/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/misc/cybrosys-logo.png differ diff --git a/salesperson_pos_order_line/static/description/assets/misc/features.png b/salesperson_pos_order_line/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/misc/features.png differ diff --git a/salesperson_pos_order_line/static/description/assets/misc/logo.png b/salesperson_pos_order_line/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/misc/logo.png differ diff --git a/salesperson_pos_order_line/static/description/assets/misc/pictures.png b/salesperson_pos_order_line/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/misc/pictures.png differ diff --git a/salesperson_pos_order_line/static/description/assets/misc/pie-chart.png b/salesperson_pos_order_line/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/misc/pie-chart.png differ diff --git a/salesperson_pos_order_line/static/description/assets/misc/right-arrow.png b/salesperson_pos_order_line/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/misc/right-arrow.png differ diff --git a/salesperson_pos_order_line/static/description/assets/misc/star.png b/salesperson_pos_order_line/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/misc/star.png differ diff --git a/salesperson_pos_order_line/static/description/assets/misc/support.png b/salesperson_pos_order_line/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/misc/support.png differ diff --git a/salesperson_pos_order_line/static/description/assets/misc/whatsapp.png b/salesperson_pos_order_line/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/misc/whatsapp.png differ diff --git a/salesperson_pos_order_line/static/description/assets/modules/1.png b/salesperson_pos_order_line/static/description/assets/modules/1.png new file mode 100644 index 000000000..5f44a7462 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/modules/1.png differ diff --git a/salesperson_pos_order_line/static/description/assets/modules/2.png b/salesperson_pos_order_line/static/description/assets/modules/2.png new file mode 100644 index 000000000..a098cf8d6 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/modules/2.png differ diff --git a/salesperson_pos_order_line/static/description/assets/modules/3.png b/salesperson_pos_order_line/static/description/assets/modules/3.png new file mode 100644 index 000000000..ea53d2e2e Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/modules/3.png differ diff --git a/salesperson_pos_order_line/static/description/assets/modules/4.png b/salesperson_pos_order_line/static/description/assets/modules/4.png new file mode 100644 index 000000000..8c3005cef Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/modules/4.png differ diff --git a/salesperson_pos_order_line/static/description/assets/modules/5.png b/salesperson_pos_order_line/static/description/assets/modules/5.png new file mode 100644 index 000000000..e1390e92c Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/modules/5.png differ diff --git a/salesperson_pos_order_line/static/description/assets/modules/6.png b/salesperson_pos_order_line/static/description/assets/modules/6.png new file mode 100644 index 000000000..76be4d0ae Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/modules/6.png differ diff --git a/salesperson_pos_order_line/static/description/assets/screenshots/hero.gif b/salesperson_pos_order_line/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..578328111 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/screenshots/hero.gif differ diff --git a/salesperson_pos_order_line/static/description/assets/screenshots/pos12.png b/salesperson_pos_order_line/static/description/assets/screenshots/pos12.png new file mode 100644 index 000000000..279c07f83 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/screenshots/pos12.png differ diff --git a/salesperson_pos_order_line/static/description/assets/screenshots/pos13.png b/salesperson_pos_order_line/static/description/assets/screenshots/pos13.png new file mode 100644 index 000000000..83a537668 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/screenshots/pos13.png differ diff --git a/salesperson_pos_order_line/static/description/assets/screenshots/pos15.png b/salesperson_pos_order_line/static/description/assets/screenshots/pos15.png new file mode 100644 index 000000000..96239de0a Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/screenshots/pos15.png differ diff --git a/salesperson_pos_order_line/static/description/assets/screenshots/pos16.png b/salesperson_pos_order_line/static/description/assets/screenshots/pos16.png new file mode 100644 index 000000000..976563893 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/screenshots/pos16.png differ diff --git a/salesperson_pos_order_line/static/description/assets/screenshots/receipt.png b/salesperson_pos_order_line/static/description/assets/screenshots/receipt.png new file mode 100644 index 000000000..72c1c9cf6 Binary files /dev/null and b/salesperson_pos_order_line/static/description/assets/screenshots/receipt.png differ diff --git a/salesperson_pos_order_line/static/description/banner.png b/salesperson_pos_order_line/static/description/banner.png new file mode 100644 index 000000000..273676e59 Binary files /dev/null and b/salesperson_pos_order_line/static/description/banner.png differ diff --git a/salesperson_pos_order_line/static/description/icon.png b/salesperson_pos_order_line/static/description/icon.png new file mode 100644 index 000000000..1e6e5189f Binary files /dev/null and b/salesperson_pos_order_line/static/description/icon.png differ diff --git a/salesperson_pos_order_line/static/description/index.html b/salesperson_pos_order_line/static/description/index.html new file mode 100644 index 000000000..6cfad63c9 --- /dev/null +++ b/salesperson_pos_order_line/static/description/index.html @@ -0,0 +1,642 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Salesperson on POS Order Line +

+

+ Now You Can Add Salesperson for Products in POS Order + Line

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module is used to set Salespersons on Pos Order Line +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Compatible with the Community and Enterprise version of Odoo. +
+
+ + Set Salesperson on Pos Order Line. +
+
+
+ + + +
+
+ + +
+

+ Screenshots +

+
+
+
+
+

+ Adds a new button Salesperson in Pos. +

+ +
+
+

+ Select the Salesperson from here.

+ + +
+
+

+ You can also select Salesperson for multiple Products in Order + Line. +

+ + +
+
+

+ You can see the Salesperson in respective orders in POS +

+ + +
+
+

+ You can see the Salesperson in Receipts +

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

+ Related + Products +

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

+ Our Services +

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

+ Our + Industries +

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

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

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

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

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

+ An + all-inclusive + hotel management application

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

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/salesperson_pos_order_line/static/src/js/pos_orderline.js b/salesperson_pos_order_line/static/src/js/pos_orderline.js new file mode 100644 index 000000000..37c724166 --- /dev/null +++ b/salesperson_pos_order_line/static/src/js/pos_orderline.js @@ -0,0 +1,47 @@ +odoo.define('salesperson_pos_order_line.Orderline', function(require) { + 'use strict'; + var models = require('point_of_sale.models'); + var _super_orderline = models.Orderline.prototype; + models.Orderline = models.Orderline.extend({ + /** + * Initializes the order line object. + * + * @param {Object} attr - The order line attributes. + * @param {Object} options - The options. + */ + initialize: function(attr, options) { + _super_orderline.initialize.call(this, attr, options); + if (options.json) { + this.salesperson = this.salesperson; + } + }, + /** + * Initializes the order line object from a JSON object. + * + * @param {Object} json - The JSON object. + */ + init_from_JSON: function(json) { + _super_orderline.init_from_JSON.apply(this, arguments); + this.salesperson = json.salesperson; + }, + /** + * Exports the order line as a JSON object. + * + * @return {Object} - The JSON object. + */ + export_as_JSON: function() { + var json = _super_orderline.export_as_JSON.apply(this, arguments); + json.sales_persons = this.salesperson; + return json + }, + /** + * Sets the salesperson for the order line. + * + * @param {Object} sp - The salesperson object. + */ + set_salesperson: function(sp) { + this.salesperson = sp[0] + this.trigger('change', this); + } + }); +}); diff --git a/salesperson_pos_order_line/static/src/js/pos_popup.js b/salesperson_pos_order_line/static/src/js/pos_popup.js new file mode 100644 index 000000000..0ec644eaa --- /dev/null +++ b/salesperson_pos_order_line/static/src/js/pos_popup.js @@ -0,0 +1,50 @@ +odoo.define('salesperson_pos_order_line.Order', function(require) { + 'use strict'; + /** + * This module defines the CustomDemoPopup class, which is a custom popup component that allows the user to set the + * salesperson for a selected order line. + */ + const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); + const Registries = require('point_of_sale.Registries'); + const { useRef } = owl.hooks; + var core = require('web.core'); + const { Gui } = require('point_of_sale.Gui'); + var _t = core._t; + class CustomDemoPopup extends AbstractAwaitablePopup { + /** + * Initializes the component. + */ + constructor() { + super(...arguments); + this.salePersonRef = useRef('salePersonRef'); + } + /** + * Confirms the selected salesperson and sets it for the selected order line. + */ + confirm() { + if (this.env.pos.get_order().get_selected_orderline()) { + var order = this.env.pos.get_order().get_selected_orderline(); + var product_id = order.product.id; + var product = this.env.pos.db.get_product_by_id(product_id); + let option = this.salePersonRef.el.selectedOptions[0] + order.set_salesperson([(option.value)]); + this.trigger('close-popup'); + } else { + Gui.showPopup("ErrorPopup", { + 'title': _t("Error"), + 'body': _.str.sprintf(_t('You should add product first')), + }); + return false; + } + } + /** + * Cancels the popup. + */ + click_cancel() { + this.trigger('close-popup'); + } + } + CustomDemoPopup.template = "CustomDemoPopup"; + Registries.Component.add(CustomDemoPopup); + return CustomDemoPopup +}); diff --git a/salesperson_pos_order_line/static/src/js/pos_screen.js b/salesperson_pos_order_line/static/src/js/pos_screen.js new file mode 100644 index 000000000..04da05363 --- /dev/null +++ b/salesperson_pos_order_line/static/src/js/pos_screen.js @@ -0,0 +1,46 @@ +odoo.define('salesperson_pos_order_line.line', function(require) { + 'use strict'; + const PosComponent = require('point_of_sale.PosComponent'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const { useListener } = require('web.custom_hooks'); + const Registries = require('point_of_sale.Registries'); + class SetProductListButton extends PosComponent { + /** + * This class represents a button in the POS product screen that, when clicked, + * displays a custom popup with a list of salespersons to choose from. + */ + constructor() { + super(...arguments); + useListener("click", this.onClick); + } + /** + * Returns an array of product objects filtered by the currently selected category. + * + * @returns {Array} An array of product objects. + */ + get productsList() { + let list = []; + list = this.env.pos.db.get_product_by_category( + this.env.pos.selectedCategoryId + ); + return list.sort(function (a, b) { + return a.display_name.localeCompare(b.display_name); + }); + } + /** + * Handles the click event on the custom product button and displays the custom popup. + */ + async onClick() { + let list = this.productsList; + this.showPopup("CustomDemoPopup",{'sales_persons':this.env.pos.users}); + } + } + SetProductListButton.template = "CustomDemoButtons"; + ProductScreen.addControlButton({ + component: SetProductListButton, + condition: function () { + return true; + }, + }); + Registries.Component.add(SetProductListButton); +}); diff --git a/salesperson_pos_order_line/static/src/xml/orderline_templates.xml b/salesperson_pos_order_line/static/src/xml/orderline_templates.xml new file mode 100644 index 000000000..d4ab2ca76 --- /dev/null +++ b/salesperson_pos_order_line/static/src/xml/orderline_templates.xml @@ -0,0 +1,15 @@ + + + + + +
+ + Salesperson: +
+
+
+
+
diff --git a/salesperson_pos_order_line/static/src/xml/pos_popup_templates.xml b/salesperson_pos_order_line/static/src/xml/pos_popup_templates.xml new file mode 100644 index 000000000..bd8ffe10b --- /dev/null +++ b/salesperson_pos_order_line/static/src/xml/pos_popup_templates.xml @@ -0,0 +1,44 @@ + + + + + + + diff --git a/salesperson_pos_order_line/static/src/xml/pos_screen_templates.xml b/salesperson_pos_order_line/static/src/xml/pos_screen_templates.xml new file mode 100644 index 000000000..3e2314659 --- /dev/null +++ b/salesperson_pos_order_line/static/src/xml/pos_screen_templates.xml @@ -0,0 +1,11 @@ + + + + +
+ + Salesperson +
+
+
diff --git a/salesperson_pos_order_line/static/src/xml/receipt_templates.xml b/salesperson_pos_order_line/static/src/xml/receipt_templates.xml new file mode 100644 index 000000000..77f84290c --- /dev/null +++ b/salesperson_pos_order_line/static/src/xml/receipt_templates.xml @@ -0,0 +1,17 @@ + + + + + + +
+ SalesPerson: + +
+
+
+
+
diff --git a/salesperson_pos_order_line/views/pos_order_views.xml b/salesperson_pos_order_line/views/pos_order_views.xml new file mode 100644 index 000000000..cda3e0876 --- /dev/null +++ b/salesperson_pos_order_line/views/pos_order_views.xml @@ -0,0 +1,17 @@ + + + + + + pos.order.view.form.inherit.salesperson.pos.order.line + + pos.order + + + + + + + +