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

Hi, i'm trying to make products packs, so I made a boolean button in the product to check if the product is a pack, now i want to make an onchange to change the type of the prodcut to service if pack checkbox is true. I'm trying with this but is not working.


class product_template(models.Model):
_inherit = 'product.template'
    pack = fields.Boolean('Pack?')

api.onchange('pack')
def _onchange_pack(self):
    if self.pack:
        self.type = 'service'


아바타
취소
베스트 답변

Hi,

Try to make the on change function in the product.product model. Also it will be helpful if you put the error msg and your version ...


아바타
취소
작성자

I don't have any error, it does nothing, is in V8. I'll try to do it in the product.product and see if it works.

관련 게시물 답글 화면 활동
1
8월 25
408
2
6월 25
1844
0
3월 25
1701
0
2월 25
1338
3
8월 24
6078