Compare commits

..

1 Commits
main ... 19.0

9 changed files with 67 additions and 96 deletions

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
{
'name': 'Account Reconciliation Reference',
'version': '17.0.1.0.2',
'version': '19.0.1.0.2',
'category': 'Accounting/Accounting',
'summary': 'Show Reference on reconciliation kanban/list and add to search',
'description': """
@ -23,6 +23,7 @@ Show Reference on reconciliation UI
'assets': {
'web.assets_backend': [
'account_reconcile_reference/static/src/xml/bank_rec_form_inherit.xml',
'account_reconcile_reference/static/src/xml/bank_rec_kanban_inherit.xml',
],
},
'installable': True,

Binary file not shown.

View File

@ -1,2 +1 @@
# -*- coding: utf-8 -*-
from . import bank_rec_widget
# -*- coding: utf-8 -*-

View File

@ -1,37 +0,0 @@
# -*- coding: utf-8 -*-
from odoo import models
class BankRecWidget(models.Model):
_inherit = "bank.rec.widget"
def _line_value_changed_ref(self, line):
"""
Persist the typed Reference as both:
- Journal Entry Reference (move.ref) so it shows on journal items
- Statement Line Reference (st_line.ref) so it remains visible after validation
Works for liquidity and non-liquidity lines in Manual Operations.
"""
self.ensure_one()
ref_val = line.ref or False
# Persist to the move (journal entry)
self.st_line_id.move_id.ref = ref_val
# Persist to the statement line so the OWL form keeps showing it after validation
# (bank_rec_form.xml shows Reference for liquidity based on line.data.ref which maps to st_line.ref)
self.st_line_id.ref = ref_val
# Reload liquidity line and the record to reflect the updated reference
self._action_reload_liquidity_line()
self.return_todo_command = {"reset_record": True, "reset_global_info": True}
def _action_validate(self):
"""
Ensure the typed Reference is flushed to the target move before reconciliation creates/replaces lines.
This covers the case when the user clicks Validate immediately after typing in Manual Operations.
"""
self.ensure_one()
line = self._lines_get_line_in_edit_form()
if line and getattr(line, "ref", False):
ref_val = line.ref
self.st_line_id.move_id.ref = ref_val
self.st_line_id.ref = ref_val
return super()._action_validate()

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<templates xml:space="preserve">
<t t-name="account_reconcile_reference.BankRecStatementLine" t-inherit="account_accountant.BankRecStatementLine" t-inherit-mode="extension">
<xpath expr="//div[contains(@class, 'o_payment_ref') and contains(@class, 'd-md-block')]//span[contains(@class, 'd-inline')]" position="after">
<div t-if="recordData.ref" class="text-muted text-truncate small">
<span t-esc="recordData.ref"/>
</div>
</xpath>
</t>
</templates>

View File

@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_move_line_reconcile_tree_inherit_ref_visible" model="ir.ui.view">
<field name="name">account.move.line.tree.reconcile.inherit.ref.visible</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account_accountant.view_move_line_reconcile_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree//field[@name='ref']" position="attributes">
<attribute name="optional">show</attribute>
<attribute name="readonly">0</attribute>
</xpath>
</field>
</record>
</data>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_move_line_reconcile_tree_inherit_ref_visible" model="ir.ui.view">
<field name="name">account.move.line.tree.reconcile.inherit.ref.visible</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account_accountant.view_move_line_reconcile_tree"/>
<field name="arch" type="xml">
<xpath expr="//list//field[@name='ref']" position="attributes">
<attribute name="optional">show</attribute>
<attribute name="readonly">0</attribute>
</xpath>
</field>
</record>
</data>
</odoo>

View File

@ -1,42 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Kanban: show ref on bank rec widget cards -->
<record id="view_bank_statement_line_kanban_inherit_ref" model="ir.ui.view">
<field name="name">account.bank.statement.line.kanban.inherit.ref</field>
<field name="model">account.bank.statement.line</field>
<field name="inherit_id" ref="account_accountant.view_bank_statement_line_kanban_bank_rec_widget"/>
<field name="arch" type="xml">
<xpath expr="//templates/t[@t-name='kanban-box']//div[@id='row2_col1']" position="after">
<div id="row2_ref" class="text-truncate text-muted">
<field name="ref"/>
</div>
</xpath>
</field>
</record>
<!-- Tree: show ref column by default -->
<record id="view_bank_statement_line_tree_inherit_ref_visible" model="ir.ui.view">
<field name="name">account.bank.statement.line.tree.inherit.ref.visible</field>
<field name="model">account.bank.statement.line</field>
<field name="inherit_id" ref="account_accountant.view_bank_statement_line_tree_bank_rec_widget"/>
<field name="arch" type="xml">
<xpath expr="//tree//field[@name='ref']" position="attributes">
<attribute name="optional">show</attribute>
</xpath>
</field>
</record>
<!-- Search: include ref -->
<record id="view_bank_statement_line_search_inherit_add_ref" model="ir.ui.view">
<field name="name">account.bank.statement.line.search.inherit.add.ref</field>
<field name="model">account.bank.statement.line</field>
<field name="inherit_id" ref="account_accountant.view_bank_statement_line_search_bank_rec_widget"/>
<field name="arch" type="xml">
<xpath expr="//search" position="inside">
<field name="ref"/>
</xpath>
</field>
</record>
</data>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Kanban: fetch ref field so it's available in OWL -->
<record id="view_bank_statement_line_kanban_inherit_ref" model="ir.ui.view">
<field name="name">account.bank.statement.line.kanban.inherit.ref</field>
<field name="model">account.bank.statement.line</field>
<field name="inherit_id" ref="account_accountant.view_bank_statement_line_kanban_bank_rec_widget"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='payment_ref']" position="after">
<field name="ref"/>
</xpath>
</field>
</record>
<!-- Tree: show ref column by default -->
<record id="view_bank_statement_line_tree_inherit_ref_visible" model="ir.ui.view">
<field name="name">account.bank.statement.line.tree.inherit.ref.visible</field>
<field name="model">account.bank.statement.line</field>
<field name="inherit_id" ref="account_accountant.view_bank_statement_line_tree_bank_rec_widget"/>
<field name="arch" type="xml">
<xpath expr="//list//field[@name='ref']" position="attributes">
<attribute name="optional">show</attribute>
</xpath>
</field>
</record>
<!-- Search: include ref -->
<record id="view_bank_statement_line_search_inherit_add_ref" model="ir.ui.view">
<field name="name">account.bank.statement.line.search.inherit.add.ref</field>
<field name="model">account.bank.statement.line</field>
<field name="inherit_id" ref="account_accountant.view_bank_statement_line_search_bank_rec_widget"/>
<field name="arch" type="xml">
<xpath expr="//search" position="inside">
<field name="ref"/>
</xpath>
</field>
</record>
</data>
</odoo>