Merge lp:~savoirfairelinux-openerp/partner-contact-management/improvement_after_integration_new_partner_firstname into lp:~savoirfairelinux-openerp/partner-contact-management/base_contact_by_functions

Status: Merged
Merged at revision: 39
Proposed branch: lp:~savoirfairelinux-openerp/partner-contact-management/improvement_after_integration_new_partner_firstname
Merge into: lp:~savoirfairelinux-openerp/partner-contact-management/base_contact_by_functions
Diff against target: 525 lines (+223/-110)
12 files modified
base_contact_by_functions/res_partner_view.xml (+79/-84)
partner_firstname/partner_view.xml (+2/-3)
partner_member_observer/i18n/fr.po (+1/-1)
partner_supplier_information/__openerp__.py (+18/-6)
partner_supplier_information/res_partner.py (+1/-1)
partner_supplier_information/res_partner_view.xml (+37/-0)
res_bank_account/__init__.py (+1/-1)
res_bank_account/__openerp__.py (+5/-3)
res_bank_account/res_bank_view.xml (+23/-0)
user_firstname/__init__.py (+1/-1)
user_firstname/__openerp__.py (+13/-10)
user_firstname/res_user_view.xml (+42/-0)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/partner-contact-management/improvement_after_integration_new_partner_firstname
Reviewer Review Type Date Requested Status
Sandy Carter (http://www.savoirfairelinux.com) code review, no test Needs Fixing
Review via email: mp+203350@code.launchpad.net

Description of the change

- Update user_firstname module: display in tree view, full_name instead of name, add full_name in search view for users. - Update parter_supplier_information: add a view.
- Redefine res_bank_account: update view.
- Replace function field in partner view; hide company if partner is a contact in base_contact_by_functions.
- Update user_firstname: display firstname before name field.

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

l.9 for readability's sake, can you put ')' on a different line like it is done at l.26
l.181 seems to be a pointless line, if you're trying to hide it, use the <delete model="..." id="..." /> tag
l.229 seems to be a pointless line, if you're trying to hide it, use the <delete model="..." id="..." /> tag
l.367 no need to have base as a dependency
l.436 no point in having a summary that is a cut and paste of the title, go for something along the lines of "Add ___ to __"
l.506 this is python code, so keep it PEP8 (spaces after commas)

review: Needs Fixing (code review, no test)
39. By El Hadji Dem (http://www.savoirfairelinux.com)

[IMP] take comments from lp:MP 203350

Revision history for this message
El Hadji Dem (http://www.savoirfairelinux.com) (eh-dem) wrote :

Hi Sandy,

l.181: <field name="function" position="replace"/> : I cannot use this the <delete model="..." id="..." /> tag because I use function in another place.If if use your tag, it creates a xml bug.
l.229: <xpath expr="//form[@string='Contact']/sheet/div/label" position="replace"/> : I cannot use this the <delete model="..." id="..." /> tag because I use function in another place.It is the same on line.181.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'base_contact_by_functions/res_partner_view.xml'
2--- base_contact_by_functions/res_partner_view.xml 2014-01-10 19:32:17 +0000
3+++ base_contact_by_functions/res_partner_view.xml 2014-01-27 18:51:38 +0000
4@@ -7,9 +7,6 @@
5 <field name="model">res.partner</field>
6 <field name="inherit_id" ref="base.view_partner_form"/>
7 <field name="arch" type="xml">
8- <label for="is_company" position="replace">
9- <label for="is_company" string="Is an Organism?"/>
10- </label>
11 <field name="use_parent_address" position="replace">
12 <field name="use_parent_address"
13 class="oe_edit_only oe_inline"
14@@ -23,6 +20,10 @@
15 attrs="{'invisible': [('parent_id','=', False),('use_parent_address','=',False)]}"
16 string="Use organism address"/>
17 </label>
18+ <!--Add ')' at the end of 'Is an Organism?'-->
19+ <label for="is_company" position="replace">
20+ <label for="is_company" string="Is an Organism?"/>)
21+ </label>
22 <notebook position="inside">
23 <page string="Functions"
24 attrs="{'invisible': [('is_company','=',False), ('child_ids', '=', [])]}"
25@@ -80,15 +81,12 @@
26 <div class="oe_kanban_partner_categories"/>
27 <div class="oe_kanban_partner_links"/>
28 <ul>
29- <li t-if="record.parent_id.raw_value and !record.function_id.raw_value">
30- <field name="parent_id"/>
31- </li>
32 <li t-if="!record.parent_id.raw_value and record.function_id.raw_value">
33 <field name="function_id"/>
34 </li>
35 <li t-if="record.parent_id.raw_value and record.function_id.raw_value">
36 <field name="function_id"/>
37- à
38+ ,
39 <field name="parent_id"/>
40 </li>
41 <li t-if="record.city.raw_value and !record.country.raw_value">
42@@ -113,84 +111,80 @@
43 </t>
44 </templates>
45 </kanban>
46- <form string="Contact" version="7.0">
47- <sheet>
48- <field name="image" widget='image' class="oe_avatar oe_left"
49- options='{"preview_image": "image_medium"}'/>
50- <div class="oe_title">
51- <label for="name" class="oe_edit_only"/>
52- <h1>
53- <field name="name" style="width: 70%%"/>
54- </h1>
55- </div>
56- <group>
57- <!-- inherited part -->
58- <field name="category_id" widget="many2many_tags"
59- placeholder="Tags..." style="width: 70%%"/>
60- <field name="parent_id"
61- placeholder="Organism"
62- domain="[('is_company','=',True)]"
63- string="Parent Organism"/>
64- <!-- inherited part end -->
65- <field name="function_id" placeholder="e.g. Sales Director"/>
66- <group colspan="4">
67- <field name="start_date" />
68- <field name="end_date"/>
69- <field name="naming"/>
70- </group>
71- <field name="email"/>
72- <field name="phone"/>
73- <field name="mobile"/>
74- </group>
75- <div>
76- <field name="use_parent_address"/>
77- <label for="use_parent_address" string="Use organism address"/>
78- </div>
79- <group>
80- <label for="type"/>
81- <div name="div_type">
82- <field class="oe_inline" name="type"/>
83- </div>
84- <label for="street" string="Address"
85- attrs="{'invisible': [('use_parent_address','=', True)]}"/>
86- <div attrs="{'invisible': [('use_parent_address','=', True)]}"
87- name="div_address">
88- <field name="street" placeholder="Street..."/>
89- <field name="street2"/>
90- <div class="address_format">
91- <field name="city" placeholder="City" style="width: 40%%"/>
92- <field name="state_id" class="oe_no_button"
93- placeholder="State" style="width: 37%%"
94- options='{"no_open": True}' on_change="onchange_state(state_id)"/>
95- <field name="zip" placeholder="ZIP" style="width: 20%%"/>
96- </div>
97- <field name="country_id" placeholder="Country"
98- class="oe_no_button" options='{"no_open": True}'/>
99- </div>
100- </group>
101- <field name="supplier" invisible="True"/>
102- <group string="Bank Accounts">
103- <field name="bank_ids" nolabel="1">
104- <tree string="Bank Details">
105- <field name="state" invisible="1"/>
106- <field name="sequence" invisible="1"/>
107- <field name="acc_number"/>
108- <field name="bank_name"/>
109- <field name="owner_name"/>
110- </tree>
111- </field>
112- </group>
113- </sheet>
114- </form>
115+ <form string="Contact" version="7.0">
116+ <sheet>
117+ <field name="image" widget='image' class="oe_avatar oe_left"
118+ options='{"preview_image": "image_medium"}'/>
119+ <div class="oe_title">
120+ <label for="name" class="oe_edit_only"/>
121+ <h1>
122+ <field name="name" style="width: 70%%"/>
123+ </h1>
124+ </div>
125+ <group>
126+ <!-- inherited part -->
127+ <field name="category_id" widget="many2many_tags"
128+ placeholder="Tags..." style="width: 70%%" string="Tag"/>
129+ <field name="parent_id"
130+ placeholder="Organism"
131+ domain="[('is_company','=',True)]"
132+ string="Parent Organism"/>
133+ <!-- inherited part end -->
134+ <field name="function_id" placeholder="e.g. Sales Director"/>
135+ <group colspan="4">
136+ <field name="start_date" />
137+ <field name="end_date"/>
138+ <field name="naming"/>
139+ </group>
140+ <field name="email"/>
141+ <field name="phone"/>
142+ <field name="mobile"/>
143+ </group>
144+ <div>
145+ <field name="use_parent_address"/>
146+ <label for="use_parent_address" string="Use organism address"/>
147+ </div>
148+ <group>
149+ <label for="type"/>
150+ <div name="div_type">
151+ <field class="oe_inline" name="type"/>
152+ </div>
153+ <label for="street" string="Address"
154+ attrs="{'invisible': [('use_parent_address','=', True)]}"/>
155+ <div attrs="{'invisible': [('use_parent_address','=', True)]}"
156+ name="div_address">
157+ <field name="street" placeholder="Street..."/>
158+ <field name="street2"/>
159+ <div class="address_format">
160+ <field name="city" placeholder="City" style="width: 40%%"/>
161+ <field name="state_id" class="oe_no_button"
162+ placeholder="State" style="width: 37%%"
163+ options='{"no_open": True}' on_change="onchange_state(state_id)"/>
164+ <field name="zip" placeholder="ZIP" style="width: 20%%"/>
165+ </div>
166+ <field name="country_id" placeholder="Country"
167+ class="oe_no_button" options='{"no_open": True}'/>
168+ </div>
169+ </group>
170+ <field name="supplier" invisible="True"/>
171+ <group string="Bank Accounts">
172+ <field name="bank_ids" nolabel="1">
173+ <tree string="Bank Details">
174+ <field name="state" invisible="1"/>
175+ <field name="sequence" invisible="1"/>
176+ <field name="acc_number"/>
177+ <field name="bank_name"/>
178+ <field name="owner_name"/>
179+ </tree>
180+ </field>
181+ </group>
182+ </sheet>
183+ </form>
184 </field>
185 </page>
186 </notebook>
187 <!--Replace function by function_id defined by organism-->
188- <field name="function" position="replace">
189- <field name="function"
190- attrs="{'invisible': [('is_company','=', True)]}"
191- string="Function"/>
192- </field>
193+ <field name="function" position="replace"/>
194 </field>
195
196 </record>
197@@ -311,7 +305,7 @@
198 </t>
199 <t t-if="record.parent_id.raw_value and record.function_id.raw_value">
200 <field name="function_id"/>
201- à
202+ ,
203 <field name="parent_id"/>
204 </t>
205 </i>
206@@ -343,7 +337,8 @@
207 have the same form for contact and other postions
208 <field name="parent_id" position="replace">
209 <field name="parent_id" placeholder="Organism"
210- domain="[('is_company','=',True)]"/>
211+ domain="[('is_company','=',True)]"
212+ attrs="{'invisible': [('is_company','=', False)]}"/>
213 </field>
214 <xpath expr="//field[@name='child_ids']/form//field[@name='supplier']"
215 position="after">
216@@ -423,7 +418,7 @@
217 </li>
218 <li t-if="record.parent_id.raw_value and record.function_id.raw_value">
219 <field name="function_id"/>
220- à
221+ ,
222 <field name="parent_id"/>
223 </li>
224 <li t-if="record.city.raw_value and !record.country.raw_value">
225
226=== modified file 'partner_firstname/partner_view.xml'
227--- partner_firstname/partner_view.xml 2014-01-22 20:01:37 +0000
228+++ partner_firstname/partner_view.xml 2014-01-27 18:51:38 +0000
229@@ -19,13 +19,12 @@
230 </field>
231
232 <!-- Add first name and name in inner contact form of child_ids -->
233- <xpath expr="//form[@string='Contact']/sheet/div/h1/field[@name='name']" position="replace"/>
234- <xpath expr="//form[@string='Contact']/sheet/div/label" position="after">
235+ <xpath expr="//form[@string='Contact']/sheet/div/h1/field[@name='name']" position="before">
236 <group>
237 <field name="firstname"/>
238- <field name="name"/>
239 </group>
240 </xpath>
241+ <xpath expr="//form[@string='Contact']/sheet/div/label" position="replace"/>
242
243 <label for="name" position="attributes">
244 <attribute name="invisible">1</attribute>
245
246=== modified file 'partner_member_observer/i18n/fr.po'
247--- partner_member_observer/i18n/fr.po 2014-01-03 16:57:29 +0000
248+++ partner_member_observer/i18n/fr.po 2014-01-27 18:51:38 +0000
249@@ -34,7 +34,7 @@
250 #. module: partner_member_observer
251 #: field:res.partner,member_states:0
252 msgid "Member state"
253-msgstr "État membre"
254+msgstr "Etat membre"
255
256 #. module: partner_member_observer
257 #: field:res.partner,observer_state:0
258
259=== modified file 'partner_supplier_information/__openerp__.py'
260--- partner_supplier_information/__openerp__.py 2014-01-03 15:07:50 +0000
261+++ partner_supplier_information/__openerp__.py 2014-01-27 18:51:38 +0000
262@@ -31,18 +31,30 @@
263 Partner Supplier Informations
264 =============================
265
266-This module adds some fields for supplier
267+This module adds some fields for supplier:
268+
269+* Legal form
270+* NGO: If partner is a Non-governmental organization (NGO)
271+* Confirmed supplier
272+* Registration number
273+* Registration date
274+* Registration location
275+* Matriculation Number
276
277
278 Contributors
279 ------------
280-* EL HADJI DEM (elhadji.dem@savoirfairelinux.com)
281+* El Hadji Dem (elhadji.dem@savoirfairelinux.com)
282 """,
283 'depends': [
284- 'base',
285- ],
286- 'external_dependencies': {},
287- 'data': [],
288+ 'account',
289+ ],
290+ 'external_dependencies': {
291+ 'python': [],
292+ },
293+ 'data': [
294+ 'res_partner_view.xml',
295+ ],
296 'demo': [],
297 'test': [],
298 'installable': True,
299
300=== modified file 'partner_supplier_information/res_partner.py'
301--- partner_supplier_information/res_partner.py 2014-01-03 15:07:50 +0000
302+++ partner_supplier_information/res_partner.py 2014-01-27 18:51:38 +0000
303@@ -35,7 +35,7 @@
304 'rcs_date': fields.date('Registration date', help="Registration date."),
305 'rcs_registration_location': fields.char('Registration location', size=256,
306 help="Registration location."),
307- 'immatriculation_number': fields.char('Immatriculation number', size=256, help="Immatriculation number."),
308+ 'matriculation_number': fields.char('Matriculation number', size=256, help="Matriculation number."),
309 }
310
311 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
312
313=== added file 'partner_supplier_information/res_partner_view.xml'
314--- partner_supplier_information/res_partner_view.xml 1970-01-01 00:00:00 +0000
315+++ partner_supplier_information/res_partner_view.xml 2014-01-27 18:51:38 +0000
316@@ -0,0 +1,37 @@
317+<?xml version="1.0" encoding="utf-8"?>
318+<openerp>
319+ <data>
320+ <!--Add legal form, ong,acronym,confirmed supplier,
321+ rcs number,rcs date, rcs and SIRET number fields in form view-->
322+ <record id="view_partner_property_supplier_info_form" model="ir.ui.view">
323+ <field name="name">res.partner.property.supplier.info.form.inherit</field>
324+ <field name="model">res.partner</field>
325+ <field name="inherit_id" ref="account.view_partner_property_form"/>
326+ <field name="arch" type="xml">
327+ <xpath expr="//page[@string='Accounting']/group[1]/group[2]"
328+ position="after">
329+ <group string="Supplier informations" col="4" colspan="4"
330+ attrs="{'invisible': [('supplier', '=', False)]}">
331+ <field name="legal_form"/>
332+ <field name="ong"/>
333+ <field name="acronym"/>
334+ <field name="confirmed_supplier"/>
335+ </group>
336+ <group string="Information" col="4" colspan="4"
337+ attrs="{'invisible': [('confirmed_supplier', '=', False)]}">
338+ <field name="rcs_registration_number"/>
339+ <field name="rcs_date"/>
340+ <field name="rcs_registration_location"/>
341+ </group>
342+ </xpath>
343+
344+ <!--add matriculation number in form view-->
345+ <field name="last_reconciliation_date"
346+ position="after">
347+ <field name="matriculation_number"
348+ attrs="{'invisible': [('confirmed_supplier', '=', False)]}"/>
349+ </field>
350+ </field>
351+ </record>
352+ </data>
353+</openerp>
354
355=== modified file 'res_bank_account/__init__.py'
356--- res_bank_account/__init__.py 2014-01-03 15:07:50 +0000
357+++ res_bank_account/__init__.py 2014-01-27 18:51:38 +0000
358@@ -20,6 +20,6 @@
359 #
360 ##############################################################################
361
362-import res_bank
363+from . import res_bank
364
365 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
366
367=== modified file 'res_bank_account/__openerp__.py'
368--- res_bank_account/__openerp__.py 2014-01-03 15:07:50 +0000
369+++ res_bank_account/__openerp__.py 2014-01-27 18:51:38 +0000
370@@ -34,13 +34,15 @@
371
372 Contributors
373 ------------
374-* EL HADJI DEM (elhadji.dem@savoirfairelinux.com)
375+* El Hadji Dem (elhadji.dem@savoirfairelinux.com)
376 """,
377 'depends': [
378- 'base',
379+ 'account',
380 ],
381 'external_dependencies': {},
382- 'data': ['res_bank_view.xml', ],
383+ 'data': [
384+ 'res_bank_view.xml',
385+ ],
386 'demo': [],
387 'test': [],
388 'installable': True,
389
390=== modified file 'res_bank_account/res_bank_view.xml'
391--- res_bank_account/res_bank_view.xml 2014-01-03 15:07:50 +0000
392+++ res_bank_account/res_bank_view.xml 2014-01-27 18:51:38 +0000
393@@ -34,5 +34,28 @@
394 </field>
395 </field>
396 </record>
397+
398+ <!--redefine bank_ids tree-->
399+ <record id="view_partner_property_bank_form" model="ir.ui.view">
400+ <field name="name">res.partner.property.bank.inherit.bank.form</field>
401+ <field name="model">res.partner</field>
402+ <field name="inherit_id" ref="account.view_partner_property_form"/>
403+ <field name="arch" type="xml">
404+ <!--redefine bank_ids tree-->
405+ <field name="bank_ids" position="replace">
406+ <field name="bank_ids"
407+ context="{'default_partner_id': active_id, 'form_view_ref': 'base.view_partner_bank_form'}">
408+ <tree string="Bank Details">
409+ <field name="active"/>
410+ <field name="state" invisible="1"/>
411+ <field name="sequence" invisible="1"/>
412+ <field name="acc_number"/>
413+ <field name="bank_name"/>
414+ <field name="owner_name"/>
415+ </tree>
416+ </field>
417+ </field>
418+ </field>
419+ </record>
420 </data>
421 </openerp>
422
423=== modified file 'user_firstname/__init__.py'
424--- user_firstname/__init__.py 2014-01-03 20:42:34 +0000
425+++ user_firstname/__init__.py 2014-01-27 18:51:38 +0000
426@@ -2,7 +2,7 @@
427 ##############################################################################
428 #
429 # OpenERP, Open Source Management Solution
430-# This module copyright (C) 2013 Savoir-faire Linux
431+# This module copyright (C) 2013, 2014 Savoir-faire Linux
432 # (<http://www.savoirfairelinux.com>).
433 #
434 # This program is free software: you can redistribute it and/or modify
435
436=== modified file 'user_firstname/__openerp__.py'
437--- user_firstname/__openerp__.py 2014-01-03 16:57:29 +0000
438+++ user_firstname/__openerp__.py 2014-01-27 18:51:38 +0000
439@@ -23,10 +23,8 @@
440 {
441 'name': 'User First Name, Last Name',
442 'version': '0.1',
443- 'author': 'Savoir-faire Linux',
444- 'maintainer': 'Savoir-faire Linux',
445- 'website': 'http://www.savoirfairelinux.com',
446- 'category': 'MISC',
447+ 'category': 'Customer Relationship Management',
448+ 'summary': 'Add First Name to user',
449 'description': """
450 User First Name, Last Name
451 ==========================
452@@ -36,15 +34,20 @@
453
454 Contributors
455 ------------
456-* EL HADJI DEM (elhadji.dem@savoirfairelinux.com)
457+* El Hadji Dem (elhadji.dem@savoirfairelinux.com)
458 """,
459+ 'author': 'Savoir-faire Linux',
460+ 'website': 'www.savoirfairelinux.com',
461+ 'license': 'AGPL-3',
462 'depends': [
463- 'base',
464- ],
465- 'external_dependencies': {},
466- 'data': [],
467- 'demo': [],
468+ 'partner_firstname',
469+ ],
470+ 'data': [
471+ 'res_user_view.xml',
472+ ],
473 'test': [],
474+ 'demo': [
475+ ],
476 'installable': True,
477 'active': False,
478 }
479
480=== added file 'user_firstname/res_user_view.xml'
481--- user_firstname/res_user_view.xml 1970-01-01 00:00:00 +0000
482+++ user_firstname/res_user_view.xml 2014-01-27 18:51:38 +0000
483@@ -0,0 +1,42 @@
484+<?xml version="1.0" encoding="utf-8"?>
485+<openerp>
486+ <data>
487+ <record id="view_users_firstname_form" model="ir.ui.view">
488+ <field name="name">res.users.form.firstname.inherit44</field>
489+ <field name="model">res.users</field>
490+ <field name="inherit_id" ref="base.view_users_form"/>
491+ <field name="arch" type="xml">
492+ <label for="name" position="replace"/>
493+ <field name="name" position="replace">
494+ <field name="firstname" placeholder="e.g. Firstname"/>
495+ <field name="name" placeholder="e.g. Lastname"/>
496+ </field>
497+ </field>
498+ </record>
499+
500+ <record id="view_users_firstname_tree" model="ir.ui.view">
501+ <field name="name">res.users.firstname.tree</field>
502+ <field name="model">res.users</field>
503+ <field name="inherit_id" ref="base.view_users_tree"/>
504+ <field name="arch" type="xml">
505+ <field name="name" position="replace">
506+ <field name="full_name"/>
507+ </field>
508+ </field>
509+ </record>
510+ <!--search in full name-->
511+ <record id="view_users_firstname_search" model="ir.ui.view">
512+ <field name="name">res.users.search</field>
513+ <field name="model">res.users</field>
514+ <field name="inherit_id" ref="base.view_users_search"/>
515+ <field name="arch" type="xml">
516+ <field name="name" position="replace">
517+ <field name="name"
518+ filter_domain="['|', ('full_name', 'ilike', self), ('login', 'ilike', self)]"
519+ string="User"/>
520+ </field>
521+ </field>
522+ </record>
523+
524+ </data>
525+</openerp>

Subscribers

People subscribed via source and target branches

to all changes: