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

The changes made in create and write of inherited res_partner should affect only the customer and not the supplier and user.

아바타
취소
베스트 답변

Hi,

There is only one object "res.partner" which manage customer and supplier.

Email : info@acespritech.com
Skype : acespritech
Blog : acespritechblog.wordpress.com

아바타
취소
베스트 답변

Customer, supplier and user (and maybe other 'persons') use the same model 'res.partner'. In order for your model to only do something different for customer, you should ask in your write and your create, if the res.partner you are in, is a customer.

Some quick and dirty code:

def create(.....):
    partner = pool.get(id)
    if partner.is_customer and not partner.supplier:
        do your code here
    else:
        res = super(self, res.partner).create(.....)

The same goes for write.

아바타
취소
관련 게시물 답글 화면 활동
2
5월 17
9505
0
10월 24
1018
2
1월 16
35758
0
3월 15
4741
2
3월 15
5673