~unifield-team/unifield-wm/us-921-sync-update-hqentries

« back to all changes in this revision

Viewing changes to account_hq_entries/hq_entries.py

  • Committer: duy.vo at msf
  • Date: 2016-03-10 16:35:11 UTC
  • Revision ID: duy.vo@geneva.msf.org-20160310163511-n1prarnw0a1o6vd7
US-921: Only save the user_validated value if the data comes from sync

Show diffs side-by-side

added added

removed removed

Lines of Context:
442
442
        """
443
443
        if context is None:
444
444
            context={}
 
445
            
 
446
        #US-921: Only save the user_validated value if the data comes from sync
 
447
        if context.get('sync_update_execution', False):
 
448
            if 'user_validated' in  vals:
 
449
                return super(hq_entries, self).write(cr, uid, ids, {'user_validated': vals['user_validated']}, context)
 
450
            return True
 
451
            
445
452
        if 'account_id' in vals:
446
453
            account = self.pool.get('account.account').browse(cr, uid, [vals.get('account_id')])[0]
447
454
            for line in self.browse(cr, uid, ids):