Code review comment for lp:~openerp-community/openobject-addons/trunk-bug-923440-base_contact_finalise6.1
- trunk-bug-923440-base_contact_finalise6.1
- Merge into 6.1
Revision history for this message
Etienne Hirt (hirt) wrote : | # |
1 | Index: /usr/share/pyshared/openerp/addons/base_contact/base_contact.py |
2 | =================================================================== |
3 | --- /usr/share/pyshared/openerp/addons/base_contact/base_contact.py (revision 13038) |
4 | +++ /usr/share/pyshared/openerp/addons/base_contact/base_contact.py (revision 13054) |
5 | @@ -287,6 +287,10 @@ |
6 | 'location_id' : fields.many2one('res.partner.location', 'Location'), |
7 | 'contact_id' : fields.many2one('res.partner.contact', 'Contact'), |
8 | |
9 | + #add private type |
10 | + 'type': fields.selection( [ ('default','Default'),('invoice','Invoice'), ('delivery','Delivery'), ('contact','Contact'), ('other','Other'), ('private', 'Private') ],'Address Type', help="Used to select automatically the right address according to the context in sales and purchases documents."), |
11 | + |
12 | + |
13 | #field for administer functions |
14 | 'sequence_contact': fields.integer('Contact Seq.',help='Order of\ |
15 | importance of this address in the list of addresses of the linked contact'), |
16 | @@ -320,6 +324,7 @@ |
17 | 'other': fields.char('Other Phone', size=64, help='Additional phone field'), |
18 | |
19 | # fields from contact |
20 | + |
21 | 'mobile' : fields.related('contact_id', 'mobile', type='char', size=64, string='Mobile'), |
22 | #store = {'res.partner.contact': (_get_address_from_contact_ids, ['mobile'], 10), |
23 | # 'res.partner.address': (_get_own_addresses,['contact_id'], 20)}), @bug: query wants to store in crm_lead!!!! |
24 | Index: /usr/share/pyshared/openerp/addons/base_contact/base_contact_view.xml |
25 | =================================================================== |
26 | --- /usr/share/pyshared/openerp/addons/base_contact/base_contact_view.xml (revision 13038) |
27 | +++ /usr/share/pyshared/openerp/addons/base_contact/base_contact_view.xml (revision 13054) |
28 | @@ -94,7 +94,8 @@ |
29 | <field name="photo" widget='image' nolabel="1"/> |
30 | </group> |
31 | </group> |
32 | - <field name="job_ids" colspan="4" nolabel="1" mode="tree,form" context="{'tree_view_ref' : 'base_contact.view_partner_address_tree_contact'}"> |
33 | + <!-- default_type is not followed! --> |
34 | + <field name="job_ids" colspan="4" nolabel="1" mode="tree,form" context="{'tree_view_ref' : 'base_contact.view_partner_address_tree_contact', 'default_contact_id': active_id, 'default_type': 'contact'}"> |
35 | </field> |
36 | </page> |
37 | <page string="Extra Information"> |
38 | @@ -169,7 +170,7 @@ |
39 | <field name="type">form</field> |
40 | <field name="arch" type="xml"> |
41 | <field name="address" position="replace" > |
42 | - <field colspan="4" mode="tree,form" name="address" nolabel="1" select="1" height="260" context="{'tree_view_ref' : 'base_contact.view_partner_address_tree_partner'}"> |
43 | + <field colspan="4" mode="tree,form" name="address" nolabel="1" select="1" height="260" context="{'tree_view_ref' : 'base_contact.view_partner_address_tree_partner', 'default_partner_id': active_id, 'default_type': 'contact'}"> |
44 | </field> |
45 | </field> |
46 | |
47 | @@ -263,6 +264,11 @@ |
48 | <field name="contact_id" on_change="onchange_contact_id(contact_id)" attrs="{'required':[('partner_id','=', False)]}"/> |
49 | <!-- <field name="name" string="use this field for initial name only" /> would require adaption of create--> |
50 | </field> |
51 | + |
52 | + <field name="type" position="replace"> |
53 | + <field name="type" required="1"/> |
54 | + </field> |
55 | + |
56 | <separator string="Postal Address" position="after"> |
57 | <field name="location_id" required="1" on_change="onchange_location_id(location_id)" domain="[('partner_id', '=', partner_id)]"/> |
58 | </separator> |
Dear Stuart,
hope you are doing well.
Please add the attached diff to our branch /code.launchpad .net/~vrt- openerp/ openobject- addons/ 6.1-trunk- bug-923440
https:/
after reviewing it as I can not add it there.
The diff adds the address type 'private' and specifies default values
for new addresses context dependent.
Best Regards
Etienne