Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
4180 Vizualizări

Im Trying to Append 2 Journal Entry lines Regarding Bank charges(1 to Bank Charges(debit) and 2 to Bank(credit)) in the same Journal While Creating a  Register Payment, I've Done in the Odoo13 And its totally working but when i tried in Odoo14 The following error is coming,

Imagine profil
Abandonează
Autor

_inherit = 'account.payment'

def _prepare_move_line_default_vals(self, write_off_line_vals=None):

res = super(AccountPaymentInherit, self)._prepare_move_line_default_vals()

debit_line = {'name': 'Test Journal Entry Creation',

'debit': 0.0, 'credit': 0.0, 'partner_id': 3,

'account_id': 7, 'payment_id': self.id}

credit_line = {'name': 'Test `Journal Entry Creation',

'debit': 0.0, 'credit': 0.0, 'partner_id': 3, 'account_id': 79, 'payment_id': self.id}

res.append(debit_line)

res.append(credit_line)

return res

I tried super the move_line preparation function and tried to append the lines ive created to it , But there is a condition in the account.payment as following

if len(liquidity_lines) != 1 or len(counterpart_lines) != 1:

raise UserError(_(

"The journal entry %s reached an invalid state relative to its payment.\n"

"To be consistent, the journal entry must always contains:\n"

"- one journal item involving the outstanding payment/receipts account.\n"

"- one journal item involving a receivable/payable account.\n"

"- optional journal items, all sharing the same account.\n\n"

) % move.display_name)

Related Posts Răspunsuri Vizualizări Activitate
3
mai 24
4089
0
apr. 22
1654
2
aug. 18
10993
1
mai 25
163
0
sept. 24
586