diff options
| author | Roberto López López (OpenERP) <rlo@openerp.com> | 2012-03-05 14:52:40 +0100 |
|---|---|---|
| committer | Roberto López López (OpenERP) <rlo@openerp.com> | 2012-03-05 14:52:40 +0100 |
| commit | 01e67d6dd52daae8e4a54202501167b451655ce9 (patch) | |
| tree | 2853e46f47bae966577ff37229435e802739e850 /addons/google_docs/google_docs.py | |
| parent | ff1fc1a7e9476f33e8a580c0c1f8942e5004bf0f (diff) | |
[imp] init config
bzr revid: rlo@openerp.com-20120305135240-o1a4sjcerod4l7jh
Diffstat (limited to 'addons/google_docs/google_docs.py')
| -rw-r--r-- | addons/google_docs/google_docs.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/addons/google_docs/google_docs.py b/addons/google_docs/google_docs.py index a63043e65ba..c254b4944ea 100644 --- a/addons/google_docs/google_docs.py +++ b/addons/google_docs/google_docs.py @@ -104,7 +104,9 @@ class google_docs_ir_attachment(osv.osv): return copy_resource class google_docs_config(osv.osv): - _name = 'google.docs.config' + #_name = 'google.docs.config' + _inherit = 'res.users' + _description = 'User\'s gdocs config' _columns = { 'model_id': fields.many2one('ir.model', 'Model'), @@ -118,7 +120,19 @@ class google_docs_config(osv.osv): 'name_template': 'Google Document' } - + def create(self, cr, uid, vals, context=None): + res = super(users, self).create(cr, uid, vals, context=context) + model_obj=self.pool.get('ir.model') + if vals.get('context_gdocs_resource_id') and vals.get('context_model_id'): + self.write(cr, uid, #[vals['model_id']], {'member_ids':[(4, res)]}, + { + 'model_id': model_obj.get(cr, uid, vals.get('context_model_id'))[0], + 'gdocs_resource_id': vals.get('context_gdocs_resource_id'), + 'name_template': vals('context_name_template'), + 'name': vals('context_name'), + }, + context) + return res class google_docs(osv.osv): _name = 'google.docs' |
