This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multiple yarn (strip) for single knitting process.
Fixes #76
- Loading branch information
1 parent
8e63858
commit 18a687f
Showing
30 changed files
with
844 additions
and
265 deletions.
There are no files selected for viewing
Empty file.
8 changes: 8 additions & 0 deletions
8
apparelo/apparelo/doctype/apparelo_yarn_category/apparelo_yarn_category.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright (c) 2020, Aerele Technologies Private Limited and contributors | ||
// For license information, please see license.txt | ||
|
||
frappe.ui.form.on('Apparelo Yarn Category', { | ||
// refresh: function(frm) { | ||
|
||
// } | ||
}); |
52 changes: 52 additions & 0 deletions
52
apparelo/apparelo/doctype/apparelo_yarn_category/apparelo_yarn_category.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"actions": [], | ||
"autoname": "field:yarn_category", | ||
"creation": "2020-02-04 16:09:56.637026", | ||
"doctype": "DocType", | ||
"editable_grid": 1, | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"yarn_category", | ||
"disabled" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "yarn_category", | ||
"fieldtype": "Data", | ||
"in_list_view": 1, | ||
"label": "Yarn Category", | ||
"reqd": 1, | ||
"unique": 1 | ||
}, | ||
{ | ||
"default": "0", | ||
"fieldname": "disabled", | ||
"fieldtype": "Check", | ||
"label": "Disabled" | ||
} | ||
], | ||
"links": [], | ||
"modified": "2020-02-04 16:11:20.313153", | ||
"modified_by": "Administrator", | ||
"module": "Apparelo", | ||
"name": "Apparelo Yarn Category", | ||
"owner": "Administrator", | ||
"permissions": [ | ||
{ | ||
"create": 1, | ||
"delete": 1, | ||
"email": 1, | ||
"export": 1, | ||
"print": 1, | ||
"read": 1, | ||
"report": 1, | ||
"role": "System Manager", | ||
"share": 1, | ||
"write": 1 | ||
} | ||
], | ||
"quick_entry": 1, | ||
"sort_field": "modified", | ||
"sort_order": "DESC", | ||
"track_changes": 1 | ||
} |
24 changes: 24 additions & 0 deletions
24
apparelo/apparelo/doctype/apparelo_yarn_category/apparelo_yarn_category.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2020, Aerele Technologies Private Limited and contributors | ||
# For license information, please see license.txt | ||
|
||
from __future__ import unicode_literals | ||
# import frappe | ||
from frappe.model.document import Document | ||
import frappe | ||
|
||
|
||
class AppareloYarnCategory(Document): | ||
def validate(self): | ||
self.create_attribute_value() | ||
def create_attribute_value(self): | ||
item_attribute=frappe.get_doc("Item Attribute","Yarn Category") | ||
yarn_categorys=[] | ||
for value in item_attribute.item_attribute_values: | ||
yarn_categorys.append(value.attribute_value) | ||
if not self.yarn_category in yarn_categorys: | ||
item_attribute.append('item_attribute_values',{ | ||
"attribute_value" : self.yarn_category, | ||
"abbr" : self.yarn_category | ||
}) | ||
item_attribute.save() |
10 changes: 10 additions & 0 deletions
10
apparelo/apparelo/doctype/apparelo_yarn_category/test_apparelo_yarn_category.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2020, Aerele Technologies Private Limited and Contributors | ||
# See license.txt | ||
from __future__ import unicode_literals | ||
|
||
# import frappe | ||
import unittest | ||
|
||
class TestAppareloYarnCategory(unittest.TestCase): | ||
pass |
Empty file.
8 changes: 8 additions & 0 deletions
8
apparelo/apparelo/doctype/apparelo_yarn_count/apparelo_yarn_count.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright (c) 2020, Aerele Technologies Private Limited and contributors | ||
// For license information, please see license.txt | ||
|
||
frappe.ui.form.on('Apparelo Yarn Count', { | ||
// refresh: function(frm) { | ||
|
||
// } | ||
}); |
52 changes: 52 additions & 0 deletions
52
apparelo/apparelo/doctype/apparelo_yarn_count/apparelo_yarn_count.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"actions": [], | ||
"autoname": "field:yarn_count", | ||
"creation": "2020-02-04 16:14:57.628712", | ||
"doctype": "DocType", | ||
"editable_grid": 1, | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"yarn_count", | ||
"disabled" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "yarn_count", | ||
"fieldtype": "Data", | ||
"in_list_view": 1, | ||
"label": "Yarn Count", | ||
"reqd": 1, | ||
"unique": 1 | ||
}, | ||
{ | ||
"default": "0", | ||
"fieldname": "disabled", | ||
"fieldtype": "Check", | ||
"label": "Disabled" | ||
} | ||
], | ||
"links": [], | ||
"modified": "2020-02-04 16:17:28.707966", | ||
"modified_by": "Administrator", | ||
"module": "Apparelo", | ||
"name": "Apparelo Yarn Count", | ||
"owner": "Administrator", | ||
"permissions": [ | ||
{ | ||
"create": 1, | ||
"delete": 1, | ||
"email": 1, | ||
"export": 1, | ||
"print": 1, | ||
"read": 1, | ||
"report": 1, | ||
"role": "System Manager", | ||
"share": 1, | ||
"write": 1 | ||
} | ||
], | ||
"quick_entry": 1, | ||
"sort_field": "modified", | ||
"sort_order": "DESC", | ||
"track_changes": 1 | ||
} |
23 changes: 23 additions & 0 deletions
23
apparelo/apparelo/doctype/apparelo_yarn_count/apparelo_yarn_count.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2020, Aerele Technologies Private Limited and contributors | ||
# For license information, please see license.txt | ||
|
||
from __future__ import unicode_literals | ||
# import frappe | ||
from frappe.model.document import Document | ||
import frappe | ||
|
||
class AppareloYarnCount(Document): | ||
def validate(self): | ||
self.create_attribute_value() | ||
def create_attribute_value(self): | ||
item_attribute=frappe.get_doc("Item Attribute","Yarn Count") | ||
counts=[] | ||
for value in item_attribute.item_attribute_values: | ||
counts.append(value.attribute_value) | ||
if not self.yarn_count in counts: | ||
item_attribute.append('item_attribute_values',{ | ||
"attribute_value" : self.yarn_count, | ||
"abbr" : self.yarn_count | ||
}) | ||
item_attribute.save() |
10 changes: 10 additions & 0 deletions
10
apparelo/apparelo/doctype/apparelo_yarn_count/test_apparelo_yarn_count.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2020, Aerele Technologies Private Limited and Contributors | ||
# See license.txt | ||
from __future__ import unicode_literals | ||
|
||
# import frappe | ||
import unittest | ||
|
||
class TestAppareloYarnCount(unittest.TestCase): | ||
pass |
Empty file.
38 changes: 38 additions & 0 deletions
38
apparelo/apparelo/doctype/apparelo_yarn_ratio/apparelo_yarn_ratio.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"actions": [], | ||
"creation": "2020-02-05 12:55:05.151712", | ||
"doctype": "DocType", | ||
"editable_grid": 1, | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"yarn", | ||
"quantity" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "quantity", | ||
"fieldtype": "Data", | ||
"in_list_view": 1, | ||
"label": "Quantity" | ||
}, | ||
{ | ||
"fieldname": "yarn", | ||
"fieldtype": "Link", | ||
"in_list_view": 1, | ||
"label": "Yarn", | ||
"options": "Item" | ||
} | ||
], | ||
"istable": 1, | ||
"links": [], | ||
"modified": "2020-02-06 12:11:25.259035", | ||
"modified_by": "Administrator", | ||
"module": "Apparelo", | ||
"name": "Apparelo Yarn Ratio", | ||
"owner": "Administrator", | ||
"permissions": [], | ||
"quick_entry": 1, | ||
"sort_field": "modified", | ||
"sort_order": "DESC", | ||
"track_changes": 1 | ||
} |
10 changes: 10 additions & 0 deletions
10
apparelo/apparelo/doctype/apparelo_yarn_ratio/apparelo_yarn_ratio.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2020, Aerele Technologies Private Limited and contributors | ||
# For license information, please see license.txt | ||
|
||
from __future__ import unicode_literals | ||
# import frappe | ||
from frappe.model.document import Document | ||
|
||
class AppareloYarnRatio(Document): | ||
pass |
Empty file.
21 changes: 21 additions & 0 deletions
21
apparelo/apparelo/doctype/apparelo_yarn_shade/apparelo_yarn_shade.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2020, Aerele Technologies Private Limited and contributors | ||
// For license information, please see license.txt | ||
|
||
frappe.ui.form.on('Apparelo Yarn Shade', { | ||
// refresh: function(frm) { | ||
|
||
// } | ||
|
||
get_combined_yarn:function(frm){ | ||
frappe.call({ | ||
method: "apparelo.apparelo.doctype.apparelo_yarn_shade.apparelo_yarn_shade.get_yarn_shade", | ||
freeze: true, | ||
args: {doc: frm.doc}, | ||
callback: function(r) { | ||
if(r.message) { | ||
frm.set_value('yarn_shade',r.message.final_yarn_shade); | ||
} | ||
} | ||
}) | ||
} | ||
}); |
73 changes: 73 additions & 0 deletions
73
apparelo/apparelo/doctype/apparelo_yarn_shade/apparelo_yarn_shade.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"actions": [], | ||
"autoname": "field:yarn_shade", | ||
"creation": "2020-02-04 12:13:48.535805", | ||
"doctype": "DocType", | ||
"editable_grid": 1, | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"is_combined", | ||
"combined_yarn", | ||
"get_combined_yarn", | ||
"yarn_shade", | ||
"disabled" | ||
], | ||
"fields": [ | ||
{ | ||
"default": "0", | ||
"fieldname": "is_combined", | ||
"fieldtype": "Check", | ||
"label": "Is Combined" | ||
}, | ||
{ | ||
"depends_on": "is_combined", | ||
"fieldname": "get_combined_yarn", | ||
"fieldtype": "Button", | ||
"label": "Get Combined Yarn" | ||
}, | ||
{ | ||
"fieldname": "yarn_shade", | ||
"fieldtype": "Data", | ||
"in_list_view": 1, | ||
"label": "Yarn Shade", | ||
"reqd": 1, | ||
"unique": 1 | ||
}, | ||
{ | ||
"default": "0", | ||
"fieldname": "disabled", | ||
"fieldtype": "Check", | ||
"label": "Disabled" | ||
}, | ||
{ | ||
"depends_on": "is_combined", | ||
"fieldname": "combined_yarn", | ||
"fieldtype": "Table MultiSelect", | ||
"label": "Combined Yarn", | ||
"options": "Combined Yarn Shade" | ||
} | ||
], | ||
"links": [], | ||
"modified": "2020-02-04 15:10:34.977767", | ||
"modified_by": "Administrator", | ||
"module": "Apparelo", | ||
"name": "Apparelo Yarn Shade", | ||
"owner": "Administrator", | ||
"permissions": [ | ||
{ | ||
"create": 1, | ||
"delete": 1, | ||
"email": 1, | ||
"export": 1, | ||
"print": 1, | ||
"read": 1, | ||
"report": 1, | ||
"role": "System Manager", | ||
"share": 1, | ||
"write": 1 | ||
} | ||
], | ||
"sort_field": "modified", | ||
"sort_order": "DESC", | ||
"track_changes": 1 | ||
} |
33 changes: 33 additions & 0 deletions
33
apparelo/apparelo/doctype/apparelo_yarn_shade/apparelo_yarn_shade.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2020, Aerele Technologies Private Limited and contributors | ||
# For license information, please see license.txt | ||
|
||
from __future__ import unicode_literals | ||
import frappe,json | ||
from six import string_types, iteritems | ||
from frappe.model.document import Document | ||
|
||
class AppareloYarnShade(Document): | ||
def validate(self): | ||
self.create_attribute_value() | ||
def create_attribute_value(self): | ||
item_attribute=frappe.get_doc("Item Attribute","Yarn Shade") | ||
yarn_shade=[] | ||
for value in item_attribute.item_attribute_values: | ||
yarn_shade.append(value.attribute_value) | ||
if not self.yarn_shade in yarn_shade: | ||
item_attribute.append('item_attribute_values',{ | ||
"attribute_value" : self.yarn_shade, | ||
"abbr" : self.yarn_shade | ||
}) | ||
item_attribute.save() | ||
|
||
|
||
@frappe.whitelist() | ||
def get_yarn_shade(doc): | ||
if isinstance(doc, string_types): | ||
doc = frappe._dict(json.loads(doc)) | ||
final_yarn_shade="" | ||
for yarn_shade_ in doc.combined_yarn: | ||
final_yarn_shade+=yarn_shade_['yarn']+"," | ||
return {"final_yarn_shade":final_yarn_shade[:-1]} |
10 changes: 10 additions & 0 deletions
10
apparelo/apparelo/doctype/apparelo_yarn_shade/test_apparelo_yarn_shade.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2020, Aerele Technologies Private Limited and Contributors | ||
# See license.txt | ||
from __future__ import unicode_literals | ||
|
||
# import frappe | ||
import unittest | ||
|
||
class TestAppareloYarnShade(unittest.TestCase): | ||
pass |
Empty file.
Oops, something went wrong.