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

Hello ,

    I'm trying to make a module that do some specific operation when an invoice is created.So I need to override the 

    create invoice button and create and view invoice button.

    i.e when any of the buttons clicked , I want to check wether a specific type of product is in the order line or not.

    How to do this?

Avatar
Abbandona

override odoo functions: https://goo.gl/4BkizH

Risposta migliore

Hi,

You can override a function using the super function.

Suppose if a button is calling a function named 'xyz' in the model 'sale.order', you can override the function 'xyz' like this,


class SaleOrder(models.Model):
_inherit = 'sale.order'

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


Thanks

Avatar
Abbandona
Autore

Thank you so much , it really works...

Post correlati Risposte Visualizzazioni Attività
1
apr 19
14834
3
lug 24
1532
2
ott 20
7503
5
mar 20
7665
2
ago 19
7694