11 changed files with 202 additions and 0 deletions
			
			
		@ -0,0 +1,2 @@ | 
				
			|||
# -*- coding: utf-8 -*- | 
				
			|||
import user_creation_from_employee | 
				
			|||
@ -0,0 +1,39 @@ | 
				
			|||
# -*- coding: utf-8 -*- | 
				
			|||
############################################################################## | 
				
			|||
# | 
				
			|||
#    Cybrosys Technologies Pvt. Ltd. | 
				
			|||
#    Copyright (C) 2016-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 <https://www.gnu.org/licenses/>. | 
				
			|||
# | 
				
			|||
############################################################################## | 
				
			|||
{ | 
				
			|||
    'name': 'User From Employee', | 
				
			|||
    'version': '9.0.1.0.0', | 
				
			|||
    'summary': 'User Creation From employee', | 
				
			|||
    'description': 'This module helps you to create user from employees form', | 
				
			|||
    'category': 'Human Resources', | 
				
			|||
    'author': 'Cybrosys Techno Solutions', | 
				
			|||
    'website': 'https://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, | 
				
			|||
} | 
				
			|||
| 
		 After Width: | Height: | Size: 73 KiB  | 
| 
		 After Width: | Height: | Size: 50 KiB  | 
| 
		 After Width: | Height: | Size: 77 KiB  | 
| 
		 After Width: | Height: | Size: 20 KiB  | 
@ -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</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;"> ☑</span>   User creation from employee.</li> | 
				
			|||
                    <li style="list-style:none !important;"><span style="color:green;"> ☑</span>   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="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> | 
				
			|||
| 
		 After Width: | Height: | Size: 86 KiB  | 
| 
		 After Width: | Height: | Size: 68 KiB  | 
@ -0,0 +1,45 @@ | 
				
			|||
# -*- coding: utf-8 -*- | 
				
			|||
############################################################################## | 
				
			|||
# | 
				
			|||
#    Cybrosys Technologies Pvt. Ltd. | 
				
			|||
#    Copyright (C) 2016-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | 
				
			|||
#    Author: Nilmar Shereef(<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 <http://www.gnu.org/licenses/>. | 
				
			|||
# | 
				
			|||
############################################################################## | 
				
			|||
from openerp import models, fields, api, _ | 
				
			|||
 | 
				
			|||
 | 
				
			|||
class ResUsersInherit(models.Model): | 
				
			|||
    _inherit = 'hr.employee' | 
				
			|||
 | 
				
			|||
    user_check = 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_check = True | 
				
			|||
 | 
				
			|||
    @api.onchange('address_home_id') | 
				
			|||
    def user_check(self): | 
				
			|||
        if self.address_home_id: | 
				
			|||
            self.user_check = True | 
				
			|||
        else: | 
				
			|||
            self.user_check = False | 
				
			|||
 | 
				
			|||
@ -0,0 +1,24 @@ | 
				
			|||
<?xml version="1.0" encoding="utf-8"?> | 
				
			|||
<openerp> | 
				
			|||
    <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_check" invisible="1"/> | 
				
			|||
                </field> | 
				
			|||
                <xpath expr="//form/sheet" position="before"> | 
				
			|||
                    <header> | 
				
			|||
                        <button name="create_user" string="Create User" type="object" class="oe_highlight" | 
				
			|||
                                attrs="{'invisible':[('user_check','=',True)]}"/> | 
				
			|||
                    </header> | 
				
			|||
                </xpath> | 
				
			|||
                <field name="work_email" position="attributes"> | 
				
			|||
                    <attribute name="required">1</attribute> | 
				
			|||
                </field> | 
				
			|||
            </field> | 
				
			|||
        </record> | 
				
			|||
    </data> | 
				
			|||
</openerp> | 
				
			|||
					Loading…
					
					
				
		Reference in new issue