[MERGE] forward port branch 8.0 up to 06141c34a5
This commit is contained in:
@@ -45,10 +45,10 @@ class base_config_settings(osv.TransientModel):
|
||||
rg = self.pool.get('auth.oauth.provider').read(cr, uid, [google_id], ['enabled','client_id'], context=context)
|
||||
rf = self.pool.get('auth.oauth.provider').read(cr, uid, [facebook_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_facebook_enabled': rf[0]['enabled'],
|
||||
'auth_oauth_facebook_client_id': rf[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,
|
||||
'auth_oauth_facebook_enabled': rf[0]['enabled'] if rf else False,
|
||||
'auth_oauth_facebook_client_id': rf[0]['client_id'] if rf else False,
|
||||
}
|
||||
|
||||
def set_oauth_providers(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -32,6 +32,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'))
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
import os
|
||||
import re
|
||||
import openerp
|
||||
from openerp import SUPERUSER_ID, tools
|
||||
from openerp import SUPERUSER_ID, tools, api
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
from openerp.tools.safe_eval import safe_eval as eval
|
||||
@@ -154,6 +154,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)
|
||||
|
||||
def onchange_footer(self, cr, uid, ids, custom_footer, phone, fax, email, website, vat, company_registry, bank_ids, context=None):
|
||||
if custom_footer:
|
||||
return {}
|
||||
|
||||
Reference in New Issue
Block a user