[IMP] convert applicant to employee: name
[odoo/odoo.git] / addons / hr_timesheet_sheet / hr_timesheet_sheet.py
index d67d0e7..d4e71ce 100644 (file)
@@ -253,18 +253,6 @@ class account_analytic_line(osv.osv):
 class hr_timesheet_line(osv.osv):
     _inherit = "hr.analytic.timesheet"
 
-    def create_timesheet(self, cr, uid, vals,context=None):
-        sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')
-        print"this >>>>>>>>>>>>>>>>>>>>>>>>",vals,sheet_obj.search(cr, uid,[('date_to', '>=', vals['date']), ('date_from', '<=', vals['date'])])
-        idss = sheet_obj.search(cr, uid,[('date_to', '>=', vals['date']), ('date_from', '<=', vals['date'])])
-        print"this 123 >>>>>>>>>>>>>>>>>>>>>>>>",idss
-        if not idss or len(idss) < 1 :
-            res = sheet_obj.default_get(cr, uid, ['date_from','date_to','employee_id','company_id','state'], context=None)
-            ids = sheet_obj.create(cr, uid, res, context=None)
-            print"this >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>...343424",ids,res
-            return ids
-        return idss
-
     def _sheet(self, cursor, user, ids, name, args, context=None):
         sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')
         res = {}.fromkeys(ids, False)
@@ -273,10 +261,9 @@ class hr_timesheet_line(osv.osv):
                 [('date_to', '>=', ts_line.date), ('date_from', '<=', ts_line.date),
                  ('employee_id.user_id', '=', ts_line.user_id.id)],
                 context=context)
-            if not sheet_ids:
-                sheet_ids = self.create_timesheet(cursor,user,ts_line,context=context)
+            if sheet_ids:
             # [0] because only one sheet possible for an employee between 2 dates
-            res[ts_line.id] = sheet_obj.name_get(cursor, user, sheet_ids, context=context)[0]
+                res[ts_line.id] = sheet_obj.name_get(cursor, user, sheet_ids, context=context)[0]
         return res
 
     def _get_hr_timesheet_sheet(self, cr, uid, ids, context=None):