Reset
This commit is contained in:
@@ -1,7 +1,26 @@
|
||||
import frappe
|
||||
from frappe.utils.print_format import print_by_server
|
||||
import json
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def create_labels(values):
|
||||
|
||||
values = json.loads(values)
|
||||
print(values)
|
||||
|
||||
print(values["item_code"])
|
||||
|
||||
doc = frappe.new_doc('Label')
|
||||
doc.item_code = values["item_code"]
|
||||
doc.item_name = values["item_name"]
|
||||
|
||||
res = doc.insert(ignore_permissions=True, # ignore write permissions during insert
|
||||
ignore_links=True, # ignore Link validation in the document
|
||||
ignore_if_duplicate=True, # dont insert if DuplicateEntryError is thrown
|
||||
ignore_mandatory=True # insert even if mandatory fields are not set
|
||||
)
|
||||
print(res)
|
||||
|
||||
# print_by_server("Label", "Label-00001", "labelprinter", "Labels")
|
||||
return 200
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) 2022, CAnetzberger Design and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Labels', {
|
||||
frappe.ui.form.on('Label', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
@@ -61,7 +61,7 @@
|
||||
"modified": "2022-01-19 12:08:40.613669",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Label Printing",
|
||||
"name": "Labels",
|
||||
"name": "Label",
|
||||
"name_case": "UPPER CASE",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
@@ -4,5 +4,5 @@
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class Labels(Document):
|
||||
class Label(Document):
|
||||
pass
|
||||
@@ -4,5 +4,5 @@
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestLabels(unittest.TestCase):
|
||||
class TestLabel(unittest.TestCase):
|
||||
pass
|
||||
Reference in New Issue
Block a user