[MERGE] forward port of branch 9.0 up to d5f28f4

This commit is contained in:
Christophe Simonis
2016-02-17 19:22:45 +01:00
+2 -4
View File
@@ -548,10 +548,8 @@ class res_partner(osv.Model, format_address):
@api.model
def create(self, vals):
if vals.get('type') == 'delivery':
vals['image'] = self.with_context(partner_type='delivery')._get_default_image(False, False)
elif vals.get('type') == 'invoice':
vals['image'] = self.with_context(partner_type='invoice')._get_default_image(False, False)
if vals.get('type') and not self._context.get('partner_type'):
self = self.with_context(partner_type=vals['type'])
if vals.get('website'):
vals['website'] = self._clean_website(vals['website'])
# function field not correctly triggered at create -> remove me when