Raimon,

In your example, yes, if you select C1 as the current company of a user,
that user can only see C1 in the available companies. That's the correct
behavior. If you want to see C2, you need to select C2 or C as the
current company.

Just tested again on 6.0:

1. Create the company structure as shown in comment #2
2. Create User U1 and make U1 belong to C and C1, and add Extended View and 
Multicompany group for U1.
3. Login as U1, and select C as the current company in the user preferences.
4. Create a customer invoice, the available companies are [C, C1, C2] in other 
info tab. Choose C1.
5. Change user preferences of U1 and select C1 as the company
6. Re-open the same invoice created at 4., now the only available company in 
other info tab is only [C1].
7. This is the correct behavior: U1 is now working for C1, so cannot select 
another company.
8. Change user preferences of U1 and select C again as the company
9. Re-open the same invoice created at 4., now the available companies are [C, 
C1, C2] again.
10. All of the above is the correct, expected behavior.

So let me repeat: ALL the data you see at any moment depends on the CURRENT 
company of the user, NOT ALL the companies of the user ; this is important for 
CONSISTENCY.
If we used your suggested rule, look at what happens: imagine U1 belongs to A 
and C: if U1 is currently looking at a sale order of A1, he can go to the 
linked invoice and change the company of that invoice to C2! This would make it 
impossible for employees of A1 to work with the sale order and the invoice!

If this is still not clear, please provide the step by step description
of what you are trying to do, but please be sure to understand the
requirement for consistency first. BTW, what version of OpenERP are you
using? 6.0 or trunk?

Thanks!

-- 
You received this bug notification because you are a member of OpenERP
CTP, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/802958

Title:
  company rule. Companies availables, not childreen

Status in OpenERP Server:
  Invalid

Bug description:
  For default, companie rules are:

  [('id','child_of',[user.company_id.id])]

  This rule only change others companies childreen. But, what happen
  when you are at children company? You do not change parent company or
  another company childreen.

  This rule is better because you can change another company (childreen
  or not childreen) availables for user:

  ['|',('id','in',[x.id for x in
  user.company_ids]),('id','child_of',[user.company_id.id])]

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

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to