Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to copy a fields from one table to another

By
More9ike
on 6/12/13, 12:01 PM 2,219 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

1

Borni DHIFI

--Borni DHIFI--
5102
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 

http://www.linkedin.com/in/borni

Skype : dhifi.borni

Borni DHIFI
On 6/12/13, 12:22 PM

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)

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

More9ike
on 6/12/13, 12:43 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 6/12/13, 12:01 PM
Seen: 2219 times
Last updated: 3/16/15, 8:10 AM