Browse Source

use sudo in method sequence_number_sync to fetch the next sequence id

pull/178/head
jbeficent 9 years ago
committed by Denis Roussel
parent
commit
aee0c44915
  1. 2
      pos_sequence_ref_number/models/pos_order.py

2
pos_sequence_ref_number/models/pos_order.py

@ -15,7 +15,7 @@ class PosOrder(models.Model):
next = vals.get('_sequence_ref_number', False) next = vals.get('_sequence_ref_number', False)
next = int(next) if next else False next = int(next) if next else False
if vals.get('session_id') and next is not False: if vals.get('session_id') and next is not False:
session = self.env['pos.session'].browse(vals['session_id'])
session = self.env['pos.session'].sudo().browse(vals['session_id'])
if next != session.config_id.sequence_id.number_next_actual: if next != session.config_id.sequence_id.number_next_actual:
session.config_id.sequence_id.number_next_actual = next session.config_id.sequence_id.number_next_actual = next
if vals.get('_sequence_ref_number') is not None: if vals.get('_sequence_ref_number') is not None:

Loading…
Cancel
Save