diff options
| author | Raphael Collet <rco@openerp.com> | 2014-07-06 16:44:26 +0200 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2014-07-06 17:05:41 +0200 |
| commit | cbe2dbb672a6c55d86f2e515f9d1cdfee426ef80 (patch) | |
| tree | d6ff62b719fce32392397783c961b734b1e4c50e /addons/project_issue/project_issue.py | |
| parent | d78192c489d3be66cd6487b39f5ce7ba4733a187 (diff) | |
[MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.
- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
Diffstat (limited to 'addons/project_issue/project_issue.py')
| -rw-r--r-- | addons/project_issue/project_issue.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 8b7c70e41e1..0c3ba5683fd 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -264,7 +264,7 @@ class project_issue(osv.Model): 'version_id': fields.many2one('project.issue.version', 'Version'), 'stage_id': fields.many2one ('project.task.type', 'Stage', track_visibility='onchange', select=True, - domain="[('project_ids', '=', project_id)]"), + domain="[('project_ids', '=', project_id)]", copy=False), 'project_id': fields.many2one('project.project', 'Project', track_visibility='onchange', select=True), 'duration': fields.float('Duration'), 'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]"), @@ -306,7 +306,7 @@ class project_issue(osv.Model): } def copy(self, cr, uid, id, default=None, context=None): - issue = self.read(cr, uid, id, ['name'], context=context) + issue = self.read(cr, uid, [id], ['name'], context=context)[0] if not default: default = {} default = default.copy() @@ -315,8 +315,7 @@ class project_issue(osv.Model): context=context) def create(self, cr, uid, vals, context=None): - if context is None: - context = {} + context = dict(context or {}) if vals.get('project_id') and not context.get('default_project_id'): context['default_project_id'] = vals.get('project_id') @@ -353,6 +352,7 @@ class project_issue(osv.Model): return {'value': result} def get_empty_list_help(self, cr, uid, help, context=None): + context = dict(context or {}) context['empty_list_help_model'] = 'project.project' context['empty_list_help_id'] = context.get('default_project_id') context['empty_list_help_document_name'] = _("issues") @@ -437,9 +437,7 @@ class project_issue(osv.Model): """ if custom_values is None: custom_values = {} - if context is None: - context = {} - context['state_to'] = 'draft' + context = dict(context or {}, state_to='draft') defaults = { 'name': msg.get('subject') or _("No Subject"), 'email_from': msg.get('from'), |
