Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bf1ad6b4c3 |
@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
{
|
{
|
||||||
'name': 'Account Reconciliation Reference',
|
'name': 'Account Reconciliation Reference',
|
||||||
'version': '17.0.1.0.2',
|
'version': '19.0.1.0.2',
|
||||||
'category': 'Accounting/Accounting',
|
'category': 'Accounting/Accounting',
|
||||||
'summary': 'Show Reference on reconciliation kanban/list and add to search',
|
'summary': 'Show Reference on reconciliation kanban/list and add to search',
|
||||||
'description': """
|
'description': """
|
||||||
@ -23,6 +23,7 @@ Show Reference on reconciliation UI
|
|||||||
'assets': {
|
'assets': {
|
||||||
'web.assets_backend': [
|
'web.assets_backend': [
|
||||||
'account_reconcile_reference/static/src/xml/bank_rec_form_inherit.xml',
|
'account_reconcile_reference/static/src/xml/bank_rec_form_inherit.xml',
|
||||||
|
'account_reconcile_reference/static/src/xml/bank_rec_kanban_inherit.xml',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'installable': True,
|
'installable': True,
|
||||||
|
|||||||
Binary file not shown.
@ -1,2 +1 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from . import bank_rec_widget
|
|
||||||
Binary file not shown.
Binary file not shown.
@ -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()
|
|
||||||
10
static/src/xml/bank_rec_kanban_inherit.xml
Normal file
10
static/src/xml/bank_rec_kanban_inherit.xml
Normal 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>
|
||||||
@ -6,7 +6,7 @@
|
|||||||
<field name="model">account.move.line</field>
|
<field name="model">account.move.line</field>
|
||||||
<field name="inherit_id" ref="account_accountant.view_move_line_reconcile_tree"/>
|
<field name="inherit_id" ref="account_accountant.view_move_line_reconcile_tree"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//tree//field[@name='ref']" position="attributes">
|
<xpath expr="//list//field[@name='ref']" position="attributes">
|
||||||
<attribute name="optional">show</attribute>
|
<attribute name="optional">show</attribute>
|
||||||
<attribute name="readonly">0</attribute>
|
<attribute name="readonly">0</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|||||||
@ -1,16 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<!-- Kanban: show ref on bank rec widget cards -->
|
<!-- Kanban: fetch ref field so it's available in OWL -->
|
||||||
<record id="view_bank_statement_line_kanban_inherit_ref" model="ir.ui.view">
|
<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="name">account.bank.statement.line.kanban.inherit.ref</field>
|
||||||
<field name="model">account.bank.statement.line</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="inherit_id" ref="account_accountant.view_bank_statement_line_kanban_bank_rec_widget"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//templates/t[@t-name='kanban-box']//div[@id='row2_col1']" position="after">
|
<xpath expr="//field[@name='payment_ref']" position="after">
|
||||||
<div id="row2_ref" class="text-truncate text-muted">
|
<field name="ref"/>
|
||||||
<field name="ref"/>
|
|
||||||
</div>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@ -21,7 +19,7 @@
|
|||||||
<field name="model">account.bank.statement.line</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="inherit_id" ref="account_accountant.view_bank_statement_line_tree_bank_rec_widget"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//tree//field[@name='ref']" position="attributes">
|
<xpath expr="//list//field[@name='ref']" position="attributes">
|
||||||
<attribute name="optional">show</attribute>
|
<attribute name="optional">show</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user