The result is a bit confusing.
For example:
When a user from the locations, select two warehouse and execute releated action Products, they get an empty screen, when he expects all warehouse products.
Then If only One warehouse is select, you get all products for this warehouse.
For me it’s OK: if you select one location you probably want to know the stock about this location and all its children but if you select two locations you’re probably interested in the quantities in only those two locations.
But this behaviour can be changed by specifying explicitly the value of the key.
Note that the issue was arised by a real customer that didn’t understand the behaviour. Keeping the current behaviour is specially strange when the user is clicking on “view”-type locations where quantity will always be 0 if children are not considered.
Even more, we always discourage adding children to storage-type locations and recomend using view locations only. The reason is that it is hard to know the quantity of the location without including its children.
I would personally do in one of theses too alternatives:
As Àngel suggests, create two actions. Though it has the problem that it makes the interface more complex.
Always include children and prevent creating children on storage-type locations. I think this is the best option because it prevents the aforementioned problems.
If the behavior of an action is different depending on the selection of items I would call that at least counterintuitive. I don’ t think it is appropriate to blame users for poor application design. I rather prefer to hear very closely to user reports to improve with repect to usability and acceptance.
When you say “switch” do you mean that the user should be allowed to choose if she wants to see only the stock of the current location only or the stock of all its children?
If I understand what you propose correctly, if the user selects two warehouses, Tryton will not allow the user to see the total stock of both locations?