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

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -