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,
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
default_get in the new API, how?
Đã xử lý
|
|
2
thg 8 19
|
12752 | |
|
2
thg 2 22
|
5562 | ||
|
3
thg 2 24
|
11641 | ||
api.onchange v8 doesnt work
Đã xử lý
|
|
2
thg 9 15
|
4619 | |
|
0
thg 5 15
|
3110 |