-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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/feat: ProductLot document folder have to be the rowid #29859
fix/feat: ProductLot document folder have to be the rowid #29859
Conversation
…ev_fix_folder_for_product_lot
…libarr into dev_fix_folder_for_product_lot
…ev_fix_folder_for_product_lot
@@ -596,7 +596,7 @@ | |||
// Documents | |||
if ($includedocgeneration) { | |||
$objref = dol_sanitizeFileName($object->ref); | |||
$relativepath = $objref.'/'.$objref.'.pdf'; | |||
$relativepath = $object->id.'/'.$objref.'.pdf'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using id may be a problem when doing export/import
Id may change. Restoring directory of a backup for exemple
will be not sync with restore
This is why we use ref.
Is it possible to use productref_batchnumber instead of batch number ? (I think it is the real key of a batch number)
Problem with not implement stritly with ID, when user create ref lot that can be look like id
Exemple
On lot ref 5300, upload a file, the file is store in "document"/productlot/5538/file.test
=> Directory name is rowid of lot ref( "document"/productlot/5538/file.test), that what we want as lot ref is not unique (unique key on ref lot(column batch)/product)
On lot ref 4883, upload a file, the file is store in "document"/productlot/5300/file.test1
Go back on lot ref 5300, you see the file /productlot/5300/file.test1 instead of 5538/file.test