~tempo-openerp/unifield-wm/utp-640

« back to all changes in this revision

Viewing changes to sourcing/wizard/multiple_sourcing.py

  • Committer: Quentin THEURET
  • Date: 2013-07-30 15:10:25 UTC
  • mfrom: (1726.2.1 unifield-wm)
  • Revision ID: qt@tempo-consulting.fr-20130730151025-ega6zkyyzbs8eudq
Tags: pilot2.5, plito2.5b1
UTP-895 [FIX] OST : Multiple line to source wizard : Add a cr.commit() to avoid bad reading of data on confirmLine in a thread with a new cursor
lp:~unifield-team/unifield-wm/utp-895

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
                        error_msg += 'Line %s ' % ', '.join(str(x[1]) for x in errors[e])
122
122
                    error_msg += ': %s' % e
123
123
                raise osv.except_osv(_('Errors'), _('There are some errors on sourcing lines : %s') % error_msg)
124
 
                
125
 
            
 
124
 
 
125
        # Commit the result to avoid problem confirmLine in thread with new cursor
 
126
        cr.commit()
 
127
 
126
128
        return {'type': 'ir.actions.act_window_close'}
127
129
 
128
130
    def source_lines(self, cr, uid, ids, context=None):
138
140
            for line in wiz.line_ids:
139
141
                if line.sale_order_id.procurement_request and wiz.po_cft == 'dpo':
140
142
                    raise osv.except_osv(_('Error'), _('You cannot choose Direct Purchase Order as method to source Internal Request lines.'))
141
 
                
142
143
                line_obj.confirmLine(cr, uid, [line.id], context=context)
143
144
 
144
145
        return {'type': 'ir.actions.act_window_close'}