Skip to Content
Menu
This question has been flagged
1433 Views

class hr_employee(osv.osv):
    _inherit = 'hr.employee'
    _order = 'matricule'

    def action_confirmed(self,cr,uid,ids,context=None):
       
        obj=self.browse(cr, uid, ids)
        right_leaves=obj.right_leaves
        remaining_leaves=obj.remaining_leaves
        return  self.write(cr,uid,ids,{'remaining_leaves':remaining_leaves + right_leaves},context=context)

hr_employee()


<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data noupdate="1">

          <record forcecreate="True" id="ir_cron_sync_all_cals111" model="ir.cron">
            <field name="name">Calendar synchronization</field>
            <field eval="True" name="active" />
            <field name="user_id" ref="base.user_root" />
            <field name="interval_number">12</field>
            <field name="interval_type">minutes</field>
            <field name="numbercall">-1</field>
            <field eval="False" name="doall" />
            <field eval="'hr.employee'" name="model" />
            <field eval="'action_confirmed'" name="function" />
        </record>

    </data>
</openerp>


Avatar
Discard