Skip to Content
Menu
This question has been flagged
1 Odpoveď
8902 Zobrazenia

I have a transient model defined.

I want one of its fields defined using active_id from context.

I want to use new API.

Does anyone know how to do it? Thanks

Avatar
Zrušiť
Best Answer

Hello EM,


@api.model

 def default_get(self, fields):

    rec = super(TransientModelClass, self).default_get(fields)

    class_obj = self.env['class.name'].browse(self._context.get('active_id'))

    for variable in class_obj:

        rec['wizard_field'] = variable.class_field


Hope this will helps you.

Thanks,


Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
2
aug 19
12717
2
feb 22
5519
3
feb 24
11608
2
sep 15
4589
0
máj 15
3093