跳至内容
菜单
此问题已终结
1 回复
4904 查看

I want to show popup message in odoo when a record is deleted from the view. How can I do it? Is it possible to show that message only when the record is deleted from the 'form view' and not from the 'tree view'?

形象
丢弃
最佳答案

Hi Ernesto:

You can inherit and extend the unlink function in the base Model class if you want this across the board. Here's a link to the code in the base class.

https://github.com/odoo/odoo/blob/13.0/odoo/models.py#L3299

If you want this to apply only to specific models, you'll need to extend this function in the classes of those models instead of the base Model class.

Regarding your second question, these changes will apply across the board i.e. form view, list view, import, api, custom code, etc.

形象
丢弃
相关帖文 回复 查看 活动
1
1月 20
3013
2
3月 15
3996
1
10月 22
1897
4
10月 20
72835
6
12月 19
17930