Browse Source

variant naming series move to py file

master
Ubuntu 3 years ago
parent
commit
ddaf18046d
  1. 40
      smart_service/fixtures/client_script.json
  2. 3
      smart_service/masters/doctype/variant/variant.json
  3. 14
      smart_service/masters/doctype/variant/variant.py

40
smart_service/fixtures/client_script.json

File diff suppressed because one or more lines are too long

3
smart_service/masters/doctype/variant/variant.json

@ -2,7 +2,6 @@
"actions": [], "actions": [],
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"autoname": "format:{vehicle}.{variant}",
"creation": "2021-10-28 12:45:38.664344", "creation": "2021-10-28 12:45:38.664344",
"doctype": "DocType", "doctype": "DocType",
"editable_grid": 1, "editable_grid": 1,
@ -102,7 +101,7 @@
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2022-03-31 16:09:20.683902", "modified": "2022-03-31 20:45:46.053551",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Masters", "module": "Masters",
"name": "Variant", "name": "Variant",

14
smart_service/masters/doctype/variant/variant.py

@ -1,8 +1,16 @@
# Copyright (c) 2021, Hard n Soft Technologies Pvt Ltd and contributors # Copyright (c) 2021, Hard n Soft Technologies Pvt Ltd and contributors
# For license information, please see license.txt # For license information, please see license.txt
from __future__ import unicode_literals
# import frappe import frappe
from frappe.model.document import Document from frappe.model.document import Document
from frappe import _
#from magic import magic
class Variant(Document): class Variant(Document):
pass def validate(self):
# mime = magic.Magic(mime=True)
if self.variant:
self.variant = self.variant.strip()
# self.variant = mime.from_file("/home/ubuntu/frappe-bench/sites/guidedsmartservice.com/public/files/anydesk.xlsx")
self.name = self.vehicle + '.' + self.variant

Loading…
Cancel
Save