← Back to team overview

c2c-oerpscenario team mailing list archive

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

 

Hello,

I have faced the same problem when 
 - in 6.0, if child company has lower ID than parent company
 - in trunk, if child company sequence has name lower than parent company sequence

In 6.0 it will depend on the ID of the company, because the result is
order by company_id so if a child company has an ID lower than the
parent company, users of parent company will always use sequence of
child company .

For trunk we recently re wrote ir.sequence, and now it will use a normal
search, so the order will be the default one and ir_sequence._order is
'name', so it will now be based on the sequence name so when the child
company has name lower then the parent we will seen the same sequence in
parent also.

Thanks for reporting!


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

** Changed in: openobject-server
       Status: Incomplete => Confirmed

** Changed in: openobject-server
     Assignee: (unassigned) => OpenERP's Framework R&D (openerp-dev-framework)

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

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

Status in OpenERP Server:
  Confirmed

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


References