콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
6479 화면

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...

관련 게시물 답글 화면 활동
1
4월 19
14911
3
7월 24
1618
2
10월 20
7585
5
3월 20
7728
2
8월 19
7796