Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
6413 Widoki

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?

Awatar
Odrzuć

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

Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor

Thank you so much , it really works...

Powiązane posty Odpowiedzi Widoki Czynność
1
kwi 19
14833
3
lip 24
1517
2
paź 20
7502
5
mar 20
7657
2
sie 19
7690