my $limit_ind_branch=(C4::Context->preference('IndependantBranches') &&
C4::Context->userenv &&
- C4::Context->userenv->{flags} !=1 &&
+ C4::Context->userenv->{flags} % 2 !=1 &&
C4::Context->userenv->{branch}?1:0);
my $branches = GetBranches($limit_ind_branch);
my $branch = $query->param("branch") || '';