Creating and Paying Employee Payslip

OpenERP is full of features, just we need to find the one we need. Today I will discuss a feature of  “How to create and pay an Employee’s Payslip”

First of all, create a new database and install modules Payroll and Payroll Accounting, Then you need to Define an employee and create its home address as shown below:

Go to Menu: Human Resources / Human Resources / Employees

workaddress

This will create the employee to be a partner in the system, define this partner as supplier.

AsSupplier

Define the receivable and payable account for this employee’s partner.

rec_pay_Acc

Now next is to create a contract for the employee including salary structure and salary rules:

Go to menu: Human Resources / Human Resources / Contracts

Note: you can create Salary structure and Salary Rules from here itself or navigate to the Menu: Human Resources / Payroll /Salary Structures and Human Resources / Payroll / Salary Rules.

contract

Create a Salary Expense Journal of type ‘Purchase’

salary_journal

Create Individual accounts for BASIC, NET, GROSS, DEDUCTIONS, ALLOWANCES etc.

accounts_per_sal_rule

Then in the salary rules assign the Debit and Credit accounts as:

All the rules will have there individual accounts created as Debit accounts and Credit account as the Salary expense account.

Go to menu:  Human Resources / Payroll / Salary Rules

salary_rule

Assign Net Salary rule’s Credit account as the partner’s receivable account( that we assigned at the start) as he is liable to receive the net amount. Assign the Debit account as the account created for individual salary rules.

net_sal_rule

Now we will create a payslip for the employee.

Go to menu: Human Resources / Payroll / Employee Payslips 

After filling the required inputs click on Compute Sheet button  and you will see the sheet is calculated.

payslip

Now Click the button Confirm to confirm and generate the accounting entries.

journal_entry_payslip

Now we will pay the employee for this navigate thru Menu: Accounting / Suppliers / Supplier Payments

Create new payment and select the employee’s partner, as soon as you select the partner you will a line is added as a payment line with the outstanding amount.

payment

Click button Validate  to generate payment accounting entries.

payment_entries

Thanks,

Database Anonymization

Database Anonymization:

When you are in a live environment you always needs to share your database with someone for many purposes but also wants to be sure that your data should be kept confidential. OpenERP provides you an addon that will let you share your database with anyone without letting your confidential information leaked. The addons is “anonymization” i.e Database Anonymization

module_install

How it works ?

It simply replaces the fields data by ‘XXX’ characters and when you reverse the anonymization process it will replace the ‘XXX’ by the original content.
i.e Two process to follow.

1: Convert Normal Data ———> Anonymized data(XXX pattern)
2: Convert Anonymized data(XXX pattern) ———> Normal Data (reverse process)
First install ‘anonymization’ addon in your database . you will see three menus created under ‘Settings’ main menu

Settings/Database anonymization
Settings/Database anonymization/Anonymization History
Settings/Database anonymization/Anonymize database
Settings/Database anonymization/Anonymized Fields

1: Convert Normal Data ———> Anonymized data(XXX pattern)

So first you need to define the fields whose value you need to keep it as secret by going through the menu “Settings/Database anonymization/Anonymized Fields” after you finished defining the fields just go to the menu “Settings/Database anonymization/Anonymize database” i.e you will find a wizard ‘Anonymize database‘ to execute the operation. Before executing the anonymization process, you should make a backup of your database.click and execute that wizard(wizard) you will see a button ‘Anonymize database‘ on the wizard, click the button and wait for few minutes… after the process is completed successfully you will have a wizard poped to save the result files. Don’t forget to save the resulting file to a safe place because you will not be able to revert the anonymization without this file. This file is also stored in the for eg: /home/nch directory. The absolute file path is: /home/nch/field_anonymization_functional_3.pickle

Anonymize _fields

anonymize_wiz

anonymize_result

So after this your values in the database will look something like this

database_value

2: Convert Anonymized data(XXX pattern) ———> Normal Data (reverse process)

To get your anonymized data back to normal values just re-execute the wizard “Anonymize database” and select the file from the path for eg:
/home/nch/field_anonymization_functional_3.pickle and click the button ‘Reverse the Database Anonymization’. after the operation is successfully executed you will receive the data back to normal values.

reverse_anonymize

To see the History of these 2 steps performed you can check it through the menu ‘Settings/Database anonymization/Anonymization History’

anonymize_history

Thanks,

Change_default in OpenERP

There are many useful features in OpenERP that is not either used by much people or may be they do not know about it or may be they heard about it but didn’t understand the functionality / working of these features. Let’s discuss it here… many more to come in the upcoming blogs…wait and watch

One of them is the CHANGE_DEFAULT attribute of a field.

Change_default: Whether or not the user can define default values on other fields depending on the value of the field having the change_default set.

This is one of the attribute that needs to be defined when you define your field for the OpenERP model (class). lets see an example

Class attribute_test(osv.osv):

_name:’attribute.test’

……….

……….

_columns:

{

zip: fields.char(‘zip’, size=64, change_default=True),

city:fields.char(‘zip’, size=64)

}

attribute_test()

Now you would  have these fields displayed in your form view. Till here we saw the declaration of this attribute. now we see how we can use it

Now go to the field for which you want to set a default value, in our case its CITY enter the value for city say Gandhinagar, just right click on this field and select set as default (GTK Client ) or click set as default from the right panel(Web Client)  then you will see the ZIP field avaialble with a checkbox, tick that field and say OK. here say the field ZIP has a value 382024.  You have the option to set the default value for All users or just for your self.

Change_default_1

change_default_2

Note 1: For web 6.1 the fields that are invisible / readonly / One2Many / Many2Many will not appear in set as default menu.

How the effect is known ?

So whenever you enter the value for the field ZIP as 382024 and hit a TAB to have the focus_out event triggered you will see the CITY is automatically field to Gandhinagar.

Note 2: You can place change_default attribute on more then one field but you can use only one of them to set the default value for the targeted field.

Thanks,

Gunicorn on OpenERP 6.1

GUNICORN

Gunicorn ‘Green Unicorn’ is a Python WSGI HTTP Server for UNIX. It’s a pre-fork worker model ported from Ruby’s Unicorn project. The Gunicorn server is broadly compatible with various web frameworks, simply implemented, light on server resources, and fairly speedy.

How you can use Gunicorn to boost your OpenERP server performance. Down we see how we can configure to achieve the massive performance improvement on OpenERP Server.

As of 6.1 OpenERP server has the inbuilt support for WSGI and you just need to specify the configuration parameters

you will find a sample configuration file for OpenERP in this path of OpenERP server source code “6.1/server/gunicorn.conf.py”

for more Details you can visit  http://gunicorn.org/configure.html

To run the OpenERP server via Gunicorn, change the appropriate settings below, in order to provide the parameters that would normally be passed in the command-line,
(at least `bind` and `conf[‘addons_path’]`), then execute:

 $ gunicorn openerp:wsgi.core.application -c gunicorn.conf.py

or if you want to run it behind a reverse proxy, add the line import openerp.wsgi.proxied  in this file and execute:

 $ gunicorn openerp:wsgi.proxied.application -c gunicorn.conf.py

import openerp

Standard OpenERP XML-RPC port is 8069

bind = ‘127.0.0.1:8069’

pidfile = ‘.gunicorn.pid’

Gunicorn recommends 2-4 x number_of_cpu_cores, but you’ll want to vary this a bit to find the best for your particular work load.

workers = 4

Some application-wide initialization is needed.
on_starting = openerp.wsgi.core.on_starting
pre_request = openerp.wsgi.core.pre_request
post_request = openerp.wsgi.core.post_request

openerp request-response cycle can be quite long for big reports for example
timeout = 240

max_requests = 2000

Equivalent of –load command-line option

openerp.conf.server_wide_modules = [‘web’]

conf = openerp.tools.config

Path to the OpenERP Addons repository (comma-separated for multiple locations)

conf[‘addons_path’] = ‘/home/openerp/addons/trunk,/home/openerp/web/trunk/addons’

Optional database config if not using local socket
conf[‘db_name’] = ‘DBNAME’
conf[‘db_host’] = ‘localhost’
conf[‘db_user’] = ‘DB USER’
conf[‘db_port’] = DB PORT
conf[‘db_password’] = ‘YOUR DB PASSWORD’

OpenERP Log Level

DEBUG=10, DEBUG_RPC=8, DEBUG_RPC_ANSWER=6, DEBUG_SQL=5, INFO=20,
WARNING=30, ERROR=40, CRITICAL=50

conf[‘log_level’] = 20

If –static-http-enable is used, path for the static web directory
conf[‘static_http_document_root’] = ‘/var/www’

Just make this changes and get the massive performance speed on OpenERP 6.1

Thanks,

Naresh

How to Generate a SSL certificate for OpenERP

To connect via xml-rpc secure protocol (8071) we need to generate a certificate and a private key file for the OpenERP . Below are the steps which can guide you to achieve this.

Step 1: Create a Directory eg: “SSL” under openerp-server/bin

Step 2: Go to “SSL” directory. cd ssl

Step 3: Generate Private key(pkey) as

execute command :   openssl genrsa – des3 -out server.pkey 2048

enter the details that is asked for.

Step 4: Certificate

execute command openssl req-new-key server.pkey -out server.csr

enter details that is asked for.

Step 5: copy the .pkey file:

cp server.pkey server.pkey.org

enter password

Step 6: openssl rsa -in server.pkey.org -out server.pkey

Step 7: Generate CA private key

openssl genrsa – des3 -out ca.pkey 2048

enter password (enter different password then before)

Step 8: Generate a certificate in x509 format

execute: openssl req-new -x509 -days 365 -key ca.pkey -out ca.crt

Enter details that is asked for.

Step 9: sign the pkey

openssl x509 -req -in server.csr -out server.crt -CA ca.crt -CAkey ca.pkey

-CAcreateserial -CAserial ca.srl

Enter password same as entered in step 7

Step 10: start openerp server with –cert-file=YOUR .crt FILE PATH –pkey-

file=YOUR pkey FILE PATH

eg: server$ ./openerp-server –addons-path=../openobject-addons/ –cert-

file=bin/ssl/server.crt –pkey-file=bin/ssl/server.pkey

Thanks,

Naresh Soni(nch)

Team Lead, OpenERP Support / OPW

How to create OpenERP development Environment on windows

# This doc explains the steps to be taken 
# if you want to deploy openerp on windows or create openerp.exe for windows
# or want to create OpenERP Setup exe.
# Note : you can get all the packages from http://nightly.openerp.com/6.1/windows_dependencies/

Install following packages:1: Install python2.6.5
   Set environment path c:\python26

2: Install all in one pygtk package:  pygtk-all-in-one-2.22.5.win32-py2.6 (default instllation)
   Set environment variable
 Variable name: GTK_RUNTIME
 Variable value: C:\Python26\Lib\site-packages\gtk-2.0\runtime 

3: from http://nightly.openerp.com/6.1/windows_dependencies/ download the "add_to_dist" folder which contains *.dlls
  set environment variable:
 Variable name: openerp_dlls
 Variable value: path to the folder "add_to_dist" 
  eg:c:\Desktop

4: Install setuptools-0.6c11.win32-py2.6

5: Install python-dateutil-1.5.win32
   (Note: you can create .win32.exe from python package using  
   >>>python setup.py bdist_wininst command it create python-dateutil-1.5.win32in dist directory)

6: Install pywin32-214.win32-py2.6

7: Install lxml-2.2.2.win32-py2.6

8: Install pydot-1.0.3.win32
     Note: you can create .win32.exe from python package using  
 >>>python setup.py bdist_wininst

Now your GTK client is ready to start from the command prompt like you do in linux

9: Install matplotlib-0.99.1.win32-py2.6

10: Install numpy-1.6.0-win32-superpack-python2.6

11: Install pyparsing-1.5.5.win32
   Note: you can create .win32.exe from python package using  
 >>>python setup.py bdist_wininst

12: Install pyOpenSSL-0.11.winxp32-py2.6

13: Install py2exe-0.6.9.win32-py2.6

14:Install nsis-2.46-setup.exe for creating auto installer

15: Copy libhippocanvas-1-0.dll and hippo.pyd of add_to_dist directory to C:\Python26\DLLs

start create exe use following command

15.  >>>path_to_openerp_client_dir>python setup.py py2exe

    it will take some time
    it create a build and dist directory in client then inside the dist dir you will find the openerp_X_Y.exe(x,y are version no)

16:To create a auto installer
 go to openerp client/
        right click on setup.nsi and select compile with nsis 
        this operation will take time and a setup installer will be created.

Thanks,

Naresh Soni(nch)

Team Lead, OpenERP Support / OPW

 

Automatic Lead creation in OpenERP 6.1

                                               

Hi,

Lets first see what is LEAD ?

 

A lead represents a potential customer with whom you have not established a relationship yet. Usually a lead contains valuable information to realise future sales opportunities. However, the most common mistake is that such key information too often gets lost, because it is registered nowhere. And even when registered, it might still be difficult to track any activity for that lead, because the information is not at hand when you need it.

There are many companies / firm that needs to have such feature running in their sales department. Here I would like to discuss about how you can automatically manage your leads in OpenERP.

First create a database. Install Fetchmail module in your database to configure Incoming mail server. After installing fetchmail Install crm to manage leads.

 

Now go to Settings–>Configuration–>Email

 

Click on:Incoming Mail Servers and click New.

 

Enter the parameters for the Incoming server: Refer Screenshot

 

Incoming mail server

 

 

Note: Field Create a New Record: This is the field where you need to specify a model for which you want your incoming mail to create a new record. Rest fields are self explanatory.

Now click Test and Confirm button to test the connection. Additionally you can click Fetch Now button to fetch new incoming mails.

You can also check all the mails that are read by clicking on Messages on right side bar.

So to check whether your leads are generated or not go to Sales –>Sales–>Leads

 

you will see list of all new incoming mails generated as a lead (refer screenshot). So now you can directly work on them and get free from all your worries.

Leads

Thanks,