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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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
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,
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
AanmeldenGerelateerde posts | Antwoorden | Weergaven | Activiteit | |
---|---|---|---|---|
default_get in the new API, how?
Opgelost
|
|
2
aug. 19
|
12698 | |
|
2
feb. 22
|
5506 | ||
|
3
feb. 24
|
11586 | ||
api.onchange v8 doesnt work
Opgelost
|
|
2
sep. 15
|
4582 | |
|
0
mei 15
|
3089 |