Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
6432 Vizualizări

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?

Imagine profil
Abandonează

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

Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor

Thank you so much , it really works...

Related Posts Răspunsuri Vizualizări Activitate
1
apr. 19
14836
3
iul. 24
1549
2
oct. 20
7508
5
mar. 20
7673
2
aug. 19
7700