bzr revid: fp@tinyerp.com-20081027130118-7v9shbf2ihi3xxx7
This commit is contained in:
Fabien Pinckaers
2008-10-27 14:01:18 +01:00
parent b04f8c89e1
commit 22a16e1b13
2 changed files with 17 additions and 17 deletions
+5 -4
View File
@@ -34,11 +34,12 @@
<field name="state"/>
<button name="set_template" string="Set as Template" type="object" states="open"/>
<button name="set_open" string="Reopen Project" type="object" states="pending,cancelled,done"/>
<button name="set_pending" string="Set as Pending" type="object" states="open"/>
<button name="set_cancel" string="Set as Cancel" type="object" states="open,pending"/>
<button name="set_done" string="Set as Done" type="object" states="open,pending"/>
<button name="set_pending" string="Pending" type="object" states="open"/>
<button name="set_cancel" string="Cancel" type="object" states="open,pending"/>
<button name="set_done" string="Done" type="object" states="open,pending"/>
<button name="reset_project" string="Reset as Project" type="object" states="template"/>
<button name="duplicate_template" string="New Project Based on Template"
<button name="duplicate_template"
string="New Project Based on Template"
type="object"
states="template"/>
</group>
+12 -13
View File
@@ -46,13 +46,13 @@ ask_form = """<?xml version="1.0" ?>
</form>"""
ask_fields = {
'name': {'string': 'Title', 'type': 'char', 'required': 'True', 'size':64},
'prefix': {'string': 'Prefix of Task', 'type': 'char', 'required': 'True', 'size':64},
'user_id': {'string':'Assign To', 'type':'many2one', 'relation': 'res.users', 'required':'True'},
'include_info': {'string':'Copy Description', 'type':'boolean'},
'planned_hours': {'string':'Planned Hours', 'type':'float', 'widget':'float_time'},
'planned_hours_me': {'string':'Hours to Validate', 'type':'float', 'widget':'float_time'},
'state': {'string':'Validation State', 'type':'selection', 'selection': [('pending','Pending'),('done','Done')]},
'name': {'string': 'Delegated Title', 'type': 'char', 'required': 'True', 'size':64, 'help':"New title of the task delegated to the user."},
'prefix': {'string': 'Your Task Title', 'type': 'char', 'required': 'True', 'size':64, 'help':"New title of your own task to validate the work done."},
'user_id': {'string':'Assign To', 'type':'many2one', 'relation': 'res.users', 'required':'True', 'help':"User you want to delegate this task to."},
'include_info': {'string':'Copy Description', 'type':'boolean', 'help':"Reinclude the description of the task in the task of the user."},
'planned_hours': {'string':'Planned Hours', 'type':'float', 'widget':'float_time', 'help':"Estimated time to close this task by the delegated user."},
'planned_hours_me': {'string':'Hours to Validate', 'type':'float', 'widget':'float_time', 'help':"Estimated time for you to validate the work done by the user to whom you delegate this task."},
'state': {'string':'Validation State', 'type':'selection', 'selection': [('pending','Pending'),('done','Done')], 'help':"New state of your own task. Pending will be reopened automatically when the delegated task is closed."},
}
class wizard_delegate(wizard.interface):
@@ -60,8 +60,7 @@ class wizard_delegate(wizard.interface):
task_obj = pooler.get_pool(cr.dbname).get('project.task')
task = task_obj.browse(cr, uid, data['id'], context)
newname = task.name
if not task.name.startswith(data['form']['prefix'] or '++'):
newname = (data['form']['prefix'] or '')+task.name
newname = data['form']['prefix'] or ''
task_obj.copy(cr, uid, data['id'], {
'name': data['form']['name'],
'user_id': data['form']['user_id'],
@@ -73,7 +72,7 @@ class wizard_delegate(wizard.interface):
'child_ids': []
})
task_obj.write(cr, uid, data['id'], {
'planned_hours': data['form']['planned_hours_me'],
'remaining_hours': data['form']['planned_hours_me'],
'name': newname
})
if data['form']['state']=='pending':
@@ -88,9 +87,9 @@ class wizard_delegate(wizard.interface):
return {
'name':task.name,
'user_id': False,
'planned_hours': task.planned_hours,
'planned_hours_me': task.planned_hours / 5.0,
'prefix': 'CHECK: ',
'planned_hours': task.remaining_hours,
'planned_hours_me': 1.0,
'prefix': 'CHECK: '+ (task.name or ''),
'state': 'pending'
}