- `ir.property`, improve API of method `get_by_record` - `res.bank`, `res.partner.bank` - `res.company` - `res.config`, `res.config.installer`, `res.config.settings`, fix usage of methods `get_default_` - `res.country`, `res.country.group`, `res.country.state` - `res.currency`, `res.currency.rate` - `res.font` - `res.lang` - `res.partner`, `res.partner.category`, `res.partner.title` - `res.request.link` - `res.groups`, `res.users`, `res.users.log`, change password wizard
30 lines
1.4 KiB
Python
30 lines
1.4 KiB
Python
from openerp.osv import fields, osv
|
|
|
|
class calendar_config_settings(osv.TransientModel):
|
|
_inherit = 'base.config.settings'
|
|
|
|
_columns = {
|
|
'google_cal_sync': fields.boolean("Show Tutorial"),
|
|
'cal_client_id': fields.char("Client_id"),
|
|
'cal_client_secret': fields.char("Client_key"),
|
|
'server_uri': fields.char('URI for tuto')
|
|
}
|
|
|
|
def set_calset(self, cr, uid, ids, context=None) :
|
|
params = self.pool['ir.config_parameter']
|
|
myself = self.browse(cr, uid, ids[0], context=context)
|
|
params.set_param(cr, uid, 'google_calendar_client_id', (myself.cal_client_id or '').strip(), groups=['base.group_system'], context=None)
|
|
params.set_param(cr, uid, 'google_calendar_client_secret', (myself.cal_client_secret or '').strip(), groups=['base.group_system'], context=None)
|
|
|
|
|
|
def get_default_all(self, cr, uid, fields, context=None):
|
|
params = self.pool.get('ir.config_parameter')
|
|
cal_client_id = params.get_param(cr, uid, 'google_calendar_client_id',default='',context=context)
|
|
cal_client_secret = params.get_param(cr, uid, 'google_calendar_client_secret',default='',context=context)
|
|
server_uri= "%s/google_account/authentication" % params.get_param(cr, uid, 'web.base.url',default="http://yourcompany.odoo.com",context=context)
|
|
return dict(cal_client_id=cal_client_id,cal_client_secret=cal_client_secret,server_uri=server_uri)
|
|
|
|
|
|
|
|
|