Monday, October 5, 2009

Base, Ir_model_data , _update


AIM : To Use the context of screen/action to the record which is getting imported (the context passed by client).

Change:

1. _update() of ir_model_data class has a new arguement context in its signature.

def _update(self,cr, uid, model, module, values, xml_id=False, store=True, noupdate=False, mode='init', res_id=False):

Will appear as

def _update(self,cr, uid, model, module, values, xml_id=False, store=True, noupdate=False, mode='init', res_id=False, context=None):

This context will be passed to OpenERP methods create(),browse(),read(),write() used withing _update().
Context is very important factor that comes into picture specially during translation.



GTK,win_import,import_csv

AIM : To pass the local context of screen/action to the record which is getting imported.

Change:

1. __init__() of Win_import class has a new arguement local_context in its signature.

def __init__(self, model, fields, preload = [], parent=None):

will appear as:
def __init__(self, model, fields, preload = [], parent=None, local_context=None):

2. The import_csv() of win_import.py has a new arguement context in its signature.

def import_csv(csv_data, f, model, fields):

will appear as:
def import_csv(csv_data, f, model, fields, context=None):

Thanks,
Regards,

Er. Jay Vora,
Sr. Application Engineer.
Tiny ERP Pvt. Ltd.

Ahmedabad,Gujarat,India.

M : 91- 9879354457
E-Mail : jvo@tinyerp.com
(Not miles, just an e-mail away...)