checking for number of working_days_per_week in hr_payroll.py

Asked by Bushair

Hi,
I have the following code in my hr_payroll.py file

class hr_contract(osv.osv):

    _inherit = 'hr.contract'
    _description = 'Employee Contract'
    _columns = {
        'permit_no':fields.char('Work Permit No', size=256, required=False, readonly=False),
        'passport_id':fields.many2one('hr.passport', 'Passport', required=False),
        'visa_no':fields.char('Visa No', size=64, required=False, readonly=False),
        'visa_expire': fields.date('Visa Expire Date'),
        'function' : fields.many2one('hr.employee.grade', 'Function'),
        'working_days_per_week': fields.integer('Working Days / Week'),
        'working_hours_per_day':fields.integer('Working Hours / Day'),
    }
    _defaults = {
        'working_days_per_week': lambda *args: 5
    }
hr_contract()

i want to use the value of the field "working_days_per_week" in many other functions.
when i use it , it is saying that the working_days_per_week is not defined. use the global defentions.

How to resolve this issue?

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#1

Hello,

This code is in progress because the object is not used in leave calculation code.

Thanks.

Can you help with this problem?

Provide an answer of your own, or ask Bushair for more information if necessary.

To post a message you must log in.