Showing posts with label create. Show all posts
Showing posts with label create. Show all posts

Audit Trail in OpenERP - (Odoo)

In business there are number of users. It is tedious task for administrator to track all user's activity. Here OpenERP (Odoo) brings good feature to track user activity on any model. It means user perform any action [like create, modify, delete] on any model that all performed action can see administrator by logs. This feature is introduced in Audit Trail module

Audit Trail allows you to log every user operation on all system models. (such as sales, leads or products)

Required module: - Audittrail

First you just need to install the Audit Trail module in OpenERP (Odoo). After installing it, you will see in the Reporting menu an Audit menu item


Install Audit Trail Module


To track user activity you need to create audit rule. Audit rules are specified on a particular model that you want and assign user that you want to track that activity. The rules tell the system which activities performed by the user need to be logged.

How to create an audit rule :-


Navigate to : Reporting/Audit/Audit Rules

  
For example: - I have created a rule for sale order model to track activity of sale_user

Create an audit rule

   
To activate the audit rule you need to first 'Subscribe' to the audit rule.


Subscribe audit rule


To test this, login with sale_user, make changes to any in sale order. I have just created a sale order to show logs.


Create sale order to check audit logs


Now login with administrator. To see the logs of the activities performed on the sale order model by sale_user :-


Navigate to : Reporting/Audit/Audit Logs



Audit logs

You will see a list of the changes made to the sale order model. Click on logs to see the changes sale_user made to the sale order. You can also check old values and new values for comparison.

You can track every user operation on all the objects of the system. [
operation such as: create, modify, delete]    



Cheers Enjoy OpenERP (Odoo)    :)
Thanks,

Mayur Maheshwari 

  Skype : mayur_maheshwari1

Backup and Restore OpenERP Database


This article describe you how to backup and restore OpenERP database.There is two way to make backup and restore database.It means You can do by web-Interface or by commend prompt

web-Interface (GUI) :-

Simple steps for backup and restore OpenERP database:

1] Open Login screen click on manage database 





 















2] click backup menu and select your database and set password and click backup button and just save that database dump file on your system






 


3] For Restore database, Browse your database dump file set password and make name to database and click restore 




 














commend prompt :-

create database

 createdb database_name
 

Backup database :-

pg_dump --cluster 9.1/main --format=c old_database_name > new_database_name




 





Restore database :-

1 : Check file type by following command

          file <name of restore db which you want> [EX: file database_name ]



         
 








2 : If file type is simple PostgreSQL dump at that time you can you following command(dump db)

            DB=new_database_name && createdb --cluster 9.1/main $DB && pg_restore --cluster 9.1/main --no-acl -O -d $DB <  backup_database_name.dump
           
3 : If file type is ASCII C program text, with very long lines at that time you can use following command (sql db)

            DB=new_database_name && createdb $DB && psql -d $DB < backup_database.dump

[Note: When you can you step2 instead of steps3 you can get error : pg_restore: [archiver] input file does not appear to be a valid archive]





 



how to Restore zip file Database :-

First Create database using cretedb database_name then type following commend in terminal

    gunzip -c filename | psql database_name



How to  restore PostgreSQL database from .tar file

First Create database using cretedb database_name then type following commend in terminal

pg_restore -c -i -U systemusername -d dbname -v "/home/mayur/workspace/db_backup.tar" -W


Hope that was helpful.

If I just made your day a little better then thank me with a coffee or maybe a pizza


Thanks,

Mayur Maheshwari