← Back to team overview

openerp-india team mailing list archive

[Bug 959407] Re: Missing sequence on close end of year action after upgrading from 6.0 to 6.1

 

Hello,

I think you already resolved the problem. But I had the same and I
resolved this using this pgScript:


DECLARE @i, @ir_sequences, @sequence_name, @increment_nbr, @start_nbr;
SET @ir_sequences = SELECT TO_CHAR(id, '000'), number_next, number_increment FROM ir_sequence;
SET @i = 0;
WHILE @i < LINES(@ir_sequences)
BEGIN
  SET @sequence_name = 'ir_sequence_' + TRIM(CAST(@ir_sequences[@i][0] AS STRING));
  SET @start_nbr = @ir_sequences[@i][1];
  SET @increment_nbr = @ir_sequences[@i][2];
  CREATE SEQUENCE @sequence_name
    INCREMENT @increment_nbr
    MINVALUE 1
    MAXVALUE 9223372036854775807
    START @start_nbr
    CACHE 1;
  SET @i = @i + 1;
END


Hopping this could help someone.

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/959407

Title:
  Missing sequence on close end of year action after upgrading from 6.0
  to 6.1

Status in OpenERP Server:
  Invalid

Bug description:
  2012-03-19 14:41:25,246 3278 ERROR ? openerp.sql_db: Programming error: relation "ir_sequence_014" does not exist
  LINE 1: SELECT nextval('ir_sequence_014')
                         ^
  , in query SELECT nextval('ir_sequence_014')
  2012-03-19 14:41:25,247 3278 ERROR ? openerp.osv.osv: Uncaught exception
  Traceback (most recent call last):
    File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 121, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 164, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/usr/lib/pymodules/python2.7/openerp/addons/account/wizard/account_fiscalyear_close.py", line 262, in data_save
      reconcile_id = _reconcile_fy_closing(cr, uid, ids, context=context)
    File "/usr/lib/pymodules/python2.7/openerp/addons/account/wizard/account_fiscalyear_close.py", line 63, in _reconcile_fy_closing
      r_id = self.pool.get('account.move.reconcile').create(cr, uid, {'type': 'auto'})
    File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 4055, in create
      vals = self._add_missing_default_values(cr, user, vals, context)
    File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 2369, in _add_missing_default_values
      defaults = self.default_get(cr, uid, missing_defaults, context)
    File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 1503, in default_get
      defaults[f] = self._defaults[f](self, cr, uid, context)
    File "/usr/lib/pymodules/python2.7/openerp/addons/account/account.py", line 1655, in <lambda>
      'name': lambda self,cr,uid,ctx={}: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile') or '/',
    File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_sequence.py", line 256, in get
      return self.get_id(cr, uid, code, 'code', context)
    File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_sequence.py", line 248, in get_id
      return self.next_by_code(cr, uid, sequence_code_or_id, context)
    File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_sequence.py", line 233, in next_by_code
      return self._next(cr, uid, ids, context)
    File "/usr/lib/pymodules/python2.7/openerp/addons/account/ir_sequence.py", line 55, in _next
      return super(ir_sequence, self)._next(cr, uid, seq_ids, context)
    File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_sequence.py", line 201, in _next
      cr.execute("SELECT nextval('ir_sequence_%03d')" % seq['id'])
    File "/usr/lib/pymodules/python2.7/openerp/sql_db.py", line 152, in wrapper
      return f(self, *args, **kwargs)
    File "/usr/lib/pymodules/python2.7/openerp/sql_db.py", line 212, in execute
      res = self._obj.execute(query, params)
  ProgrammingError: relation "ir_sequence_014" does not exist
  LINE 1: SELECT nextval('ir_sequence_014')
                         ^

  2012-03-19 14:41:25,345 3278 ERROR ? openerp.netsvc: relation "ir_sequence_014" does not exist
  LINE 1: SELECT nextval('ir_sequence_014')
                         ^

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/959407/+subscriptions


References