Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
6416 Представления

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?

Аватар
Отменить

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

Лучший ответ

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

Аватар
Отменить
Автор

Thank you so much , it really works...

Related Posts Ответы Просмотры Активность
1
апр. 19
14833
3
июл. 24
1528
2
окт. 20
7503
5
мар. 20
7664
2
авг. 19
7693