[CLEAN] Project_issue: cleaned subtypes, removed auto following that will be added in mail_thread. Updated track_visility parameter.

bzr revid: tde@openerp.com-20121219163923-8xmhb00sxvddcx4g
This commit is contained in:
Thibault Delavallée 2012-12-19 17:39:23 +01:00
parent 33ea9c9f73
commit fe429e8082
2 changed files with 24 additions and 27 deletions

View File

@ -52,14 +52,14 @@ class project_issue(base_stage, osv.osv):
_track = {
'state': {
'project_issue.mt_project_issue_closed': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'done',
'project_issue.mt_project_issue_started': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'open',
'project_issue.mt_issue_closed': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'done',
'project_issue.mt_issue_started': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'open',
},
'stage_id': {
'project_issue.mt_project_issue_stage': lambda self, cr, uid, obj, ctx=None: obj['state'] not in ['done', 'open'],
'project_issue.mt_issue_stage': lambda self, cr, uid, obj, ctx=None: obj['state'] not in ['done', 'open'],
},
'kanban_state': {
'project_issue.mt_project_issue_blocked': lambda self, cr, uid, obj, ctx=None: obj['kanban_state'] == 'blocked',
'project_issue.mt_issue_blocked': lambda self, cr, uid, obj, ctx=None: obj['kanban_state'] == 'blocked',
},
}
@ -248,7 +248,7 @@ class project_issue(base_stage, osv.osv):
If the case needs to be reviewed then the status is \
set to \'Pending\'.'),
'kanban_state': fields.selection([('normal', 'Normal'),('blocked', 'Blocked'),('done', 'Ready for next stage')], 'Kanban State',
_track_visibility=1,
track_visibility=1,
help="A Issue's kanban state indicates special situations affecting it:\n"
" * Normal is the default situation\n"
" * Blocked indicates something is preventing the progress of this issue\n"
@ -265,16 +265,16 @@ class project_issue(base_stage, osv.osv):
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True),
'version_id': fields.many2one('project.issue.version', 'Version'),
'stage_id': fields.many2one ('project.task.type', 'Stage',
_track_visibility=1,
track_visibility=1,
domain="['&', ('fold', '=', False), ('project_ids', '=', project_id)]"),
'project_id':fields.many2one('project.project', 'Project', _track_visibility=1),
'project_id':fields.many2one('project.project', 'Project', track_visibility=1),
'duration': fields.float('Duration'),
'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]"),
'day_open': fields.function(_compute_day, string='Days to Open', \
multi='compute_day', type="float", store=True),
'day_close': fields.function(_compute_day, string='Days to Close', \
multi='compute_day', type="float", store=True),
'user_id': fields.many2one('res.users', 'Assigned to', required=False, select=1, _track_visibility=1),
'user_id': fields.many2one('res.users', 'Assigned to', required=False, select=1, track_visibility=1),
'working_hours_open': fields.function(_compute_day, string='Working Hours to Open the Issue', \
multi='compute_day', type="float", store=True),
'working_hours_close': fields.function(_compute_day, string='Working Hours to Close the Issue', \
@ -388,12 +388,7 @@ class project_issue(base_stage, osv.osv):
if any([field in vals for field in logged_fields]):
vals['date_action_last'] = time.strftime('%Y-%m-%d %H:%M:%S')
res = super(project_issue, self).write(cr, uid, ids, vals, context)
# subscribe new project followers to the issue
if vals.get('project_id'):
self.message_subscribe_from_parent(cr, uid, ids, context=context)
return res
return super(project_issue, self).write(cr, uid, ids, vals, context)
def onchange_task_id(self, cr, uid, ids, task_id, context=None):
if not task_id:

View File

@ -48,20 +48,23 @@ Access all issues from the top Project menu, and access the issues of a specific
<field name="name">Issue Created</field>
<field name="res_model">project.issue</field>
<field name="default" eval="False"/>
<field name="description">Issue &lt;b&gt;created&lt;/b&gt;</field>
</record>
<record id="mt_issue_started" model="mail.message.subtype">
<field name="name">Issue Started</field>
<field name="res_model">project.issue</field>
<field name="default" eval="False"/>
<field name="description">Issue &lt;b&gt;started&lt;/b&gt;</field>
</record>
<record id="mt_issue_blocked" model="mail.message.subtype">
<field name="name">Issue Blocked</field>
<field name="res_model">project.issue</field>
<field name="default" eval="False"/>
<field name="description">Issue &lt;b&gt;blocked&lt;/b&gt;</field>
</record>
<record id="mt_issue_closed" model="mail.message.subtype">
<field name="name">Issue Closed</field>
<field name="res_model">project.issue</field>
<field name="description">Issue &lt;b&gt;closed&lt;/b&gt;</field>
</record>
<record id="mt_issue_stage" model="mail.message.subtype">
<field name="name">Stage Changed</field>
@ -70,38 +73,37 @@ Access all issues from the top Project menu, and access the issues of a specific
</record>
<!-- Project-related subtypes for messaging / Chatter -->
<record id="mt_project_issue_new" model="mail.message.subtype">
<field name="name">Issue Created</field>
<field name="name">PJ-Issue Created</field>
<field name="res_model">project.project</field>
<field name="default" eval="False"/>
<field name="parent_id" eval="ref('mt_issue_new')"/>
<field name="parent_field">project_id</field>
<field name="relation_field">project_id</field>
</record>
<record id="mt_project_issue_started" model="mail.message.subtype">
<field name="name">Issue Started</field>
<field name="name">PJ-Issue Started</field>
<field name="res_model">project.project</field>
<field name="default" eval="False"/>
<field name="parent_id" eval="ref('mt_issue_started')"/>
<field name="parent_field">project_id</field>
<field name="relation_field">project_id</field>
</record>
<record id="mt_project_issue_blocked" model="mail.message.subtype">
<field name="name">Issue Blocked</field>
<field name="name">PJ-Issue Blocked</field>
<field name="res_model">project.project</field>
<field name="default" eval="False"/>
<field name="parent_id" eval="ref('mt_issue_blocked')"/>
<field name="parent_field">project_id</field>
<field name="relation_field">project_id</field>
</record>
<record id="mt_project_issue_closed" model="mail.message.subtype">
<field name="name">Issue Closed</field>
<field name="name">PJ-Issue Closed</field>
<field name="res_model">project.project</field>
<field name="parent_id" eval="ref('mt_issue_closed')"/>
<field name="parent_field">project_id</field>
<field name="relation_field">project_id</field>
</record>
<record id="mt_project_issue_stage" model="mail.message.subtype">
<field name="name">Stage Changed</field>
<field name="res_model">project.issue</field>
<field name="name">PJ-Stage Changed</field>
<field name="res_model">project.project</field>
<field name="description">Stage &lt;b&gt;changed&lt;/b&gt;</field>
<field name="parent_id" eval="ref('mt_issue_stage')"/>
<field name="parent_field">project_id</field>
<field name="relation_field">project_id</field>
</record>
</data>