Files
Odoo-Modules/fix_from_lines.py
gsinghpal c66bdf5089 changes
2026-04-03 15:45:18 -04:00

28 lines
1009 B
Python

# Manually reconcile the 4 "from" lines — they're Scotia Current transfers
# with no account number in the ref
AML = env['account.move.line'].sudo()
BSL = env['account.bank.statement.line'].sudo()
line_ids = [16375, 16380, 16383, 16433]
for lid in line_ids:
line = BSL.browse(lid)
if line.is_reconciled:
continue
print(f'Line {lid}: {line.payment_ref}, ${line.amount}, {line.move_id.date}', flush=True)
# These are transfers from Scotia Current — post to Outstanding Receipts (493)
model = env['account.reconcile.model'].search([
('match_label_param', '=', 'PAYMENT FROM'),
('trigger', '=', 'auto_reconcile'),
], limit=1)
if model:
try:
model._trigger_reconciliation_model(line)
env.cr.commit()
line.invalidate_recordset()
print(f' -> Reconciled: {line.is_reconciled}', flush=True)
except Exception as e:
print(f' -> Error: {e}', flush=True)
env.cr.rollback()