diff --git a/employee_creation_from_user/__manifest__.py b/employee_creation_from_user/__manifest__.py index ed3544e55..0e51ef8e3 100644 --- a/employee_creation_from_user/__manifest__.py +++ b/employee_creation_from_user/__manifest__.py @@ -24,7 +24,7 @@ 'name': 'Employees From User', 'version': '10.0.1.0.0', 'summary': 'This module automatically creates while creating user', - 'description': 'This module helps you to create employees automatically while creating user', + 'description': 'This module helps you to create employees automatically while creating users', 'category': 'Human Resources', 'author': 'Cybrosys Techno Solutions', 'website': 'http://www.cybrosys.com', diff --git a/employee_creation_from_user/__manifest__.py~ b/employee_creation_from_user/__manifest__.py~ index 06f0ddca1..ed3544e55 100644 --- a/employee_creation_from_user/__manifest__.py~ +++ b/employee_creation_from_user/__manifest__.py~ @@ -23,8 +23,8 @@ { 'name': 'Employees From User', 'version': '10.0.1.0.0', - 'summary': 'This module Automatically Create Employees From User', - 'description': 'This module helps you to create employees automatically from user', + 'summary': 'This module automatically creates while creating user', + 'description': 'This module helps you to create employees automatically while creating user', 'category': 'Human Resources', 'author': 'Cybrosys Techno Solutions', 'website': 'http://www.cybrosys.com', diff --git a/product_deletion/__init__.py b/product_deletion/__init__.py new file mode 100644 index 000000000..8de993dba --- /dev/null +++ b/product_deletion/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Niyas Raphy() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import models diff --git a/product_deletion/__manifest__.py b/product_deletion/__manifest__.py new file mode 100644 index 000000000..7e1f48594 --- /dev/null +++ b/product_deletion/__manifest__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Niyas Raphy() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'Product Removal Authorisation', + 'summary': """Users in the Group "Product Deletion" Can Only Delete the Products""", + 'version': '10.0.1.0', + 'description': """Permission to delete the product""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'http://www.cybrosys.com', + 'category': 'Warehouse', + 'depends': ['base', 'product'], + 'license': 'LGPL-3', + 'data': [ + 'views/product_deletion_group.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'installable': True, + 'auto_install': False, +} diff --git a/product_deletion/models/__init__.py b/product_deletion/models/__init__.py new file mode 100644 index 000000000..1eb02e313 --- /dev/null +++ b/product_deletion/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Niyas Raphy() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import product_deletion diff --git a/product_deletion/models/product_deletion.py b/product_deletion/models/product_deletion.py new file mode 100644 index 000000000..4e3b5a322 --- /dev/null +++ b/product_deletion/models/product_deletion.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Niyas Raphy() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo import models, api, _ +from odoo.exceptions import Warning + + +class ProductDeletion(models.Model): + _inherit = 'product.template' + + @api.multi + @api.model + def unlink(self, default=None): + res_user = self.env['res.users'].search([('id', '=', self._uid)]) + if not res_user.has_group('product_deletion.product_deletion_group'): + raise Warning(_( + "You cannot delete the product(s). Please contact the System Administrator")) + + diff --git a/product_deletion/static/description/banner.jpg b/product_deletion/static/description/banner.jpg new file mode 100644 index 000000000..1b584bfda Binary files /dev/null and b/product_deletion/static/description/banner.jpg differ diff --git a/product_deletion/static/description/cybro_logo.png b/product_deletion/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/product_deletion/static/description/cybro_logo.png differ diff --git a/product_deletion/static/description/deletion_warning.png b/product_deletion/static/description/deletion_warning.png new file mode 100644 index 000000000..7a56f304e Binary files /dev/null and b/product_deletion/static/description/deletion_warning.png differ diff --git a/product_deletion/static/description/icon.png b/product_deletion/static/description/icon.png new file mode 100644 index 000000000..08b687c4b Binary files /dev/null and b/product_deletion/static/description/icon.png differ diff --git a/product_deletion/static/description/index.html b/product_deletion/static/description/index.html new file mode 100644 index 000000000..8d092a5c7 --- /dev/null +++ b/product_deletion/static/description/index.html @@ -0,0 +1,48 @@ +
+
+

Product Removal Authorisation

+

Users having the permission can only delete the products

+

Author : Cybrosys Techno Solutions , www.cybrosys.com

+
+
+ +
+
+

Product Form

+
+

+ ☛ Only users in the group Product Deletion can delete the product.
+ ☛ If user is not in the group Odoo will raise a warning message.
+

+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/product_deletion/views/product_deletion_group.xml b/product_deletion/views/product_deletion_group.xml new file mode 100644 index 000000000..2e03d7674 --- /dev/null +++ b/product_deletion/views/product_deletion_group.xml @@ -0,0 +1,10 @@ + + + + + + Product Deletion + + + + \ No newline at end of file