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
Post a Comment