← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 888135] Re: [6.1] account_bank - post_write method not single id safe

 

** Changed in: openobject-addons
   Importance: Undecided => Low

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

** Changed in: openobject-addons
     Assignee: (unassigned) => OpenERP R&D Addons Team 3 (openerp-dev-addons3)

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/888135

Title:
  [6.1] account_bank - post_write method not single id safe

Status in OpenERP Addons (modules):
  Confirmed

Bug description:
  Hello,

  While using some ooor script, I figured out that the method write
  crash if you try to use a single id instead of a list of ids.

  Traceback (most recent call last):
    File "/home/yvaucher/Projects/dnag_openerp_6_1/test/src/server/openerp/wsgi.py", line 77, in xmlrpc_return
      result = openerp.netsvc.dispatch_rpc(service, method, params)
    File "/home/yvaucher/Projects/dnag_openerp_6_1/test/src/server/openerp/netsvc.py", line 325, in dispatch_rpc
      result = ExportService.getService(service_name).dispatch(method, params)
    File "/home/yvaucher/Projects/dnag_openerp_6_1/test/src/server/openerp/service/web_services.py", line 580, in dispatch
      res = fn(db, uid, *params)
    File "/home/yvaucher/Projects/dnag_openerp_6_1/test/src/server/openerp/osv/osv.py", line 120, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/home/yvaucher/Projects/dnag_openerp_6_1/test/src/server/openerp/osv/osv.py", line 172, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/home/yvaucher/Projects/dnag_openerp_6_1/test/src/server/openerp/osv/osv.py", line 163, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/home/yvaucher/Projects/dnag_openerp_6_1/test/src/server/openerp/addons/account/account_bank.py", line 38, in write
      return result
    File "/home/yvaucher/Projects/dnag_openerp_6_1/test/src/server/openerp/addons/account/account_bank.py", line 44, in post_write
      if bank.company_id and not bank.journal_id:
    File "/home/yvaucher/Projects/dnag_openerp_6_1/test/src/server/openerp/osv/orm.py", line 490, in __iter__
      raise NotImplementedError("Iteration is not allowed on %s" % self)
  NotImplementedError: Iteration is not allowed on browse_record(res.partner.bank, 17)

  
  This issue come from method post_write that is expecting a list of ids.

  A patch is attached.

  Regards,
  Yannick

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


References