python - odoo context.get.active_id is not working -


i have create registration module in school management system in odoo 8. in module have one2many field called enrollment_ids. want activated registration_id when create new enrollment. it's not working.

here code.

def default_get(self, cr, uid, fields, context=none):     data = super(op_enrollment, self).default_get(cr, uid, fields, context=context)     registration_id = context.get('active_id', false)     return true 

why can't active registration_id. return false.

try way, write on xml code:

<field name="enrollment_ids" widget="one2many_list" context="{'default_registration_id': active_id}">    <tree>       ...    </tree> </field> 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -