0
votes

I am doing offline implementation for ODOO/ OpenERP iOS application. In this can i get list of deleted records from odoo server ??

If some record is deleted from ODOO web and same record is still present in my mobile database, i want to delete that from mobile too.

I have tried to find out solution but not able to come with solution.

Below code is used to delete record :

models.execute_kw(db, uid, password, 'res.partner', 'unlink', [[id]])
# check if the deleted record is still in the database
models.execute_kw(db, uid, password,
    'res.partner', 'search', [[['id', '=', id]]])

So is there any api available to get list of deleted records from ODOO server ?

Thanks in advance

2

2 Answers

2
votes

There is no any API or any method to fetch out deleted records from Odoo. So, you have to manage other way.

Like deleted_ids = set(mobile_ids)-set(Odoo_ids)

0
votes

For version 7 you could possibly use the audittrail module but be aware this has been deprecated on 8 so if you are on 7 and thinking of upgrading I wouldn't use this.

Otherwise, the easiest I can think of would be to override the unlink method of the models you are interested in and record the deleted IDs to a table somewhere so you can query it. If you are interested in every model, you will possibly need to patch unlink in openerp.models.BaseModel.