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

I am using odoo 12 community version

beginner. please help

아바타
취소
베스트 답변

Hi,

If you are looking to clear data entered in the one2many field and date field, you can try the below code,


@api.multi
def action_clear(self):
for rec in self:
rec.write({'order_line': [(5, 0, 0)],
'validity_date': ''})


Here in the above code, order_line is the One2many field and validity_date is the date field.

Thanks

아바타
취소

thx you saved a day!

작성자 베스트 답변

Thanks, but what about the date field?

아바타
취소