[merge] with lp:~openerp-dev/openobject-addons/trunk-state_sync_with_kanban-task-mdi

bzr revid: rlo@openerp.com-20120418085124-pf1hmjbsl52j7w1d
This commit is contained in:
Roberto López López (OpenERP) 2012-04-18 10:51:24 +02:00
commit 38948deaca
4 changed files with 16 additions and 11 deletions

View File

@ -32,6 +32,8 @@ from openerp.addons.resource.faces import task as Task
# _name = 'project.project'
#project_project()
_TASK_STATE = [('draft', 'New'),('open', 'In Progress'),('pending', 'Pending'), ('done', 'Done'), ('cancelled', 'Cancelled')]
class project_task_type(osv.osv):
_name = 'project.task.type'
_description = 'Task Stage'
@ -42,8 +44,12 @@ class project_task_type(osv.osv):
'sequence': fields.integer('Sequence'),
'project_default': fields.boolean('Common to All Projects', help="If you check this field, this stage will be proposed by default on each new project. It will not assign this stage to existing projects."),
'project_ids': fields.many2many('project.project', 'project_task_type_rel', 'type_id', 'project_id', 'Projects'),
'state': fields.selection(_TASK_STATE, 'State', required=True,
help='If the task is created the state is \'Draft\'.\n If the task is started, the state becomes \'In Progress\'.\n If review is needed the task is in \'Pending\' state.\
\n If the task is over, the states is set to \'Done\'.'),
}
_defaults = {
'state': 'draft',
'sequence': 1
}
_order = 'sequence'
@ -662,9 +668,7 @@ class task(osv.osv):
'priority': fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Important'), ('0','Very important')], 'Priority', select=True),
'sequence': fields.integer('Sequence', select=True, help="Gives the sequence order when displaying a list of tasks."),
'type_id': fields.many2one('project.task.type', 'Stage'),
'state': fields.selection([('draft', 'New'),('open', 'In Progress'),('pending', 'Pending'), ('done', 'Done'), ('cancelled', 'Cancelled')], 'State', readonly=True, required=True,
help='If the task is created the state is \'Draft\'.\n If the task is started, the state becomes \'In Progress\'.\n If review is needed the task is in \'Pending\' state.\
\n If the task is over, the states is set to \'Done\'.'),
'state': fields.related('type_id','state', type='selection', selection=_TASK_STATE, string="State", readonly=True, store=True),
'kanban_state': fields.selection([('normal', 'Normal'),('blocked', 'Blocked'),('done', 'Ready To Pull')], 'Kanban State',
help="A task's kanban state indicates special situations affecting it:\n"
" * Normal is the default situation\n"

View File

@ -279,6 +279,7 @@
<tree string="Delegated tasks">
<field name="name"/>
<field name="user_id"/>
<field name="type_id"/>
<field name="state"/>
<field name="effective_hours" widget="float_time"/>
<field name="progress" widget="progressbar"/>
@ -598,6 +599,7 @@
<field name="name"/>
<field name="project_default"/>
<field name="sequence"/>
<field name="state"/>
</group>
<separator string="Description" colspan="4"/>
<field colspan="4" name="description" nolabel="1"/>
@ -613,6 +615,7 @@
<tree string="Task Stage">
<field name="sequence"/>
<field name="name"/>
<field name="state"/>
</tree>
</field>
</record>

View File

@ -42,6 +42,8 @@ class project_issue_version(osv.osv):
}
project_issue_version()
_ISSUE_STATE= [('draft', 'New'), ('open', 'In Progress'), ('cancel', 'Cancelled'), ('done', 'Done'),('pending', 'Pending')]
class project_issue(crm.crm_case, osv.osv):
_name = "project.issue"
_description = "Project Issue"
@ -179,11 +181,7 @@ class project_issue(crm.crm_case, osv.osv):
'partner_id': fields.many2one('res.partner', 'Partner', select=1),
'company_id': fields.many2one('res.company', 'Company'),
'description': fields.text('Description'),
'state': fields.selection([('draft', 'New'), ('open', 'In Progress'), ('cancel', 'Cancelled'), ('done', 'Done'),('pending', 'Pending'), ], 'State', size=16, readonly=True,
help='The state is set to \'Draft\', when a case is created.\
\nIf the case is in progress the state is set to \'Open\'.\
\nWhen the case is over, the state is set to \'Done\'.\
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
'state': fields.related('type_id','state', type='selection', selection=_ISSUE_STATE, string="State", readonly=True, store=True),
'email_from': fields.char('Email', size=128, help="These people will receive email.", select=1),
'email_cc': fields.char('Watchers Emails', size=256, help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"),
'date_open': fields.datetime('Opened', readonly=True,select=True),

View File

@ -186,7 +186,7 @@
<filter string="Stage" icon="terp-stage" domain="[]"
context="{'group_by':'type_id'}" />
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]"
context="{'group_by':'state'}" />
context="{'group_by':'state'}"/>
<separator orientation="vertical" />
<filter string="Month" icon="terp-go-month"
domain="[]" context="{'group_by':'create_date'}" help="Creation Month"/>
@ -262,7 +262,7 @@
<a string="Convert To Task" name="convert_issue_task" icon="gtk-index" type="object"/>
</div>
<div class="oe_kanban_right">
<a name="case_open" string="Open" states="draft,pending" type="object" icon="kanban-apply" />
<a name="case_open" string="Open" states="draft,pending" type="object" icon="kanban-apply"/>
<a name="case_pending" string="Pending" states="draft,open" type="object" icon="kanban-pause"/>
<a name="case_close" string="Close" states="open,draft,pending" type="object" icon="kanban-stop"/>
</div>
@ -317,7 +317,7 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Feature Tracker Search">
<filter icon="terp-go-today" string="Today"
<filter icon="terp-go-today" string="Today"
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]" help="Today's features"/>
<separator orientation="vertical"/>
<group>