Merge lp:~akretion-team/openobject-addons/trunk-partner-bank-currency-related into lp:openobject-addons

Proposed by Alexis de Lattre on 2012-02-01
Status: Merged
Merged at revision: 6463
Proposed branch: lp:~akretion-team/openobject-addons/trunk-partner-bank-currency-related
Merge into: lp:openobject-addons
Diff against target: 44 lines (+17/-0)
2 files modified
account/account_bank.py (+3/-0)
account/account_bank_view.xml (+14/-0)
To merge this branch: bzr merge lp:~akretion-team/openobject-addons/trunk-partner-bank-currency-related
Reviewer Review Type Date Requested Status
Raphael Collet (OpenERP) (community) 2012-02-01 Approve on 2012-02-01
Review via email: mp+91038@code.launchpad.net

Description of the Change

This merge proposal adds a currency_id related field on res.partner.bank. It displays the field on the form and tree view of res.partner.bank. With this addition, we are now able to easily identify the currency of the bank account when we select it on a customer invoice for example. For a company who has several bank accounts in different currencies in the same bank, it's much easier to differenciate the bank accounts by their currency than by their number.

This proposal implements the suggestion of Raphaël Collet on this (refused) merge proposal :
https://code.launchpad.net/~alexis-via/openobject-server/server-trunk-partner-bank-currency/+merge/90713

To post a comment you must log in.

Excellent!

Thanks,
Raphael

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_bank.py'
2--- account/account_bank.py 2011-12-30 10:20:07 +0000
3+++ account/account_bank.py 2012-02-01 10:15:31 +0000
4@@ -26,6 +26,9 @@
5 _inherit = "res.partner.bank"
6 _columns = {
7 'journal_id': fields.many2one('account.journal', 'Account Journal', help="This journal will be created automatically for this bank account when you save the record"),
8+ 'currency_id': fields.related('journal_id', 'currency', type="many2one",
9+ relation='res.currency', string="Currency", readonly=True,
10+ help="Currency of the related account journal."),
11 }
12 def create(self, cr, uid, data, context={}):
13 result = super(bank, self).create(cr, uid, data, context=context)
14
15=== modified file 'account/account_bank_view.xml'
16--- account/account_bank_view.xml 2011-10-16 01:28:00 +0000
17+++ account/account_bank_view.xml 2012-02-01 10:15:31 +0000
18@@ -16,12 +16,26 @@
19 <group name="accounting" col="2" colspan="2" attrs="{'invisible': [('company_id','=', False)]}" groups="base.group_extended">
20 <separator string="Accounting Information" colspan="2"/>
21 <field name="journal_id"/>
22+ <field name="currency_id"/>
23 </group>
24 </group>
25 </field>
26 </record>
27
28
29+ <record id="view_partner_bank_tree_add_currency" model="ir.ui.view">
30+ <field name="name">Partner Bank Accounts - Add currency on tree</field>
31+ <field name="model">res.partner.bank</field>
32+ <field name="type">tree</field>
33+ <field name="inherit_id" ref="base.view_partner_bank_tree"/>
34+ <field name="arch" type="xml">
35+ <field name="acc_number" position="after">
36+ <field name="currency_id"/>
37+ </field>
38+ </field>
39+ </record>
40+
41+
42 <record id="action_bank_tree" model="ir.actions.act_window">
43 <field name="name">Setup your Bank Accounts</field>
44 <field name="res_model">res.partner.bank</field>

Subscribers

People subscribed via source and target branches

to all changes: