Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 10 23
2301
0
thg 9 22
2214
0
thg 3 19
3692
0
thg 3 15
6333
0
thg 10 24
1455