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

Hello, 

I have a function for filling in many fields automatically with an api.onchange() decorator.

@api.onchange('nursery_morning', 'nursery_evening', 'responsible_partner')
def retrieve_responsible_nursery(self):
    if self.nursery_morning or self.nursery_evening:
        if self.responsible_partner:
            if not self.resp_civility1 and not self.resp_name1 and not self.resp_cp1 and not self.resp_num1 \
                    and not self.resp_address1 and not self.resp_town1 \
                    and not self.resp_phone1 and not self.resp_phonemobile1:
                self.resp_civility1 = self.responsible_partner.title.name
                self.resp_name1 = self.responsible_partner.name
                self.resp_cp1 = self.responsible_partner.zip_id.name
                self.resp_num1 = self.responsible_partner.street_number_id.name
                self.resp_address1 = self.responsible_partner.street_id.name
                self.resp_town1 = self.responsible_partner.city_id.name
                self.resp_phone1 = self.responsible_partner.phone
                self.resp_phonemobile1 = self.responsible_partner.mobile

 

Currently, the fields do not change once one of the fields listed are filled but not saved in database but I would like them to change until the recording is saved. Then the fields remain blocked. How to do ?

Thanks you :) 

아바타
취소
베스트 답변

Verify all the fields are on the view and not readonly mode. 

아바타
취소
관련 게시물 답글 화면 활동
0
3월 21
6250
3
7월 20
20428
2
1월 19
6490
1
7월 18
7022
1
4월 18
3421