[IMP] crm_parner_assign, crm: Corrected history[whole, laetst, case info] for lead...
[odoo/odoo.git] / addons / hr_payroll / hr_payroll.py
index 57f794e..affd81c 100644 (file)
@@ -211,7 +211,7 @@ class one2many_mod2(fields.one2many):
 class hr_payslip_run(osv.osv):
 
     _name = 'hr.payslip.run'
-    _description = 'Payslip Run'
+    _description = 'Payslip Batches'
     _columns = {
         'name': fields.char('Name', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}),
         'slip_ids': fields.one2many('hr.payslip', 'payslip_run_id', 'Payslips', required=False, readonly=True, states={'draft': [('readonly', False)]}),
@@ -286,7 +286,7 @@ class hr_payslip(osv.osv):
         'contract_id': fields.many2one('hr.contract', 'Contract', required=False, readonly=True, states={'draft': [('readonly', False)]}),
         'details_by_salary_rule_category': fields.function(_get_lines_salary_rule_category, method=True, type='one2many', relation='hr.payslip.line', string='Details by Salary Rule Category'),
         'credit_note': fields.boolean('Credit Note', help="Indicates this payslip has a refund of another", readonly=True, states={'draft': [('readonly', False)]}),
-        'payslip_run_id': fields.many2one('hr.payslip.run', 'Payslip Run', readonly=True, states={'draft': [('readonly', False)]}),
+        'payslip_run_id': fields.many2one('hr.payslip.run', 'Payslip Batches', readonly=True, states={'draft': [('readonly', False)]}),
     }
     _defaults = {
         'date_from': lambda *a: time.strftime('%Y-%m-01'),
@@ -646,7 +646,7 @@ class hr_payslip(osv.osv):
                       'struct_id': False,
                       }
             }
-        if not employee_id:
+        if (not employee_id) or (not date_from) or (not date_to):
             return res
         ttyme = datetime.fromtimestamp(time.mktime(time.strptime(date_from, "%Y-%m-%d")))
         employee_id = empolyee_obj.browse(cr, uid, employee_id, context=context)
@@ -928,6 +928,10 @@ class hr_payslip_line(osv.osv):
         'total': fields.function(_calculate_total, method=True, type='float', string='Total', digits_compute=dp.get_precision('Payroll'),store=True ),
     }
 
+    _defaults = {
+        'quantity': 1.0,
+    }
+
 hr_payslip_line()
 
 class hr_payroll_structure(osv.osv):