[IMP] base/res : take the defult photo image on create time

bzr revid: sbh@tinyerp.com-20120302110517-1ufjptji4rv9kxwr
This commit is contained in:
Bhumika (OpenERP)
2012-03-02 16:35:17 +05:30
parent 68c5ef4a0b
commit efdf616e09
+3
View File
@@ -263,6 +263,9 @@ class res_partner(osv.osv):
return super(res_partner,self).write(cr, uid, ids, vals, context=context)
def create(self, cr, uid, vals, context=None):
# temo get the defulat photo image ,it will remove
if 'photo' not in vals:
vals['photo'] =self._get_photo(cr,uid,vals.get('is_company'),context)
if vals.get('parent_id'):
update_ids= self.search(cr, uid, [('parent_id', '=', vals.get('parent_id')),('use_parent_address','=',True)], context=context)
update_ids.append(vals.get('parent_id'))