Hi ,
i have a class that look something like this.
class myclass(osv.Model):
_name="myclass.class1"
def _get_cur_subline_ids(self, cr, uid, ids, field_name, arg, context): {
//i need my current active class_line id here !!!
print context
//expecting to get model_line_id in the context but cannot
}
def _srch_subline(self, cr, uid, obj, name, args, context):: {
//i need my current active class_line id here !!!
print context
//expecting to get model_line_id in the context but cannot
}
_columns = {
"name" : fields.char('Desc.',help="enter your description"),
"class_line_ids" : fields.one2many('class.line', 'class_id', 'Lines'),
"lines_subline_ids" : fields.function(_get_cur_subline_ids,
type='one2many',
obj="product.product",
method=True,
string='Products List'
fnct_search=_srch_subline),
}
myclass()
XML for myclass
<field name="class_line_ids" nolabel="1" context="{'model_line_id': active_id}">
My questions is , how can i get the ACTIVE id of my class_line_ids i.e. when user click on the tree view of the class_line_ids in my form and pass it to the context and then in turn to be used by either the _get_cur_subline_ids or _srch_subline function to filter the return ids of the object "product.product" dynamically ?