I'm working on the payroll module and on my own module, this data file is the one of paryroll , i'm trying to add another category ... because I need a category with a calculation rule that retrieves the value of the amount "montant"of class.
This category belongs to that one of the deduction. I need it to compute the payslip.
<record id="hr_AVANCE" model="hr.salary.rule.category">
<field name="name">Remboursement de Prêts</field>
<field name="code">AVANCE</field>
<field name="parent_id" ref="hr_payroll.DED"/>
</record>
<record id="hr_payroll.avance" model="hr.salary.rule">
<field name="name">Remboursement des Prêts</field>
<field name="code">AVANCE PRET</field>
<field name="sequence">100000</field>
<field name="category_id" ref="hr_AVANCE"/>
<field name="condition_select">none</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">result = hr.line.echeancier.montant</field>
<field name="appears_on_payslip" eval="False"/>
<field name="note">la valeur des avances et des prêts.</field>
</record>
pyhton:
class hr_line_echeancier(osv.osv):
_name = "hr.line.echeancier"
_description = "Echeancier"
_columns = {
'line_id': fields.many2one('hr.avance.pret', "ligne d\'échéancier"),
'date_ech': fields.date('Date d\'échéance',
states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]}, select=True),
'montant': fields.float('Montant'),
}
Thank you so much ..
is there any link between
contract
and this modules or payslip and this module?? ,,,it's linked with contract: class hr_contract(osv.osv):
hr_contract()
SOS @Sandeep !!
see below answer