~eoc/openobject-addons/eoc-extra-addons-trunk

« back to all changes in this revision

Viewing changes to stock_serial_number/stock.py

  • Committer: Mariano Ruiz
  • Date: 2015-01-14 18:17:21 UTC
  • Revision ID: mrsarm@gmail.com-20150114181721-mdlbzyyu8qfpuqm9
[FIX] [stock_serial_number] Allow 'Reset to draft' action in pickings with serial numbers

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
                else:
79
79
                    len_serial = len(move.serial_ids)
80
80
                if move.product_id.is_serial:
81
 
                    if qty != len_serial and move.state not in ('draft', 'waiting', 'confirmed', 'cancel'):
 
81
                    if qty != len_serial and move.state not in ('draft', 'waiting', 'confirmed', 'cancel') \
 
82
                      and vals.get('state', None) != 'draft':
82
83
                        if qty == 1:
83
84
                            raise osv.except_osv(_('Error'),
84
85
                                    _("The product has no serial number assigned"))