Skip to content

Commit b8c441b

Browse files
HP-2117: Allow '-' symbol in part serialno on /stock/part/replace page (#177)
* HP-2117: Allow '-' symbol in part serialno on /stock/part/replace page * HP-2110: Allow '_' symbol in part serialno on /stock/part/replace page which will create a random serial
1 parent b34fe01 commit b8c441b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/models/Part.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ function ($attribute) {
150150
[
151151
['serial'],
152152
'match',
153-
'pattern' => '/^[a-zA-Z0-9]+$/u',
153+
'pattern' => '/^([a-zA-Z0-9-]+|_)$/u',
154154
'on' => 'replace',
155-
'message' => Yii::t('hipanel:stock', 'The input format must match /^[a-zA-Z0-9]+$/'),
155+
'message' => Yii::t('hipanel:stock', 'The input format must match /^[a-zA-Z0-9-]+$/ or the _ character, which will create a random serial.'),
156156
],
157157
[['disposal_id'], 'string', 'on' => 'replace'],
158158

0 commit comments

Comments
 (0)