← Back to team overview

openerp-india team mailing list archive

[Bug 863221] Re: sequence might use a child company's sequence by error under certain circumstances

 

As Naresh says, we have fixed this by considering a "preferred company" when selecting the sequence. By default the preferred company will be the company of the user, but this can be overridden for special cases. (Technically this works similarly to reading properties: by specifying a 'force_company' key in the context).
If no sequence is found for the preferred company, we fallback to selecting the first matching sequence that is currently visible to the user. Probably in that last case we should give priority to sequences that belong to a company rather than global sequences, because the former are presumed to be more specific than the latter.

-- 
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/863221

Title:
  sequence might use a child company's sequence by error under certain
  circumstances

Status in OpenERP Server:
  Fix Committed
Status in OpenERP Server 6.0 series:
  Confirmed
Status in OpenERP Server trunk series:
  Fix Committed

Bug description:
  On ~openerp/openobject-server/6.0 since rev 3460:

  "rev 3460 : [MERGE] Merged ILA's branch for the fix of correction in
  get_id() of ir_sequence to allow multi-company feature"

  It's does'nt work if you use multi-company feature...

  Now the sql query select every sequences for all companies (for the
  object) order by company_id, but there is a  cr.dictfetchone() after
  sql response...

  For example, when you create a sale_order (or any other objects), the sequence returned is the for the first company_id found.
  However we need to have the specific sequence of the active user's company .

  So the code of ir_sequence.py before rev 3460 works fine with multi-
  company

  ir_sequence.py, line 78 rev 3460:
   - company_id = self.pool.get('res.users').read(cr, uid, uid, ['company_id'], context=context)['company_id'][0] or None
  + company_ids = self.pool.get('res.company').search(cr, uid, [], context=context)

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