Well it depends. If your record is already saved you can do it:
Let's see an example:
def onchange_shop_id(self, cr, uid, ids, shop_id, context=None):
v = {}
if shop_id:
shop = self.pool.get('sale.shop').browse(cr, uid, shop_id, context=context)
if shop.project_id.id:
v['project_id'] = shop.project_id.id
if shop.pricelist_id.id:
v['pricelist_id'] = shop.pricelist_id.id
return {'value': v}
Right here you have a code when you are changing shop_id on sales.
on shop_id
you have the NEW VALUE
But you can get the old value doing this:
self.browse(cr, uid, ids[0]).shop_id.id
Why? Because ids
it's going to store the id of the record on the database.
If you want to change first some value and without saving it, and then change it again, you can't get the old value.
So finally you can have the new value on your view, and the one that is stored on the database.
I hope this can help you.