Merge lp:~savoirfairelinux-openerp/partner-contact-management/partner-contact-management-base_contact_add_res_bank_account into lp:~partner-contact-core-editors/partner-contact-management/7.0

Status: Needs review
Proposed branch: lp:~savoirfairelinux-openerp/partner-contact-management/partner-contact-management-base_contact_add_res_bank_account
Merge into: lp:~partner-contact-core-editors/partner-contact-management/7.0
Diff against target: 311 lines (+280/-0)
6 files modified
res_bank_account/__init__.py (+25/-0)
res_bank_account/__openerp__.py (+54/-0)
res_bank_account/i18n/fr.po (+52/-0)
res_bank_account/i18n/res_bank_account.pot (+52/-0)
res_bank_account/res_bank.py (+36/-0)
res_bank_account/res_bank_view.xml (+61/-0)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/partner-contact-management/partner-contact-management-base_contact_add_res_bank_account
Reviewer Review Type Date Requested Status
Lorenzo Battistini (community) Needs Resubmitting
Ana Juaristi Olalde (community) Needs Fixing
Yannick Vaucher @ Camptocamp Disapprove
Sandy Carter (http://www.savoirfairelinux.com) code review, test Approve
Review via email: mp+204047@code.launchpad.net

Description of the change

Add res_bank_account module: add the title bank account, observation and active boolean fields.It allows to manage several bank accounts for each contact

To post a comment you must log in.
Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) :
review: Approve (code review, test)
Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

Community, any update on this?

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

_columns = {
237 + 'title_bank_account': fields.char('Title bank account', size=256,
238 + help="Title bank account."),
239 + 'observation': fields.text('Observation', help="Observation."),
240 + 'active': fields.boolean('Active', help="Active/Inactive."),
241 + }
242 +

help text are not very helpful :)

review: Needs Fixing
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

What is the purpose of this module ? the description doesn't help either :/

34. By Sandy Carter (http://www.savoirfairelinux.com)

Clarified help and description of module

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

Help text and description improved.
I hope this helps for further review.

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Description seems inaccurate to me, OpenERP already allows to manage multiple bank account per partner.

What is the plus-value when installing this module?
I suppose this is to add details on bank accounts to describe for what they should be used.
Why should I need a title_bank_account and an observation field on my res_partner_bank
Wouldn't one field be enough?
If I needed more info on res.partner.bank, I would simply add a 'description' field as on other models

title_bank_account seems useless to me as it isn't even in tree views.

Active field already exists on res.partner.bank model. By the way you overide the select=True parameter on it.

And finally this may be a matter of taste but I would name this module res_partner_bank_imp instead.

Thus sorry but I'll disaprove this one in that state.

review: Disapprove
Revision history for this message
Ana Juaristi Olalde (ajuaristio) wrote :

@yannick
title_bank_account seems useless to me as it isn't even in tree views.

This is a subjective opinion. If someone needs 2 fields, he adds 2 fields. That's all :)

@Elhadji
My oppinion is Need fixing because:

1. <field name="bank_ids" position="replace">
If you replace bank_ids with something hardcoded on your module view, you will not see new "future" core improvements on that view.

2. I agree with @yannick in --> Active field already exists on res.partner.bank model. By the way you overide the select=True parameter on it.

review: Needs Fixing
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Thanks for the review Ana

My point about title_bank_account is that most of Models have standard `name` and `description` fields.
I agree having a second field description is quiet useful to add note on the object when you open it.

However as res.partner.bank is already a bank account, naming a field xxx_bank_account seams also redundant. Thus I think it is badly named.

Still, module description doesn't match what the module does. This is more about adding fields for informations than allowing to manage multiple bank accounts. Or am I missing something?

Revision history for this message
Lorenzo Battistini (elbati) wrote :

This project is now hosted on https://github.com/OCA/partner-contact. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

review: Needs Resubmitting

Unmerged revisions

34. By Sandy Carter (http://www.savoirfairelinux.com)

Clarified help and description of module

33. By El Hadji Dem (http://www.savoirfairelinux.com)

[ADD]Add res_bank_account module: add the title bank account, observation and active boolean fields.It allows to manage several bank accounts for each contact

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'res_bank_account'
2=== added file 'res_bank_account/__init__.py'
3--- res_bank_account/__init__.py 1970-01-01 00:00:00 +0000
4+++ res_bank_account/__init__.py 2014-03-21 19:34:54 +0000
5@@ -0,0 +1,25 @@
6+# -*- encoding: utf-8 -*-
7+##############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# This module copyright (C) 2013 Savoir-faire Linux
11+# (<http://www.savoirfairelinux.com>).
12+#
13+# This program is free software: you can redistribute it and/or modify
14+# it under the terms of the GNU Affero General Public License as
15+# published by the Free Software Foundation, either version 3 of the
16+# License, or (at your option) any later version.
17+#
18+# This program is distributed in the hope that it will be useful,
19+# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+# GNU Affero General Public License for more details.
22+#
23+# You should have received a copy of the GNU Affero General Public License
24+# along with this program. If not, see <http://www.gnu.org/licenses/>.
25+#
26+##############################################################################
27+
28+from . import res_bank
29+
30+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
31
32=== added file 'res_bank_account/__openerp__.py'
33--- res_bank_account/__openerp__.py 1970-01-01 00:00:00 +0000
34+++ res_bank_account/__openerp__.py 2014-03-21 19:34:54 +0000
35@@ -0,0 +1,54 @@
36+# -*- encoding: utf-8 -*-
37+##############################################################################
38+#
39+# OpenERP, Open Source Management Solution
40+# This module copyright (C) 2010 - 2014 Savoir-faire Linux
41+# (<http://www.savoirfairelinux.com>).
42+#
43+# This program is free software: you can redistribute it and/or modify
44+# it under the terms of the GNU Affero General Public License as
45+# published by the Free Software Foundation, either version 3 of the
46+# License, or (at your option) any later version.
47+#
48+# This program is distributed in the hope that it will be useful,
49+# but WITHOUT ANY WARRANTY; without even the implied warranty of
50+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51+# GNU Affero General Public License for more details.
52+#
53+# You should have received a copy of the GNU Affero General Public License
54+# along with this program. If not, see <http://www.gnu.org/licenses/>.
55+#
56+##############################################################################
57+
58+{
59+ 'name': 'Bank Account',
60+ 'version': '0.1',
61+ 'author': 'Savoir-faire Linux',
62+ 'maintainer': 'Savoir-faire Linux',
63+ 'website': 'http://www.savoirfairelinux.com',
64+ 'category': 'Customer Relationship Management',
65+ 'description': """
66+Bank Account
67+============
68+
69+This module allows to manage multiple bank accounts for a specific contact.
70+
71+It adds a bank account object linked to a bank with a name for the account, a
72+description and wheter it is active or not.
73+
74+
75+Contributors
76+------------
77+* El Hadji Dem (elhadji.dem@savoirfairelinux.com)
78+""",
79+ 'depends': [
80+ 'account',
81+ ],
82+ 'external_dependencies': {},
83+ 'data': [
84+ 'res_bank_view.xml',
85+ ],
86+ 'demo': [],
87+ 'test': [],
88+ 'installable': True,
89+}
90
91=== added directory 'res_bank_account/i18n'
92=== added file 'res_bank_account/i18n/fr.po'
93--- res_bank_account/i18n/fr.po 1970-01-01 00:00:00 +0000
94+++ res_bank_account/i18n/fr.po 2014-03-21 19:34:54 +0000
95@@ -0,0 +1,52 @@
96+# Translation of OpenERP Server.
97+# This file contains the translation of the following modules:
98+# * res_bank_account
99+#
100+msgid ""
101+msgstr ""
102+"Project-Id-Version: OpenERP Server 7.0\n"
103+"Report-Msgid-Bugs-To: \n"
104+"POT-Creation-Date: 2014-01-03 07:26+0000\n"
105+"PO-Revision-Date: 2014-01-03 02:26-0500\n"
106+"Last-Translator: EL Hadji DEM <elhadji.dem@savoirfairelinux.com>\n"
107+"Language-Team: \n"
108+"MIME-Version: 1.0\n"
109+"Content-Type: text/plain; charset=UTF-8\n"
110+"Content-Transfer-Encoding: 8bit\n"
111+"Plural-Forms: \n"
112+"X-Generator: Poedit 1.5.4\n"
113+
114+#. module: res_bank_account
115+#: field:res.partner.bank,observation:0
116+msgid "Observation"
117+msgstr "Remarque"
118+
119+#. module: res_bank_account
120+#: help:res.partner.bank,active:0
121+msgid "Active/Inactive."
122+msgstr "Actif/Inactif."
123+
124+#. module: res_bank_account
125+#: model:ir.model,name:res_bank_account.model_res_partner_bank
126+msgid "Bank Accounts"
127+msgstr "Comptes bancaires"
128+
129+#. module: res_bank_account
130+#: help:res.partner.bank,observation:0
131+msgid "Observation."
132+msgstr "Remarque."
133+
134+#. module: res_bank_account
135+#: field:res.partner.bank,title_bank_account:0
136+msgid "Title bank account"
137+msgstr "Intitulé du compte bancaire"
138+
139+#. module: res_bank_account
140+#: field:res.partner.bank,active:0
141+msgid "Active"
142+msgstr "Active"
143+
144+#. module: res_bank_account
145+#: help:res.partner.bank,title_bank_account:0
146+msgid "Title bank account."
147+msgstr "Intitulé du compte bancaire."
148
149=== added file 'res_bank_account/i18n/res_bank_account.pot'
150--- res_bank_account/i18n/res_bank_account.pot 1970-01-01 00:00:00 +0000
151+++ res_bank_account/i18n/res_bank_account.pot 2014-03-21 19:34:54 +0000
152@@ -0,0 +1,52 @@
153+# Translation of OpenERP Server.
154+# This file contains the translation of the following modules:
155+# * res_bank_account
156+#
157+msgid ""
158+msgstr ""
159+"Project-Id-Version: OpenERP Server 7.0\n"
160+"Report-Msgid-Bugs-To: \n"
161+"POT-Creation-Date: 2014-01-03 07:25+0000\n"
162+"PO-Revision-Date: 2014-01-03 02:25-0500\n"
163+"Last-Translator: EL Hadji DEM <elhadji.dem@savoirfairelinux.com>\n"
164+"Language-Team: \n"
165+"MIME-Version: 1.0\n"
166+"Content-Type: text/plain; charset=UTF-8\n"
167+"Content-Transfer-Encoding: 8bit\n"
168+"Plural-Forms: \n"
169+"X-Generator: Poedit 1.5.4\n"
170+
171+#. module: res_bank_account
172+#: field:res.partner.bank,observation:0
173+msgid "Observation"
174+msgstr ""
175+
176+#. module: res_bank_account
177+#: help:res.partner.bank,active:0
178+msgid "Active/Inactive."
179+msgstr ""
180+
181+#. module: res_bank_account
182+#: model:ir.model,name:res_bank_account.model_res_partner_bank
183+msgid "Bank Accounts"
184+msgstr ""
185+
186+#. module: res_bank_account
187+#: help:res.partner.bank,observation:0
188+msgid "Observation."
189+msgstr ""
190+
191+#. module: res_bank_account
192+#: field:res.partner.bank,title_bank_account:0
193+msgid "Title bank account"
194+msgstr ""
195+
196+#. module: res_bank_account
197+#: field:res.partner.bank,active:0
198+msgid "Active"
199+msgstr ""
200+
201+#. module: res_bank_account
202+#: help:res.partner.bank,title_bank_account:0
203+msgid "Title bank account."
204+msgstr ""
205
206=== added file 'res_bank_account/res_bank.py'
207--- res_bank_account/res_bank.py 1970-01-01 00:00:00 +0000
208+++ res_bank_account/res_bank.py 2014-03-21 19:34:54 +0000
209@@ -0,0 +1,36 @@
210+# -*- encoding: utf-8 -*-
211+##############################################################################
212+#
213+# OpenERP, Open Source Management Solution
214+# This module copyright (C) 2010 - 2014 Savoir-faire Linux
215+# (<http://www.savoirfairelinux.com>).
216+#
217+# This program is free software: you can redistribute it and/or modify
218+# it under the terms of the GNU Affero General Public License as
219+# published by the Free Software Foundation, either version 3 of the
220+# License, or (at your option) any later version.
221+#
222+# This program is distributed in the hope that it will be useful,
223+# but WITHOUT ANY WARRANTY; without even the implied warranty of
224+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
225+# GNU Affero General Public License for more details.
226+#
227+# You should have received a copy of the GNU Affero General Public License
228+# along with this program. If not, see <http://www.gnu.org/licenses/>.
229+#
230+##############################################################################
231+
232+from openerp.osv import orm, fields
233+
234+
235+class res_partner_bank(orm.Model):
236+ """Bank account"""
237+ _inherit = 'res.partner.bank'
238+
239+ _columns = {
240+ 'title_bank_account': fields.char(
241+ 'Title bank account', size=256, help="Name for the bank account."),
242+ 'observation': fields.text(
243+ 'Observation', help="Extra information about the account."),
244+ 'active': fields.boolean('Active', help="Whether the account is still active or not."),
245+ }
246
247=== added file 'res_bank_account/res_bank_view.xml'
248--- res_bank_account/res_bank_view.xml 1970-01-01 00:00:00 +0000
249+++ res_bank_account/res_bank_view.xml 2014-03-21 19:34:54 +0000
250@@ -0,0 +1,61 @@
251+<?xml version="1.0" encoding="utf-8"?>
252+<openerp>
253+ <data>
254+
255+ <!-- Adds title_bank_account,observation and active fields in res.bank form view -->
256+ <record id="view_partner_bank_inherit_add_form" model="ir.ui.view">
257+ <field name="name">res.partner.bank.inherit.add.form</field>
258+ <field name="model">res.partner.bank</field>
259+ <field name="inherit_id" ref="base.view_partner_bank_form"/>
260+ <field name="arch" type="xml">
261+ <field name="state" position="before">
262+ <field name="title_bank_account"/>
263+ </field>
264+ <field name="acc_number" position="after">
265+ <field name="active"/>
266+ </field>
267+ <xpath expr="//form[@string='Bank account']/group[2]"
268+ position="after">
269+ <group>
270+ <field name="observation"/>
271+ </group>
272+ </xpath>
273+ </field>
274+ </record>
275+
276+ <!--Add active field in tree view-->
277+ <record id="view_partner_bank_inherit_active_tree" model="ir.ui.view">
278+ <field name="name">res.partner.bank.inherit.active.tree</field>
279+ <field name="model">res.partner.bank</field>
280+ <field name="inherit_id" ref="base.view_partner_bank_tree"/>
281+ <field name="arch" type="xml">
282+ <field name="state" position="before">
283+ <field name="active"/>
284+ </field>
285+ </field>
286+ </record>
287+
288+ <!--redefine bank_ids tree-->
289+ <record id="view_partner_property_bank_form" model="ir.ui.view">
290+ <field name="name">res.partner.property.bank.inherit.bank.form</field>
291+ <field name="model">res.partner</field>
292+ <field name="inherit_id" ref="account.view_partner_property_form"/>
293+ <field name="arch" type="xml">
294+ <!--redefine bank_ids tree-->
295+ <field name="bank_ids" position="replace">
296+ <field name="bank_ids"
297+ context="{'default_partner_id': active_id, 'form_view_ref': 'base.view_partner_bank_form'}">
298+ <tree string="Bank Details">
299+ <field name="active"/>
300+ <field name="state" invisible="1"/>
301+ <field name="sequence" invisible="1"/>
302+ <field name="acc_number"/>
303+ <field name="bank_name"/>
304+ <field name="owner_name"/>
305+ </tree>
306+ </field>
307+ </field>
308+ </field>
309+ </record>
310+ </data>
311+</openerp>