[IMP] hr_payroll: refund payslip feature improved
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>
Mon, 11 Apr 2011 12:10:46 +0000 (14:10 +0200)
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>
Mon, 11 Apr 2011 12:10:46 +0000 (14:10 +0200)
bzr revid: qdp-launchpad@openerp.com-20110411121046-7r0dzzqiw6hv6hkl

addons/hr_payroll/hr_payroll.py
addons/hr_payroll/hr_payroll_view.xml

index bc2136d..6725b28 100644 (file)
@@ -246,7 +246,7 @@ class hr_payslip(osv.osv):
         'paid': fields.boolean('Made Payment Order ? ', required=False, readonly=True, states={'draft': [('readonly', False)]}),
         'note': fields.text('Description'),
         'contract_id': fields.many2one('hr.contract', 'Contract', required=False, readonly=True, states={'draft': [('readonly', False)]}),
-        'credit_note': fields.boolean('Credit Note', help="It indicates that the payslip has been refunded", readonly=True),
+        'credit_note': fields.boolean('Credit Note', help="Indicates this payslip has a refund of another"),
        #TODO put me back
        # 'details_by_salary_head': fields.function(_get_salary_rules, method=True, type='one2many', relation='hr.salary.rule', string='Details by Salary Head', multi='details_by_salary_head'),
     }
index 5fec6c7..9449523 100644 (file)
                         <field name="struct_id" groups="base.group_extended" attrs="{'required':[('contract_id','&lt;&gt;',False)]}"/>
                         <field name="date_to"/>
                         <field name="name" colspan="4"/>
+                        <field name="credit_note" readonly="1"/>
                     </group>
                     <notebook colspan="4">
                         <page string="Salary Computation" >
                        </page>
 
                     </notebook>
-                    <field name='credit_note' />
                     <group col="10" colspan="4">
                         <field name="state"/>
                         <button string="Cancel" icon="terp-dialog-close" name="cancel_sheet" states="draft,hr_check,confirm"/>
                         <button string="Approve Sheet" icon="terp-camera_test" name="final_verify_sheet" states="hr_check"/>
                         <button string="Pay Salary" icon="terp-dolar_ok!" name="process_sheet" states="confirm"/>
                         <button string="Set to Draft" icon="terp-stock_effects-object-colorize" name="draft" states="cancel"/>
-                        <button string="Refund" icon="gtk-execute" name="refund_sheet" states="done" type='object'/>
+                        <button string="Refund" icon="gtk-execute" name="refund_sheet" states="confirm,done" type='object'/>
                     </group>
                 </form>
             </field>