Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
8920 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

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,


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
aug. 19
12746
2
feb. 22
5536
3
feb. 24
11629
2
sept. 15
4609
0
mai 15
3106