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

In invoice screen when i try to validate an invoice without adding any line items it throws me an error whereas in accounting -> journal entries I'm able to post an entry without adding any line items. How can i change this behavior of journal entries to the same as invoice.

아바타
취소
베스트 답변

Hi,

For this what you can do is that, inherit the account.move and super the function of the POST) action_post) button and check whether the end user entered the journal items(line_ids), if lines_ids is not entered you can return a warning message.


def action_post(self):

    res = super(classname, self).action_post()

    if not self.line_ids:

        # return warning message

        raise ValidationError(_("No Journal Items"))

    return res


The code is just typed , not tested, so check and make necessary changes


Thanks

아바타
취소
작성자

Thanks for the answer Raphy, I'll look into it and update the same.

작성자

It worked like a charm, Thanks bud!

관련 게시물 답글 화면 활동
1
8월 22
7481
1
5월 19
6241
12
5월 19
5063
3
4월 23
6017
2
7월 25
1778