FIX: Fix delete consumed line of a Mo with movement stock (#25343)

* FIX: Fix delete consumed line of a Mo with movement stock

* Fix langs
This commit is contained in:
kkhelifa-opendsi 2023-07-12 12:53:27 +02:00 committed by GitHub
parent 4f4f817690
commit 765dd665f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -842,7 +842,7 @@ class Mo extends CommonObject
public function deleteLine(User $user, $idline, $notrigger = false)
{
global $langs;
$langs->load('stocks');
$langs->loadLangs(array('stocks', 'mrp'));
if ($this->status < 0) {
$this->error = 'ErrorDeleteLineNotAllowedByObjectStatus';

View file

@ -1045,7 +1045,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Action delete line
if ($permissiontodelete) {
$href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line2['rowid']).'&fk_movement='.((int) $line2['fk_stock_movement']);
$href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line->id).'&fk_movement='.((int) $line2['fk_stock_movement']);
print '<td class="center">';
print '<a class="reposition" href="'.$href.'">';
print img_picto($langs->trans('TooltipDeleteAndRevertStockMovement'), 'delete');