Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
9082 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
2
Agu 19
12825
2
Feb 22
5689
3
Feb 24
11766
2
Sep 15
4766
0
Mei 15
3241