Skip to Content
Menu
This question has been flagged
1 Reply
9516 Views

Hello all, please how do I copy some fields from one model to another model in OpenERP. For example, i have a model called club.member with fields id, name, address, country and state and another model called member. So i want to copy all the fields values from club.member model to member model. How do I achieve that? Thanks

Avatar
Discard
Best Answer

Hi,

You can start with this subject Here

this Technical_Memento_v0.7.3 contenant all method ORM.

or

create object member inherit to club.member.

class member(osv.osv):         
    _inherit = 'club.member'

or

club_member_pool = self.pool.get('club.member')
member_pool = self.pool.get('member')

#return  all  objects  member selected ,generally one object (  actual object)
#you cane use search
club_member_browse = club_member_pool.browse(cr, uid, ids)
for club_member  in club_member_browse
    member : {
               'name' : club_member.name,
               'address'  : club_member.address,
               #....
                 }
     member_pool.create(cr, uid, member)
Avatar
Discard
Author

Thank you very much for quick response! I will give it a trial