manage read_supplier_prices permission also on stock movement list (#33700)

Co-authored-by: Christophe Battarel <christophe@altairis.fr>
This commit is contained in:
Christophe Battarel 2025-04-02 19:13:24 +02:00 committed by GitHub
parent 6c9922ca36
commit 2c6c3a90d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -1133,8 +1133,12 @@ if ($resql) {
}
if (!empty($arrayfields['m.price']['checked'])) {
// Price
$usercancreadsupplierprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('product', 'product_advance', 'read_supplier_prices') : $user->hasRight('product', 'lire');
if ($productstatic->isService()) {
$usercancreadsupplierprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('service', 'service_advance', 'read_supplier_prices') : $user->hasRight('service', 'lire');
}
print '<td class="right">';
if ($objp->price != 0) {
if ($objp->price != 0 && $usercancreadsupplierprice) {
print price($objp->price);
}
print '</td>';

View file

@ -1630,8 +1630,12 @@ while ($i < $imaxinloop) {
}
// Price
if (!empty($arrayfields['m.price']['checked'])) {
$usercancreadsupplierprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('product', 'product_advance', 'read_supplier_prices') : $user->hasRight('product', 'lire');
if ($productstatic->isService()) {
$usercancreadsupplierprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('service', 'service_advance', 'read_supplier_prices') : $user->hasRight('service', 'lire');
}
print '<td class="right">';
if ($obj->price != 0) {
if ($obj->price != 0 && $usercancreadsupplierprice) {
print price($obj->price);
}
print '</td>';