~unifield-team/unifield-wm/us-808-sync

« back to all changes in this revision

Viewing changes to sync_remote_warehouse/update.py

  • Committer: jf
  • Date: 2015-11-23 16:39:39 UTC
  • mfrom: (601.1.14 unifield-sync)
  • Revision ID: jfb@tempo-consulting.fr-20151123163939-yf7d3zfy48vzpyzv
Tags: uf2.0rc1
US-703 [IMP] Sync server: remove puller
US-703 [IMP] Split data pulled ids
SP-190 [IMP] Data push: do not browse all records
SP-199 [IMP] Do not send multi delete updates for the same record
US-684 [IMP] Close and remove cursor used by sync process
Us-684 [IMP] Don't load db dump file in memory

lp:~unifield-team/unifield-wm/us-703-sync-qt

Changes in sync_server.sync_rule.csv:
remove duplicated rule to generate delete updates on:
    - account.target.costcenter #107, done @rule #113
    - res.currency.rate #128, done @rule #106
    - cost.center.distribution.line #202 and #203, done @rule #201
    - funding.pool.distribution.line #211, done @rule #210
    - account.cashbox.line #404, done @rule #402
    - account.move.line #417, done @rule #412
    - account.analytic.line #421 and #422, done @rule #420
    - financing.contract.format #450, done @rule @451
    - financing.contract.format.line #457, done @rule #452
    - supplier.catalogue #655, done @rule #650
    - supplier.catalogue.line #656, done @rule #655

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
            if not 'id' in included_fields: 
40
40
                included_fields.append('id')
41
41
 
42
 
            ids_to_compute = self.usb_need_to_push(cr, uid,
43
 
                self.search_ext(cr, uid, domain, context=context), context=context)
 
42
            ids_need_to_push = self.usb_need_to_push(cr, uid, context=context)
 
43
            if not ids_need_to_push:
 
44
                return 0
 
45
            domain.append(('id', 'in', ids_need_to_push))
 
46
            ids_to_compute = self.search_ext(cr, uid, domain, context=context)
44
47
            if not ids_to_compute:
45
48
                return 0
46
49
 
70
73
                return 0
71
74
 
72
75
            ids_to_delete = self.need_to_push(cr, uid,
73
 
                self.search_deleted(cr, uid, [('module','=','sd')], context=context), context=context)
 
76
                self.search_deleted(cr, uid, module='sd', context=context), context=context)
74
77
 
75
78
            if not ids_to_delete:
76
79
                return 0
94
97
        assert obj, "Cannot find model %s of rule id=%d!" % (rule.model, rule.id)
95
98
        return (create_normal_update(obj, rule, update_context), create_delete_update(obj, rule, update_context))
96
99
 
97
 
UpdateToSend()
 
 
b'\\ No newline at end of file'
 
100
UpdateToSend()