← Back to team overview

clearcorp team mailing list archive

[Merge] lp:~rr.clearcorp/openerp-costa-rica/6.1-l10n_cr_hr_payroll into lp:openerp-costa-rica/6.1

 

Ronald Rubi has proposed merging lp:~rr.clearcorp/openerp-costa-rica/6.1-l10n_cr_hr_payroll into lp:openerp-costa-rica/6.1.

Requested reviews:
  CLEARCORP drivers (clearcorp-drivers)

For more details, see:
https://code.launchpad.net/~rr.clearcorp/openerp-costa-rica/6.1-l10n_cr_hr_payroll/+merge/108524

Add button confirm payslips in paylisp batches.
-- 
https://code.launchpad.net/~rr.clearcorp/openerp-costa-rica/6.1-l10n_cr_hr_payroll/+merge/108524
Your team CLEARCORP development team is subscribed to branch lp:openerp-costa-rica/6.1.
=== modified file 'l10n_cr_hr_payroll/l10n_cr_hr_payroll.py'
--- l10n_cr_hr_payroll/l10n_cr_hr_payroll.py	2012-06-03 00:46:54 +0000
+++ l10n_cr_hr_payroll/l10n_cr_hr_payroll.py	2012-06-04 05:51:19 +0000
@@ -62,9 +62,9 @@
 
 
 class hr_payslip_run(osv.osv):
-	_inherit = 'hr.payslip.run'
-	_columns = {
-		'schedule_pay': fields.selection([
+    _inherit = 'hr.payslip.run'
+    _columns = {
+        'schedule_pay': fields.selection([
             ('fortnightly', 'Fortnightly'),
             ('monthly', 'Monthly'),
             ('quarterly', 'Quarterly'),
@@ -74,8 +74,16 @@
             ('bi-weekly', 'Bi-weekly'),
             ('bi-monthly', 'Bi-monthly'),
             ], 'Scheduled Pay', select=True, readonly=True, states={'draft': [('readonly', False)]}),
-	}
-	
+    }
+
+    def confirm_payslips(self, cr, uid, ids, context=None):
+        for payslip_run in self.browse(cr, uid, ids, context=context):
+            payslip_obj = self.pool.get('hr.payslip')
+            payslips = payslip_obj.browse(cr, uid, payslip_run.slip_ids, context)
+            for payslip in payslips:
+                payslip_id = payslip.id
+                payslip_id.process_sheet()
+
 hr_payslip_run()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'l10n_cr_hr_payroll/l10n_cr_hr_payroll_view.xml'
--- l10n_cr_hr_payroll/l10n_cr_hr_payroll_view.xml	2012-06-03 14:39:29 +0000
+++ l10n_cr_hr_payroll/l10n_cr_hr_payroll_view.xml	2012-06-04 05:51:19 +0000
@@ -27,11 +27,14 @@
             <field name="arch" type="xml">
                 <data>                
                     <field name = "date_end" position = "after">
-                        <field name="schedule_pay" required = "True" string = "Frecuencia de pago"/>
+                        <field name="schedule_pay" required = "True" string = "Schedule pay"/>
                     </field>
 					<button string = "Generate Payslips" position = "replace"> 
 						<button name="%(hr_payroll.action_hr_payslip_by_employees)d" context="{'schedule_pay': schedule_pay}" type="action" states="draft" icon="gtk-execute" string="Generate Payslips" />
 			        </button>
+                    <button string = "Generate Payslips" position = "after"> 
+						<button name="confirm_payslips" type="object" states="draft" icon="STOCK_GOTO_BOTTOM" string="Confirm Payslips" />
+			        </button>
                 </data>
             </field>
         </record>        


Follow ups