[MERGE] forward port branch saas-6 up to 5ae9205070
This commit is contained in:
@@ -23,8 +23,8 @@ class base_config_settings(osv.TransientModel):
|
||||
google_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'auth_oauth', 'provider_google')[1]
|
||||
rg = self.pool.get('auth.oauth.provider').read(cr, uid, [google_id], ['enabled','client_id'], context=context)
|
||||
return {
|
||||
'auth_oauth_google_enabled': rg[0]['enabled'],
|
||||
'auth_oauth_google_client_id': rg[0]['client_id'],
|
||||
'auth_oauth_google_enabled': rg[0]['enabled'] if rg else False,
|
||||
'auth_oauth_google_client_id': rg[0]['client_id'] if rg else False,
|
||||
}
|
||||
|
||||
def set_oauth_providers(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -11,6 +11,8 @@ from openerp.exceptions import UserError
|
||||
|
||||
|
||||
def geo_find(addr):
|
||||
if not addr:
|
||||
return None
|
||||
url = 'https://maps.googleapis.com/maps/api/geocode/json?sensor=false&address='
|
||||
url += urllib2.quote(addr.encode('utf8'))
|
||||
|
||||
|
||||
@@ -95,6 +95,19 @@ class res_company(osv.osv):
|
||||
('name_uniq', 'unique (name)', 'The company name must be unique !')
|
||||
]
|
||||
|
||||
@api.multi
|
||||
def copy(self, default=None):
|
||||
"""
|
||||
Duplicating a company without specifying a partner duplicate the partner
|
||||
"""
|
||||
self.ensure_one()
|
||||
default = dict(default or {})
|
||||
if not default.get('name') and not default.get('partner_id'):
|
||||
copy_partner = self.partner_id.copy()
|
||||
default['partner_id'] = copy_partner.id
|
||||
default['name'] = copy_partner.name
|
||||
return super(res_company, self).copy(default)
|
||||
|
||||
@api.onchange('custom_footer', 'phone', 'fax', 'email', 'website', 'vat', 'company_registry')
|
||||
def onchange_footer(self):
|
||||
if not self.custom_footer:
|
||||
|
||||
Reference in New Issue
Block a user