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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -