Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
5693 Widoki
I am using Odoo16 Enterprise Edition.
I am trying to add new journal items having credit equals to exactly the value so that the total debit and credit will get balanced. why am I unable to add the the journal items.

I am using the given code to add the new value.


self.line_ids= [(0,0,{'move_id':self.id,'name' :self.tds_label,'account_id': self.tds_account.id,'credit': round(self.tds_amount,2),'debit':0})]


User Error

OK

An error has occurred.

The move (Draft Bill (* 24300)) is not balanced.
The total of debits equals 79,100.00 ₨ and the total of credits equals 78,050.00 ₨.
You might want to specify a default account on journal "Vendor Bills" to automatically balance each move.

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

You have to ensure that the credit and debit values are balanced in your case. If this is not the case, you pass the check_move_validity as False in the context and see.

Try as follows:


self.with_context(check_move_validity=False).line_ids = [(0,0,{'move_id':self.id,'name' :self.tds_label,'account_id': self.tds_account.id,'credit': round(self.tds_amount,2),'debit':0})]

Thanks

Awatar
Odrzuć
Autor

I figured out the issue. This issue occurs when the set the type of related charts of account other than payable/receivable.

The type of tds account on vendor bill is 'current liabilities' and I am facing the issue.

Powiązane posty Odpowiedzi Widoki Czynność
4
cze 25
14558
1
lip 23
2641
3
sie 25
2649
1
maj 25
2664
1
kwi 25
3665