Merge lp:~credativ/openobject-addons/elico-6.1-fixes-gap-analysis-duplicate into lp:~openerp-community/openobject-addons/elico-6.1

Proposed by Tom Pickering
Status: Needs review
Proposed branch: lp:~credativ/openobject-addons/elico-6.1-fixes-gap-analysis-duplicate
Merge into: lp:~openerp-community/openobject-addons/elico-6.1
Diff against target: 26 lines (+8/-3)
1 file modified
gap_analysis/gap_analysis.py (+8/-3)
To merge this branch: bzr merge lp:~credativ/openobject-addons/elico-6.1-fixes-gap-analysis-duplicate
Reviewer Review Type Date Requested Status
OpenERP Community (OBSOLETE) Pending
Review via email: mp+218425@code.launchpad.net

Description of the change

This branch enables users to duplicate Gap Analyses.

To post a comment you must log in.

Unmerged revisions

11. By Jacob Hicks (credativ)

[IMP] Modify default values of duplicated gap analysis

10. By Tom Pickering

[IMP] Gap Analyses can now be duplicated.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gap_analysis/gap_analysis.py'
2--- gap_analysis/gap_analysis.py 2013-06-22 02:18:01 +0000
3+++ gap_analysis/gap_analysis.py 2014-05-06 13:37:19 +0000
4@@ -293,8 +293,13 @@
5
6
7 def copy(self, cr, uid, id, default=None, context=None):
8- raise osv.except_osv(_('Warning'), _("Copying a Gap Analysis is currently not allowed."))
9- return False
10+ if default is None:
11+ default = {}
12+ if not default.get('reference', False):
13+ default.update(reference=self.pool.get('ir.sequence').get(cr, uid, 'gap_analysis'))
14+ if not default.get('name', False):
15+ default.update(name=_('%s (copy)') % (self.browse(cr, uid, id, context=context).name))
16+ return super(gap_analysis, self).copy(cr, uid, id, default, context)
17
18
19 def onchange_project_id(self, cr, uid, ids, project_id):
20@@ -475,4 +480,4 @@
21
22 gap_analysis_line()
23
24-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
25\ No newline at end of file
26+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

Subscribers

People subscribed via source and target branches