0
1 答案
0
最佳答案
Define default Method Code
def _get_default_category(self, cr, uid, context=None):
res = self.pool.get('model.category').search(cr, uid, [('name','=',categroy_name)], context=context)
return return res and res[0] or False
_defaults = {
'category_id':_get_default_category,
}
4
注释
on change method will be called while I enter some value in some field. If I directly create record, and then create category from test.test default type should come. Is it possible to do ? For example: Create product, then create Contract from product form, by default employee should come as Administrator.