← Back to team overview

openerp-dev-web team mailing list archive

lp:~openerp-dev/openobject-addons/trunk-payroll-improve-states-mtr into lp:~openerp-dev/openobject-addons/trunk-payroll

 

Meera Trambadia (OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-payroll-improve-states-mtr into lp:~openerp-dev/openobject-addons/trunk-payroll.

Requested reviews:
  OpenERP R&D Team (openerp-dev)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-payroll-improve-states-mtr/+merge/62260

hr_payroll:-improved payslip state and removed unrequired methods as per workflow changes 
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-payroll-improve-states-mtr/+merge/62260
Your team OpenERP R&D Team is requested to review the proposed merge of lp:~openerp-dev/openobject-addons/trunk-payroll-improve-states-mtr into lp:~openerp-dev/openobject-addons/trunk-payroll.
=== modified file 'hr_payroll/hr_payroll.py'
--- hr_payroll/hr_payroll.py	2011-05-24 12:31:16 +0000
+++ hr_payroll/hr_payroll.py	2011-05-25 09:23:26 +0000
@@ -304,12 +304,6 @@
     def cancel_sheet(self, cr, uid, ids, context=None):
         return self.write(cr, uid, ids, {'state': 'cancel'}, context=context)
 
-    def account_check_sheet(self, cr, uid, ids, context=None):
-        return self.write(cr, uid, ids, {'state': 'accont_check'}, context=context)
-    
-    def hr_check_sheet(self, cr, uid, ids, context=None):
-        return self.write(cr, uid, ids, {'state': 'hr_check'}, context=context)
-    
     def process_sheet(self, cr, uid, ids, context=None):
         return self.write(cr, uid, ids, {'paid': True, 'state': 'done'}, context=context)
 
@@ -343,9 +337,6 @@
             'context': {}
         }
 
-    def verify_sheet(self, cr, uid, ids, context=None):
-        return self.write(cr, uid, ids, {'state': 'confirm'}, context=context)
-    
     def check_done(self, cr, uid, ids, context=None):
         return True
 
@@ -493,7 +484,7 @@
                 result = 0.0
                 self.cr.execute("SELECT sum(quantity) as sum\
                             FROM hr_payslip as hp, hr_payslip_input as pi \
-                            WHERE hp.employee_id = %s AND hp.state in ('confirm','done') \
+                            WHERE hp.employee_id = %s AND hp.state = 'done' \
                             AND hp.date_from >= %s AND hp.date_to <= %s AND hp.id = pi.payslip_id AND pi.code = %s",
                            (self.employee_id, from_date, to_date, code))
                 res = self.cr.fetchone()[0]
@@ -507,7 +498,7 @@
                 result = 0.0
                 self.cr.execute("SELECT sum(number_of_days) as number_of_days, sum(number_of_hours) as number_of_hours\
                             FROM hr_payslip as hp, hr_payslip_worked_days as pi \
-                            WHERE hp.employee_id = %s AND hp.state in ('confirm','done') \
+                            WHERE hp.employee_id = %s AND hp.state = 'done'\
                             AND hp.date_from >= %s AND hp.date_to <= %s AND hp.id = pi.payslip_id AND pi.code = %s",
                            (self.employee_id, from_date, to_date, code))
                 return self.cr.fetchone()
@@ -528,7 +519,7 @@
                     to_date = datetime.now().strftime('%Y-%m-%d')
                 self.cr.execute("SELECT sum(case when hp.credit_note = False then (pl.total) else (-pl.total) end)\
                             FROM hr_payslip as hp, hr_payslip_line as pl \
-                            WHERE hp.employee_id = %s AND hp.state in ('confirm','done') \
+                            WHERE hp.employee_id = %s AND hp.state = 'done' \
                             AND hp.date_from >= %s AND hp.date_to <= %s AND hp.id = pl.slip_id AND pl.code = %s",
                             (self.employee_id, from_date, to_date, code))
                 res = self.cr.fetchone()


Follow ups