Wednesday 3 July 2013

OpenERP Error

OpenERP error like : when we use new 'addons / web / server'

Solution :
Manual migration script to run on DB :

ALTER TABLE ir_model_fields ADD column serialization_field_id int references ir_model_fields on delete cascade;


Server Traceback (most recent call last):
  File "/home/pna/workspace/6.1/web/addons/web/common/http.py", line 593, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/home/pna/workspace/6.1/server/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/pna/workspace/6.1/server/openerp/service/web_services.py", line 397, in dispatch
    return fn(*params)
  File "/home/pna/workspace/6.1/server/openerp/service/web_services.py", line 408, in exp_authenticate
    res_users = pooler.get_pool(db).get('res.users')
  File "/home/pna/workspace/6.1/server/openerp/pooler.py", line 50, in get_pool
    return get_db_and_pool(db_name, force_demo, status, update_module)[1]
  File "/home/pna/workspace/6.1/server/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
  File "/home/pna/workspace/6.1/server/openerp/modules/registry.py", line 180, in get
    update_module, pooljobs)
  File "/home/pna/workspace/6.1/server/openerp/modules/registry.py", line 202, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/home/pna/workspace/6.1/server/openerp/modules/loading.py", line 298, in load_modules
    loaded_modules, processed_modules = load_module_graph(cr, graph, status, perform_checks=(not update_module), report=report)
  File "/home/pna/workspace/6.1/server/openerp/modules/loading.py", line 167, in load_module_graph
    models = pool.load(cr, package)
  File "/home/pna/workspace/6.1/server/openerp/modules/registry.py", line 109, in load
    res.append(cls.create_instance(self, cr))
  File "/home/pna/workspace/6.1/server/openerp/osv/orm.py", line 919, in create_instance
    obj.__init__(pool, cr)
  File "/home/pna/workspace/6.1/server/openerp/osv/orm.py", line 1027, in __init__
    if field['serialization_field_id']:
KeyError: 'serialization_field_id'

Thursday 6 June 2013

Field level Security in OpenERP


Field level Security in OpenERP


In openerp erp its some times its needed to secure system.

So, there are lots of way to secure System. You can create access rights, Groups or etc.

But i think some times needed to field level security also. So, we can simply groups= "xyz group" so it will simply manage and that particular user can access. You can also restrict from xml also.

But if you try same thing in 7 also than you find if in fields you put "group1" and now, if you login with other group user which have all access rights of current object and you have put another group on fields than it will give you access rights warning and not able to access whole object.

So, in that case you can achieve from following code.

'standard_price': fields.float('Cost', write=['base.group_sale_manager'], read=['base.group_user']),

Suppose, here i give you example of standard price in this i give read right to 'base.group_user' and for write rights give to sales manager so, now you can restrict it by only sales manager can update cost price and the rest of user can only see but not rights to update.

And for invisible particular field you can use groups in xml file also.
So, you can achieve field level security as well as xml security to hide.

<field name="standard_price" groups="base.group_sale_manager"/>


We hope it will useful to you.

..Enjoy..

Friday 3 May 2013

Document Management System in OpenERP



Hello All,
Today i try to explore a Document Management System in OpenERP,
I think its very easy or some says there is nothing new in it.
Yes, you all are right if you already know about it otherewise
its became complex.
Here i try to explain DMS in OpenERP with FTP server.

I hope its useful to all of you.


Define Sale Tax as well as purchase tax in OpenERP 7



You can define Default sale tax as well as Purchase tax in openerp 7.
That will be set at the product when you create new product than it will automatically set default sale tax as well as purchase tax.



...Enjoy...

Monday 15 April 2013

Example of xmlrpc and openerp


How to work with xmlrpc and OpenERP?

Here example of xmlrpc and openerp ....
save following file as xmlrpc.py

You can also create xmlrpc for the use of import or export data. Or you can also create a new records also.

Example : 
import xmlrpclib
username = 'admin'
password = 'a'
database = 'test_60A'
sock_comm = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/common')
uid = sock_comm.login(database,username,password)
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')
print "connection success full"
ids = sock.execute(database,uid, password,'res.company', 'search', [])
print "list of ids",ids
#ids will contain ids of company A and B
sock.execute(database,uid, password, 'res.company', 'write', ids, {'rml_header1': 'hop'})


start server and run file $  python xmlrpc.py

With workflow(invoice validate) :
sock.exec_workflow (dbname, 1, pwd, 'account.invoice', 'invoice_open', inv_id)


Here a example of connect with server and fetch list of ids of company and just call write operation you can do
the operation which needed..


..Enjoy..

Wednesday 10 April 2013

How to apply patch in OpenERP ?



How to apply patch in OpenERP ?


Hello All, I think most of all of you guys in search of "How to apply Patch? Or What is patch?", yes, if you are developer than you know but if you are not a developer than its creates problem about to patch.

Here i try to describe some of steps or trick to apply patch, how it will be helpful to you all.

What is patch ?

Simply, patch is piece of some bug(error) fixing or some improvements of existing system.In another way patch means you are using any software and there is any error or need to improve or something else you want to do with existing system than obisiously you are trying such a thing in temperory source and if its work fine than you have to change in main code

For Apply :

1. If you use Ubuntu (Mind blowing Open Source) than its easy to apply patch.
 From command prompt follow the command :

 Go to particular directory and just apply patch
    > patch -p1 < ~/Desktop/xxx.patch

Or if you are using the Eclipse

2. If you are using Eclipse than also its, became easy to apply patch.
For that right click on addons folder then click on "Team" and select apply patch you will get the wizard to apply the patch.

                          ..Enjoy..


View Larger Map