Hi all ! I defined a function. but when I used it , the message error is : TypeError: _read() takes at least 6 arguments (4 given).
I dont know i have an error. I need some your help.
This is my code .py
def _read(self, cr, uid, ids, field_name ,arg, context = None):
res = {}
obj = self.pool.get('danh.sach.nv').browse(cr, uid, ma_nv, context = context)
ma_nvs = self.search(cr, uid, [('obj','=',ma_nv)], context=context)
res = self.read(cr, uid, ma_nvs , ['ten_bp', 'ten_cd'])
return { ' value' : res}
_columns = {
'ma_nv':fields.many2one('danh.sach.nv', 'Mã NV'),
'ten_nv':fields.char( 'Tên nhân viên', size = 30),
'ngay_sinh':fields.date('Ngày sinh'),
'ten_bp':fields.char('Bộ phận', size = 30),
'ten_cd':fields.char( 'Chức danh', size = 30),
'ly_do_huy': fields.char('Lý do hủy hợp đồng', size = 100),
'ngay_huy':fields.date('Ngày hủy'),
}
_defaults = {
'ten_bp': _read,
'ten_cd' : _read
}
I need your help.
Thanks all