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

I like to replace either the Create button or modify the method when pressed. This is in the tree or list view  of my custom module that inherits productd.template . All the examples I tried through either the template xml . But can't seem to replace these - not sure the syntax either for xpath cause string no longer works in 12 right? and what would be the name of that button ? PLEASE HELP! 

Thanks in Advance 

R

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

Hi,

Instead of replacing the function, inheriting the function is a good method follow the below example of inheriting an existing function

class Product(models.Model):
_inherit = 'product.template'

def create(self):
res = super(Product, self).create()
# do the necessary operations here
return res

Regards

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 3 23
10016
2
thg 3 23
2433
2
thg 5 22
4383
0
thg 3 22
1576
1
thg 9 20
3524