tfr (Openerp) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-fix-basecontact-tfr into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-fix-basecontact-tfr/+merge/89430

Fix usability for base_contact + domain + partner id in sub form
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-fix-basecontact-tfr/+merge/89430
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-fix-basecontact-tfr.
=== modified file 'base_contact/base_contact.py'
--- base_contact/base_contact.py	2011-12-27 20:57:42 +0000
+++ base_contact/base_contact.py	2012-01-20 13:11:37 +0000
@@ -120,7 +120,6 @@
         'city': fields.char('City', size=128),
         'state_id': fields.many2one("res.country.state", 'Fed. State', domain="[('country_id','=',country_id)]"),
         'country_id': fields.many2one('res.country', 'Country'),
-        'partner_id': fields.many2one('res.partner', 'Partner Name', ondelete='set null', select=True, help="Keep empty for a private address, not related to partner."),
         'company_id': fields.many2one('res.company', 'Company',select=1),
         'job_ids': fields.one2many('res.partner.address', 'location_id', 'Contacts'),
         'partner_id': fields.related('job_ids', 'partner_id', type='many2one',\

=== modified file 'base_contact/base_contact_view.xml'
--- base_contact/base_contact_view.xml	2011-12-27 20:57:42 +0000
+++ base_contact/base_contact_view.xml	2012-01-20 13:11:37 +0000
@@ -50,7 +50,8 @@
                        </group>
                        <field name="job_ids" colspan="4" nolabel="1" mode="tree,form">
                             <form string="Functions and Addresses">
-                                <field name="location_id"/>
+                                <field name="partner_id" />
+                                <field name="location_id" domain="[('partner_id', '=', partner_id)]"/>
                                 <field name="function" />
                                 <separator string="Professional Info" colspan="4"/>
                                 <field name="phone"/>
@@ -135,14 +136,14 @@
         <field name="type">form</field>
         <field name="arch" type="xml">
             <separator string="Postal Address" position="after">
-                <field name="location_id" on_change="onchange_location_id(location_id)"/>
+                <field name="location_id" on_change="onchange_location_id(location_id)" domain="[('partner_id', '=', parent.id)]"/>
             </separator>
             <xpath expr="//field[@string='Contact Name']" position="replace">
                 <field name="contact_id"/>
             </xpath>
             <field name="title" position="replace"/>
         </field>
-    </record>
+    </record>	
 
     <!-- Views for Addresses -->
 

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to