Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
8914 Zobrazení

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šit
Nejlepší odpověď

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šit
Related Posts Odpovědi Zobrazení Aktivita
2
srp 19
12738
2
úno 22
5527
3
úno 24
11624
2
zář 15
4604
0
kvě 15
3100