[FIX] Purchase : Destination address should not be restricted to be an address of any partner

lp bug: https://launchpad.net/bugs/710516 fixed

bzr revid: jvo@tinyerp.com-20110210184806-qg3ivhwlcp69b39v
This commit is contained in:
Jay Vora (OpenERP) 2011-02-11 00:18:06 +05:30
parent 62e3bd941e
commit 0771b32361
1 changed files with 6 additions and 3 deletions

View File

@ -257,9 +257,12 @@ class purchase_order(osv.osv):
def onchange_dest_address_id(self, cr, uid, ids, adr_id):
if not adr_id:
return {}
part_id = self.pool.get('res.partner.address').read(cr, uid, [adr_id], ['partner_id'])[0]['partner_id'][0]
loc_id = self.pool.get('res.partner').browse(cr, uid, part_id).property_stock_customer.id
return {'value':{'location_id': loc_id, 'warehouse_id': False}}
values = {'warehouse_id': False}
part_id = self.pool.get('res.partner.address').browse(cr, uid, adr_id).partner_id
if part_id:
loc_id = part_id.property_stock_customer.id
values.update({'location_id': loc_id})
return {'value':values}
def onchange_warehouse_id(self, cr, uid, ids, warehouse_id):
if not warehouse_id: