diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 9ca28ef8430..4ed261945ba 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -340,7 +340,7 @@ if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->facture->v } // Repasse la facture en mode brouillon (unvalidate) -if ($action == 'modif' && $user->rights->facture->unvalidate) +if ($action == 'modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate)) { $object->fetch($id); $object->fetch_thirdparty(); @@ -2580,7 +2580,7 @@ else { if (! $objectidnext) { - if ($user->rights->facture->unvalidate) + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate) { print ''.$langs->trans('Modify').''; } diff --git a/htdocs/includes/modules/modFacture.class.php b/htdocs/includes/modules/modFacture.class.php index 0281fcfc4f4..51c17d203df 100644 --- a/htdocs/includes/modules/modFacture.class.php +++ b/htdocs/includes/modules/modFacture.class.php @@ -131,7 +131,8 @@ class modFacture extends DolibarrModules $this->rights[$r][1] = 'Dévalider les factures'; $this->rights[$r][2] = 'a'; $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'unvalidate'; + $this->rights[$r][4] = 'invoice_advance'; + $this->rights[$r][5] = 'unvalidate'; $r++; $this->rights[$r][0] = 14;