Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: error return missing in mo creation when qty to consume is <= 0 #31134

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions htdocs/langs/en_US/mrp.lang
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,8 @@ Manufacturing=Manufacturing
Disassemble=Disassemble
ProducedBy=Produced by
QtyTot=Qty Total

QtyCantBeSplit= Quantity cannot be split
NoRemainQtyToDispatch=No quantity remaining to divide

THMOperatorEstimatedHelp=Estimated cost of operator per hour. Will be used to estimate cost of a BOM using this workstation.
THMMachineEstimatedHelp=Estimated cost of machine per hour. Will be used to estimate cost of a BOM using this workstation.

BadValueForquantityToConsume=Quantity to consume for a material cannot be 0 or negative
8 changes: 3 additions & 5 deletions htdocs/langs/fr_FR/mrp.lang
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ DateStartPlannedMo=Date de début prévue
DateEndPlannedMo=Date de fin prévue
KeepEmptyForAsap=Vide signifie 'Dès que possible'
EstimatedDuration=Durée estimée
EstimatedDurationDesc=Durée de fabrication (ou décomposition) planifiée pour ce produit avec cette BOM
EstimatedDurationDesc=Durée de fabrication (ou décomposition) planifiée pour ce produit avec cette BOM
ConfirmValidateBom=Voulez-vous vraiment valider la nomenclature (BOM) avec la référence <strong>%s</strong> (vous pourrez l'utiliser pour créer de nouveaux Ordres de Fabrication)
ConfirmCloseBom=Voulez-vous vraiment annuler cette nomenclature (vous ne pourrez plus l'utiliser pour créer de nouveaux Ordres de Fabrication)?
ConfirmReopenBom=Êtes-vous sûr de vouloir rouvrir cette nomenclature (vous pourrez l'utiliser pour créer de nouveaux Ordres de Fabrication)
Expand Down Expand Up @@ -97,7 +97,7 @@ Workstation=Poste de travail
Workstations=Postes de travail
WorkstationsDescription=Gestion des postes de travail
WorkstationSetup = Configuration du module Poste de travail
WorkstationSetupPage = Configuration du module Poste de travail
WorkstationSetupPage = Configuration du module Poste de travail
WorkstationList=Liste des postes de travail
WorkstationCreate=Ajouter un nouveau poste de travail
ConfirmEnableWorkstation=Voulez-vous vraiment activer le poste de travail <b>%s</b>?
Expand Down Expand Up @@ -130,10 +130,8 @@ Manufacturing=Fabrication
Disassemble=Déassemblage
ProducedBy=Produit par
QtyTot=Qté totale

QtyCantBeSplit= Quantité non fractionnable
NoRemainQtyToDispatch=Aucune quantité restant à fractionner

THMOperatorEstimatedHelp=Coût estimé de l'opérateur par heure. Sera utilisé pour estimer le coût d'une nomenclature utilisant ce poste de travail.
THMMachineEstimatedHelp=Coût estimé de la machine par heure. Sera utilisé pour estimer le coût d'une nomenclature utilisant ce poste de travail.

BadValueForquantityToConsume=La quantité à consommer d'un composant ne peut être 0 ou négative
6 changes: 5 additions & 1 deletion htdocs/mrp/class/mo.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,10 @@ public function create(User $user, $notrigger = false)

if (!$error) {
$this->db->commit();
return $idcreated;
} else {
$this->db->rollback();
return -1;
}

return $idcreated;
Expand Down Expand Up @@ -764,6 +766,7 @@ public function createProduction(User $user, $notrigger = true)
if ($moline->qty <= 0) {
$error++;
$this->error = "BadValueForquantityToConsume";
$this->errors[] = $this->error;
break;
} else {
$moline->fk_product = $line->fk_product;
Expand All @@ -779,7 +782,8 @@ public function createProduction(User $user, $notrigger = true)
if ($resultline <= 0) {
$error++;
$this->error = $moline->error;
$this->errors = $moline->errors;
$this->errors[] = $moline->error;
$this->errors = array_merge($this->errors, $moline->errors);
dol_print_error($this->db, $moline->error, $moline->errors);
break;
}
Expand Down
Loading