Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
1675 Lượt xem

Hello,

When I try to get an active id using the below, it shows None.

self.env.context.get('active_id')

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi 

Refer this video  https://youtu.be/icl4IEWWmuU and check your code 

Hope this Helps.


Regards

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

HI,

Based on the comment you have added, it seems you need to use self.id instead of looking for the active_id . In the validation to exclude the current record you can use self.id to compare or to exclude the current record.


To know more about self and odoo environment, see: Odoo Environment Variables

Thanks

Ảnh đại diện
Huỷ bỏ