'name' : fields.char('Sprint Name', required=True, size=64),
'date_start': fields.date('Starting Date', required=True),
'date_stop': fields.date('Ending Date', required=True),
-- 'project_id': fields.many2one('project.project', 'Project', required=True, domain=[('scrum','=',1)], help="If you have [?] in the project name, it means there are no analytic account linked to this project."),
++ 'project_id': fields.many2one('project.project', 'Project', required=True, help="If you have [?] in the project name, it means there are no analytic account linked to this project."),
'product_owner_id': fields.many2one('res.users', 'Product Owner', required=True,help="The person who is responsible for the product"),
'scrum_master_id': fields.many2one('res.users', 'Scrum Manager', required=True,help="The person who is maintains the processes for the product"),
'meeting_ids': fields.one2many('scrum.meeting', 'sprint_id', 'Daily Scrum'),
'name' : fields.char('Feature', size=64, required=True),
'note' : fields.text('Note'),
'active' : fields.boolean('Active', help="If Active field is set to true, it will allow you to hide the product backlog without removing it."),
-- 'project_id': fields.many2one('project.project', 'Project', required=True, domain=[('scrum','=',1)], help="If you have [?] in the project name, it means there are no analytic account linked to this project."),
++ 'project_id': fields.many2one('project.project', 'Project', required=True, help="If you have [?] in the project name, it means there are no analytic account linked to this project."),
'user_id': fields.many2one('res.users', 'Responsible'),
'sprint_id': fields.many2one('scrum.sprint', 'Sprint'),
'sequence' : fields.integer('Sequence', help="Gives the sequence order when displaying a list of product backlog."),
}
def button_send_to_master(self, cr, uid, ids, context=None):
++ if context is None:
++ context = {}
meeting_id = self.browse(cr, uid, ids)[0]
-- user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
-- if meeting_id and meeting_id.sprint_id.scrum_master_id.user_email:
-- self.email_send(cr, uid, ids, email)
++ email = meeting_id.sprint_id.scrum_master_id.user_email
++ if email:
++ self.email_send(cr, uid, ids, email, context=context)
else:
raise osv.except_osv(_('Error !'), _('Please provide email address for scrum master defined on sprint.'))
return True
def button_send_product_owner(self, cr, uid, ids, context=None):
++ if context is None:
++ context = {}
++ context.update({'button_send_product_owner': True})
meeting_id = self.browse(cr, uid, ids)[0]
-- if meeting_id.sprint_id.product_owner_id.user_email:
-- self.email_send(cr,uid,ids,email)
++ email = meeting_id.sprint_id.product_owner_id.user_email
++ if email:
++ self.email_send(cr, uid, ids, email, context=context)
else:
raise osv.except_osv(_('Error !'), _('Please provide email address for product owner defined on sprint.'))
return True
def email_send(self, cr, uid, ids, email, context=None):
++ if context is None:
++ context = {}
email_from = tools.config.get('email_from', False)
meeting_id = self.browse(cr,uid,ids)[0]
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
sub_name = meeting_id.name or 'Scrum Meeting of %s '%meeting_id.date
flag = tools.email_send(user_email , [email], sub_name, body, reply_to=None, openobject_id=str(meeting_id.id))
if not flag:
-- raise osv.except_osv(_('Error !'), _(' Email Not send to %s!' % meeting_id.sprint_id.product_owner_id.name))
++ if context.get('button_send_product_owner', False):
++ raise osv.except_osv(_('Error !'), _(' Email Not send to the product owner %s!' % meeting_id.sprint_id.product_owner_id.name))
++ raise osv.except_osv(_('Error !'), _(' Email Not send to the scrum master %s!' % meeting_id.sprint_id.scrum_master_id.name))
++ if context.get('button_send_product_owner', False):
++ raise osv.except_osv(_('Information !'), _(' Email send successfully to product owner %s!' % meeting_id.sprint_id.product_owner_id.name))
++ raise osv.except_osv(_('Information!'), _(' Email send successfully to scrum master %s!'% meeting_id.sprint_id.scrum_master_id.name))
return True
scrum_meeting()
<field name="expected_hours" sum="Planned hours" widget="float_time"/>
<field name="effective_hours" sum="Effective hours" widget="float_time"/>
<field name="state"/>
-- <button type="object" string="Open" name="button_open" states="draft,pending" icon="gtk-jump-to"/>
++ <button type="object" string="Open" name="button_open" states="draft,pending" icon="gtk-execute"/>
<button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
<button type="action" string="Convert to Task" name="%(action_scrum_backlog_to_task)d" states="pending" icon="gtk-execute"/>
<button type="object" string="Close" name="button_close" states="open,pending" icon="gtk-jump-to"/>
<field name="name" select="1"/>
<field name="project_id" select="1"/>
<field domain="[('project_id','=',project_id), ('state','in', ['draft','open'])]" name="sprint_id" select="1"/>
-- <button name="button_postpone" string="Post Pone" type="object"
++ <button name="button_postpone" string="Post Pone" type="object"
help="Post Pone backlog" colspan="2"
icon="gtk-convert" attrs="{'invisible':[('state','=','done')]}"/>
<field name="user_id" select="1"/>
<field name="effective_hours" sum="Effective hours" widget="float_time"/>
<field name="expected_hours" sum="Planned hours" widget="float_time"/>
<field name="state"/>
-- <button type="object" string="Open" name="button_open" states="draft,pending" icon="gtk-jump-to"/>
++ <button type="object" string="Open" name="button_open" states="draft,pending" icon="gtk-execute"/>
<button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
<button type="object" string="Close" name="button_close" states="open,pending" icon="gtk-jump-to"/>
<button type="object" string="Set to Draft" name="button_draft" states="cancel,done" icon="gtk-convert"/>