[FIX] procurement: removed message_track overwriting which was not needed anymore...
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>
Mon, 28 Oct 2013 10:33:15 +0000 (11:33 +0100)
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>
Mon, 28 Oct 2013 10:33:15 +0000 (11:33 +0100)
bzr revid: qdp-launchpad@openerp.com-20131028103315-nu387n2tm9s803rs

addons/procurement/procurement.py

index 730b410..cffb81b 100644 (file)
@@ -137,22 +137,6 @@ class procurement_order(osv.osv):
         'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'procurement.order', context=c)
     }
 
-    def message_track(self, cr, uid, ids, tracked_fields, initial_values, context=None):
-        """ Overwrite message_track to avoid tracking more than once the confirm-exception loop
-        Add '_first_pass_done_' to the note field only the first time stuck in exception state
-        Will avoid getting furthur confirmed and exception change of state messages
-
-        TODO: this hack is necessary for a stable version but should be avoided for the next release.
-        Instead find a more elegant way to prevent redundant messages or entirely stop tracking states on procurement orders
-        """
-        for proc in self.browse(cr, uid, ids, context=context):
-            if not proc.note or '_first_pass_done_' not in proc.note or proc.state not in ('confirmed', 'exception'):
-                super(procurement_order, self).message_track(cr, uid, [proc.id], tracked_fields, initial_values, context=context)
-                if proc.state == 'exception':
-                    cr.execute("""UPDATE procurement_order set note = TRIM(both E'\n' FROM COALESCE(note, '') || %s) WHERE id = %s""", ('\n\n_first_pass_done_',proc.id))
-
-        return True
-
     def unlink(self, cr, uid, ids, context=None):
         procurements = self.read(cr, uid, ids, ['state'], context=context)
         unlink_ids = []