mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Allow to link a bank journal to an existing bank account (one of the remarks of Frederic Clementi)
This commit is contained in:
committed by
Enric Tobella
parent
60e0816c80
commit
614df6ddca
@@ -16,6 +16,7 @@
|
||||
'views/account_payment_mode.xml',
|
||||
'views/res_partner_bank.xml',
|
||||
'views/res_partner.xml',
|
||||
'views/account_journal.xml',
|
||||
],
|
||||
'demo': ['demo/payment_demo.xml'],
|
||||
'installable': True,
|
||||
|
||||
@@ -22,3 +22,6 @@ class AccountJournal(models.Model):
|
||||
default=_default_outbound_payment_methods)
|
||||
inbound_payment_method_ids = fields.Many2many(
|
||||
default=_default_inbound_payment_methods)
|
||||
company_partner_id = fields.Many2one(
|
||||
'res.partner', related='company_id.partner_id',
|
||||
readonly=True) # Used in domain of field bank_account_id
|
||||
|
||||
29
account_payment_mode/views/account_journal.xml
Normal file
29
account_payment_mode/views/account_journal.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<!-- FIX of the 'account' module: on the form view of a bank journal,
|
||||
allow to link to an existing bank account -->
|
||||
<record id="view_account_journal_form" model="ir.ui.view">
|
||||
<field name="name">fix_bank_account_selection.account_journal.form</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.view_account_journal_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="bank_acc_number" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="bank_acc_number" position="before">
|
||||
<field name="company_partner_id" invisible="1"/>
|
||||
<field name="bank_account_id" domain="[('partner_id', '=', company_partner_id)]"/>
|
||||
</field>
|
||||
<!-- better when related fields are readonly, otherwise the user
|
||||
doesn't understand that he is changing the bank_id on the underlying
|
||||
res.partner.bank object -->
|
||||
<field name="bank_id" position="attributes">
|
||||
<attribute name="readonly">1</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user