'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()