Se rendre au contenu
Menu
Cette question a été signalée

I need to get matched the partial reconcile account move line:

eg: In account move line I have 2000 as debit amount and another credit account move line as 2100 and both are partial reconciled and matching_number showing 'P'.

I need to get both the account move line and need to show balance as 100. 

which means: 
balance(100) = journal item 1(2000) - journal item 2(2100)
But I am not getting the partial reconciled journal items for the invoice. 
Can someone help on how to get matched partial reconcile account move line in account move.

thanks In advance

Avatar
Ignorer
Meilleure réponse

To get the partial reconciled account move lines in Odoo v16, you can use the reconciled_line_ids field of the account move line object. This field contains the list of account move lines that have been reconciled with the current line.

Here's an example code snippet that shows how to retrieve the partial reconciled lines for a given account move line:

move_line = self.env['account.move.line'].browse(line_id)
partial_reconciled_lines = move_line.reconciled_line_ids.filtered(lambda l: l.matching_number == 'P')

In this code snippet, line_id is the ID of the account move line you want to retrieve the partial reconciled lines for. The browse method is used to retrieve the account move line record. Then, the reconciled_line_ids field is accessed to get the list of reconciled lines. Finally, the filtered method is used to filter the list and only keep the lines that have a matching_number of 'P', indicating a partial reconciliation.

Once you have the partial reconciled lines, you can use their debit and credit fields to calculate the balance between them and the current line.

Avatar
Ignorer
Publications associées Réponses Vues Activité
1
oct. 23
2296
0
sept. 22
2212
0
mars 19
3690
0
mars 15
6331
0
oct. 24
1451