Merge lp:~alexis-via/openobject-server/server-trunk-partner-bank-currency into lp:openobject-server

Proposed by Alexis de Lattre
Status: Rejected
Rejected by: Raphael Collet (OpenERP)
Proposed branch: lp:~alexis-via/openobject-server/server-trunk-partner-bank-currency
Merge into: lp:openobject-server
Diff against target: 32 lines (+4/-0)
2 files modified
openerp/addons/base/res/res_bank.py (+2/-0)
openerp/addons/base/res/res_bank_view.xml (+2/-0)
To merge this branch: bzr merge lp:~alexis-via/openobject-server/server-trunk-partner-bank-currency
Reviewer Review Type Date Requested Status
Raphael Collet (OpenERP) (community) Disapprove
Review via email: mp+90713@code.launchpad.net

Description of the change

A company can have multiple bank accounts in different currencies : one in EUR, one in USD, etc... We need to be able to defined the currency of the bank account.

So this merge proposal adds a field "currency_id" (many2one to res.currency) on the object res.partner.bank.

If this merge proposal is accepted, please also merge the following branch, that add the 'currency_id' field in the required views of the 'account' module :
lp:~alexis-via/openobject-addons/trunk-partner-bank-currency

To post a comment you must log in.
Revision history for this message
Alexis de Lattre (alexis-via) wrote :
Revision history for this message
Frontware International (frontware) wrote :

Totally agree. Most of bank accounts are related to a specific currency. We should be able to specify the currency related to the bank account.

Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

Hi,

A bank account is associated to an accounting journal by the module 'account'. The currency of the bank account is therefore the currency of its accounting journal. Adding a field 'currency_id' that is independent from the bank account's journal is a source of confusion. IMHO, this proposal is inadequate, as it is.

I think that any currency field on bank accounts should be guaranteed to be consistent with the accounting journal's currency. A related field added by the module 'account' would be better.

Thanks for the proposal, anyway.
Raphael

review: Disapprove
Revision history for this message
Alexis de Lattre (alexis-via) wrote :

@Raphael Collet
I think that your suggestion is good... a related field currency_id that points to the currency of the related journal is better. I was not aware of the link from res.partner.bank to account.journal because it is not displayed in the views when you access the bank account via the partners. I now access it via the menu Accounting > Configuration > Financial accounting > Accounts > Setup your bank accounts and I can see the link.

In fact, I find your suggestion so good that I have already implemented and tested it. Here it is, ready for merging :

https://code.launchpad.net/~akretion-team/openobject-addons/trunk-partner-bank-currency-related/+merge/91038

Unmerged revisions

3979. By Alexis de Lattre

Add 'currency_id' field on res.partner.bank object
Add it to the corresponding views

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/addons/base/res/res_bank.py'
2--- openerp/addons/base/res/res_bank.py 2012-01-27 08:51:33 +0000
3+++ openerp/addons/base/res/res_bank.py 2012-01-30 15:23:01 +0000
4@@ -122,6 +122,8 @@
5 _columns = {
6 'name': fields.char('Bank Account', size=64), # to be removed in v6.2 ?
7 'acc_number': fields.char('Account Number', size=64, required=True),
8+ 'currency_id': fields.many2one('res.currency', 'Currency',
9+ help="Select the currency of the bank account"),
10 'bank': fields.many2one('res.bank', 'Bank'),
11 'bank_bic': fields.char('Bank Identifier Code', size=16),
12 'bank_name': fields.char('Bank Name', size=32),
13
14=== modified file 'openerp/addons/base/res/res_bank_view.xml'
15--- openerp/addons/base/res/res_bank_view.xml 2011-11-22 14:45:12 +0000
16+++ openerp/addons/base/res/res_bank_view.xml 2012-01-30 15:23:01 +0000
17@@ -100,6 +100,7 @@
18 <field name="footer" attrs="{'invisible': [('company_id','=',False)]}"/>
19 <newline/>
20 <field name="acc_number"/>
21+ <field name="currency_id"/>
22 </group>
23 <group name="owner" colspan="2" col="2">
24 <separator colspan="4" string="Bank Account Owner"/>
25@@ -147,6 +148,7 @@
26 <tree string="Bank Accounts">
27 <field name="sequence" invisible="1"/>
28 <field name="acc_number"/>
29+ <field name="currency_id"/>
30 <field name="bank_name"/>
31 <field name="company_id" invisible="context.get('company_hide', True)"/>
32 <field name="footer" invisible="context.get('company_hide', True)"/>