[IMP]base/res_partner: remove photo field
bzr revid: kjo@tinyerp.com-20120313073307-61xlb1fgkeiv3rqp
This commit is contained in:
@@ -225,7 +225,7 @@
|
||||
<field name="parent_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<field name="photo" nolabel="1" widget="image"/>
|
||||
<field name="logo" nolabel="1" widget="image"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
|
||||
@@ -143,7 +143,6 @@ class res_company(osv.osv):
|
||||
'vat': fields.related('partner_id', 'vat', string="Tax ID", type="char", size=32),
|
||||
'company_registry': fields.char('Company Registry', size=64),
|
||||
'paper_format': fields.selection([('a4', 'A4'), ('us_letter', 'US Letter')], "Paper Format", required=True),
|
||||
'photo': fields.related('partner_id', 'photo', string="Photo", type="binary"),
|
||||
}
|
||||
_sql_constraints = [
|
||||
('name_uniq', 'unique (name)', 'The company name must be unique !')
|
||||
|
||||
@@ -259,13 +259,15 @@ 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):
|
||||
if context is None:
|
||||
context={}
|
||||
# Update parent and siblings records
|
||||
if vals.get('parent_id') and vals.get('use_parent_address'):
|
||||
domain_siblings = [('parent_id', '=', vals['parent_id']), ('use_parent_address', '=', True)]
|
||||
update_ids = [vals['parent_id']] + self.search(cr, uid, domain_siblings, context=context)
|
||||
self.update_address(cr, uid, update_ids, vals, context)
|
||||
if 'photo' not in vals:
|
||||
vals['photo'] = self._get_photo(cr, uid, vals.get('is_company', False), context)
|
||||
if 'photo' not in vals :
|
||||
vals['photo'] = self._get_photo(cr, uid, vals.get('is_company', False) or context.get('default_is_company'), context)
|
||||
return super(res_partner,self).create(cr, uid, vals, context=context)
|
||||
|
||||
def update_address(self, cr, uid, ids, vals, context=None):
|
||||
|
||||
Reference in New Issue
Block a user