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/feat: ProductLot document folder have to be the rowid #29859

Merged
merged 21 commits into from
Nov 13, 2024

Conversation

FHenry
Copy link
Member

@FHenry FHenry commented Jun 6, 2024

Problem with not implement stritly with ID, when user create ref lot that can be look like id
Exemple

  • lot ref : 4883 (rowid : 5300)
  • lot ref : 5300 (rowid : 5538)

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

@FHenry FHenry requested a review from eldy June 26, 2024 06:12
@@ -596,7 +596,7 @@
// Documents
if ($includedocgeneration) {
$objref = dol_sanitizeFileName($object->ref);
$relativepath = $objref.'/'.$objref.'.pdf';
$relativepath = $object->id.'/'.$objref.'.pdf';
Copy link
Member

@eldy eldy Jul 18, 2024

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)

@eldy eldy added the Discussion Some questions or discussions are opened and wait answers of author or other people to be processed label Jul 18, 2024
@eldy eldy merged commit ba46e7d into Dolibarr:develop Nov 13, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Some questions or discussions are opened and wait answers of author or other people to be processed Event: DevCamp 2024 Montpellier
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants