diff --git a/account_restrict_journal/README.rst b/account_restrict_journal/README.rst new file mode 100644 index 000000000..601712269 --- /dev/null +++ b/account_restrict_journal/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.odoo.com/documentation/user/15.0/legal/licenses/licenses.html + :alt: License: LGPL-3 + +Restrict Journal for Users +========================== +This module helps to restrict journal for the specific users. Users can access allowed journals only. + +Configuration +============= +No additional configuration required + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/15.0/legal/licenses/licenses.html) + +Credits +------- +Developer : (V15) Saneen K, 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/account_restrict_journal/__init__.py b/account_restrict_journal/__init__.py new file mode 100644 index 000000000..a6a3c2326 --- /dev/null +++ b/account_restrict_journal/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Saneen K (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import models diff --git a/account_restrict_journal/__manifest__.py b/account_restrict_journal/__manifest__.py new file mode 100644 index 000000000..ead02e6c8 --- /dev/null +++ b/account_restrict_journal/__manifest__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Saneen K (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +{ + 'name': "Restrict Journal for Users", + "version": "15.0.1.0.0", + "category": "Accounting", + "summary": "User can select only allowed journals", + "description": 'Restrict account journal for the specific users to access' + ' allowed journals only', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['account'], + 'data': [ + 'security/account_journal_security.xml', + 'views/account_journal_views.xml', + 'views/res_user_views.xml' + ], + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/account_restrict_journal/doc/RELEASE_NOTES.md b/account_restrict_journal/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..b02945331 --- /dev/null +++ b/account_restrict_journal/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 05.12.2023 +#### Version 15.0.1.0.0 +#### ADD +- Initial commit for Restrict Journal for Users diff --git a/account_restrict_journal/models/__init__.py b/account_restrict_journal/models/__init__.py new file mode 100644 index 000000000..052c48eb7 --- /dev/null +++ b/account_restrict_journal/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Saneen K (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import account_journal +from . import res_user diff --git a/account_restrict_journal/models/account_journal.py b/account_restrict_journal/models/account_journal.py new file mode 100644 index 000000000..902a73d42 --- /dev/null +++ b/account_restrict_journal/models/account_journal.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Saneen K (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import fields, models + + +class AccountJournal(models.Model): + """Inherit the account. journal for restricted the users for + particular journal""" + _inherit = 'account.journal' + + restrict_user_ids = fields.Many2many('res.users', + string="Account Restricted Users", + help="Restrict the users for " + "particular products") + is_account_journal = fields.Boolean(default=True, + string='Journal Restriction', + help="Enable product restriction") diff --git a/account_restrict_journal/models/res_user.py b/account_restrict_journal/models/res_user.py new file mode 100644 index 000000000..a02e40330 --- /dev/null +++ b/account_restrict_journal/models/res_user.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Saneen K (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import fields, models + + +class ResUsers(models.Model): + """ Adding journal fields in res. users where we can select a journal + that can be accessed by the user""" + _inherit = 'res.users' + + allowed_journal_ids = fields.Many2many( + 'account.journal', string='Allowed Journals', + help='Only the selected journal will be visible to the' + ' particular user') + is_admin = fields.Boolean(compute='_compute_is_admin', string='Is Admin', + help='Check the user is admin or not') + + def write(self, vals): + """Write the values of restrict journal to the corresponding users""" + res = super(ResUsers, self).write(vals) + for user in self: + if user: + journals = self.env['account.journal'].sudo(). \ + search([('restrict_user_ids', 'in', user.id)]) + if user.allowed_journal_ids: + for journal in journals: + journal.is_account_journal = True + for journal in self.env['account.journal'].sudo(). \ + search([('restrict_user_ids', 'not in', + [rec.id for rec in journals])]): + journal.is_account_journal = False + else: + for journal in self.env['account.journal'].sudo().search( + []): + journal.is_account_journal = True + for user_journal in self.allowed_journal_ids: + user_journal.sudo().write({ + 'restrict_user_ids': [(4, user.id)] + }) + return res + + def _compute_is_admin(self): + """ Compute the value of is_admin based on the user id admin or not""" + for admin in self: + admin.is_admin = False + if admin.id == self.env.ref('base.user_admin').id: + admin.is_admin = True diff --git a/account_restrict_journal/security/account_journal_security.xml b/account_restrict_journal/security/account_journal_security.xml new file mode 100644 index 000000000..8744237e1 --- /dev/null +++ b/account_restrict_journal/security/account_journal_security.xml @@ -0,0 +1,27 @@ + + + + + Account Journal Restrict on Users + + ['|',('is_account_journal','=',True),('restrict_user_ids', 'in',user.id)] + + + + + + + + + + Account Journal Restrict for Admin + + [(1,'=',1)] + + + + + + + + diff --git a/account_restrict_journal/static/description/assets/icons/check.png b/account_restrict_journal/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/check.png differ diff --git a/account_restrict_journal/static/description/assets/icons/chevron.png b/account_restrict_journal/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/chevron.png differ diff --git a/account_restrict_journal/static/description/assets/icons/cogs.png b/account_restrict_journal/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/cogs.png differ diff --git a/account_restrict_journal/static/description/assets/icons/consultation.png b/account_restrict_journal/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/consultation.png differ diff --git a/account_restrict_journal/static/description/assets/icons/ecom-black.png b/account_restrict_journal/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/ecom-black.png differ diff --git a/account_restrict_journal/static/description/assets/icons/education-black.png b/account_restrict_journal/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/education-black.png differ diff --git a/account_restrict_journal/static/description/assets/icons/hotel-black.png b/account_restrict_journal/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/hotel-black.png differ diff --git a/account_restrict_journal/static/description/assets/icons/license.png b/account_restrict_journal/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/license.png differ diff --git a/account_restrict_journal/static/description/assets/icons/lifebuoy.png b/account_restrict_journal/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/lifebuoy.png differ diff --git a/account_restrict_journal/static/description/assets/icons/manufacturing-black.png b/account_restrict_journal/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/manufacturing-black.png differ diff --git a/account_restrict_journal/static/description/assets/icons/pos-black.png b/account_restrict_journal/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/pos-black.png differ diff --git a/account_restrict_journal/static/description/assets/icons/puzzle.png b/account_restrict_journal/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/puzzle.png differ diff --git a/account_restrict_journal/static/description/assets/icons/restaurant-black.png b/account_restrict_journal/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/restaurant-black.png differ diff --git a/account_restrict_journal/static/description/assets/icons/service-black.png b/account_restrict_journal/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/service-black.png differ diff --git a/account_restrict_journal/static/description/assets/icons/trading-black.png b/account_restrict_journal/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/trading-black.png differ diff --git a/account_restrict_journal/static/description/assets/icons/training.png b/account_restrict_journal/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/training.png differ diff --git a/account_restrict_journal/static/description/assets/icons/update.png b/account_restrict_journal/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/update.png differ diff --git a/account_restrict_journal/static/description/assets/icons/user.png b/account_restrict_journal/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/user.png differ diff --git a/account_restrict_journal/static/description/assets/icons/wrench.png b/account_restrict_journal/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/account_restrict_journal/static/description/assets/icons/wrench.png differ diff --git a/account_restrict_journal/static/description/assets/misc/categories.png b/account_restrict_journal/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/account_restrict_journal/static/description/assets/misc/categories.png differ diff --git a/account_restrict_journal/static/description/assets/misc/check-box.png b/account_restrict_journal/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/account_restrict_journal/static/description/assets/misc/check-box.png differ diff --git a/account_restrict_journal/static/description/assets/misc/compass.png b/account_restrict_journal/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/account_restrict_journal/static/description/assets/misc/compass.png differ diff --git a/account_restrict_journal/static/description/assets/misc/corporate.png b/account_restrict_journal/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/account_restrict_journal/static/description/assets/misc/corporate.png differ diff --git a/account_restrict_journal/static/description/assets/misc/customer-support.png b/account_restrict_journal/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/account_restrict_journal/static/description/assets/misc/customer-support.png differ diff --git a/account_restrict_journal/static/description/assets/misc/cybrosys-logo.png b/account_restrict_journal/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/account_restrict_journal/static/description/assets/misc/cybrosys-logo.png differ diff --git a/account_restrict_journal/static/description/assets/misc/features.png b/account_restrict_journal/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/account_restrict_journal/static/description/assets/misc/features.png differ diff --git a/account_restrict_journal/static/description/assets/misc/logo.png b/account_restrict_journal/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/account_restrict_journal/static/description/assets/misc/logo.png differ diff --git a/account_restrict_journal/static/description/assets/misc/pictures.png b/account_restrict_journal/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/account_restrict_journal/static/description/assets/misc/pictures.png differ diff --git a/account_restrict_journal/static/description/assets/misc/pie-chart.png b/account_restrict_journal/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/account_restrict_journal/static/description/assets/misc/pie-chart.png differ diff --git a/account_restrict_journal/static/description/assets/misc/right-arrow.png b/account_restrict_journal/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/account_restrict_journal/static/description/assets/misc/right-arrow.png differ diff --git a/account_restrict_journal/static/description/assets/misc/star.png b/account_restrict_journal/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/account_restrict_journal/static/description/assets/misc/star.png differ diff --git a/account_restrict_journal/static/description/assets/misc/support.png b/account_restrict_journal/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/account_restrict_journal/static/description/assets/misc/support.png differ diff --git a/account_restrict_journal/static/description/assets/misc/whatsapp.png b/account_restrict_journal/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/account_restrict_journal/static/description/assets/misc/whatsapp.png differ diff --git a/account_restrict_journal/static/description/assets/modules/1.png b/account_restrict_journal/static/description/assets/modules/1.png new file mode 100644 index 000000000..004c61a9e Binary files /dev/null and b/account_restrict_journal/static/description/assets/modules/1.png differ diff --git a/account_restrict_journal/static/description/assets/modules/2.png b/account_restrict_journal/static/description/assets/modules/2.png new file mode 100644 index 000000000..04d502e26 Binary files /dev/null and b/account_restrict_journal/static/description/assets/modules/2.png differ diff --git a/account_restrict_journal/static/description/assets/modules/3.png b/account_restrict_journal/static/description/assets/modules/3.png new file mode 100644 index 000000000..c4b3a2088 Binary files /dev/null and b/account_restrict_journal/static/description/assets/modules/3.png differ diff --git a/account_restrict_journal/static/description/assets/modules/4.png b/account_restrict_journal/static/description/assets/modules/4.png new file mode 100644 index 000000000..958ed2bf4 Binary files /dev/null and b/account_restrict_journal/static/description/assets/modules/4.png differ diff --git a/account_restrict_journal/static/description/assets/modules/5.png b/account_restrict_journal/static/description/assets/modules/5.png new file mode 100644 index 000000000..c138dd7c2 Binary files /dev/null and b/account_restrict_journal/static/description/assets/modules/5.png differ diff --git a/account_restrict_journal/static/description/assets/modules/6.png b/account_restrict_journal/static/description/assets/modules/6.png new file mode 100644 index 000000000..09e2d45b2 Binary files /dev/null and b/account_restrict_journal/static/description/assets/modules/6.png differ diff --git a/account_restrict_journal/static/description/assets/screenshots/1.png b/account_restrict_journal/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..792863a08 Binary files /dev/null and b/account_restrict_journal/static/description/assets/screenshots/1.png differ diff --git a/account_restrict_journal/static/description/assets/screenshots/2.png b/account_restrict_journal/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..91f4acfef Binary files /dev/null and b/account_restrict_journal/static/description/assets/screenshots/2.png differ diff --git a/account_restrict_journal/static/description/assets/screenshots/3.png b/account_restrict_journal/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..64ea3adf9 Binary files /dev/null and b/account_restrict_journal/static/description/assets/screenshots/3.png differ diff --git a/account_restrict_journal/static/description/assets/screenshots/4.png b/account_restrict_journal/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..c838410c3 Binary files /dev/null and b/account_restrict_journal/static/description/assets/screenshots/4.png differ diff --git a/account_restrict_journal/static/description/assets/screenshots/5.png b/account_restrict_journal/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..1ff7b8b27 Binary files /dev/null and b/account_restrict_journal/static/description/assets/screenshots/5.png differ diff --git a/account_restrict_journal/static/description/assets/screenshots/6.png b/account_restrict_journal/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..595610dd3 Binary files /dev/null and b/account_restrict_journal/static/description/assets/screenshots/6.png differ diff --git a/account_restrict_journal/static/description/assets/screenshots/hero.gif b/account_restrict_journal/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..8fdbe7627 Binary files /dev/null and b/account_restrict_journal/static/description/assets/screenshots/hero.gif differ diff --git a/account_restrict_journal/static/description/banner.png b/account_restrict_journal/static/description/banner.png new file mode 100644 index 000000000..9da3ebe89 Binary files /dev/null and b/account_restrict_journal/static/description/banner.png differ diff --git a/account_restrict_journal/static/description/icon.png b/account_restrict_journal/static/description/icon.png new file mode 100644 index 000000000..d5acb151e Binary files /dev/null and b/account_restrict_journal/static/description/icon.png differ diff --git a/account_restrict_journal/static/description/index.html b/account_restrict_journal/static/description/index.html new file mode 100644 index 000000000..0ea7588fc --- /dev/null +++ b/account_restrict_journal/static/description/index.html @@ -0,0 +1,561 @@ +
+ +
+ +
+
+ Odoo.sh +
+
+ Enterprise +
+
+
+ +
+
+
+ +

Restrict Journal for Users +

+

Restrict the Journals for Specific Users

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ This module helps you to restrict journals for specific users. So that users can only access the allowed journals. +
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + Restrict Journal for Users +
+
+ + Users can Access Only Allowed Journals +
+
+
+ +
+ + Available in Odoo 15.0 Enterprise. +
+
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +

Select Allowed Journal For the Users +

+

Go to Settings -> Users & Companies.

+ +

You can see new page 'Allowed Journal' where you can select allowed journal for that user.

+ +
+ +
+

Journal View +

+

Go to Accounting -> Configuration -> Journals + . You can only see the selected journals. +

+ +
+ +
+

Journal Selection in Register Payment +

+

Create and confirm an invoice and click on 'Register Payment' + Only selected journal will be visible here. +

+ +
+
+

Journal Selection on Payment +

+

Go to Accounting -> Vendor or Customer -> Payments. + Only allowed journal can be select for that user. +

+ +
+
+

Remove Allowed Journal +

+

Go to Settings -> Users & Companies.

+

Remove all the journals for accessing all the journal without restriction. +

+ +
+ +
+

Account Journal Without Restriction +

+

Go to Accounting -> Configuration ->Journals. + We can see all journals without any restriction +

+ +
+ +
+ + +
+
+ +
+

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

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/account_restrict_journal/views/account_journal_views.xml b/account_restrict_journal/views/account_journal_views.xml new file mode 100644 index 000000000..e508b497a --- /dev/null +++ b/account_restrict_journal/views/account_journal_views.xml @@ -0,0 +1,19 @@ + + + + + account.journal.view.form.inherit.account.restrict.journal + account.journal + + + + + + + + + + + + + diff --git a/account_restrict_journal/views/res_user_views.xml b/account_restrict_journal/views/res_user_views.xml new file mode 100644 index 000000000..c3020545d --- /dev/null +++ b/account_restrict_journal/views/res_user_views.xml @@ -0,0 +1,19 @@ + + + + + res.users.view.form.inherit.account.restrict.journal + res.users + extension + + + + + + + + + + + + diff --git a/odoo_pipedrive_connector/README.rst b/odoo_pipedrive_connector/README.rst new file mode 100755 index 000000000..8250b3b7f --- /dev/null +++ b/odoo_pipedrive_connector/README.rst @@ -0,0 +1,52 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Odoo Pipedrive Connector +======================== +Integrate Products, Contacts and Leads between Pipedrive and Odoo + +Configuration +============= +Please note that this feature is only supported on secure (HTTPS) URLs. + +* First you need to create Pipedrive Token. +1) Go to https://demo-sandbox4.pipedrive.com/settings/api and login to your account. +2) Click on your profile picture at the right corner. +3) Click on Personal preferences. +4) Under API, you can see the Pipedrive token. + +License +------- +AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: (V15) Unnimaya C O, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/odoo_pipedrive_connector/__init__.py b/odoo_pipedrive_connector/__init__.py new file mode 100755 index 000000000..b715a9d1f --- /dev/null +++ b/odoo_pipedrive_connector/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import controllers +from . import models diff --git a/odoo_pipedrive_connector/__manifest__.py b/odoo_pipedrive_connector/__manifest__.py new file mode 100755 index 000000000..9a03dcd63 --- /dev/null +++ b/odoo_pipedrive_connector/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +{ + 'name': "Odoo Pipedrive Connector", + 'version': '15.0.1.0.0', + 'category': 'Productivity', + 'summary': """Integrate contacts, products and leads between Pipedrive + and Odoo""", + 'description': """This module helps to successfully import all products, + contacts and leads between Pipedrive to Odoo. Also, it is possible to + export all these data from Odoo to Pipedrive. All import and export + operations can be performed in a single button click.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['account', 'crm'], + 'data': [ + 'views/res_company_views.xml' + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/odoo_pipedrive_connector/controllers/__init__.py b/odoo_pipedrive_connector/controllers/__init__.py new file mode 100755 index 000000000..2c90af57c --- /dev/null +++ b/odoo_pipedrive_connector/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import odoo_pipedrive_connector diff --git a/odoo_pipedrive_connector/controllers/odoo_pipedrive_connector.py b/odoo_pipedrive_connector/controllers/odoo_pipedrive_connector.py new file mode 100755 index 000000000..c74557de4 --- /dev/null +++ b/odoo_pipedrive_connector/controllers/odoo_pipedrive_connector.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +import json +from odoo import http +from odoo.http import request + + +class PipedriveWebhook(http.Controller): + """ This controller is responsible for receiving Webhooks from Pipedrive""" + + @http.route('/update_pipedrive_product', type="json", auth="public", + methods=['POST']) + def get_updated_product_details(self, **kw): + """Webhook for receiving the updated product details.""" + data = json.loads(request.httprequest.data.decode('utf-8')) + request.env.company.sudo().create_product_category() + uom_id = 1 + if data['current']['unit']: + for rec in request.env['uom.uom'].sudo().search([]).mapped( + 'name'): + if rec.lower() == data['current']['unit'].lower(): + uom_id = request.env['uom.uom'].sudo().search( + [('name', '=', rec)]).id + product_template = request.env['product.template'].sudo().search([( + 'pipedrive_reference', '=', data['current']['id'])]) + if product_template: + product_template.sudo().write({ + 'name': data['current']['name'], + 'description': data['current']['description'], + 'uom_id': uom_id, + 'active': data['current']['active_flag'], + 'uom_po_id': uom_id, + 'standard_price': data['current']['prices'][0]['cost'], + 'list_price': data['current']['prices'][0]['price'], + 'categ_id': request.env['product.category'].sudo().search([( + 'pipedrive_reference', '=', + data['current']['category'])]).id if data[ + 'current']['category'] else 1 + }) + + @http.route('/delete_pipedrive_product', type="json", auth="public", + methods=['POST']) + def get_deleted_product_details(self, **kw): + """Webhook for receiving the deleted product details.""" + data = json.loads(request.httprequest.data.decode('utf-8')) + request.env['product.template'].sudo().search([( + 'pipedrive_reference', '=', data['meta']['id'])]).unlink() + + @http.route('/update_pipedrive_contact', type="json", auth="public", + methods=['POST']) + def get_updated_contact_details(self, **kw): + """Webhook for receiving the updated contact details.""" + data = json.loads(request.httprequest.data.decode('utf-8')) + partner = request.env['res.partner'].sudo().search([( + 'pipedrive_reference', '=', data['current']['id'])]) + if partner: + partner.sudo().write({ + 'name': data['current']['name'], + 'email': data['current']['email'][0]['value'], + 'phone': data['current']['phone'][0]['value'], + }) + + @http.route('/delete_pipedrive_contact', type="json", auth="public", + methods=['POST']) + def get_deleted_contact_details(self, **kw): + """Webhook for receiving the deleted contact details.""" + data = json.loads(request.httprequest.data.decode('utf-8')) + request.env['res.partner'].sudo().search([( + 'pipedrive_reference', '=', data['meta']['id'])]).unlink() diff --git a/odoo_pipedrive_connector/doc/RELEASE_NOTES.md b/odoo_pipedrive_connector/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..deb1261d4 --- /dev/null +++ b/odoo_pipedrive_connector/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 04.12.2023 +#### Version 15.0.1.0.0 +#### ADD + +- Initial commit for Odoo Pipedrive Connector diff --git a/odoo_pipedrive_connector/models/__init__.py b/odoo_pipedrive_connector/models/__init__.py new file mode 100755 index 000000000..6bc8bdc51 --- /dev/null +++ b/odoo_pipedrive_connector/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import crm_lead +from . import product_category +from . import product_template +from . import res_company +from . import res_partner diff --git a/odoo_pipedrive_connector/models/crm_lead.py b/odoo_pipedrive_connector/models/crm_lead.py new file mode 100755 index 000000000..27e30cee0 --- /dev/null +++ b/odoo_pipedrive_connector/models/crm_lead.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +import json +import requests +from odoo import fields, models +from odoo.exceptions import ValidationError + + +class CrmLead(models.Model): + """Inherits crm Lead for including Pipedrive fields and functions""" + _inherit = 'crm.lead' + + pipedrive_reference = fields.Char(string='Pipedrive Id', + help="Pipedrive reference of the lead") + + def write(self, vals): + """Inherited to add the code for updating the product details in + Pipedrive""" + data = {} + if 'name' in vals.keys(): + data['title'] = vals['name'] + if 'partner_id' in vals.keys(): + pipedrive_reference = self.env['res.partner'].browse( + vals['partner_id']).pipedrive_reference + if not pipedrive_reference: + pipedrive_reference = self.env.user.company_id.create_contact( + self.env['res.partner'].browse( + vals['partner_id'])) + data['person_id'] = int(pipedrive_reference) + if 'expected_revenue' in vals.keys(): + data['value'] = { + 'amount': vals['expected_revenue'], + 'currency': self.env.company.currency_id.name + } + if self.pipedrive_reference and data: + headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + } + response = requests.patch( + url=f'https://api.pipedrive.com/v1/leads/' + f'{self.pipedrive_reference}', + params={ + 'api_token': self.env.user.company_id.api_key, + }, timeout=10, headers=headers, data=json.dumps(data)) + if 'error' in response.json().keys(): + raise ValidationError( + response.json()['error']) + return super().write(vals) + + def unlink(self): + """Inherited to add the code for deleting the product from Pipedrive""" + if self.pipedrive_reference: + headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + } + response = requests.delete( + url=f'https://api.pipedrive.com/v1/leads/' + f'{self.pipedrive_reference}', + params={ + 'api_token': self.env.user.company_id.api_key, + }, timeout=10, headers=headers) + if 'error' in response.json().keys(): + raise ValidationError( + response.json()['error']) + return super().unlink() diff --git a/odoo_pipedrive_connector/models/product_category.py b/odoo_pipedrive_connector/models/product_category.py new file mode 100755 index 000000000..fa27f9e32 --- /dev/null +++ b/odoo_pipedrive_connector/models/product_category.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +import json +import requests +from odoo import fields, models +from odoo.exceptions import ValidationError + + +class ProductCategory(models.Model): + """Inherits product_category for including Pipedrive fields and functions""" + _inherit = 'product.category' + + pipedrive_reference = fields.Char(string='Pipedrive Id', + help="Pipedrive Id of the Partner") + + def write(self, vals): + """Inherited to update product field in pipedrive""" + data = {} + if 'name' in vals.keys() and self.pipedrive_reference: + data['label'] = vals['name'] + headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + } + response = requests.put( + url=f'https://api.pipedrive.com/v1/productFields/' + f'{self.pipedrive_reference}', + params={ + 'api_token': self.env.user.company_id.api_key, + }, timeout=10, headers=headers, data=json.dumps(data)) + if 'error' in response.json().keys(): + raise ValidationError( + response.json()['error']) + return super().write(vals) + + def unlink(self): + """Inherited to delete the product field from Pipedrive""" + if self.pipedrive_reference: + headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + } + response = requests.delete( + url=f'https://api.pipedrive.com/v1/productFields/' + f'{self.pipedrive_reference}', + params={ + 'api_token': self.env.user.company_id.api_key, + }, timeout=10, headers=headers) + if 'error' in response.json().keys(): + raise ValidationError( + response.json()['error']) + return super().unlink() diff --git a/odoo_pipedrive_connector/models/product_template.py b/odoo_pipedrive_connector/models/product_template.py new file mode 100755 index 000000000..052385b5a --- /dev/null +++ b/odoo_pipedrive_connector/models/product_template.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +import json +import requests +from odoo import fields, models +from odoo.exceptions import ValidationError + + +class ProductTemplate(models.Model): + """Inherits product template for including Pipedrive fields and + functions""" + _inherit = 'product.template' + + pipedrive_reference = fields.Char(string='Pipedrive Id', + help="Pipedrive Id of the Product") + + def write(self, vals): + """Inherited to update the Pipedrive product.""" + data = {} + if 'name' in vals.keys(): + data['name'] = vals['name'] + if 'uom_id' in vals.keys(): + data['unit'] = self.env['uom.uom'].browse(vals['uom_id']).name + if 'taxes_id' in vals.keys(): + if vals['taxes_id'] and isinstance(vals['taxes_id'][0], list): + total_tax = 0.0 + for tax in self.env['account.tax'].search( + [('id', 'in', vals['taxes_id'][0][2])]): + total_tax += self.calculate_total_tax_percentage(tax) + data['tax'] = total_tax + if 'list_price' in vals.keys(): + data['prices'] = [{'price': vals['list_price'], + 'currency': self.env.company.currency_id.name} + ] + if self.pipedrive_reference and data: + headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + } + response = requests.put( + url=f'https://api.pipedrive.com/v1/products/' + f'{self.pipedrive_reference}', + params={ + 'api_token': self.env.user.company_id.api_key, + }, timeout=10, headers=headers, data=json.dumps(data)) + if 'error' in response.json().keys(): + raise ValidationError( + response.json()['error']) + return super().write(vals) + + def calculate_total_tax_percentage(self, tax): + """Method for calculating total tax""" + total_percentage_tax = 0.0 + # Percentage Taxes + if tax.amount_type == 'percent': + total_percentage_tax = tax.amount + # Group Taxes + elif tax.amount_type == 'group': + for child_tax in tax.children_tax_ids.filtered( + lambda t: t.amount_type == 'percent'): + total_percentage_tax += child_tax.amount + # Fixed Taxes + elif tax.amount_type == 'fixed': + total_percentage_tax = (tax.amount / tax.list_price) * 100 + # Division Taxes + else: + total_percentage_tax = (tax.list_price / tax.factor) * 100 + return total_percentage_tax + + def unlink(self): + """Method for deleting a product from Pipedrive""" + if self.pipedrive_reference: + headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + } + response = requests.delete( + url=f'https://api.pipedrive.com/v1/products/' + f'{self.pipedrive_reference}', + params={ + 'api_token': self.env.user.company_id.api_key, + }, timeout=10, headers=headers) + if 'error' in response.json().keys(): + raise ValidationError( + response.json()['error']) + return super().unlink() diff --git a/odoo_pipedrive_connector/models/res_company.py b/odoo_pipedrive_connector/models/res_company.py new file mode 100755 index 000000000..7ee0276e6 --- /dev/null +++ b/odoo_pipedrive_connector/models/res_company.py @@ -0,0 +1,383 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +import json +import requests +from odoo import fields, models, _ +from odoo.exceptions import ValidationError + + +class ResCompany(models.Model): + """Inherits Res Company for including Pipedrive credential fields""" + _inherit = 'res.company' + + api_key = fields.Char(string='Token', + help="It is used to connect with Pipedrive" + ) + import_product = fields.Boolean(string="Import Product", + help="Check if you want to Import Products " + "from Pipedrive") + import_contact = fields.Boolean(string="Import Contact", + help="Check if you want to Import Contacts " + "from Pipedrive") + import_lead = fields.Boolean(string="Import Lead", + help="Check if you want to Import Leads from" + " Pipedrive") + export_product = fields.Boolean(string="Export Product", + help="Check if you want to Export Products " + "to Pipedrive") + export_contact = fields.Boolean(string="Export Contact", + help="Check if you want to Export Contacts" + " to Pipedrive") + export_lead = fields.Boolean(string="Export Lead", + help="Check if you want to Export Leads to" + " Pipedrive") + pipedrive_reference = fields.Char(string='Pipedrive Id', + help="Pipedrive Id of the Company") + product_webhook = fields.Boolean(string='Product Webhook', + help='True if update webhook for ' + 'products is created') + contact_webhook = fields.Boolean(string='Contact Webhook', + help='True if update webhook for ' + 'contact is created') + + def calculate_total_tax_percentage(self, product): + """Method for calculating total tax""" + total_percentage_tax = 0.0 + # Percentage Taxes + for tax in product.taxes_id.filtered( + lambda t: t.amount_type == 'percent'): + total_percentage_tax += tax.amount + # Group Taxes + for tax in product.taxes_id.filtered( + lambda t: t.amount_type == 'group'): + for child_tax in tax.children_tax_ids.filtered( + lambda t: t.amount_type == 'percent'): + total_percentage_tax += child_tax.amount + # Fixed Taxes + for tax in product.taxes_id.filtered( + lambda t: t.amount_type == 'fixed'): + total_percentage_tax += (tax.amount / product.list_price) * 100 + # Division Taxes + for tax in product.taxes_id.filtered( + lambda t: t.amount_type == 'division'): + total_percentage_tax += (product.list_price / tax.factor) * 100 + return total_percentage_tax + + def action_execute(self): + """For executing Import and Export between Odoo and Pipedrive""" + if not self.api_key: + raise ValidationError(_('Please Enter an API Key')) + if self.import_product: + self.get_products() + if self.import_contact: + self.get_contacts() + if self.import_lead: + self.get_leads() + if self.export_product: + self.export_products_to_pipedrive() + if self.export_contact: + self.export_contacts_to_pipedrive() + if self.export_lead: + self.export_leads_to_pipedrive() + + def get_products(self): + """Receives Products from Pipedrive""" + response = requests.get(url='https://api.pipedrive.com/v1/products', + params={ + 'api_token': self.api_key, + }, timeout=10) + if not response.json()['success']: + raise ValidationError( + response.json()['error'] + '. ' + response.json()[ + 'error_info']) + if response.json()['data']: + self.create_product_category() + for data in response.json()['data']: + pipedrive_reference = self.env['product.template'].search( + []).mapped( + 'pipedrive_reference') + if str(data['id']) not in pipedrive_reference: + if not self.product_webhook: + self.create_webhook( + 'deleted', + '/delete_pipedrive_product', + 'product') + self.create_webhook( + "updated", + '/update_pipedrive_product', + 'product') + uom_id = 1 + if data['unit']: + for rec in self.env['uom.uom'].search([]).mapped( + 'name'): + if rec.lower() == data['unit'].lower(): + uom_id = self.env['uom.uom'].search( + [('name', '=', rec)]).id + if data['prices'][0]['price']: + currency = self.env['res.currency'].search( + [('name', '=', data['prices'][0]['currency']), + ('active', 'in', [True, False])]) + if not currency.active: + currency.active = True + product = self.env['product.template'].create({ + 'name': data['name'], + 'description': data['description'], + 'uom_id': uom_id, + 'uom_po_id': uom_id, + 'list_price': data['prices'][0]['price'], + 'standard_price': data['prices'][0]['cost'], + 'taxes_id': False, + 'pipedrive_reference': data['id'], + 'categ_id': self.env['product.category'].search([( + 'pipedrive_reference', '=', data['category'])]).id + if data['category'] else 1 + }) + product.taxes_id.unlink() + if data['tax'] != 0: + tax = self.env['account.tax'].search( + [('amount_type', '=', 'percent'), + ('type_tax_use', '=', 'sale'), ('amount', + '=', + data['tax'])]) + if not tax: + tax = self.env['account.tax'].create({ + 'name': 'Tax ' + str(data['tax']) + '%', + 'amount_type': 'percent', + 'type_tax_use': 'sale', + 'amount': data['tax'] + }) + product.write({ + "taxes_id": [(4, tax.id)] + }) + + def create_product_category(self): + """Returns product category from category_id""" + response = requests.get( + url='https://api.pipedrive.com/v1/productFields', + params={ + 'api_token': self.api_key, + }, timeout=10) + if not response.json()['success']: + raise ValidationError( + response.json()['error'] + '. ' + response.json()[ + 'error_info']) + for rec in response.json()['data']: + if rec['key'] == 'category': + for item in rec['options']: + category = self.env['product.category'].search( + [('name', '=', item['label'])]) + if not category: + self.env['product.category'].create( + { + 'name': item['label'], + 'pipedrive_reference': item['id'] + } + ) + else: + category.write({ + 'pipedrive_reference': item['id'] + }) + + def get_contacts(self): + """Receives contacts from Pipedrive""" + response = requests.get(url='https://api.pipedrive.com/v1/persons', + params={ + 'api_token': self.api_key, + }, timeout=10) + if not response.json()['success']: + raise ValidationError( + response.json()['error'] + '. ' + response.json()[ + 'error_info']) + if response.json()['data']: + for data in response.json()['data']: + partner_id = self.env['res.partner'].search([]).mapped( + 'pipedrive_reference') + if str(data['id']) not in partner_id: + self.env['res.partner'].create({ + 'name': data['name'], + 'phone': data['phone'][0]['value'], + 'email': data['email'][0]['value'], + 'pipedrive_reference': data['id'] + }) + if not self.contact_webhook: + self.create_webhook( + 'updated', '/update_pipedrive_contact', + 'person') + self.create_webhook( + 'deleted', '/delete_pipedrive_contact', + 'person') + + def get_leads(self): + """Receives leads from Pipedrive""" + response = requests.get(url='https://api.pipedrive.com/v1/leads', + params={ + 'api_token': self.api_key, + }, timeout=10) + if not response.json()['success']: + raise ValidationError( + response.json()['error'] + '. ' + response.json()[ + 'error_info']) + if response.json()['data']: + for data in response.json()['data']: + lead_id = self.env['crm.lead'].search([]).mapped( + 'pipedrive_reference') + expected_revenue = 0 + if data['value']: + currency = self.env['res.currency'].search( + [('name', '=', data['value']['currency']), + ('active', 'in', [True, False])]) + if not currency.active: + currency.active = True + expected_revenue = currency.compute( + data['value']['amount'], self.env.company.currency_id) + if str(data['id']) not in lead_id: + self.env['crm.lead'].create({ + 'name': data['title'], + 'type': 'opportunity', + 'expected_revenue': expected_revenue, + 'pipedrive_reference': data['id'] + }) + + def export_products_to_pipedrive(self): + """Export Products from Odoo to Pipedrive""" + for product in self.env['product.template'].search( + [('pipedrive_reference', '=', False)]): + data = { + 'name': product.name, + 'unit': product.uom_id.name, + 'tax': self.calculate_total_tax_percentage(product), + 'prices': [{ + 'price': product.list_price, + 'currency': self.env.company.currency_id.name + }] + } + response = requests.post( + url='https://api.pipedrive.com/v1/products', + params={ + 'api_token': self.api_key, + }, json=data, timeout=10) + if not response.json()['success']: + raise ValidationError( + response.json()['error'] + '. ' + response.json()[ + 'error_info']) + product.write( + {'pipedrive_reference': response.json()['data']['id']}) + if not self.product_webhook: + self.create_webhook( + 'updated', '/update_pipedrive_product', + 'product') + self.create_webhook( + 'deleted', '/delete_pipedrive_product', + 'product') + + def export_contacts_to_pipedrive(self): + """Export Contacts from Odoo to Pipedrive""" + for partner in self.env['res.partner'].search( + [('pipedrive_reference', '=', False)]): + self.create_contact(partner) + + def create_contact(self, partner): + """Create Persons in Pipedrive""" + data = { + 'name': partner.name, + 'email': partner.email, + 'phone': partner.phone + } + response = requests.post( + url='https://api.pipedrive.com/v1/persons', + params={ + 'api_token': self.api_key, + }, json=data, timeout=10) + if not response.json()['success']: + raise ValidationError( + response.json()['error'] + '. ' + response.json()[ + 'error_info']) + partner.sudo().write( + {'pipedrive_reference': response.json()['data']['id']}) + if not self.contact_webhook: + self.create_webhook( + 'updated', '/update_pipedrive_contact', + 'person') + self.create_webhook( + 'deleted', '/delete_pipedrive_contact', + 'person') + return response.json()['data']['id'] + + def create_webhook(self, event_action, url, event_object): + """Method for creating contact webhook in Pipedrive""" + payload = json.dumps({ + "subscription_url": self.env['ir.config_parameter'].get_param( + 'web.base.url') + url, + "event_action": event_action, + "event_object": event_object + }) + headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + } + params = { + 'api_token': self.api_key, + } + response = requests.request("POST", + "https://api.pipedrive.com/v1/" + "webhooks", + headers=headers, data=payload, + params=params, + timeout=10) + if not response.json()['success']: + if 'error' in response.json().keys(): + raise ValidationError( + response.json()['error']) + if 'message' in response.json().keys(): + raise ValidationError( + response.json()['message']) + if event_object == 'person': + self.contact_webhook = True + elif event_object == 'product': + self.product_webhook = True + + def export_leads_to_pipedrive(self): + """Export Leads from Odoo to Pipedrive""" + for lead in self.env['crm.lead'].search( + [('pipedrive_reference', '=', False), + ('partner_id', '!=', False)]): + if not lead.partner_id.pipedrive_reference: + self.create_contact(lead.partner_id) + data = { + 'title': lead.name, + 'person_id': int(lead.partner_id.pipedrive_reference), + 'value': { + 'amount': lead.expected_revenue, + 'currency': self.env.company.currency_id.name + } + } + response = requests.post( + url='https://api.pipedrive.com/v1/leads', + params={ + 'api_token': self.api_key, + }, json=data, timeout=10) + if not response.json()['success']: + raise ValidationError( + response.json()['error'] + '. ' + response.json()[ + 'error_info']) + lead.write( + {'pipedrive_reference': response.json()['data']['id']}) diff --git a/odoo_pipedrive_connector/models/res_partner.py b/odoo_pipedrive_connector/models/res_partner.py new file mode 100755 index 000000000..42fa7379b --- /dev/null +++ b/odoo_pipedrive_connector/models/res_partner.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Unnimaya C O (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +import json +import requests +from odoo import fields, models +from odoo.exceptions import ValidationError + + +class ResPartner(models.Model): + """Inherits Res Users for including Pipedrive fields and functions""" + _inherit = 'res.partner' + + pipedrive_reference = fields.Char(string='Pipedrive Id', + help="Pipedrive Id of the Partner") + + def write(self, vals): + """Inherited to update the partner details in Pipedrive""" + data = {} + if 'name' in vals.keys(): + data['name'] = vals['name'] + if 'email' in vals.keys(): + data['email'] = [{'value': vals['email'], 'primary': True}] + if 'phone' in vals.keys(): + data['phone'] = [{'value': vals['phone'], 'primary': True}] + if self.pipedrive_reference and data: + headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + } + response = requests.put( + url=f'https://api.pipedrive.com/v1/persons/' + f'{self.pipedrive_reference}', + params={ + 'api_token': self.env.user.company_id.api_key, + }, timeout=10, headers=headers, data=json.dumps(data)) + if 'error' in response.json().keys(): + raise ValidationError( + response.json()['error']) + return super().write(vals) + + def unlink(self): + """Inherited to delete the partner from Pipedrive""" + if self.pipedrive_reference: + headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + } + response = requests.delete( + url=f'https://api.pipedrive.com/v1/persons/' + f'{self.pipedrive_reference}', + params={ + 'api_token': self.env.user.company_id.api_key, + }, timeout=10, headers=headers) + if 'error' in response.json().keys(): + raise ValidationError( + response.json()['error']) + return super().unlink() diff --git a/odoo_pipedrive_connector/static/description/assets/icons/check.png b/odoo_pipedrive_connector/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/check.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/chevron.png b/odoo_pipedrive_connector/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/chevron.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/cogs.png b/odoo_pipedrive_connector/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/cogs.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/consultation.png b/odoo_pipedrive_connector/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/consultation.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/ecom-black.png b/odoo_pipedrive_connector/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/ecom-black.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/education-black.png b/odoo_pipedrive_connector/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/education-black.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/hotel-black.png b/odoo_pipedrive_connector/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/hotel-black.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/license.png b/odoo_pipedrive_connector/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/license.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/lifebuoy.png b/odoo_pipedrive_connector/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/lifebuoy.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/logo.png b/odoo_pipedrive_connector/static/description/assets/icons/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/logo.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/manufacturing-black.png b/odoo_pipedrive_connector/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/manufacturing-black.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/pos-black.png b/odoo_pipedrive_connector/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/pos-black.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/puzzle.png b/odoo_pipedrive_connector/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/puzzle.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/restaurant-black.png b/odoo_pipedrive_connector/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/restaurant-black.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/service-black.png b/odoo_pipedrive_connector/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/service-black.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/trading-black.png b/odoo_pipedrive_connector/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/trading-black.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/training.png b/odoo_pipedrive_connector/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/training.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/update.png b/odoo_pipedrive_connector/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/update.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/user.png b/odoo_pipedrive_connector/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/user.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/icons/wrench.png b/odoo_pipedrive_connector/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/icons/wrench.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/modules/agriculture.png b/odoo_pipedrive_connector/static/description/assets/modules/agriculture.png new file mode 100755 index 000000000..bb6d60e85 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/modules/agriculture.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/modules/hospital.png b/odoo_pipedrive_connector/static/description/assets/modules/hospital.png new file mode 100755 index 000000000..187ab1e5e Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/modules/hospital.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/modules/project_dashboard.png b/odoo_pipedrive_connector/static/description/assets/modules/project_dashboard.png new file mode 100755 index 000000000..c46f55b75 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/modules/project_dashboard.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/modules/shopify.png b/odoo_pipedrive_connector/static/description/assets/modules/shopify.png new file mode 100755 index 000000000..288227618 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/modules/shopify.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/modules/systray.png b/odoo_pipedrive_connector/static/description/assets/modules/systray.png new file mode 100755 index 000000000..e67ae8c93 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/modules/systray.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/modules/woocomp_connector.png b/odoo_pipedrive_connector/static/description/assets/modules/woocomp_connector.png new file mode 100755 index 000000000..4bec075eb Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/modules/woocomp_connector.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot.png new file mode 100755 index 000000000..1795d94c5 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot0.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot0.png new file mode 100755 index 000000000..06b255e9c Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot0.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot1.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot1.png new file mode 100755 index 000000000..fc16d5871 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot1.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot10.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot10.png new file mode 100755 index 000000000..e1b47742f Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot10.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot11.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot11.png new file mode 100755 index 000000000..b7a3abd17 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot11.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot12.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot12.png new file mode 100755 index 000000000..7b1a7ad23 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot12.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot13.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot13.png new file mode 100755 index 000000000..0b784685b Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot13.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot14.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot14.png new file mode 100755 index 000000000..95ea76805 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot14.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot15.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot15.png new file mode 100755 index 000000000..11a0e4668 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot15.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot16.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot16.png new file mode 100755 index 000000000..7f551d860 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot16.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot17.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot17.png new file mode 100755 index 000000000..2c9f4c261 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot17.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot18.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot18.png new file mode 100755 index 000000000..4a91f10f5 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot18.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot19.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot19.png new file mode 100755 index 000000000..ab76cf943 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot19.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot2.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot2.png new file mode 100755 index 000000000..da4bd30f2 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot2.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot20.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot20.png new file mode 100755 index 000000000..c826376a6 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot20.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot21.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot21.png new file mode 100755 index 000000000..f5233982b Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot21.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot22.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot22.png new file mode 100755 index 000000000..2a25163dc Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot22.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot23.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot23.png new file mode 100755 index 000000000..fb6d0865f Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot23.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot24.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot24.png new file mode 100755 index 000000000..5700060a1 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot24.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot25.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot25.png new file mode 100755 index 000000000..0571614dd Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot25.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot3.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot3.png new file mode 100755 index 000000000..5811ae598 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot3.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot4.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot4.png new file mode 100755 index 000000000..fdd692259 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot4.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot5.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot5.png new file mode 100755 index 000000000..bf3259dac Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot5.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot6.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot6.png new file mode 100755 index 000000000..8550f6beb Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot6.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot7.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot7.png new file mode 100755 index 000000000..5f7eb95c2 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot7.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot8.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot8.png new file mode 100755 index 000000000..1e1635086 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot8.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot9.png b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot9.png new file mode 100755 index 000000000..9c538baaa Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/Screenshot9.png differ diff --git a/odoo_pipedrive_connector/static/description/assets/screenshots/hero.gif b/odoo_pipedrive_connector/static/description/assets/screenshots/hero.gif new file mode 100755 index 000000000..e2f1e2691 Binary files /dev/null and b/odoo_pipedrive_connector/static/description/assets/screenshots/hero.gif differ diff --git a/odoo_pipedrive_connector/static/description/banner.jpg b/odoo_pipedrive_connector/static/description/banner.jpg new file mode 100755 index 000000000..d14f71a0f Binary files /dev/null and b/odoo_pipedrive_connector/static/description/banner.jpg differ diff --git a/odoo_pipedrive_connector/static/description/icon.png b/odoo_pipedrive_connector/static/description/icon.png new file mode 100755 index 000000000..cc8ccb96a Binary files /dev/null and b/odoo_pipedrive_connector/static/description/icon.png differ diff --git a/odoo_pipedrive_connector/static/description/index.html b/odoo_pipedrive_connector/static/description/index.html new file mode 100755 index 000000000..297274df9 --- /dev/null +++ b/odoo_pipedrive_connector/static/description/index.html @@ -0,0 +1,783 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+
+
+

+ Odoo Pipedrive Connector

+

+ Integrate Contacts, Products and Leads between Pipedrive and + Odoo +

+ +
+
+ +
+
+

+ Overview +

+
+
+

+ This module helps to successfully import all products, + contacts and leads between Pipedrive to Odoo. Also, it is + possible to export all these data from Odoo to Pipedrive. + All import and export operations can be performed in a single + button click. + Please note that this feature is only supported on secure (HTTPS) URLs. + +

+
+
+
+
+

+ Features +

+
+
+
+ +
+
+

+ Exports all Products, Contacts and Leads from Odoo to + Pipedrive

+
+
+
+
+ +
+
+

+ Imports all Products, Contacts and Leads from Pipedrive to + Odoo

+
+
+
+
+ +
+
+

+ Sync Product updates and deletions between Pipedrive and + Odoo.

+
+
+
+
+ +
+
+

+ Sync Contact updates and deletions between Pipedrive and + Odoo.

+
+
+
+
+ +
+
+

+ Sync Lead updates and deletions from Odoo to Pipedrive.

+
+
+
+
+ +
+
+ +
+

+ Create Token

+

+ Click on your profile picture at the right corner. Select the + option Personal preferences. Under API tab, you can see + Your personal API token.

+ +
+
+

+ Create new Product in Pipedrive

+ +
+
+

+ Import Product

+

+ Add Token, check Import Product and click EXECUTE. +

+ +
+
+

+ Imported Product in Odoo

+ +
+
+

+ Create a Person in Pipedrive

+ +
+
+

+ Import Contact

+

+ Add Token, check Import Contact and click EXECUTE. +

+ +
+
+

+ Imported Contact in Odoo

+ +
+
+

+ Create a Lead in Pipedrive

+ +
+
+

+ Import Lead

+

+ Add Token, check Import Lead and click EXECUTE. +

+ +
+
+

+ Imported Lead in Odoo

+ +
+
+

+ Export Product +

+

+ Add Token, check Export Product and click EXECUTE. +

+ +
+
+

+ Exported Products in Pipedrive

+ +
+
+

+ Export Contact +

+

+ Add Token, check Export Contact and click EXECUTE. +

+ +
+
+

+ Exported Contacts in Pipedrive

+ +
+
+

+ Export Lead +

+

+ Add Token, check Export Lead and click EXECUTE. +

+ +
+
+

+ Exported Leads in Pipedrive

+ +
+
+

+ Update Product Name from Odoo

+ +
+
+

+ Product Name updated in Pipedrive

+ +
+
+

+ Product UNIT PRICE updated from Pipedrive

+

+ Since Odoo utilizes various types of taxes that are not + represented as simple numerical values, while Pipedrive provides + tax information as numerical values, synchronizing tax updates + for products from Pipedrive to Odoo is currently not feasible +

+ +
+
+

+ Product Sales Price updated in Odoo

+ +
+
+

+ Contact's Email updated from Odoo

+ +
+
+

+ Contact's Email updated in Pipedrive.

+ +
+
+

+ Contact's Name updated from Pipedrive

+ +
+
+

+ Contact's Name updated in Odoo.

+ +
+
+

+ Updated the Expected Revenue of Lead from Odoo

+

+ Due to the lack of webhook support for leads in Pipedrive, + synchronizing lead updates from Pipedrive to Odoo is currently + not feasible +

+ +
+
+

+ Updated the Value of Lead updated from Odoo

+ +
+
+
+ +
+
+

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?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + + diff --git a/odoo_pipedrive_connector/views/res_company_views.xml b/odoo_pipedrive_connector/views/res_company_views.xml new file mode 100755 index 000000000..05e8810ec --- /dev/null +++ b/odoo_pipedrive_connector/views/res_company_views.xml @@ -0,0 +1,37 @@ + + + + + + res.company.view.form.inherit.odoo.pipedrive.connector + + + res.company + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_button_visibility/static/src/xml/RefundButton.xml b/pos_button_visibility/static/src/xml/RefundButton.xml new file mode 100644 index 000000000..4a27d426f --- /dev/null +++ b/pos_button_visibility/static/src/xml/RefundButton.xml @@ -0,0 +1,18 @@ + + + + + + + + +
+ + Refund +
+
+
+
+
diff --git a/pos_button_visibility/static/src/xml/RewardButton.xml b/pos_button_visibility/static/src/xml/RewardButton.xml new file mode 100644 index 000000000..2ac01b33e --- /dev/null +++ b/pos_button_visibility/static/src/xml/RewardButton.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + Reward + + + + + + diff --git a/pos_button_visibility/views/res_users_views.xml b/pos_button_visibility/views/res_users_views.xml new file mode 100644 index 000000000..0b0d5bd83 --- /dev/null +++ b/pos_button_visibility/views/res_users_views.xml @@ -0,0 +1,21 @@ + + + + + res.users.view.form.inherit.pos.button.visibility + res.users + + + + + + + + + + + + + + + diff --git a/pos_category_wise_receipt/README.rst b/pos_category_wise_receipt/README.rst new file mode 100644 index 000000000..9ba7c50aa --- /dev/null +++ b/pos_category_wise_receipt/README.rst @@ -0,0 +1,59 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +POS Category Wise Receipt +========================= +This module aims to print category-wise receipts for products ordered from Point of Sale. + +Features +======== +* The receipt shows category wise products and subtotal of each category. + +Installation +============ +Just select it from available modules to install, there is no need of extra installations. + +Configuration +============= +Nothing to configure. + +License +------- +Lesser General Public License, Version 3 (LGPL v3) +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +======= +* Developers : (V9) Anusha, + (V12) Akshay Babu, + (V14) Aysha Shalin, + (V15) Aysha Shalin, + (V16) Vishnu K P + 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/pos_category_wise_receipt/__init__.py b/pos_category_wise_receipt/__init__.py new file mode 100644 index 000000000..50d6fc95b --- /dev/null +++ b/pos_category_wise_receipt/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. + +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Aysha Shalin() + +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################## diff --git a/pos_category_wise_receipt/__manifest__.py b/pos_category_wise_receipt/__manifest__.py new file mode 100644 index 000000000..6a923b21b --- /dev/null +++ b/pos_category_wise_receipt/__manifest__.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Aysha Shalin() +# +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'POS Category Wise Receipt', + 'version': '15.0.1.0.0', + 'category': 'Point of Sale', + 'summary': 'Category wise receipt for Point of Sale', + 'description': """This module aims to print category-wise receipts for + products ordered from Point of Sale.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "http://www.cybrosys.com", + 'depends': ['point_of_sale'], + 'assets': { + 'web.assets_backend': [ + 'pos_category_wise_receipt/static/src/js/Screens/ReceiptScreen/OrderReceipt.js', + ], + 'web.assets_qweb': [ + 'pos_category_wise_receipt/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_category_wise_receipt/doc/RELEASE_NOTES.md b/pos_category_wise_receipt/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..70a88c1d5 --- /dev/null +++ b/pos_category_wise_receipt/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 28.11.2023 +#### Version 15.0.1.0.0 +#### ADD +- Initial Commit for POS Category Wise Receipt diff --git a/pos_category_wise_receipt/static/description/assets/icons/check.png b/pos_category_wise_receipt/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/check.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/chevron.png b/pos_category_wise_receipt/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/chevron.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/cogs.png b/pos_category_wise_receipt/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/cogs.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/consultation.png b/pos_category_wise_receipt/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/consultation.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/ecom-black.png b/pos_category_wise_receipt/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/ecom-black.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/education-black.png b/pos_category_wise_receipt/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/education-black.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/hotel-black.png b/pos_category_wise_receipt/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/hotel-black.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/license.png b/pos_category_wise_receipt/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/license.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/lifebuoy.png b/pos_category_wise_receipt/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/logo.png b/pos_category_wise_receipt/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/logo.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/manufacturing-black.png b/pos_category_wise_receipt/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/pos-black.png b/pos_category_wise_receipt/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/pos-black.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/puzzle.png b/pos_category_wise_receipt/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/puzzle.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/restaurant-black.png b/pos_category_wise_receipt/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/service-black.png b/pos_category_wise_receipt/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/service-black.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/trading-black.png b/pos_category_wise_receipt/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/trading-black.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/training.png b/pos_category_wise_receipt/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/training.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/update.png b/pos_category_wise_receipt/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/update.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/user.png b/pos_category_wise_receipt/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/user.png differ diff --git a/pos_category_wise_receipt/static/description/assets/icons/wrench.png b/pos_category_wise_receipt/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/icons/wrench.png differ diff --git a/pos_category_wise_receipt/static/description/assets/misc/categories.png b/pos_category_wise_receipt/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/misc/categories.png differ diff --git a/pos_category_wise_receipt/static/description/assets/misc/check-box.png b/pos_category_wise_receipt/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/misc/check-box.png differ diff --git a/pos_category_wise_receipt/static/description/assets/misc/compass.png b/pos_category_wise_receipt/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/misc/compass.png differ diff --git a/pos_category_wise_receipt/static/description/assets/misc/corporate.png b/pos_category_wise_receipt/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/misc/corporate.png differ diff --git a/pos_category_wise_receipt/static/description/assets/misc/customer-support.png b/pos_category_wise_receipt/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/misc/customer-support.png differ diff --git a/pos_category_wise_receipt/static/description/assets/misc/cybrosys-logo.png b/pos_category_wise_receipt/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/misc/cybrosys-logo.png differ diff --git a/pos_category_wise_receipt/static/description/assets/misc/features.png b/pos_category_wise_receipt/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/misc/features.png differ diff --git a/pos_category_wise_receipt/static/description/assets/misc/logo.png b/pos_category_wise_receipt/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/misc/logo.png differ diff --git a/pos_category_wise_receipt/static/description/assets/misc/pictures.png b/pos_category_wise_receipt/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/misc/pictures.png differ diff --git a/pos_category_wise_receipt/static/description/assets/misc/pie-chart.png b/pos_category_wise_receipt/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/misc/pie-chart.png differ diff --git a/pos_category_wise_receipt/static/description/assets/misc/right-arrow.png b/pos_category_wise_receipt/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/misc/right-arrow.png differ diff --git a/pos_category_wise_receipt/static/description/assets/misc/star.png b/pos_category_wise_receipt/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/misc/star.png differ diff --git a/pos_category_wise_receipt/static/description/assets/misc/support.png b/pos_category_wise_receipt/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/misc/support.png differ diff --git a/pos_category_wise_receipt/static/description/assets/misc/whatsapp.png b/pos_category_wise_receipt/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/misc/whatsapp.png differ diff --git a/pos_category_wise_receipt/static/description/assets/modules/combo_product_image.png b/pos_category_wise_receipt/static/description/assets/modules/combo_product_image.png new file mode 100644 index 000000000..0d5f7d7f7 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/modules/combo_product_image.png differ diff --git a/pos_category_wise_receipt/static/description/assets/modules/credit_limit_image.png b/pos_category_wise_receipt/static/description/assets/modules/credit_limit_image.png new file mode 100644 index 000000000..994ef0d2c Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/modules/credit_limit_image.png differ diff --git a/pos_category_wise_receipt/static/description/assets/modules/custom_receipts.png b/pos_category_wise_receipt/static/description/assets/modules/custom_receipts.png new file mode 100644 index 000000000..478ff1fe3 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/modules/custom_receipts.png differ diff --git a/pos_category_wise_receipt/static/description/assets/modules/order_types_image.png b/pos_category_wise_receipt/static/description/assets/modules/order_types_image.png new file mode 100644 index 000000000..518a5cae4 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/modules/order_types_image.png differ diff --git a/pos_category_wise_receipt/static/description/assets/modules/product_add_ons.png b/pos_category_wise_receipt/static/description/assets/modules/product_add_ons.png new file mode 100644 index 000000000..6b199d4fc Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/modules/product_add_ons.png differ diff --git a/pos_category_wise_receipt/static/description/assets/modules/serial_number_validator.png b/pos_category_wise_receipt/static/description/assets/modules/serial_number_validator.png new file mode 100644 index 000000000..f244581a8 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/modules/serial_number_validator.png differ diff --git a/pos_category_wise_receipt/static/description/assets/screenshots/hero.png b/pos_category_wise_receipt/static/description/assets/screenshots/hero.png new file mode 100644 index 000000000..b548e3dc3 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/screenshots/hero.png differ diff --git a/pos_category_wise_receipt/static/description/assets/screenshots/pos1.png b/pos_category_wise_receipt/static/description/assets/screenshots/pos1.png new file mode 100644 index 000000000..5fb6c74e3 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/screenshots/pos1.png differ diff --git a/pos_category_wise_receipt/static/description/assets/screenshots/pos2.png b/pos_category_wise_receipt/static/description/assets/screenshots/pos2.png new file mode 100644 index 000000000..0392d3873 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/screenshots/pos2.png differ diff --git a/pos_category_wise_receipt/static/description/assets/screenshots/pos3.png b/pos_category_wise_receipt/static/description/assets/screenshots/pos3.png new file mode 100644 index 000000000..51d149898 Binary files /dev/null and b/pos_category_wise_receipt/static/description/assets/screenshots/pos3.png differ diff --git a/pos_category_wise_receipt/static/description/banner.png b/pos_category_wise_receipt/static/description/banner.png new file mode 100644 index 000000000..53ff42471 Binary files /dev/null and b/pos_category_wise_receipt/static/description/banner.png differ diff --git a/pos_category_wise_receipt/static/description/icon.png b/pos_category_wise_receipt/static/description/icon.png new file mode 100644 index 000000000..ffae083af Binary files /dev/null and b/pos_category_wise_receipt/static/description/icon.png differ diff --git a/pos_category_wise_receipt/static/description/index.html b/pos_category_wise_receipt/static/description/index.html new file mode 100644 index 000000000..1fb33e5b8 --- /dev/null +++ b/pos_category_wise_receipt/static/description/index.html @@ -0,0 +1,583 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + + +
+

+ POS Category Wise Receipt

+

+ Print Category Wise Receipt

+ + +
+
+ + +
+
+ +
+

+ Explore This Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module is used to generate category wise receipt +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Community & Enterprise Support +

+ Available in Odoo 15.0 Community and Enterprise

+
+
+ + Category Wise Receipt +

+ Category wise receipts of selected products by users.

+
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Choose Products you want to buy

+

+ From here you can choose the products randomly as per your + needs.

+ +
+
+

+ Click on Payment Button goes here

+

+ After choosing the product click on the Payment button below, + further choose the payment method and click on the Validate + button.

+ +
+
+

+ Category Wise Receipt goes here

+

+ On clicking Validate button it leads to the receipt page, + here we can see category wise receipt.

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

+ 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/pos_category_wise_receipt/static/src/js/Screens/ReceiptScreen/OrderReceipt.js b/pos_category_wise_receipt/static/src/js/Screens/ReceiptScreen/OrderReceipt.js new file mode 100644 index 000000000..f8b749643 --- /dev/null +++ b/pos_category_wise_receipt/static/src/js/Screens/ReceiptScreen/OrderReceipt.js @@ -0,0 +1,24 @@ +odoo.define('pos_category_wise_receipt.receipt', function(require) { + 'use strict'; +// Extending OrderReceipt for printing category wise receipts of products + const OrderReceipt =require('point_of_sale.OrderReceipt'); + const Registries = require('point_of_sale.Registries'); + const CategoryOrderReceipt = OrderReceipt => + class extends OrderReceipt { + get orderlines() { + var order_lines = this.receiptEnv.orderlines; + var categ = { + 'category': [], + 'orderlines': order_lines + } + for (var i = 0; i <= order_lines.length - 1; i++){ + if(!categ.category.includes(order_lines[i].product.pos_categ_id[1])){ + categ.category.push(order_lines[i].product.pos_categ_id[1]); + } + } + return categ; + } + } + Registries.Component.extend(OrderReceipt, CategoryOrderReceipt); + return OrderReceipt; +}); diff --git a/pos_category_wise_receipt/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml b/pos_category_wise_receipt/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml new file mode 100644 index 000000000..fc888f74b --- /dev/null +++ b/pos_category_wise_receipt/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml @@ -0,0 +1,58 @@ + + + + + +
+ + + + +

+

+ +

+

+ + + + + + + + +
+ + + + + +
+ With a + % + discount +
+
+ +
+ + x + +
+
+
+ + + +
+ Subtotal + +
+
+
+
+
+
diff --git a/website_multi_product_return_management/README.rst b/website_multi_product_return_management/README.rst new file mode 100644 index 000000000..bf7a3f721 --- /dev/null +++ b/website_multi_product_return_management/README.rst @@ -0,0 +1,44 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Multi Product Return From Website +================================= +* Manage Sale Order return from Website and can see in backend and manage return orders. + +Configuration +============= +* No additional configuration required + +Company +------- +`Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License, version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: (V15) Bhagyadev kp, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there +if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com +This module is maintained by Cybrosys Technologies. +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/website_multi_product_return_management/__init__.py b/website_multi_product_return_management/__init__.py new file mode 100644 index 000000000..5b3278a7f --- /dev/null +++ b/website_multi_product_return_management/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Bhagyadev K 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 +from . import controllers diff --git a/website_multi_product_return_management/__manifest__.py b/website_multi_product_return_management/__manifest__.py new file mode 100644 index 000000000..f58168982 --- /dev/null +++ b/website_multi_product_return_management/__manifest__.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Bhagyadev K 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': 'Multi Product Return From Website', + 'version': '15.0.1.0.0', + 'category': 'Website', + 'summary': 'Sale Order Multi product Return Management from Website', + 'description': """Website Multi product Return Order Management, + Website Return, Order Return, RMA, Website RMA""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['website_sale', 'stock', 'sale_management', 'portal'], + 'data': [ + 'security/ir.model.access.csv', + 'data/website_multi_product_return_management_data.xml', + 'views/website_thankyou_template.xml', + 'views/sale_return_views.xml', + 'views/website_portal_templates.xml', + 'views/sale_order_views.xml', + 'views/res_partner_views.xml', + 'views/stock_picking_views.xml', + 'report/website_multi_product_return_management_reports.xml' + ], + 'assets': { + 'web.assets_frontend': [ + '/website_multi_product_return_management/static/src/js/sale_return.js', + ] + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/website_multi_product_return_management/controllers/__init__.py b/website_multi_product_return_management/controllers/__init__.py new file mode 100644 index 000000000..73c56af48 --- /dev/null +++ b/website_multi_product_return_management/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Bhagyadev K 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 main +from . import portal diff --git a/website_multi_product_return_management/controllers/main.py b/website_multi_product_return_management/controllers/main.py new file mode 100644 index 000000000..67b8d7fc8 --- /dev/null +++ b/website_multi_product_return_management/controllers/main.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Bhagyadev K 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 datetime import datetime +from odoo.addons.web.controllers import main +from odoo import http +from odoo.http import request + + +class CustomerRegistration(main.Home): + @http.route('/sale_return', type='json', csrf=False, auth="public", website=True) + def sale_return(self, **kwargs, ): + """Controller to create return order""" + if kwargs.get('vals'): + lines = [] + so_id = False + for line in kwargs.get('vals'): + so_id = request.env['sale.order'].sudo().search( + [('id', '=', int(line['order_id']))]) + qty = int(line['quantity']) + d_qty = int(line['deli_qty']) + reason = line['reason'] + if qty > 0: + lines.append((0, 0, {'product_id': line['product_id'], + 'received_qty': qty, + 'quantity': d_qty, + 'reason': reason + })) + if so_id: + values = { + 'partner_id': so_id.partner_id.id, + 'sale_order_id': so_id.id, + 'user_id': request.env.uid, + 'create_date': datetime.now(), + 'return_line_ids': lines + } + stock_picks = request.env['stock.picking'].sudo().search( + [('origin', '=', so_id.name)]) + moves = stock_picks.mapped( + 'move_ids_without_package').sudo().filtered( + lambda p: p.product_id.id == line['product_id']) + if moves: + moves = moves.sorted('product_uom_qty', reverse=True) + values.update({'state': 'draft'}) + ret_order = request.env['sale.return'].sudo().create(values) + moves[0].picking_id.return_order_id = ret_order.id + moves[0].picking_id.return_order_picking = False + return True + return False + + @http.route('/my/request-thank-you', website=True, page=True, + auth='public', csrf=False) + def maintenance_request_thanks(self): + """Controller to redirect to the success page when return order + submitted successfully""" + return request.render( + 'website_multi_product_return_management.' + 'customers_request_thank_page') diff --git a/website_multi_product_return_management/controllers/portal.py b/website_multi_product_return_management/controllers/portal.py new file mode 100644 index 000000000..1425e1531 --- /dev/null +++ b/website_multi_product_return_management/controllers/portal.py @@ -0,0 +1,159 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Bhagyadev K 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 . +################################################################################ +import base64 +from collections import OrderedDict +from odoo.exceptions import AccessError, MissingError +from odoo import http +from odoo.http import request +from odoo.tools import image_process +from odoo.tools.translate import _ +from odoo.addons.portal.controllers.portal import CustomerPortal +from odoo.addons.web.controllers.main import Binary + + +class ReturnCustomerPortal(CustomerPortal): + + def _prepare_home_portal_values(self, counters): + """ Add return details to main account page """ + values = super()._prepare_home_portal_values(counters) + partner = request.env.user.partner_id + if 'return_count' in counters: + if request.env.user.has_group('base.group_portal'): + values['return_count'] = request.env[ + 'sale.return'].search_count([ + ('state', 'in', ['draft', 'confirm', 'done', 'cancel']), + ('partner_id', '=', partner.id)]) + elif request.env.user.has_group('base.group_system'): + values['return_count'] = request.env[ + 'sale.return'].search_count([ + ('state', 'in', ['draft', 'confirm', 'done', 'cancel'])]) + else: + values['return_count'] = request.env[ + 'sale.return'].search_count( + ['|', ('partner_id', '=', partner.id), + ('user_id', '=', request.env.user.id)]) + return values + + @http.route(['/my/return_orders', '/my/return_orders/page/'], + type='http', auth="user", website=True) + def portal_my_sale_return(self, page=1, date_begin=None, date_end=None, + sortby=None, filterby=None, **kw): + """ My orders function """ + values = self._prepare_portal_layout_values() + sale_return = request.env['sale.return'] + partner = request.env.user.partner_id + if request.env.user.has_group('base.group_portal'): + domain = [ + ('partner_id', '=', partner.id) + ] + elif request.env.user.has_group('base.group_system'): + domain = [] + else: + domain = ['|', ('partner_id', '=', partner.id), + ('user_id', '=', request.env.user.id)] + searchbar_sortings = { + 'date': {'label': _('Newest'), 'order': 'create_date desc'}, + 'name': {'label': _('Name'), 'order': 'name'}, + 'sale': {'label': _('Sale Order'), 'order': 'sale_order_id'}, + } + if not sortby: + sortby = 'date' + order = searchbar_sortings[sortby]['order'] + if date_begin and date_end: + domain += [('create_date', '>', date_begin), + ('create_date', '<=', date_end)] + searchbar_filters = { + 'all': {'label': _('All'), 'domain': [ + ('state', 'in', ['draft', 'confirm', 'done', 'cancel'])]}, + 'confirm': {'label': _('Confirmed'), + 'domain': [('state', '=', 'confirm')]}, + 'cancel': {'label': _('Cancelled'), + 'domain': [('state', '=', 'cancel')]}, + 'done': {'label': _('Done'), 'domain': [('state', '=', 'done')]}, + } + # default filter by value + if not filterby: + filterby = 'all' + domain += searchbar_filters[filterby]['domain'] + return_count = sale_return.sudo().search_count(domain) + # pager + pager = request.website.pager( + url="/my/return_orders", + url_args={'date_begin': date_begin, 'date_end': date_end, + 'sortby': sortby}, + total=return_count, + page=page, + step=self._items_per_page + ) + # content according to pager and archive selected + orders = sale_return.sudo().search(domain, order=order, + limit=self._items_per_page, + offset=pager['offset']) + request.session['my_return_history'] = orders.ids[:100] + values.update({ + 'date': date_begin, + 'orders': orders.sudo(), + 'page_name': 'Sale_Return', + 'default_url': '/my/return_orders', + 'pager': pager, + 'searchbar_filters': OrderedDict(sorted(searchbar_filters.items())), + 'searchbar_sortings': searchbar_sortings, + 'sortby': sortby, + }) + return request.render( + "website_multi_product_return_management.portal_my_returns", values) + + @http.route(['/my/return_orders/'], type='http', + auth="public", website=True) + def portal_my_return_detail(self, order_id=None, access_token=None + , report_type=None, download=False, **kw): + """ + Function for return details in portal + """ + try: + order_sudo = self._document_check_access('sale.return', order_id, + access_token) + except (AccessError, MissingError): + return request.redirect('/my') + if report_type in ('html', 'pdf', 'text'): + return self._show_report(model=order_sudo, report_type=report_type, + report_ref='website_multi_product_return_management.' + 'report_sale_returns', + download=download) + values = self._sale_return_get_page_view_values(order_sudo, + access_token, **kw) + return request.render( + "website_multi_product_return_management.portal_sale_return_page", + values) + + def _sale_return_get_page_view_values(self, order, access_token, **kwargs): + """Function to get values of the sale return""" + def resize_to_48(b64source): + if not b64source: + b64source = base64.b64encode(Binary.placeholder()) + return image_process(b64source, size=(48, 48)) + + values = { + 'orders': order, + 'resize_to_48': resize_to_48, + } + return self._get_page_view_values(order, access_token, values, + 'my_return_history', False, **kwargs) diff --git a/website_multi_product_return_management/data/website_multi_product_return_management_data.xml b/website_multi_product_return_management/data/website_multi_product_return_management_data.xml new file mode 100644 index 000000000..b50b2d6dc --- /dev/null +++ b/website_multi_product_return_management/data/website_multi_product_return_management_data.xml @@ -0,0 +1,13 @@ + + + + + + Sale Return + sale.return + RET + 5 + + + + diff --git a/website_multi_product_return_management/doc/RELEASE_NOTES.md b/website_multi_product_return_management/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..90536efaf --- /dev/null +++ b/website_multi_product_return_management/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 10.11.2023 +#### Version 15.0.1.0.0 +#### ADD + +- Initial commit for Multi Product Return From Website diff --git a/website_multi_product_return_management/models/__init__.py b/website_multi_product_return_management/models/__init__.py new file mode 100644 index 000000000..d560afbbb --- /dev/null +++ b/website_multi_product_return_management/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Bhagyadev K 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 res_partner +from . import sale_return +from . import return_order_line +from . import sale_order +from . import stock_picking +from . import stock_return_picking diff --git a/website_multi_product_return_management/models/res_partner.py b/website_multi_product_return_management/models/res_partner.py new file mode 100644 index 000000000..9c4d79a1b --- /dev/null +++ b/website_multi_product_return_management/models/res_partner.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Bhagyadev K 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 fields, models + + +class ResPartner(models.Model): + """inheriting res_partner model to set return orders """ + _inherit = 'res.partner' + + return_order_count = fields.Integer(compute="_compute_returns", + string='Return Orders', + help="Number of return orders") + + def _compute_returns(self): + """Function to calculate the return count""" + all_partners = (self.with_context(active_test=False).sudo(). + search([('id', 'child_of', self.ids)])) + all_partners.read(['parent_id']) + sale_return_groups = self.env['sale.return'].sudo().read_group( + domain=[('partner_id', '=', all_partners.ids)], + fields=['partner_id'], groupby=['partner_id']) + partners = self.sudo().browse() + for group in sale_return_groups: + partner = self.browse(group['partner_id'][0]) + while partner: + if partner in self: + partner.return_order_count += group['partner_id_count'] + partners |= partner + partner = partner.parent_id + (self - partners).return_order_count = 0 + + def action_open_returns(self): + """This function returns an action that displays the sale return orders + from partner.""" + + action = self.env['ir.actions.act_window']._for_xml_id( + 'website_multi_product_return_management.sale_return_action') + domain = [] + if self.is_company: + domain.append(('partner_id.commercial_partner_id.id', '=', self.id)) + else: + domain.append(('partner_id.id', '=', self.id)) + action['domain'] = domain + action['context'] = {'search_default_customer': 1} + return action diff --git a/website_multi_product_return_management/models/return_order_line.py b/website_multi_product_return_management/models/return_order_line.py new file mode 100644 index 000000000..f1dd2d961 --- /dev/null +++ b/website_multi_product_return_management/models/return_order_line.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Bhagyadev K 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 api, fields, models + + +class ReturnOrderLine(models.Model): + """creating model for return order lines""" + _name = 'return.order.line' + _description = "return products Details" + + order_id = fields.Many2one("sale.return", string="Order", + help="Orders") + product_id = fields.Many2one('product.product', + string="Product Variant", required=True, + help="Defines the product variant that need to" + " be returned") + product_tmpl_id = fields.Many2one('product.template', + related="product_id.product_tmpl_id", + store=True, string="Product", + help="Product") + quantity = fields.Float(string="Delivered Quantity", store=True, + help="product quantity") + received_qty = fields.Float(string="Received Quantity", + help="Received quantity") + reason = fields.Text("Reason", help="Reason for returning the product") + to_refund = fields.Boolean(string='Update SO/PO Quantity', + help='Trigger a decrease of the' + ' delivered/received quantity in the ' + 'associated Sale Order/Purchase Order') + + @api.onchange('product_id') + def _onchange_product_id(self): + """ setting up domain for products as per the products in the + vendor price list""" + self.ensure_one() + if self._context.get('order_id'): + order_id = self.env['sale.order'].browse( + self._context.get('order_id')) + products = order_id.order_line.mapped('product_id').ids + if self.product_id: + dqty = sum( + order_id.order_line.filtered( + lambda p: p.product_id == self.product_id).mapped( + 'qty_delivered')) + self.quantity = dqty + return {'domain': {'product_id': [('id', 'in', products)]}} diff --git a/website_multi_product_return_management/models/sale_order.py b/website_multi_product_return_management/models/sale_order.py new file mode 100644 index 000000000..d6d4ff16b --- /dev/null +++ b/website_multi_product_return_management/models/sale_order.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Bhagyadev K 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 fields, models + + +class SaleOrder(models.Model): + """inheriting sale_order model to set return orders """ + _inherit = 'sale.order' + + return_order_count = fields.Integer(string='Return Orders', + compute="_compute_returns", + help="Number of return orders") + + def _compute_returns(self): + """method to compute return count""" + sale_return_groups = self.env['sale.return'].sudo().read_group( + domain=[('sale_order_id', '=', self.ids)], + fields=['sale_order_id'], groupby=['sale_order_id']) + orders = self.sudo().browse() + for group in sale_return_groups: + sale_order = self.sudo().browse(group['sale_order_id'][0]) + while sale_order: + if sale_order in self: + sale_order.return_order_count += group['sale_order_id_count'] + orders |= sale_order + sale_order = False + (self - orders).return_order_count = 0 + + def action_open_returns(self): + """This function returns an action that displays the sale return orders + from sale order""" + action = self.env['ir.actions.act_window']._for_xml_id( + 'website_multi_product_return_management.sale_return_action') + domain = [('sale_order_id', '=', self.id)] + action['domain'] = domain + action['context'] = {'search_default_order': 1} + return action diff --git a/website_multi_product_return_management/models/sale_return.py b/website_multi_product_return_management/models/sale_return.py new file mode 100644 index 000000000..12afc7f40 --- /dev/null +++ b/website_multi_product_return_management/models/sale_return.py @@ -0,0 +1,246 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Bhagyadev K 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 api, fields, models + + +class ReturnOrder(models.Model): + """Creating model for returning order""" + _name = 'sale.return' + _inherit = ['portal.mixin'] + _rec_name = "name" + _order = "name" + _description = "Return Order" + + @api.model + def _get_default_name(self): + """Used the default name for the return order""" + return self.env['ir.sequence'].get('sale.return') + + active = fields.Boolean(string='Active', default=True, help='Active') + name = fields.Char(string="Name", default=_get_default_name, + help='Name of order') + sale_order_id = fields.Many2one('sale.order', string="Sale Order", + required=True, help='Correspondent sale order') + partner_id = fields.Many2one('res.partner', string="Customer", + help='Partner of return order') + user_id = fields.Many2one('res.users', string="Responsible", + default=lambda self: self.env.user, + help="User of the order") + create_date = fields.Datetime(string="Create Date", + help="Create date of the order") + stock_picking_ids = fields.One2many('stock.picking', + 'return_order_pick_id', + domain="[('return_order_id','=',False)]", + string="Return Picking", + help="Shows the return picking of the" + " corresponding return order") + picking_count = fields.Integer(compute="_compute_delivery", + string='Picking Order', + copy=False, default=0, store=True, + help="Number of pickings") + delivery_count = fields.Integer(compute="_compute_delivery", + string='Delivery Order', copy=False, + default=0, store=True, + help="Number of delivery") + state = fields.Selection([('draft', 'Draft'), ('confirm', 'Confirm'), + ('done', 'Done'), ('cancel', 'Canceled')], + string='Status', readonly=True, default='draft', + help="State of the return order") + source_pick_ids = fields.One2many('stock.picking', 'return_order_id', + string="Source Delivery", + domain="[('return_order_pick_id','=',False)]", + help="Shows the delivery orders of the" + " corresponding return order") + note = fields.Text("Note", help="Note to display") + return_line_ids = fields.One2many('return.order.line', + 'order_id', + string="Return Lines", + help="Return order lines") + + def action_return_confirm(self): + """Confirm the sale return""" + if not self.source_pick_ids: + stock_picks = self.env['stock.picking'].sudo().search([('origin', '=', self.sale_order_id.name)]) + moves = stock_picks.mapped('move_ids_without_package').sudo().filtered( + lambda p: p.product_id.id in self.return_line_ids.mapped('product_id').ids) + else: + moves = self.source_pick_ids.mapped('move_ids_without_package').sudo().filtered( + lambda p: p.product_id.id in self.return_line_ids.mapped('product_id').ids) + if moves: + moves = moves.sorted('product_uom_qty', reverse=True) + pick = moves[0].picking_id + vals = {'picking_id': pick.id} + return_pick_wizard = self.env['stock.return.picking'].sudo().create(vals) + return_pick_wizard._onchange_picking_id() + return_pick_wizard.product_return_moves.unlink() + lines = [] + reason = '' + for line in self.return_line_ids: + move = moves.filtered(lambda m:m.product_id == line.product_id) + lines.append( + {'product_id': line.product_id.id, "quantity": line.received_qty, + 'move_id': move.id, 'to_refund': line.to_refund}) + reason = reason + '\n' + line.reason + lines = self.env['stock.return.picking.line'].create(lines) + return_pick_wizard.write({ + 'product_return_moves': [(6, 0, lines.ids)] + }) + return_pick = return_pick_wizard._create_returns() + if return_pick: + return_pick = self.env['stock.picking'].sudo().browse(return_pick[0]) + return_pick.update({'note': reason}) + return_pick.write({'return_order_id': False, 'return_order_pick_id': self.id, 'return_order_picking': True}) + self.write({'state': 'confirm'}) + + def action_return_cancel(self): + """Cancel the return""" + self.write({'state': 'cancel'}) + if self.stock_picking_ids: + for rec in self.stock_picking_ids.sudo().filtered(lambda s: s.state not in ['done', 'cancel']): + rec.action_cancel() + + def _get_report_base_filename(self): + """setting the file name""" + self.ensure_one() + return 'Sale Return - %s' % (self.name) + + def _compute_access_url(self): + """access url""" + super(ReturnOrder, self)._compute_access_url() + for order in self: + order.access_url = '/my/return_orders/%s' % order.id + + @api.depends('stock_picking_ids', 'state') + def _compute_delivery(self): + """Function to compute picking and delivery counts""" + for rec in self: + rec.delivery_count = 0 + rec.picking_count = 0 + if rec.source_pick_ids: + rec.delivery_count = len(rec.source_pick_ids) + else: + rec.delivery_count = self.env[ + 'stock.picking'].sudo().search_count( + [('return_order_id', 'in', self.ids), + ('return_order_picking', '=', False)]) + if rec.stock_picking_ids: + rec.picking_count = len(rec.stock_picking_ids) + else: + rec.picking_count = self.env[ + 'stock.picking'].sudo().search_count( + [('return_order_pick_id', 'in', self.ids), + ('return_order_picking', '=', True)]) + + def action_view_picking(self): + """Function to view the stock picking transfers""" + action = self.env["ir.actions.actions"]._for_xml_id( + "stock.action_picking_tree_all") + pickings = self.mapped('stock_picking_ids') + if not self.stock_picking_ids: + pickings = self.env['stock.picking'].sudo().search( + [('return_order_pick_id', '=', self.id), + ('return_order_picking', '=', True)]) + if len(pickings) > 1: + action['domain'] = [('id', 'in', pickings.ids)] + elif pickings: + form_view = [(self.env.ref('stock.view_picking_form').id, 'form')] + if 'views' in action: + action['views'] = form_view + [(state, view) for state, view + in action['views'] if view != 'form'] + else: + action['views'] = form_view + action['res_id'] = pickings.id + # Prepare the context. + picking_id = pickings.sudo().filtered( + lambda l: l.picking_type_id.code == 'outgoing') + if picking_id: + picking_id = picking_id[0] + else: + picking_id = pickings[0] + action['context'] = dict(self._context, + default_partner_id=self.partner_id.id, + default_picking_type_id=picking_id. + picking_type_id.id) + return action + + def action_view_delivery(self): + """Function to view the delivery transfers""" + action = self.env["ir.actions.actions"]._for_xml_id( + "stock.action_picking_tree_all") + pickings = self.mapped('source_pick_ids') + if not self.source_pick_ids: + pickings = self.env['stock.picking'].sudo().search( + [('return_order_id', '=', self.id), + ('return_order_picking', '=', False)]) + if len(pickings) > 1: + action['domain'] = [('id', 'in', pickings.ids)] + elif pickings: + form_view = [(self.env.ref('stock.view_picking_form').id, 'form')] + if 'views' in action: + action['views'] = form_view + [(state, view) for state, view in + action['views'] if + view != 'form'] + else: + action['views'] = form_view + action['res_id'] = pickings.id + # Prepare the context. + picking_id = pickings.filtered( + lambda l: l.picking_type_id.code == 'outgoing') + if picking_id: + picking_id = picking_id[0] + else: + picking_id = pickings[0] + action['context'] = dict(self._context, + default_partner_id=self.partner_id.id, + default_picking_type_id=picking_id. + picking_type_id.id) + return action + + @api.onchange('sale_order_id', 'source_pick_ids') + def _onchange_sale_order_id(self): + """All the fields are updated according to the sale order""" + delivery = None + if self.sale_order_id: + self.partner_id = self.sale_order_id.partner_id + delivery = self.env['stock.picking'].sudo().search( + [('origin', '=', self.sale_order_id.name)]) + if self.source_pick_ids: + delivery = self.source_pick_ids + if delivery: + product_ids = delivery.move_ids_without_package.mapped( + 'product_id').ids + delivery = delivery.ids + else: + product_ids = self.sale_order_id.order_line.mapped('product_id').ids + + return {'domain': {'source_pick_ids': [('id', 'in', delivery)], + 'product_id': [('id', 'in', product_ids)]}} + + @api.onchange('product_id') + def _onchange_product_id(self): + """Update the received quantity based on the selected product and source + pick.""" + if self.product_id and self.source_pick_ids: + moves = self.source_pick_ids.mapped( + 'move_ids_without_package').sudo().filtered( + lambda p: p.product_id == self.product_id) + if moves: + self.received_qty = sum(moves.mapped('quantity_done')) diff --git a/website_multi_product_return_management/models/stock_picking.py b/website_multi_product_return_management/models/stock_picking.py new file mode 100644 index 000000000..e31bffdd0 --- /dev/null +++ b/website_multi_product_return_management/models/stock_picking.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Bhagyadev K 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 fields, models + + +class StockPicking(models.Model): + """Inheriting stock_picking model for validating the return order""" + _inherit = 'stock.picking' + + return_order_id = fields.Many2one('sale.return', + string='Return order', + help="Shows the return order of current" + " transfer") + return_order_pick_id = fields.Many2one('sale.return', + string='Return order Pick', + help="Shows the return order picking" + " of current return order") + return_order_picking = fields.Boolean(string='Return order picking', + help="Helps to identify delivery and" + " return picking, if true the " + "transfer is return picking" + " else delivery") + + def button_validate(self): + """Validating the stock picking and update the return order""" + res = super(StockPicking, self).button_validate() + for rec in self: + if rec.return_order_pick_id: + if any(line.state != 'done' for line in + rec.return_order_pick_id.stock_picking_ids): + return res + else: + rec.return_order_pick_id.write({'state': 'done'}) + return res diff --git a/website_multi_product_return_management/models/stock_return_picking.py b/website_multi_product_return_management/models/stock_return_picking.py new file mode 100644 index 000000000..d017eb024 --- /dev/null +++ b/website_multi_product_return_management/models/stock_return_picking.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Bhagyadev K 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 + + +class StockReturnPicking(models.TransientModel): + """Inheriting stock_return_picking model for creating returns""" + _inherit = 'stock.return.picking' + + def _create_returns(self): + """create returns""" + new_picking, pick_type_id = (super(StockReturnPicking, self). + _create_returns()) + picking = self.env['stock.picking'].browse(new_picking) + if self.picking_id.return_order_id: + picking.write({'return_order_picking': False, + 'return_order_id': False, + 'return_order_pick_id': self.picking_id.return_order_id.id}) + self.picking_id.return_order_id.write({'state': 'confirm'}) + return new_picking, pick_type_id diff --git a/website_multi_product_return_management/report/website_multi_product_return_management_reports.xml b/website_multi_product_return_management/report/website_multi_product_return_management_reports.xml new file mode 100644 index 000000000..9b432ba77 --- /dev/null +++ b/website_multi_product_return_management/report/website_multi_product_return_management_reports.xml @@ -0,0 +1,78 @@ + + + + + + Sale Return + sale.return + qweb-pdf + website_multi_product_return_management.report_salereturn + website_multi_product_return_management.report_salereturn + 'Sale Retun - %s' % object.name + + report + + + + + + + diff --git a/website_multi_product_return_management/security/ir.model.access.csv b/website_multi_product_return_management/security/ir.model.access.csv new file mode 100644 index 000000000..03c1be82e --- /dev/null +++ b/website_multi_product_return_management/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_sale_return_user,access.sale.return.user,model_sale_return,base.group_user,1,1,1,1 +access_sale_return_line_user,access.sale.return.line.user,model_return_order_line,base.group_user,1,1,1,1 diff --git a/website_multi_product_return_management/static/description/assets/icons/check.png b/website_multi_product_return_management/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/check.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/chevron.png b/website_multi_product_return_management/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/chevron.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/cogs.png b/website_multi_product_return_management/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/cogs.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/consultation.png b/website_multi_product_return_management/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/consultation.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/ecom-black.png b/website_multi_product_return_management/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/ecom-black.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/education-black.png b/website_multi_product_return_management/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/education-black.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/hotel-black.png b/website_multi_product_return_management/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/hotel-black.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/license.png b/website_multi_product_return_management/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/license.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/lifebuoy.png b/website_multi_product_return_management/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/lifebuoy.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/logo.png b/website_multi_product_return_management/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/logo.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/manufacturing-black.png b/website_multi_product_return_management/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/manufacturing-black.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/pos-black.png b/website_multi_product_return_management/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/pos-black.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/puzzle.png b/website_multi_product_return_management/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/puzzle.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/restaurant-black.png b/website_multi_product_return_management/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/restaurant-black.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/service-black.png b/website_multi_product_return_management/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/service-black.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/trading-black.png b/website_multi_product_return_management/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/trading-black.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/training.png b/website_multi_product_return_management/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/training.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/update.png b/website_multi_product_return_management/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/update.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/user.png b/website_multi_product_return_management/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/user.png differ diff --git a/website_multi_product_return_management/static/description/assets/icons/wrench.png b/website_multi_product_return_management/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/icons/wrench.png differ diff --git a/website_multi_product_return_management/static/description/assets/misc/categories.png b/website_multi_product_return_management/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/misc/categories.png differ diff --git a/website_multi_product_return_management/static/description/assets/misc/check-box.png b/website_multi_product_return_management/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/misc/check-box.png differ diff --git a/website_multi_product_return_management/static/description/assets/misc/compass.png b/website_multi_product_return_management/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/misc/compass.png differ diff --git a/website_multi_product_return_management/static/description/assets/misc/corporate.png b/website_multi_product_return_management/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/misc/corporate.png differ diff --git a/website_multi_product_return_management/static/description/assets/misc/customer-support.png b/website_multi_product_return_management/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/misc/customer-support.png differ diff --git a/website_multi_product_return_management/static/description/assets/misc/cybrosys-logo.png b/website_multi_product_return_management/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/misc/cybrosys-logo.png differ diff --git a/website_multi_product_return_management/static/description/assets/misc/features.png b/website_multi_product_return_management/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/misc/features.png differ diff --git a/website_multi_product_return_management/static/description/assets/misc/logo.png b/website_multi_product_return_management/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/misc/logo.png differ diff --git a/website_multi_product_return_management/static/description/assets/misc/pictures.png b/website_multi_product_return_management/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/misc/pictures.png differ diff --git a/website_multi_product_return_management/static/description/assets/misc/pie-chart.png b/website_multi_product_return_management/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/misc/pie-chart.png differ diff --git a/website_multi_product_return_management/static/description/assets/misc/right-arrow.png b/website_multi_product_return_management/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/misc/right-arrow.png differ diff --git a/website_multi_product_return_management/static/description/assets/misc/star.png b/website_multi_product_return_management/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/misc/star.png differ diff --git a/website_multi_product_return_management/static/description/assets/misc/support.png b/website_multi_product_return_management/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/misc/support.png differ diff --git a/website_multi_product_return_management/static/description/assets/misc/whatsapp.png b/website_multi_product_return_management/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/misc/whatsapp.png differ diff --git a/website_multi_product_return_management/static/description/assets/modules/module_1.png b/website_multi_product_return_management/static/description/assets/modules/module_1.png new file mode 100644 index 000000000..61235b3a2 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/modules/module_1.png differ diff --git a/website_multi_product_return_management/static/description/assets/modules/module_2.png b/website_multi_product_return_management/static/description/assets/modules/module_2.png new file mode 100644 index 000000000..ec4ea42e5 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/modules/module_2.png differ diff --git a/website_multi_product_return_management/static/description/assets/modules/module_3.png b/website_multi_product_return_management/static/description/assets/modules/module_3.png new file mode 100644 index 000000000..73839c854 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/modules/module_3.png differ diff --git a/website_multi_product_return_management/static/description/assets/modules/module_4.png b/website_multi_product_return_management/static/description/assets/modules/module_4.png new file mode 100644 index 000000000..642ffc693 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/modules/module_4.png differ diff --git a/website_multi_product_return_management/static/description/assets/modules/module_5.png b/website_multi_product_return_management/static/description/assets/modules/module_5.png new file mode 100644 index 000000000..8ed055142 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/modules/module_5.png differ diff --git a/website_multi_product_return_management/static/description/assets/modules/module_6.png b/website_multi_product_return_management/static/description/assets/modules/module_6.png new file mode 100644 index 000000000..2c27f88df Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/modules/module_6.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/1.png b/website_multi_product_return_management/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..be900238c Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/1.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/10.png b/website_multi_product_return_management/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..ee6e6bb06 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/10.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/11.png b/website_multi_product_return_management/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..adb82c505 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/11.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/12.png b/website_multi_product_return_management/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..811936594 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/12.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/13.png b/website_multi_product_return_management/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..fecf3a349 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/13.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/14.png b/website_multi_product_return_management/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..2115a52f9 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/14.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/15.png b/website_multi_product_return_management/static/description/assets/screenshots/15.png new file mode 100644 index 000000000..cc2f469fa Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/15.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/2.png b/website_multi_product_return_management/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..6800f680a Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/2.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/3.png b/website_multi_product_return_management/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..d52fc67b5 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/3.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/4.png b/website_multi_product_return_management/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..4d37eab36 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/4.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/5.png b/website_multi_product_return_management/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..bb2125b3e Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/5.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/6.png b/website_multi_product_return_management/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..8648aabca Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/6.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/7.png b/website_multi_product_return_management/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..87dc1371e Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/7.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/8.png b/website_multi_product_return_management/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..c17f847b4 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/8.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/9.png b/website_multi_product_return_management/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..50c4b6fc8 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/9.png differ diff --git a/website_multi_product_return_management/static/description/assets/screenshots/hero.gif b/website_multi_product_return_management/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..a19535976 Binary files /dev/null and b/website_multi_product_return_management/static/description/assets/screenshots/hero.gif differ diff --git a/website_multi_product_return_management/static/description/banner.jpg b/website_multi_product_return_management/static/description/banner.jpg new file mode 100644 index 000000000..18dbfcb67 Binary files /dev/null and b/website_multi_product_return_management/static/description/banner.jpg differ diff --git a/website_multi_product_return_management/static/description/icon.png b/website_multi_product_return_management/static/description/icon.png new file mode 100644 index 000000000..5cb9d3219 Binary files /dev/null and b/website_multi_product_return_management/static/description/icon.png differ diff --git a/website_multi_product_return_management/static/description/index.html b/website_multi_product_return_management/static/description/index.html new file mode 100644 index 000000000..257ca9810 --- /dev/null +++ b/website_multi_product_return_management/static/description/index.html @@ -0,0 +1,676 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo sh +
+
+
+ +
+
+
+ +

+ Multi Product Return From Website

+

+ Manage Sale Order return from Website

+ + +
+
+
+
F + +
+
+ +
+

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module allows to create and manage sale order return from website. + The logged user can create multiple product return from website. The + Authorize persons can manage the return orders. And allow the portal + users can view their return orders from the account portal view. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Create Return Orders From Website +
+
+
+
+ + Portal Return Order View +
+
+
+
+ + Link Return With Sale Order +
+
+
+
+ + Link Return Order With Partner +
+
+
+
+ + Return Order report +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

Return Button on Order Page on Portal.

+ +
+
+

Return Product Screen.

+ +
+
+

Return Orders in Portal for View.

+ +
+
+

Return Orders tree view in Portal.

+ +
+
+

Return Orders detailed view in Portal.

+ +
+
+

Return Orders - Backend

+ +
+
+

Return Orders form view in backend.

+ +
+
+

Delivery Order Tab and Smart button

+ +
+
+

Return Process on DO picking.

+ +
+
+

Delivery Order Return Button.

+ +
+
+

Delivery Order Return Wizard(Odoo Standard).

+ +
+
+

Return Picking Order Tab and Smart button.

+ +
+
+

Smart Button on Customer Form.

+ +
+
+

Smart Button on Sale Order Form

+ +
+
+

Return Orders - Report Sample.

+ +
+
+
+ + + +
+
+

Suggested Products

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

+ Our Services +

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

+ Our + Industries +

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

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

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

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

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

+ An + all-inclusive + hotel management application

+
+
+
+
+ + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/website_multi_product_return_management/static/src/js/sale_return.js b/website_multi_product_return_management/static/src/js/sale_return.js new file mode 100644 index 000000000..7cb7262d7 --- /dev/null +++ b/website_multi_product_return_management/static/src/js/sale_return.js @@ -0,0 +1,59 @@ +odoo.define('website_multi_product_return_management.return', function (require) { + "use strict"; + var publicWidget = require('web.public.widget'); + var ajax = require('web.ajax'); +// Modal hiding and showing in button click + $("#hidden_box_btn").on('click', function () { + $('#hidden_box').modal('show'); + }) + $("#close-button").on('click', function () { + $('#hidden_box').modal('hide'); + }) +// Adding return quantity and it's details + $(".js_add_json").on('click', function (ev) { + var $link = $(ev.currentTarget); + var $input = $link.closest('.input-group').find("input"); + var min = parseFloat($input.data("min") || 0); + var max = parseFloat($input.data("max") || Infinity); + var previousQty = parseFloat($input.val() || 0, 10); + var quantity = ($link.has(".fa-minus").length ? -1 : 1) + previousQty; + var newQty = quantity > min ? (quantity < max ? quantity : max) : min; + if (newQty !== previousQty) { + $input.val(newQty).trigger('change'); + } + return false; + }) +// Form submit function + $('#sale_return_form').on('submit', function(submission) { + var val = [] + submission.preventDefault(); + $("tr.order_line").each(function() { + var qty = parseFloat($(this).find(".quantity").val() || 0); + if (qty !== 0){ + val.push({ 'order_id' : $(this).find(".quantity").data("order-id"), + 'line_id' : $(this).find(".quantity").data("line-id"), + 'deli_qty' : $(this).find(".quantity").data("delivered_qty"), + 'quantity' : $(this).find(".quantity").val(), + 'product_id' : $(this).find(".quantity").data('product-id'), + 'reason' : $(this).find("#return_reason").val()}); + } + }); + if (val.length !== 0){ + ajax.jsonRpc('/sale_return', 'call', { + 'vals':val, + }).then(function(result){ + if (result == true){ + window.location.href = '/my/request-thank-you'; + + } + else{ + alert("Retry again"); + } + }); + } + else{ + alert("Please specify at least one return quantity"); + submission.preventDefault(); + } + }); +}); diff --git a/website_multi_product_return_management/views/res_partner_views.xml b/website_multi_product_return_management/views/res_partner_views.xml new file mode 100644 index 000000000..c1544c941 --- /dev/null +++ b/website_multi_product_return_management/views/res_partner_views.xml @@ -0,0 +1,19 @@ + + + + + res.partner.view.form.inherit.website.multi.product.return.management + res.partner + + + + + + + + + diff --git a/website_multi_product_return_management/views/sale_order_views.xml b/website_multi_product_return_management/views/sale_order_views.xml new file mode 100644 index 000000000..27ebc2f3d --- /dev/null +++ b/website_multi_product_return_management/views/sale_order_views.xml @@ -0,0 +1,18 @@ + + + + + sale.order.view.form.inherit.website.multi.product.return.management + sale.order + + + + + + + + diff --git a/website_multi_product_return_management/views/sale_return_views.xml b/website_multi_product_return_management/views/sale_return_views.xml new file mode 100644 index 000000000..9bdc25047 --- /dev/null +++ b/website_multi_product_return_management/views/sale_return_views.xml @@ -0,0 +1,123 @@ + + + + + sale.return.view.form + sale.return + 100 + +
+
+
+ +
+ + +
+
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + sale.return.view.tree + sale.return + + + + + + + + + + + + + + sale.return.view.search + sale.return + + + + + + + + + + + + + + + + + + Sale Return + sale.return + tree,form + + +

Create The First Return +

+
+
+ + +
diff --git a/website_multi_product_return_management/views/stock_picking_views.xml b/website_multi_product_return_management/views/stock_picking_views.xml new file mode 100644 index 000000000..163ce6395 --- /dev/null +++ b/website_multi_product_return_management/views/stock_picking_views.xml @@ -0,0 +1,16 @@ + + + + + stock.picking.view.form.inherit.website.multi.product.return.management + stock.picking + + + + + + + + + + diff --git a/website_multi_product_return_management/views/website_portal_templates.xml b/website_multi_product_return_management/views/website_portal_templates.xml new file mode 100644 index 000000000..e34393dcf --- /dev/null +++ b/website_multi_product_return_management/views/website_portal_templates.xml @@ -0,0 +1,343 @@ + + +