diff --git a/account_payment_approval/README.rst b/account_payment_approval/README.rst new file mode 100644 index 000000000..a6409daa8 --- /dev/null +++ b/account_payment_approval/README.rst @@ -0,0 +1,18 @@ +Payment Approval v15 +==================== +Enables to use the approval feature in customer and vendor payments. + +Installation +============ +No additional files neeeded. + +Configuration +============= + +No configurations needed. + +Credits +======= +Developer: v13.0 Mashood K U @ cybrosys, odoo@cybrosys.com + v14.0 Minhaj T @ cybrosys, odoo@cybrosys.com + v15.0 Mohammed Shahil M P T @ cybrosys, odoo@cybrosys.com diff --git a/account_payment_approval/__init__.py b/account_payment_approval/__init__.py new file mode 100644 index 000000000..f2c5a4636 --- /dev/null +++ b/account_payment_approval/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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_payment_approval/__manifest__.py b/account_payment_approval/__manifest__.py new file mode 100644 index 000000000..55464d363 --- /dev/null +++ b/account_payment_approval/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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': 'Payment Approvals', + 'version': '15.0.1.0.0', + 'category': 'Accounting', + 'summary': """ This modules enables approval feature in the payment.""", + 'description': """This modules enables approval feature in the payment. """, + 'author': ' Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['account'], + 'data': [ + 'views/res_config_settings_views.xml', + 'views/account_payment_view.xml', + ], + 'license': 'LGPL-3', + 'images': ['static/description/banner.png'], + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/account_payment_approval/doc/RELEASE_NOTES.md b/account_payment_approval/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..7e39bfd71 --- /dev/null +++ b/account_payment_approval/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 16.10.2021 +#### Version 15.0.1.0.0 +##### ADD +- Initial commit for Payment Approval diff --git a/account_payment_approval/models/__init__.py b/account_payment_approval/models/__init__.py new file mode 100644 index 000000000..ee06b56c8 --- /dev/null +++ b/account_payment_approval/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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_payment +from . import res_config_settings diff --git a/account_payment_approval/models/account_payment.py b/account_payment_approval/models/account_payment.py new file mode 100644 index 000000000..405c33916 --- /dev/null +++ b/account_payment_approval/models/account_payment.py @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 models, fields, _ +from odoo.exceptions import UserError, ValidationError + + +class AccountMove(models.Model): + _inherit = "account.move" + + state = fields.Selection( + selection_add=[('waiting_approval', 'Waiting For Approval'), + ('approved', 'Approved'), + ('rejected', 'Rejected')], + ondelete={'waiting_approval': 'set default', 'approved': 'set default', 'rejected': 'set default'}) + + +class AccountPayment(models.Model): + _inherit = "account.payment" + _inherits = {'account.move': 'move_id'} + + def _check_is_approver(self): + approval = self.env['ir.config_parameter'].sudo().get_param( + 'account_payment_approval.payment_approval') + approver_id = int(self.env['ir.config_parameter'].sudo().get_param( + 'account_payment_approval.approval_user_id')) + self.is_approver = True if self.env.user.id == approver_id and approval else False + + is_approver = fields.Boolean(compute=_check_is_approver, readonly=True) + + def action_post(self): + """Overwrites the _post() to validate the payment in the 'approved' stage too. + Currently Odoo allows payment posting only in draft stage. + """ + validation = self._check_payment_approval() + if validation: + if self.state not in ('draft', 'approved'): + raise UserError(_("Only a draft or approved payment can be posted.")) + + if any(inv.state != 'posted' for inv in self.reconciled_invoice_ids): + raise ValidationError(_("The payment cannot be processed because the invoice is not open!")) + self.move_id._post(soft=False) + + def _check_payment_approval(self): + if self.state == "draft": + first_approval = self.env['ir.config_parameter'].sudo().get_param( + 'account_payment_approval.payment_approval') + if first_approval: + amount = float(self.env['ir.config_parameter'].sudo().get_param( + 'account_payment_approval.approval_amount')) + payment_currency_id = int(self.env['ir.config_parameter'].sudo().get_param( + 'account_payment_approval.approval_currency_id')) + payment_amount = self.amount + if payment_currency_id: + if self.currency_id and self.currency_id.id != payment_currency_id: + currency_id = self.env['res.currency'].browse(payment_currency_id) + payment_amount = self.currency_id._convert( + self.amount, currency_id, self.company_id, + self.date or fields.Date.today(), round=True) + if payment_amount > amount: + self.write({ + 'state': 'waiting_approval' + }) + return False + return True + + def approve_transfer(self): + if self.is_approver: + self.write({ + 'state': 'approved' + }) + + def reject_transfer(self): + self.write({ + 'state': 'rejected' + }) diff --git a/account_payment_approval/models/res_config_settings.py b/account_payment_approval/models/res_config_settings.py new file mode 100644 index 000000000..a1f7cf040 --- /dev/null +++ b/account_payment_approval/models/res_config_settings.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + def _get_account_manager_ids(self): + user_ids = self.env['res.users'].search([]) + account_manager_ids = user_ids.filtered(lambda l: l.has_group('account.group_account_manager')) + return [('id', 'in', account_manager_ids.ids)] + + payment_approval = fields.Boolean('Payment Approval', config_parameter='account_payment_approval.payment_approval') + approval_user_id = fields.Many2one('res.users', string="Payment Approver", required=False, + domain=_get_account_manager_ids, + config_parameter='account_payment_approval.approval_user_id') + approval_amount = fields.Float( + 'Minimum Approval Amount', config_parameter='account_payment_approval.approval_amount', + help="If amount is 0.00, All the payments go through approval.") + approval_currency_id = fields.Many2one('res.currency', string='Approval Currency', + config_parameter='account_payment_approval.approval_currency_id', + help="Converts the payment amount to this currency if chosen.") diff --git a/account_payment_approval/static/description/banner.png b/account_payment_approval/static/description/banner.png new file mode 100644 index 000000000..f3038d908 Binary files /dev/null and b/account_payment_approval/static/description/banner.png differ diff --git a/account_payment_approval/static/description/icon.png b/account_payment_approval/static/description/icon.png new file mode 100644 index 000000000..c70b3b225 Binary files /dev/null and b/account_payment_approval/static/description/icon.png differ diff --git a/account_payment_approval/static/description/images/banner-account-bank-book.png b/account_payment_approval/static/description/images/banner-account-bank-book.png new file mode 100644 index 000000000..088d9be88 Binary files /dev/null and b/account_payment_approval/static/description/images/banner-account-bank-book.png differ diff --git a/account_payment_approval/static/description/images/banner-account-cash-book.jpg b/account_payment_approval/static/description/images/banner-account-cash-book.jpg new file mode 100644 index 000000000..b7a48f2f4 Binary files /dev/null and b/account_payment_approval/static/description/images/banner-account-cash-book.jpg differ diff --git a/account_payment_approval/static/description/images/banner-account-day-book.png b/account_payment_approval/static/description/images/banner-account-day-book.png new file mode 100644 index 000000000..a3fced2e6 Binary files /dev/null and b/account_payment_approval/static/description/images/banner-account-day-book.png differ diff --git a/account_payment_approval/static/description/images/banner-account-recurring-payment.png b/account_payment_approval/static/description/images/banner-account-recurring-payment.png new file mode 100644 index 000000000..d7ed02cc9 Binary files /dev/null and b/account_payment_approval/static/description/images/banner-account-recurring-payment.png differ diff --git a/account_payment_approval/static/description/images/banner-accounting-kit.gif b/account_payment_approval/static/description/images/banner-accounting-kit.gif new file mode 100644 index 000000000..30b746d7f Binary files /dev/null and b/account_payment_approval/static/description/images/banner-accounting-kit.gif differ diff --git a/account_payment_approval/static/description/images/banner-customer-follow-ups.png b/account_payment_approval/static/description/images/banner-customer-follow-ups.png new file mode 100644 index 000000000..e2b85a997 Binary files /dev/null and b/account_payment_approval/static/description/images/banner-customer-follow-ups.png differ diff --git a/account_payment_approval/static/description/images/checked.png b/account_payment_approval/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/account_payment_approval/static/description/images/checked.png differ diff --git a/account_payment_approval/static/description/images/cybrosys.png b/account_payment_approval/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/account_payment_approval/static/description/images/cybrosys.png differ diff --git a/account_payment_approval/static/description/images/payment-approval-01.png b/account_payment_approval/static/description/images/payment-approval-01.png new file mode 100644 index 000000000..3db56a830 Binary files /dev/null and b/account_payment_approval/static/description/images/payment-approval-01.png differ diff --git a/account_payment_approval/static/description/images/payment-approval-02.png b/account_payment_approval/static/description/images/payment-approval-02.png new file mode 100644 index 000000000..d2dcfcd06 Binary files /dev/null and b/account_payment_approval/static/description/images/payment-approval-02.png differ diff --git a/account_payment_approval/static/description/images/payment-approval-03.png b/account_payment_approval/static/description/images/payment-approval-03.png new file mode 100644 index 000000000..e487c1915 Binary files /dev/null and b/account_payment_approval/static/description/images/payment-approval-03.png differ diff --git a/account_payment_approval/static/description/images/payment-approval-04.png b/account_payment_approval/static/description/images/payment-approval-04.png new file mode 100644 index 000000000..43f668311 Binary files /dev/null and b/account_payment_approval/static/description/images/payment-approval-04.png differ diff --git a/account_payment_approval/static/description/images/payment-approval-05.png b/account_payment_approval/static/description/images/payment-approval-05.png new file mode 100644 index 000000000..55d033f77 Binary files /dev/null and b/account_payment_approval/static/description/images/payment-approval-05.png differ diff --git a/account_payment_approval/static/description/images/payment-approval-06.png b/account_payment_approval/static/description/images/payment-approval-06.png new file mode 100644 index 000000000..048232579 Binary files /dev/null and b/account_payment_approval/static/description/images/payment-approval-06.png differ diff --git a/account_payment_approval/static/description/images/payment-approval-07.png b/account_payment_approval/static/description/images/payment-approval-07.png new file mode 100644 index 000000000..764b7efce Binary files /dev/null and b/account_payment_approval/static/description/images/payment-approval-07.png differ diff --git a/account_payment_approval/static/description/index.html b/account_payment_approval/static/description/index.html new file mode 100644 index 000000000..896774a1d --- /dev/null +++ b/account_payment_approval/static/description/index.html @@ -0,0 +1,560 @@ +
+ cybrosys-logo
+
+
+
+

Payment Approval

+

Enables to use the approval feature in + customer and vendor payments. +

+
+

Key Highlights

+
    +
  • Approval stages in payments +
  • +
+
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ This module helps the accounting department to have a control over the payments. + It enables payment approval feature in the payment transaction. +

+
+
+ +

Dynamic Product Fields

+
+
    +
  • + + Approval stage in payment. +
  • +
  • + Can + Enable/disable payment approval from the settings. +
  • +
  • + Can + Approval feature can be applied based on the given amount. +
  • +
  • + Can + Currency wise amount specification. +
  • +
  • + Can + Quick access of the approval stages like Waiting For Approval, Approved, Rejected etc + from the filter window. +
  • + +
+
+ +
+
+

Screenshots

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

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

Our Industries

+
+ +
+
+
+
+ Odoo Industry
+
+
+

+ + Trading

+

+ Easily procure and sell your products.

+
+
+
+
+
+ Odoo Industry +
+
+
+

+ + Manufacturing

+

+ Plan, track and schedule your operations.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Restaurant

+

+ Run your bar or restaurant methodical.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + POS

+

+ Easy configuring and convivial selling.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + E-commerce & Website

+

+ Mobile friendly, awe-inspiring product pages.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Hotel Management

+

+ An all-inclusive hotel management application.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Education

+

+ A Collaborative platform for educational management.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + Service Management

+

+ Keep track of services and invoice accordingly.

+
+
+
+
+
+ +
+
+
+

Need Any Help?

+
+

If you have anything to share with us based on your use of this module, please + let us know. We are ready to offer our support.

+
+

Email us

+

odoo@cybrosys.com

+
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ \ No newline at end of file diff --git a/account_payment_approval/views/account_payment_view.xml b/account_payment_approval/views/account_payment_view.xml new file mode 100644 index 000000000..66b13f85a --- /dev/null +++ b/account_payment_approval/views/account_payment_view.xml @@ -0,0 +1,45 @@ + + + + account.payment.form + account.payment + + + +