Merge pull request #24136 from OPEN-DSI/develop_new_orign_when_create_product_batch_from_movement_stock

NEW - Add origin info when create a product batch when created from a movement stock
This commit is contained in:
Laurent Destailleur 2023-03-10 22:58:14 +01:00 committed by GitHub
commit 293d7e8c0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -368,6 +368,8 @@ class MouvementStock extends CommonObject
}
} else { // If not found, we add record
$productlot = new Productlot($this->db);
$productlot->origin = !empty($this->origin) ? (empty($this->origin->origin_type) ? $this->origin->element : $this->origin->origin_type) : '';
$productlot->origin_id = !empty($this->origin) ? $this->origin->id : 0;
$productlot->entity = $conf->entity;
$productlot->fk_product = $fk_product;
$productlot->batch = $batch;