Merge lp:~akretion-team/openobject-addons/trunk-addons-currency-format-layout-v2 into lp:openobject-addons

Proposed by Alexis de Lattre on 2012-07-11
Status: Merged
Merged at revision: 7018
Proposed branch: lp:~akretion-team/openobject-addons/trunk-addons-currency-format-layout-v2
Merge into: lp:openobject-addons
Diff against target: 16 lines (+6/-0)
1 file modified
account/ (+6/-0)
To merge this branch: bzr merge lp:~akretion-team/openobject-addons/trunk-addons-currency-format-layout-v2
Reviewer Review Type Date Requested Status
OpenERP Core Team 2012-07-11 Pending
Christophe CHAUVET 2012-07-11 Pending
Cristian Salamea 2012-07-11 Pending
Review via email:

This proposal supersedes a proposal from 2012-06-15.

Description of the change

This merge proposal is the continuity of the work I made in the following merge :

Some companies have several bank accounts in different currencies at the same bank. When it is the case, as users don't usually know bank account numbers by heart, they can't differenciate the bank accounts by the bank name, they also need the currency.

This merge proposal adds the ablility to use 'currency_name' in the 'format_layout' of (can be configured in the menu Sale > Configuration > Address book > Bank account types).

If this merge is accepted, the function name_get in server-trunk/openerp/addons/base/res/ line 175 should be removed.

To post a comment you must log in.
Christophe CHAUVET (christophe-chauvet) wrote : Posted in a previous version of this proposal

Hi Alexis

It's a good idea


review: Approve
Cristian Salamea (ovnicraft) wrote : Posted in a previous version of this proposal

In line 26 would not be better call name_get from currency to keep "(symbol) name" format ?


review: Needs Information
Alexis de Lattre (alexis-via) wrote : Posted in a previous version of this proposal

I don't think we need to have the symbol of the currency in the bank account name ; I think that having the name of the currency is enough (having both would use more caracters in the bank name... and there are already many things to print in the bank name)

Alexis de Lattre (alexis-via) wrote :

I have just updated the merge proposal, following Quentin's remarks ; Quentin wanted to keep the code of the name_get function in the server.

This MP requires the following MP on the server :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/'
2--- account/ 2012-03-09 10:56:59 +0000
3+++ account/ 2012-07-11 00:19:21 +0000
4@@ -43,6 +43,12 @@
5 "Return the name to use when creating a bank journal"
6 return (bank.bank_name or '') + ' ' + bank.acc_number
8+ def _prepare_name_get(self, cr, uid, bank_type_obj, bank_obj, context=None):
9+ """Add ability to have %(currency_name)s in the format_layout of
11+ bank_obj._data[]['currency_name'] = bank_obj.currency_id and or ''
12+ return super(bank, self)._prepare_name_get(cr, uid, bank_type_obj, bank_obj, context=context)
14 def post_write(self, cr, uid, ids, context={}):
15 if isinstance(ids, (int, long)):
16 ids = [ids]


People subscribed via source and target branches

to all changes: