From 22c2b27b3a70b11603b18da9eff7373f15ccce80 Mon Sep 17 00:00:00 2001 From: mtr Date: Mon, 16 May 2011 18:57:39 +0530 Subject: [PATCH 1/3] [IMP] hr_payroll: changed label of field quantity on Payslip input into 'Amount' bzr revid: mtr@mtr-20110516132739-bay9gf9tpolxagsx --- addons/hr_payroll/hr_payroll.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index b70b30676a8..cd7c08144bf 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -660,7 +660,7 @@ class hr_payslip_input(osv.osv): 'payslip_id': fields.many2one('hr.payslip', 'Pay Slip', required=True), 'sequence': fields.integer('Sequence', required=True,), 'code': fields.char('Code', size=52, required=True, help="The code that can be used in the salary rules"), - 'quantity': fields.float('Quantity', help="It is used in computation. For e.g. A rule for sales having 1% commission of basic salary for per product can defined in expression like result = inputs['S-ASUS']['qunatity']*contract.wage*0.01."), + 'quantity': fields.float('Amount', help="It is used in computation. For e.g. A rule for sales having 1% commission of basic salary for per product can defined in expression like result = inputs['S-ASUS']['qunatity']*contract.wage*0.01."), 'contract_id': fields.many2one('hr.contract', 'Contract', required=True, help="The contract for which applied this input"), } _order = 'payslip_id, sequence' From ad6b2593c2bcbf63dc22e50a2fafc18ee396112a Mon Sep 17 00:00:00 2001 From: mtr Date: Tue, 24 May 2011 11:32:02 +0530 Subject: [PATCH 2/3] [IMP] hr_payroll: renamed the field 'quantity' to 'amount' bzr revid: mtr@mtr-20110524060202-z58x324zvkugddd1 --- addons/hr_payroll/hr_payroll.py | 6 +++--- addons/hr_payroll/hr_payroll_demo.xml | 2 +- addons/hr_payroll/hr_payroll_view.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index b11f4202b73..4fd1d0a9a47 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -490,7 +490,7 @@ class hr_payslip(osv.osv): if to_date is None: to_date = datetime.now().strftime('%Y-%m-%d') result = 0.0 - self.cr.execute("SELECT sum(quantity) as sum\ + self.cr.execute("SELECT sum(amount) as sum\ FROM hr_payslip as hp, hr_payslip_input as pi \ WHERE hp.employee_id = %s AND hp.state in ('confirm','done') \ AND hp.date_from >= %s AND hp.date_to <= %s AND hp.id = pi.payslip_id AND pi.code = %s", @@ -727,13 +727,13 @@ class hr_payslip_input(osv.osv): 'payslip_id': fields.many2one('hr.payslip', 'Pay Slip', required=True), 'sequence': fields.integer('Sequence', required=True,), 'code': fields.char('Code', size=52, required=True, help="The code that can be used in the salary rules"), - 'quantity': fields.float('Quantity', help="It is used in computation. For e.g. A rule for sales having 1% commission of basic salary for per product can defined in expression like result = inputs.SASUS.qunatity * contract.wage*0.01."), + 'amount': fields.float('Amount', help="It is used in computation. For e.g. A rule for sales having 1% commission of basic salary for per product can defined in expression like result = inputs.SASUS.amount * contract.wage*0.01."), 'contract_id': fields.many2one('hr.contract', 'Contract', required=True, help="The contract for which applied this input"), } _order = 'payslip_id, sequence' _defaults = { 'sequence': 10, - 'quantity': 0.0, + 'amount': 0.0, } hr_payslip_input() diff --git a/addons/hr_payroll/hr_payroll_demo.xml b/addons/hr_payroll/hr_payroll_demo.xml index 3d5240c76fc..6408cb78094 100644 --- a/addons/hr_payroll/hr_payroll_demo.xml +++ b/addons/hr_payroll/hr_payroll_demo.xml @@ -67,7 +67,7 @@ Get 1% of sales - result = (inputs.SALEURO.quantity + inputs.SALASIA.quantity) * contract.wage * 0.01 + result = (inputs.SALEURO.amount + inputs.SALASIA.amount) * contract.wage * 0.01 diff --git a/addons/hr_payroll/hr_payroll_view.xml b/addons/hr_payroll/hr_payroll_view.xml index 4d422d708de..01bbcd1844b 100644 --- a/addons/hr_payroll/hr_payroll_view.xml +++ b/addons/hr_payroll/hr_payroll_view.xml @@ -297,7 +297,7 @@ - + @@ -307,7 +307,7 @@ - + From 60794632f881b131fdcb575799474b570db26908 Mon Sep 17 00:00:00 2001 From: mtr Date: Wed, 25 May 2011 14:42:34 +0530 Subject: [PATCH 3/3] [IMP] hr_payroll: improved payslip state as per workflow changes and removed unrequired methods bzr revid: mtr@mtr-20110525091234-ih8c8e9vei8vfhbp --- addons/hr_payroll/hr_payroll.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index 70bac2a497c..614d6514a7d 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -304,12 +304,6 @@ class hr_payslip(osv.osv): 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 @@ class hr_payslip(osv.osv): '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 @@ class hr_payslip(osv.osv): 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 @@ class hr_payslip(osv.osv): 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 @@ class hr_payslip(osv.osv): 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()