Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
6407 Zobrazení

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
Zrušit

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

Nejlepší odpověď

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
Zrušit
Autor

Thank you so much , it really works...

Related Posts Odpovědi Zobrazení Aktivita
1
dub 19
14833
3
čvc 24
1514
2
říj 20
7502
5
bře 20
7655
2
srp 19
7688