title: Odoo payslip with leave in salary rule python code
body: <p>I have to calculate the basic pay with if condition.if the employee does not have unpaid leave means Unpaid is not there under Worked days and input under payslip then unpaid leave should be o(Zero).
      I have tried the below code but its given error.</p>
  
  <pre><code>day=contract.wage/30
  if not worked_days.Unpaid.number_of_days in payslip:
        result=day*(30-0)
  else:
        result=day*(30-worked_days.Unpaid.number_of_days)
  </code></pre>