mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[FIX] Do not write obsolete field 'code' to res.bank
[ADD] Write bic field to res.partner.bank when found [FIX] Super() called with wrong object name [FIX] Disable invalid xpath expression
This commit is contained in:
@@ -1142,6 +1142,9 @@ class res_partner_bank(osv.osv):
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
'''
|
||||
Create dual function IBAN account for SEPA countries
|
||||
|
||||
Update the domestic account number when the IBAN is
|
||||
written, or clear the domestic number on regular account numbers.
|
||||
'''
|
||||
if ids and isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
@@ -1149,7 +1152,7 @@ class res_partner_bank(osv.osv):
|
||||
cr, uid, ids, ['state', 'acc_number']):
|
||||
if 'state' in vals or 'acc_number' in vals:
|
||||
account.update(vals)
|
||||
if 'state' in vals and vals['state'] == 'iban':
|
||||
if account['state'] == 'iban':
|
||||
vals['acc_number'], vals['acc_number_domestic'] = (
|
||||
self._correct_IBAN(account['acc_number']))
|
||||
else:
|
||||
@@ -1361,12 +1364,14 @@ class res_partner_bank(osv.osv):
|
||||
bank_id, country_id = get_or_create_bank(
|
||||
self.pool, cursor, uid,
|
||||
info.bic or iban_acc.BIC_searchkey,
|
||||
code = info.code, name = info.bank
|
||||
name = info.bank
|
||||
)
|
||||
values['country_id'] = country_id or \
|
||||
country_ids and country_ids[0] or \
|
||||
False
|
||||
values['bank'] = bank_id or False
|
||||
if info.bic:
|
||||
values['bank_bic'] = info.bic
|
||||
else:
|
||||
info = None
|
||||
if info is None:
|
||||
|
||||
@@ -1934,7 +1934,7 @@ class account_bank_statement_line(osv.osv):
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
if line.state == 'confirmed':
|
||||
raise osv.except_osv(_('Confirmed Statement Line'), _("You cannot delete a confirmed Statement Line: '%s'" % line.name))
|
||||
return super(account_bank_statement,self).unlink(cr, uid, ids, context=context)
|
||||
return super(account_bank_statement_line,self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
account_bank_statement_line()
|
||||
|
||||
|
||||
@@ -13,6 +13,13 @@
|
||||
<field eval="False" name="required"/>
|
||||
<field eval="False" name="readonly"/>
|
||||
</record>
|
||||
<!--
|
||||
BIC is not legally required
|
||||
See https://bugs.launchpad.net/bugs/933472
|
||||
-->
|
||||
<record id="base_iban.bank_swift_field" model="res.partner.bank.type.field">
|
||||
<field eval="False" name="required"/>
|
||||
</record>
|
||||
<!-- Add manual bank transfer as default payment option -->
|
||||
<record model="payment.mode.type" id="account_banking.manual_bank_tranfer">
|
||||
<field name="name">Manual Bank Transfer</field>
|
||||
|
||||
@@ -373,6 +373,7 @@ def create_bank_account(pool, cursor, uid, partner_id,
|
||||
|
||||
if bic:
|
||||
values.bank = get_or_create_bank(pool, cursor, uid, bic)[0]
|
||||
values.bank_bic = bic
|
||||
|
||||
# Create bank account and return
|
||||
return pool.get('res.partner.bank').create(cursor, uid, values)
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
<field name="res_model">payment.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{'search_payment_order_type': 'debit'}</field>
|
||||
<field name="context">{'search_payment_order_type': 'debit',
|
||||
'default_payment_order_type': 'debit'}</field>
|
||||
<field name="search_view_id" ref="account_payment.view_payment_order_search"/>
|
||||
<field name="domain">[('payment_order_type', '=', 'debit')]</field>
|
||||
<field name="help">A debit order is a debit request from your company to collect customer invoices. Here you can register all debit orders that should be done, keep track of all debit orders and mention the invoice reference and the partner the withdrawal should be done for.</field>
|
||||
@@ -45,10 +46,11 @@
|
||||
icon="gtk-find"
|
||||
/>
|
||||
</xpath>
|
||||
<xpath expr="//tree[@string='Payment Line']" position="inside">
|
||||
<!-- the attrs do not work like this, apparently -->
|
||||
<field name="storno" attrs="{'invisible': [(parent.payment_order_type, '!=', 'debit')]}"/>
|
||||
</xpath>
|
||||
<!-- the attrs do not work like this, apparently
|
||||
<xpath expr="//tree[@string='Payment Line']" position="inside">
|
||||
<field name="storno" attrs="{'invisible': [(parent.payment_order_type, '!=', 'debit')]}"/>
|
||||
</xpath>
|
||||
-->
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -7,6 +7,3 @@ class res_partner_bank(osv.osv):
|
||||
'acc_number_domestic': fields.char(
|
||||
'Domestic Account Number', size=64)
|
||||
}
|
||||
|
||||
res_partner_bank()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user