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

Hi Guys can anyone tell me what is wrong with this function? Its not assigning the values on the form for the specified fields?

I have length, height, depth, and widt_box fields which i wish to assign a value when product_size is changed. The value is fetched correctly but not displayed on the form what can be the reason? 

    @api.onchange('product_size')

    def set_product_box_vals(self):

        if self.product_size:

            if self.three_d_size:

                length, width, depth = self.product_size.size_information.split('x', 2)

                self.width_box = float(width[1:])

                self.length = float(length[1:])

                self.depth = float(depth[1:])

            else:

                width, height = self.product_size.size_information.split('x', 1)

                self.width = float(width[1:])

                self.height = float(height[1:])

아바타
취소
베스트 답변

Did you checked the value in "float(width[1:])" is correct and not null ?

아바타
취소
작성자

Yes the values are comming properly even if I print self.height, self.width, they too hold values, but are not displayed on the form view.

관련 게시물 답글 화면 활동
2
2월 24
13049
3
10월 18
3704
1
3월 18
4453
0
11월 17
2530
2
4월 23
11470