[MERGE] merge

bzr revid: qdp-launchpad@openerp.com-20110411155356-jncdanf2fv0rgynd
This commit is contained in:
Quentin (OpenERP)
2011-04-11 17:53:56 +02:00
+7
View File
@@ -51,10 +51,17 @@ class hr_payroll_structure(osv.osv):
'note': fields.text('Description'),
'parent_id':fields.many2one('hr.payroll.structure', 'Parent'),
}
def _get_parent(self, cr, uid, context=None):
data_id = self.pool.get('ir.model.data').search(cr, uid, [('model', '=', 'hr.payroll.structure'), ('name', '=', 'structure_base')])
res = self.pool.get('ir.model.data').browse(cr, uid, data_id[0], context=context).res_id
return res or False
_defaults = {
'company_id': lambda self, cr, uid, context: \
self.pool.get('res.users').browse(cr, uid, uid,
context=context).company_id.id,
'parent_id': _get_parent,
}
def copy(self, cr, uid, id, default=None, context=None):