@param ids: List of Openday’s IDs
@return: difference between current date and log date
@param context: A standard dictionary for contextual values
- """
- cal_obj = self.pool.get('resource.calendar')
- res_obj = self.pool.get('resource.resource')
+ """
+ cal_obj = self.pool.get('resource.calendar')
+ res_obj = self.pool.get('resource.resource')
res = {}
for lead in self.browse(cr, uid, ids , context):
duration = float(ans.days)
if lead.section_id.resource_calendar_id:
- duration = float(ans.days) * 24
+ duration = float(ans.days) * 24
new_dates = cal_obj.interval_get(cr,
uid,
lead.section_id.resource_calendar_id and lead.section_id.resource_calendar_id.id or False,
date_until = mx.DateTime.strptime(date_until, '%Y-%m-%d %H:%M:%S')
for in_time, out_time in new_dates:
if in_time.date not in no_days:
- no_days.append(in_time.date)
+ no_days.append(in_time.date)
if out_time > date_until:
- break
+ break
duration = len(no_days)
res[lead.id][field] = abs(int(duration))
return res
'referred': fields.char('Referred By', size=32),
'date_open': fields.datetime('Opened', readonly=True),
'day_open': fields.function(_compute_day, string='Days to Open', \
- method=True, multi='day_open', type="integer", store=True),
+ method=True, multi='day_open', type="float", store=True),
'day_close': fields.function(_compute_day, string='Days to Close', \
- method=True, multi='day_close', type="integer", store=True),
+ method=True, multi='day_close', type="float", store=True),
'function_name': fields.char('Function', size=64),
}
@param ids: List of Openday’s IDs
@return: difference between current date and log date
@param context: A standard dictionary for contextual values
- """
- cal_obj = self.pool.get('resource.calendar')
- res_obj = self.pool.get('resource.resource')
+ """
+ cal_obj = self.pool.get('resource.calendar')
+ res_obj = self.pool.get('resource.resource')
res = {}
for opportunity in self.browse(cr, uid, ids , context):
duration = float(ans.days)
if opportunity.section_id.resource_calendar_id:
- duration = float(ans.days) * 24
+ duration = float(ans.days) * 24
new_dates = cal_obj.interval_get(cr,
uid,
opportunity.section_id.resource_calendar_id and opportunity.section_id.resource_calendar_id.id or False,
date_until = mx.DateTime.strptime(date_until, '%Y-%m-%d %H:%M:%S')
for in_time, out_time in new_dates:
if in_time.date not in no_days:
- no_days.append(in_time.date)
+ no_days.append(in_time.date)
if out_time > date_until:
- break
+ break
duration = len(no_days)
res[opportunity.id][field] = abs(int(duration))
return res
'date_open': fields.datetime('Opened', readonly=True),
'day_open': fields.function(_compute_day, string='Days to Open', \
- method=True, multi='day_open', type="integer", store=True),
+ method=True, multi='day_open', type="float", store=True),
'day_close': fields.function(_compute_day, string='Days to Close', \
- method=True, multi='day_close', type="integer", store=True),
+ method=True, multi='day_close', type="float", store=True),
}
def onchange_stage_id(self, cr, uid, ids, stage_id, context={}):
@param ids: List of Openday’s IDs
@return: difference between current date and log date
@param context: A standard dictionary for contextual values
- """
- cal_obj = self.pool.get('resource.calendar')
- res_obj = self.pool.get('resource.resource')
+ """
+ cal_obj = self.pool.get('resource.calendar')
+ res_obj = self.pool.get('resource.resource')
res = {}
for issue in self.browse(cr, uid, ids , context):
duration = float(ans.days)
if issue.section_id.resource_calendar_id:
- duration = float(ans.days) * 24
+ duration = float(ans.days) * 24
new_dates = cal_obj.interval_get(cr,
uid,
issue.section_id.resource_calendar_id and issue.section_id.resource_calendar_id.id or False,
date_until = mx.DateTime.strptime(date_until, '%Y-%m-%d %H:%M:%S')
for in_time, out_time in new_dates:
if in_time.date not in no_days:
- no_days.append(in_time.date)
+ no_days.append(in_time.date)
if out_time > date_until:
- break
+ break
duration = len(no_days)
res[issue.id][field] = abs(int(duration))
return res
'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]"),
'date_open': fields.datetime('Opened', readonly=True),
'day_open': fields.function(_compute_day, string='Days to Open', \
- method=True, multi='day_open', type="integer", store=True),
+ method=True, multi='day_open', type="float", store=True),
'day_close': fields.function(_compute_day, string='Days to Close', \
- method=True, multi='day_close', type="integer", store=True),
+ method=True, multi='day_close', type="float", store=True),
'assigned_to' : fields.many2one('res.users', 'Assigned to'),
'timesheet_ids' : fields.one2many('hr.analytic.timesheet', 'issue_id', 'Timesheets'),
'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account',