[IMP] account: replace old manual reconciliation wizard
The old manual reconciliation wizard gets deprecated (soon to be removed) while we push forward the 'payment matching' widget. Better, faster, stronger. Was task: 1847703 Was part of PR #25921
This commit is contained in:
@@ -265,6 +265,7 @@ class AccountReconciliation(models.AbstractModel):
|
||||
assert account_type in ('payable', 'receivable', None)
|
||||
is_partner = res_type == 'partner'
|
||||
res_alias = is_partner and 'p' or 'a'
|
||||
aml_ids = self._context.get('active_ids') and self._context.get('active_model') == 'account.move.line' and tuple(self._context.get('active_ids'))
|
||||
|
||||
query = ("""
|
||||
SELECT {0} account_id, account_name, account_code, max_date,
|
||||
@@ -302,7 +303,8 @@ class AccountReconciliation(models.AbstractModel):
|
||||
{7}
|
||||
AND l.amount_residual < 0
|
||||
)
|
||||
GROUP BY {8} a.id, a.name, a.code, {res_alias}.last_time_entries_checked
|
||||
{8}
|
||||
GROUP BY {9} a.id, a.name, a.code, {res_alias}.last_time_entries_checked
|
||||
ORDER BY {res_alias}.last_time_entries_checked
|
||||
) as s
|
||||
WHERE (last_time_entries_checked IS NULL OR max_date > last_time_entries_checked)
|
||||
@@ -315,6 +317,7 @@ class AccountReconciliation(models.AbstractModel):
|
||||
res_ids and 'AND ' + res_alias + '.id in %(res_ids)s' or '',
|
||||
self.env.user.company_id.id,
|
||||
is_partner and 'AND l.partner_id = p.id' or ' ',
|
||||
aml_ids and 'AND l.id IN %(aml_ids)s' or '',
|
||||
is_partner and 'l.partner_id, p.id,' or ' ',
|
||||
res_alias=res_alias
|
||||
))
|
||||
@@ -336,7 +339,7 @@ class AccountReconciliation(models.AbstractModel):
|
||||
currency = account.currency_id or account.company_id.currency_id
|
||||
row['currency_id'] = currency.id
|
||||
partner_id = is_partner and row['partner_id'] or None
|
||||
rec_prop = self._get_move_line_reconciliation_proposition(account.id, partner_id)
|
||||
rec_prop = aml_ids and self.env['account.move.line'].browse(aml_ids) or self._get_move_line_reconciliation_proposition(account.id, partner_id)
|
||||
row['reconciliation_proposition'] = self._prepare_move_lines(rec_prop, target_currency=currency)
|
||||
row['company_id'] = account.company_id.id
|
||||
return rows
|
||||
|
||||
@@ -26,14 +26,11 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_account_move_line_reconcile" model="ir.actions.act_window">
|
||||
<record id="action_view_account_move_line_reconcile" model="ir.actions.client">
|
||||
<field name="name">Reconcile Entries</field>
|
||||
<field name="res_model">account.move.line.reconcile</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_account_move_line_reconcile_full"/>
|
||||
<field name="target">new</field>
|
||||
<field name="binding_model_id" ref="account.model_account_move_line" />
|
||||
<field name="tag">manual_reconciliation_view</field>
|
||||
<field name="binding_model_id" ref="account.model_account_move_line"/>
|
||||
<field name="binding_type">action</field>
|
||||
</record>
|
||||
|
||||
<record id="account_move_line_reconcile_writeoff" model="ir.ui.view">
|
||||
|
||||
Reference in New Issue
Block a user