Can not get a sequence_id from a child company
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Medium
|
OpenERP's Framework R&D |
Bug Description
In V6, how to reproduce the bug:
2 companies, A is child of B.
2 invoice sequences, one for A and one for B.
User X with company B as main company should be able to watch all objects from company B and A.
When user X is entering a new invoice for company A, no sequence_id is generated. This is due to the fact that in ir_sequence/get_id the following code seems incorrect:
company_id = self.pool.
The function is filtering according to user's company (B) and cannot find the correct invoice sequence (which is assigned to A company).
As far as I understand multi-company, the filter should find a list of all children companies and give all sequences for A, B and NULL.
affects: | openobject-addons → openobject-server |
Changed in openobject-server: | |
assignee: | nobody → OpenERP's Framework R&D (openerp-dev-framework) |
importance: | Undecided → Medium |
status: | New → Confirmed |
On Sunday 29 May 2011, you wrote: get('res. users') .read(cr, uid, uid, context) ['company_ id'][0] or None
> Public bug reported:
>
> In V6, how to reproduce the bug:
> 2 companies, A is child of B.
> 2 invoice sequences, one for A and one for B.
> User X with company B as main company should be able to watch all objects
> from company B and A. When user X is entering a new invoice for company A,
> no sequence_id is generated. This is due to the fact that in
> ir_sequence/get_id the following code seems incorrect:
>
> company_id = self.pool.
> ['company_id'], context=
Hmm. Smells dead fish here..
The company_id of the ir.sequence must match the one of the journal. Or
shouldn't be considered at all..
Why would the sequence ever be affected by the /user/ doing the operation,
rather than the /object/ receiving the sequence number?
Using the current code, *please* have distinct sequences per journal, and have
company_id=NULL at all of them.
--
Say NO to spam and viruses. Stop using Microsoft Windows!