~unifield-team/unifield-wm/utp-794

« back to all changes in this revision

Viewing changes to sourcing/sourcing.py

  • Committer: matthieu.choplin at msf
  • Date: 2013-05-06 14:51:22 UTC
  • mto: This revision was merged to the branch mainline in revision 1763.
  • Revision ID: matthieu.choplin@geneva.msf.org-20130506145122-k9digd1xfgkqqhm2
[FIX] uf-1949: set a hierarchy between categories if several FO update one PO

Show diffs side-by-side

added added

removed removed

Lines of Context:
1128
1128
            write_values = {'origin': origin}
1129
1129
            purchase_read = self.pool.get('purchase.order').read(cr, uid, purchase_ids[0], ['categ', 'priority'])
1130
1130
            # update categ and prio if they are different from the existing po one's.
1131
 
            if values['categ'] != purchase_read['categ']:
 
1131
            if values.get('categ') and values['categ'] != purchase_read['categ']:
1132
1132
                write_values['categ'] = 'other'
1133
 
            if values['priority'] in priority_sorted.keys() and values['priority']!= purchase_read['priority']:
 
1133
            if values.get('priority') and values['priority'] in priority_sorted.keys() and values['priority']!= purchase_read['priority']:
1134
1134
                if priority_sorted[values['priority']] < priority_sorted[purchase_read['priority']]:
1135
1135
                    write_values['priority'] = values['priority']
1136
1136
            self.pool.get('purchase.order').write(cr, uid, purchase_ids[0], write_values, context=context)