Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4333 Visualizzazioni

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

Avatar
Abbandona
Risposta migliore

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

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
mar 23
10021
2
mar 23
2435
2
mag 22
4393
0
mar 22
1578
1
set 20
3527