diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-08-29 11:16:18 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-08-29 11:16:18 +0700 |
| commit | 8f985aea08c4247519dea18e0dcd742078b16c38 (patch) | |
| tree | 9c2822c58c7bc111b7cf308d210c54beaf87650b /indoteknik_custom/models/product_template.py | |
| parent | a1400f8ccdfb829a4193c5e8d3f910211e0d5830 (diff) | |
| parent | d8b5c8392596b4090dfe7074dfe807cab066ee03 (diff) | |
Merge branch 'production' of https://bitbucket.org/altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_custom/models/product_template.py')
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index d6b9fcfe..019d229c 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -54,11 +54,11 @@ class ProductTemplate(models.Model): @api.constrains('name') def _validate_name(self): - pattern = r'^[a-zA-Z0-9\[\]\(\)\.\s/%]+$' + pattern = r'^[a-zA-Z0-9\[\]\(\)\.\s/%-]+$' if not re.match(pattern, self.name): - pattern_suggest = r'[a-zA-Z0-9\[\]\(\)\.\s/%]+' + pattern_suggest = r'[a-zA-Z0-9\[\]\(\)\.\s/%-]+' suggest = ''.join(re.findall(pattern_suggest, self.name)) - raise UserError(f'Nama hanya bisa menggunakan angka, huruf kecil, huruf besar, titik, kurung lengkung, kurung siku, garis miring. Contoh: {suggest}') + raise UserError(f'Nama hanya bisa menggunakan angka, strip, huruf kecil, huruf besar, titik, kurung lengkung, kurung siku, garis miring. Contoh: {suggest}') # def write(self, vals): # if 'solr_flag' not in vals and self.solr_flag == 1: @@ -292,11 +292,11 @@ class ProductProduct(models.Model): @api.constrains('name') def _validate_name(self): - pattern = r'^[a-zA-Z0-9\[\]\(\)\.\s/%]+$' + pattern = r'^[a-zA-Z0-9\[\]\(\)\.\s/%-]+$' if not re.match(pattern, self.name): - pattern_suggest = r'[a-zA-Z0-9\[\]\(\)\.\s/%]+' + pattern_suggest = r'[a-zA-Z0-9\[\]\(\)\.\s/%-]+' suggest = ''.join(re.findall(pattern_suggest, self.name)) - raise UserError(f'Nama hanya bisa menggunakan angka, huruf kecil, huruf besar, titik, kurung lengkung, kurung siku, garis miring. Contoh: {suggest}') + raise UserError(f'Nama hanya bisa menggunakan angka, strip, huruf kecil, huruf besar, titik, kurung lengkung, kurung siku, garis miring. Contoh: {suggest}') def _get_qty_incoming_bandengan(self): for product in self: |
