← Back to team overview

openerp-india team mailing list archive

[Bug 1075513] Re: Table: public.procurement_order Field: message size too small?

 

Hello,

We have already Increase the size of this field (message) on trunk from
64 to 124.

So this issue doesn't affect to trunk, but as per my "Opinion" size 124
is not good as per the coding convention it should be 128. For this you
can check the lp:1079548.

I think 64 is also enough for message you have to reduce the size of
your procurement exception message, It will helps you because we can not
consider this issue for 6.1.

Thanks for the reporting!

** Changed in: openobject-addons
       Status: New => Invalid

** Summary changed:

-  Table: public.procurement_order Field: message size too small? 
+ [6.1]Table: public.procurement_order Field: message size too small?

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

Title:
  [6.1]Table: public.procurement_order Field: message size too small?

Status in OpenERP Addons (modules):
  Invalid

Bug description:
  Creating a new OM, if some error happens on procurement, an error-message is logged on public.procurement_order table and field message.
  But using a localized ( on my case in Spanish ) database, the message itself exceeds its field size which has currently 64 characters, causing an SQL-Error.

  It is safe to have such small field size? And maybe this can occur on
  other localizations?

  Here is the sql sentence that fails:

  "update procurement_order set message='No hay suficiente stock y no se
  ha definido una regla de stock mínimo.' where id=5"

  And here is an example stack trace:

  Environment Information :
  System : Linux-3.2.0-32-generic-pae-i686-with-Ubuntu-12.04-precise
  OS Name : posix
  Distributor ID: Ubuntu
  Description: Ubuntu 12.04.1 LTS
  Release: 12.04
  Codename: precise
  Operating System Release : 3.2.0-32-generic-pae
  Operating System Version : #51-Ubuntu SMP Wed Sep 26 21:54:23 UTC 2012
  Operating System Architecture : 32bit
  Operating System Locale : en_US.UTF-8
  Python Version : 2.7.3
  OpenERP-Client Version : 6.1.1
  Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/service/netrpc_server.py", line 64, in run
      result = netsvc.dispatch_rpc(msg[0], msg[1], msg[2:])
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/netsvc.py", line 360, in dispatch_rpc
      result = ExportService.getService(service_name).dispatch(method, params)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/service/web_services.py", line 586, in dispatch
      res = fn(db, uid, *params)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/osv/osv.py", line 121, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/osv/osv.py", line 164, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/home/raul/Work.openerp/NiledOpenERP.6_1/addons-niled/mrp_niled/wizard/lot_selection.py", line 55, in confirm_production
      wf_service.trg_validate(uid, 'mrp.production', context['active_id'], 'button_confirm', cr)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/wkf_service.py", line 124, in trg_validate
      res2 = instance.validate(cr, id, ident, signal)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/instance.py", line 48, in validate
      workitem.process(cr, witem, ident, signal, force_running, stack=stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 61, in process
      ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 176, in _split_test
      _join_test(cr, t[0], t[1], ident, stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 184, in _join_test
      create(cr,[activity], inst_id, ident, stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 41, in create
      process(cr, res, ident, stack=stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 53, in process
      result = _execute(cr, workitem, activity, ident, stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 128, in _execute
      id_new = wkf_expr.execute(cr, ident, workitem, activity)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/wkf_expr.py", line 68, in execute
      return _eval_expr(cr, ident, workitem, activity['action'])
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/wkf_expr.py", line 58, in _eval_expr
      ret = eval(line, env, nocopy=True)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/tools/safe_eval.py", line 241, in safe_eval
      return eval(test_expr(expr,_SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
    File "", line 1, in <module>
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/osv/orm.py", line 368, in function_proxy
      return attr(self._cr, self._uid, [self._id], *args, **kwargs)
    File "/home/raul/Work.openerp/NiledOpenERP.6_1/addons-niled/mrp_niled/mrp.py", line 202, in action_confirm
      picking_id = super(mrp_production, self).action_confirm(cr, uid, ids)
    File "/home/raul/Work.openerp/openerp/addons/6.1/mrp/mrp.py", line 1020, in action_confirm
      self._make_production_line_procurement(cr, uid, line, shipment_move_id, context=context)
    File "/home/raul/Work.openerp/openerp/addons/6.1/mrp/mrp.py", line 888, in _make_production_line_procurement
      wf_service.trg_validate(uid, procurement_order._name, procurement_id, 'button_confirm', cr)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/wkf_service.py", line 124, in trg_validate
      res2 = instance.validate(cr, id, ident, signal)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/instance.py", line 48, in validate
      workitem.process(cr, witem, ident, signal, force_running, stack=stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 61, in process
      ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 176, in _split_test
      _join_test(cr, t[0], t[1], ident, stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 184, in _join_test
      create(cr,[activity], inst_id, ident, stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 41, in create
      process(cr, res, ident, stack=stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 61, in process
      ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 176, in _split_test
      _join_test(cr, t[0], t[1], ident, stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 184, in _join_test
      create(cr,[activity], inst_id, ident, stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 41, in create
      process(cr, res, ident, stack=stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 61, in process
      ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 176, in _split_test
      _join_test(cr, t[0], t[1], ident, stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 184, in _join_test
      create(cr,[activity], inst_id, ident, stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 41, in create
      process(cr, res, ident, stack=stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 61, in process
      ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/workitem.py", line 158, in _split_test
      if wkf_expr.check(cr, workitem, ident, transition,signal):
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/wkf_expr.py", line 81, in check
      return _eval_expr(cr, ident, workitem, transition['condition'])
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/workflow/wkf_expr.py", line 58, in _eval_expr
      ret = eval(line, env, nocopy=True)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/tools/safe_eval.py", line 241, in safe_eval
      return eval(test_expr(expr,_SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
    File "", line 1, in <module>
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/osv/orm.py", line 368, in function_proxy
      return attr(self._cr, self._uid, [self._id], *args, **kwargs)
    File "/home/raul/Work.openerp/openerp/addons/6.1/procurement/procurement.py", line 255, in check_make_to_stock
      ok = ok and self._check_make_to_stock_product(cr, uid, procurement, context)
    File "/home/raul/Work.openerp/openerp/addons/6.1/procurement/procurement.py", line 387, in _check_make_to_stock_product
      cr.execute('update procurement_order set message=%s where id=%s', (message, procurement.id))
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/sql_db.py", line 152, in wrapper
      return f(self, *args, **kwargs)
    File "/home/raul/Work.openerp/openerp/server/6.1/openerp/sql_db.py", line 212, in execute
      res = self._obj.execute(query, params)
  DataError: value too long for type character varying(64)

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


References