OCA / hr

Odoo Human Resources Addons
GNU Affero General Public License v3.0
216 stars 667 forks source link

[7.0][hr_family] REF Proposal to add many family in one2many #27

Closed moylop260 closed 9 years ago

moylop260 commented 9 years ago

Hello, We need a module that add family model. Similar to hr_family module, but this should be one2many.

I want make a PR to 8.0 with this feature. But I don't know if is a good idea.

class hr_family:
    _name = 'hr.employee.family' 

   def get_family_type():
          # inherit this function to add more family type
         return [('mother', 'Mother'), ('father', 'Father'), ('brother', 'Brother'), ('child', 'Child')]

    _columns = {
        'name': fields.char('Name', size=256, required=True),
        'dob': fields.date('Date of Birth'),
        'employee_id': fields.many2one('hr.employee', 'Employee'),
        'family_type': fields.selection( get_family_type )# or maybe is better a many2one with data/data
    }

What do you think?

pedrobaeza commented 9 years ago

I think it's better to migrate @hbrunn module _partnerrelations, that covers this and others needs:

https://github.com/OCA/partner-contact/pull/15

moylop260 commented 9 years ago

@pedrobaeza, Good thank you

I see this solution in res.partner done What is your proposal with this module for HR?

pedrobaeza commented 9 years ago

An employee always has a related partner, and a partner can have with this module all the relations you want, including father, mother, brother, sons, and so on.

moylop260 commented 9 years ago

Ok, I got it Thank you

What I can help?

pedrobaeza commented 9 years ago

You can review the module to get accepted on 7.0, and migrated to 8.0