Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
6 Ответы
9645 Представления

Is there an event triggered when a form is shown?

Аватар
Отменить
Лучший ответ

From the base model code:

    def view_init(self, cr, uid, fields_list, context=None):
        """Override this method to do specific things when a view on the object is opened."""
        pass

So in any model, you should be able to override view_init, and put any custom code in there. You don't even need to call super(), because the base class's view_init doesn't do anything.

Аватар
Отменить
Автор

Thanks a lot.

Please mark this answer as accepted if this is what you're looking for. Thanks!

Автор

I guess I need karma 20 to do that.

Лучший ответ

@Ratmil
Correct this is only triggered for create new and not for edit.

Аватар
Отменить
Автор Лучший ответ

 

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
нояб. 24
1672
1
сент. 21
9452
1
янв. 24
17062
3
февр. 16
6448
0
мар. 15
3327