Browse Source

[ADD] Initial Commit

pull/54/head
SHEREEF PT 8 years ago
parent
commit
bb100d16fa
  1. 12
      product_deletion/README.rst
  2. 23
      product_deletion/__init__.py
  3. 41
      product_deletion/__manifest__.py
  4. 23
      product_deletion/models/__init__.py
  5. 38
      product_deletion/models/product_deletion.py
  6. BIN
      product_deletion/static/description/banner.jpg
  7. BIN
      product_deletion/static/description/cybro_logo.png
  8. BIN
      product_deletion/static/description/deletion_warning.png
  9. BIN
      product_deletion/static/description/icon.png
  10. 48
      product_deletion/static/description/index.html
  11. 10
      product_deletion/views/product_deletion_group.xml

12
product_deletion/README.rst

@ -0,0 +1,12 @@
Product Removal Authorisation v11
=================================
User in the group "Product Deletion" can only delete the products. Those who are not in the
group cant delete the product. Odoo will raise a warning if the user in not in the group
Credits
=======
Cybrosys Techno Solutions
Contributors
------------
* Niyas Raphy, Cybrosys <niyas@cybrosys.in>

23
product_deletion/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Niyas Raphy(<https://www.cybrosys.com>)
# 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 <https://www.gnu.org/licenses/>.
#
##############################################################################
import models

41
product_deletion/__manifest__.py

@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Niyas Raphy(<https://www.cybrosys.com>)
# 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 <https://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Product Removal Authorisation',
'summary': """Users in the Group "Product Deletion" Can Only Delete the Products""",
'version': '11.0.1.0',
'description': """Permission to delete the product""",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': 'https://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,
}

23
product_deletion/models/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Niyas Raphy(<https://www.cybrosys.com>)
# 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 <https://www.gnu.org/licenses/>.
#
##############################################################################
import product_deletion

38
product_deletion/models/product_deletion.py

@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Niyas Raphy(<https://www.cybrosys.com>)
# 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 <https://www.gnu.org/licenses/>.
#
##############################################################################
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"))

BIN
product_deletion/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
product_deletion/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
product_deletion/static/description/deletion_warning.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
product_deletion/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

48
product_deletion/static/description/index.html

@ -0,0 +1,48 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Product Removal Authorisation</h2>
<h3 class="oe_slogan">Users having the permission can only delete the products</h3>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4>
</div>
</section>
<section>
<div class="oe_row oe_spaced oe_dark">
<h4 class="oe_slogan">Product Form</h4>
<div class="oe_span12">
<p class='oe_mt32'>
&#x261B; Only users in the group Product Deletion can delete the product.<br>
&#x261B; If user is not in the group Odoo will raise a warning message.<br>
</p>
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="deletion_warning.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/contact/"><i
class="fa fa-phone"></i> Contact Us </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
<div>
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td>
</div>
</div>
</section>

10
product_deletion/views/product_deletion_group.xml

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<openerp>
<data>
<record id="product_deletion_group" model="res.groups">
<field name="name">Product Deletion</field>
</record>
</data>
</openerp>
Loading…
Cancel
Save