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

I have already added some values in one2many field and on button click i want to update only one field value. How can i do that?

For example :

my one2many field stud_details  have values:

Roll No
Name
Mark
1
abc

2
pqr

Here rollno , name are already added and on Clicking BUTTon "UPDATE" the marks field need to get updated..

I need to add the same mark for all the students..

for say, for taking marks values having one integer field called Mark_update field, and on clicking the button "UPDATE" the values in Mark_update field  need to get updated to the one2many  Mark field for all student

.



아바타
취소
베스트 답변

You can Use write() method for updating the one2many field.

For example :            

Here below is the code , here we can write mark for each record in one2many field.

for record in self.browse(cr,uid,ids,context=context): 
    for order in record.stud_details:      
        order.write({'mark': record.mark_update})
return
아바타
취소
베스트 답변

You click the one2many field  and add Mark field then save 

아바타
취소
작성자

Bro, i have updated my question , please go through it and guide me with the necessary.