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

Trying to grammatically change the tax value of a invoice.
Tax is changing or updating in line
but to re computation works. amount,tax amount,total etc.

tried to invoke methods

line._onchange_mark_recompute_taxes()
line._onchange_price_subtotal()
move._compute_tax_lock_date_message()
move._compute_invoice_taxes_by_group()

 

아바타
취소
베스트 답변

Hi,

Try calling the _recompute_dynamic_lines or _recompute_tax_lines function.

Thanks

아바타
취소
작성자

it thrown some error like,Cannot create unbalanced journal entry. Ids:
seems like we should call something before

pass check check_move_validity=False in the context

작성자

def _recompute_tax_lines(self, recompute_tax_base_amount=False):
def _recompute_dynamic_lines(self, recompute_all_taxes=False,recompute_tax_base_amount=False):

there is no parameter like check_move_validity

its not a parameter, its a marker which has to pass in the context.
with_context(check_move_validity=False)

suppose if you are calling self.action_test(), call it as self.with_context(check_move_validity=False).action_test()

작성자 베스트 답변

Finally,
move.with_context(check_move_validity=False)._recompute_dynamic_lines(recompute_all_taxes=True)

Thanks :)

아바타
취소

this worked. thanks.

Perfect... Thanks

관련 게시물 답글 화면 활동
5
12월 22
5446
3
1월 20
6199
2
3월 15
3645
1
7월 25
399
0
8월 22
68