openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #03179
[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-720631-jam into lp:openobject-addons
Jigar Amin - OpenERP has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-720631-jam into lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
#720631 [PS] When duplicating a task, no "(copy)" tag in the task name
https://bugs.launchpad.net/bugs/720631
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-720631-jam/+merge/50281
Hello,
Changes Proposed for Merging:
+ lp:720631 [PS] When duplicating a task, no "(copy)" tag in the task name
Kindly Review this.
Thank You
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-720631-jam/+merge/50281
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-720631-jam.
=== modified file 'project/project.py'
--- project/project.py 2011-01-18 22:45:39 +0000
+++ project/project.py 2011-02-18 07:42:10 +0000
@@ -239,6 +239,7 @@
start_date = date(*time.strptime(proj.date_start,'%Y-%m-%d')[:3])
end_date = date(*time.strptime(proj.date,'%Y-%m-%d')[:3])
new_date_end = (datetime(*time.strptime(new_date_start,'%Y-%m-%d')[:3])+(end_date-start_date)).strftime('%Y-%m-%d')
+ context.update({'copy':True})
new_id = project_obj.copy(cr, uid, proj.id, default = {
'name': proj.name +_(' (copy)'),
'state':'open',
@@ -365,7 +366,9 @@
default['active'] = True
default['type_id'] = False
if not default.get('name', False):
- default['name'] = self.browse(cr, uid, id, context=context).name
+ default['name'] = self.browse(cr, uid, id, context=context).name or ''
+ if not context.get('copy',False):
+ default.update({'name':(default.get('name','')+_(" (copy)"))})
return super(task, self).copy_data(cr, uid, id, default, context)
def _check_dates(self, cr, uid, ids, context=None):
Follow ups