Browse Source

[ADD] Initial Commit

pull/29/head
SHEREEF PT 8 years ago
parent
commit
0d84abc63f
  1. 2
      user_creation_from_employee/__init__.py
  2. 39
      user_creation_from_employee/__manifest__.py
  3. BIN
      user_creation_from_employee/static/description/banner.jpg
  4. BIN
      user_creation_from_employee/static/description/cybro_logo.png
  5. BIN
      user_creation_from_employee/static/description/employee.png
  6. BIN
      user_creation_from_employee/static/description/icon.png
  7. 92
      user_creation_from_employee/static/description/index.html
  8. BIN
      user_creation_from_employee/static/description/user.png
  9. BIN
      user_creation_from_employee/static/description/user1.png
  10. 43
      user_creation_from_employee/user_creation_from_employee.py
  11. 24
      user_creation_from_employee/user_creation_from_employee_view.xml

2
user_creation_from_employee/__init__.py

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
import user_creation_from_employee

39
user_creation_from_employee/__manifest__.py

@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://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 <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'User From Employee',
'version': '10.0.1.0.1',
'summary': 'This module automatically creates User while creating Employee',
'description': 'This module helps you to create user automatically from employees',
'category': 'Human Resources',
'author': 'Cybrosys Techno Solutions',
'website': 'http://www.cybrosys.com',
'company': 'Cybrosys Techno Solutions',
'depends': ['base', 'hr'],
'data': ['user_creation_from_employee_view.xml'],
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

BIN
user_creation_from_employee/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
user_creation_from_employee/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
user_creation_from_employee/static/description/employee.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
user_creation_from_employee/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

92
user_creation_from_employee/static/description/index.html

@ -0,0 +1,92 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">User From Employee</h2>
<h3 class="oe_slogan">User Creation From Employee Form</h3>
<h4 class="oe_slogan">Author : Cybrosys Techno Solutions , www.cybrosys.com</h4>
<div>
<h4><p>Features:</p></h4>
<ul>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp; User creation from employee.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp; Set home action for employee.</li>
</ul>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">User creation from employee</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img style="border:10px solid white;" class="oe_picture oe_screenshot" src="employee.png">
</div>
</div>
<div class="oe_span12">
<p class="oe_mt32">
You can create an user for any employee through "Create User" button.
</p>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Set home action for employee</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img style="border:10px solid white;" class="oe_picture oe_screenshot" src="user.png">
</div>
</div>
<div class="oe_span12">
<p>This user will be added in home action too. </p>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">User Form</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img style="border:10px solid white;" class="oe_picture oe_screenshot" src="user1.png">
</div>
</div>
<div class="oe_span12">
<p class="oe_mt32">
<p>This is the user created from employee. </p>
</p>
</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="http://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="http://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="http://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>

BIN
user_creation_from_employee/static/description/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
user_creation_from_employee/static/description/user1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

43
user_creation_from_employee/user_creation_from_employee.py

@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://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 <http://www.gnu.org/licenses/>.
#
##############################################################################
from odoo import models, fields, api, _
class ResUsersInherit(models.Model):
_inherit = 'hr.employee'
user_check1 = fields.Boolean(default=False)
@api.multi
def create_user(self):
user_id = self.env['res.users'].create({'name': self.name,'login': self.work_email})
self.address_home_id = user_id.partner_id.id
self.user_check1 = True
@api.onchange('address_home_id')
def user_check(self):
if self.address_home_id:
self.user_check1 = True
else:
self.user_check1 = False

24
user_creation_from_employee/user_creation_from_employee_view.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="hr_employee_form_inherit" model="ir.ui.view">
<field name="name">hr.employee.form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<field name="work_email" position="after">
<field name="user_check1"/>
</field>
<xpath expr="//form/sheet" position="before">
<header>
<button name="create_user" string="Create User" type="object" class="oe_highlight"
attrs="{'invisible':[('user_check1','=',True)]}"/>
</header>
</xpath>
<field name="work_email" position="attributes">
<attribute name="required">1</attribute>
</field>
</field>
</record>
</data>
</odoo>
Loading…
Cancel
Save