@ -0,0 +1,51 @@ |
|||||
|
.. 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 |
||||
|
|
||||
|
Customer/Supplier Approval |
||||
|
========================== |
||||
|
* This module allows users to validate or approve customers/vendors |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
* Add users to the three user groups |
||||
|
- Allow Validate Partner: can create and validate contacts |
||||
|
- Allow Approval Partner: can approve the validated contacts |
||||
|
- Administrator: can do both validation and approval of contacts |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
======= |
||||
|
GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) |
||||
|
(https://www.gnu.org/licenses/agpl.html) |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developer: |
||||
|
(V16) Ruksana P, |
||||
|
(V17) Anjhana A K, |
||||
|
(V18) Farook Al Ameen |
||||
|
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: `<static/description/index.html>`__ |
@ -0,0 +1,21 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Farook Al Ameen(<https://www.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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import models |
@ -0,0 +1,47 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Farook Al Ameen(<https://www.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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
'name': 'Customer/Supplier Approval', |
||||
|
'version': '18.0.1.0.0', |
||||
|
'category': 'Extra Tools', |
||||
|
'summary': """This module allows users to validate or approve contacts """, |
||||
|
'description': """By this module, you can grant access to users to |
||||
|
validate or approve partners. Then you will be able to select only |
||||
|
approved partners on sales orders, purchase orders, invoices, bills or |
||||
|
delivery orders.""", |
||||
|
'author': ' Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': "https://www.cybrosys.com", |
||||
|
'depends': [ 'contacts', 'stock', 'sale_management', 'account', |
||||
|
'purchase', ], |
||||
|
'data': [ |
||||
|
'security/customer_supplier_approval_groups.xml', |
||||
|
'security/ir.model.access.csv', |
||||
|
'views/res_partner_views.xml', |
||||
|
'views/account_move_views.xml', |
||||
|
], |
||||
|
'images': ['static/description/banner.gif'], |
||||
|
'license': 'AGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
## Module <customer_supplier_approval> |
||||
|
|
||||
|
#### 10.02.2025 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
##### ADD |
||||
|
- Initial Commit for Customer/Supplier Approval |
@ -0,0 +1,24 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Farook Al Ameen(<https://www.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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import purchase_order |
||||
|
from . import res_partner |
||||
|
from . import stock_picking |
||||
|
from . import sale_order |
@ -0,0 +1,30 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Farook Al Ameen(<https://www.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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class PurchaseOrder(models.Model): |
||||
|
"""Add domain value for field partner_id in purchase order model """ |
||||
|
_inherit = 'purchase.order' |
||||
|
|
||||
|
partner_id = fields.Many2one("res.partner", string='Vendor', |
||||
|
domain="[('state', '=', 'approved')]", |
||||
|
help="We can see the approved partner here") |
@ -0,0 +1,78 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Farook Al Ameen(<https://www.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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models, _ |
||||
|
from odoo.exceptions import ValidationError |
||||
|
|
||||
|
|
||||
|
class ResPartner(models.Model): |
||||
|
""" This class inherited to add some extra fields and functions in the |
||||
|
Partner """ |
||||
|
_inherit = 'res.partner' |
||||
|
|
||||
|
customer_supplier = fields.Char(string="Customer Supplier Id", |
||||
|
domain="[('state', '=', 'validated')]", |
||||
|
help="Unique id for partners") |
||||
|
is_hide_button = fields.Boolean(default=False, |
||||
|
string='Hide Approve Button', |
||||
|
help="TChecking the box enables to hide " |
||||
|
"the approve button") |
||||
|
is_hide_button_validate = fields.Boolean(default=False, |
||||
|
string='Hide Validate Button', |
||||
|
help="This boolean field is used " |
||||
|
"to hide the Validate button" |
||||
|
) |
||||
|
state = fields.Selection([('draft', 'Draft'), ('validated', 'Validated'), |
||||
|
('approved', 'Approved')], default='draft', |
||||
|
string='Status', |
||||
|
help="The status of contacts") |
||||
|
_sql_constraints = [ |
||||
|
('id_uniq', 'unique (customer_supplier)', 'The partner id unique !') |
||||
|
] |
||||
|
|
||||
|
def action_validate(self): |
||||
|
""" Method of button validate to validate customer or supplier """ |
||||
|
for rec in self: |
||||
|
rec.is_hide_button_validate = True |
||||
|
rec.write({'state': 'validated'}) |
||||
|
|
||||
|
def action_approve(self): |
||||
|
""" Method of button approve to approve customer or supplier """ |
||||
|
for rec in self: |
||||
|
rec.is_hide_button = True |
||||
|
rec.write({'state': 'approved'}) |
||||
|
|
||||
|
def write(self, values): |
||||
|
""" To raise validation error when validator changes the state""" |
||||
|
if 'state' in values: |
||||
|
new_state = values.get('state') |
||||
|
if new_state == 'approved' or self.state == 'approved': |
||||
|
if not self.env.user.has_group( |
||||
|
'customer_supplier_approval.' |
||||
|
'customer_supplier_approval_group_approval'): |
||||
|
raise ValidationError( |
||||
|
_("Only Manager can perform that move!")) |
||||
|
if new_state == 'validated' or self.state == 'draft': |
||||
|
if not self.env.user.has_group( |
||||
|
'customer_supplier_approval.' |
||||
|
'customer_supplier_approval_group_validation'): |
||||
|
raise ValidationError( |
||||
|
_("Only Managers can perform that move!")) |
||||
|
return super().write(values) |
@ -0,0 +1,30 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Farook Al Ameen(<https://www.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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class SaleOrder(models.Model): |
||||
|
""" Add domain value for inherited fields """ |
||||
|
_inherit = 'sale.order' |
||||
|
|
||||
|
partner_id = fields.Many2one("res.partner", string='Customer', |
||||
|
domain="[('state', '=', 'approved')]", |
||||
|
help="We can see the approved partner here") |
@ -0,0 +1,31 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Farook Al Ameen(<https://www.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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class StockPicking(models.Model): |
||||
|
""" Add domain value for inherited fields """ |
||||
|
_inherit = 'stock.picking' |
||||
|
|
||||
|
partner_id = fields.Many2one("res.partner", |
||||
|
string='Receive From', |
||||
|
domain="[('state', '=', 'approved')]", |
||||
|
help="We can see the approved partner here") |
@ -0,0 +1,33 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- Add new user group--> |
||||
|
<odoo> |
||||
|
<record model="ir.module.category" id="module_approval_validate"> |
||||
|
<field name="name">Partner Approval and Validation</field> |
||||
|
<field name="description">User access level for validating and |
||||
|
approving |
||||
|
</field> |
||||
|
<field name="sequence">10</field> |
||||
|
</record> |
||||
|
<!-- Validation group--> |
||||
|
<record id="customer_supplier_approval_group_validation" model="res.groups"> |
||||
|
<field name="name">Allow Validate Partner</field> |
||||
|
<field name="category_id" ref="module_approval_validate"/> |
||||
|
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/> |
||||
|
</record> |
||||
|
<!-- Approval group--> |
||||
|
<record id="customer_supplier_approval_group_approval" model="res.groups"> |
||||
|
<field name="name">Allow Approve Partner</field> |
||||
|
<field name="category_id" ref="module_approval_validate"/> |
||||
|
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/> |
||||
|
</record> |
||||
|
<!-- Admin group--> |
||||
|
<record id="customer_supplier_approval_group_admin" model="res.groups"> |
||||
|
<field name="name">Administrator</field> |
||||
|
<field name="category_id" ref="module_approval_validate"/> |
||||
|
<field name="implied_ids" |
||||
|
eval="[(4, ref('customer_supplier_approval.customer_supplier_approval_group_validation')), |
||||
|
(4, ref('customer_supplier_approval.customer_supplier_approval_group_approval'))]"/> |
||||
|
<field name="users" |
||||
|
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/> |
||||
|
</record> |
||||
|
</odoo> |
|
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 711 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 767 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 760 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 697 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 120 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 182 KiB |
After Width: | Height: | Size: 120 KiB |
After Width: | Height: | Size: 223 KiB |
After Width: | Height: | Size: 120 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 239 KiB |
After Width: | Height: | Size: 101 KiB |
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 764 KiB |
After Width: | Height: | Size: 47 KiB |