I need to do importing in openerp with the following scenario.
I have already a set of records in my system. And the form values are similar to this.
Course
- Course Name (For now i'll call this as main record)
- Course ID
- Subjects (one2many record) (For now i'll call this as sub record)
- Subject Name
- Teacher
- Total Marks
Now when i import another set of records i would like the importing functionality to perform like below
- Create main record if data in the main record doesn't exist already
- Update main record if data in the main record exist already
- If main record data exist and one of the sub record doesn't exist create a sub record and map it to main record
- If main record data exist and sub records also exist then update the sub records with new values
Is it possible to do all the above with openerp default importing functionality. From my knowledge i see that if the importing record doesnt have the id then it creates a new record and if id exist then it updates. Not sure how it works for sub records as i don't find any id for them.
So the clue i have is i am able to update a record with the export id of the record.
Sample is _export_crm.lead_187
Kindly feel free to edit the question if it's not of better clarity. Hope i've narrated the issue in an understandable manner. Thanks for your time.