-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
170 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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) 2022, Frappe Technologies Pvt. Ltd. and contributors | ||
// For license information, please see license.txt | ||
|
||
// frappe.ui.form.on("Incoterm", { | ||
// refresh(frm) { | ||
|
||
// }, | ||
// }); |
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,117 @@ | ||
{ | ||
"actions": [], | ||
"allow_rename": 1, | ||
"autoname": "field:code", | ||
"creation": "2022-11-17 15:17:34.717467", | ||
"default_view": "List", | ||
"doctype": "DocType", | ||
"editable_grid": 1, | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"code", | ||
"title", | ||
"description" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "code", | ||
"fieldtype": "Data", | ||
"in_list_view": 1, | ||
"label": "Code", | ||
"length": 3, | ||
"reqd": 1, | ||
"unique": 1 | ||
}, | ||
{ | ||
"fieldname": "title", | ||
"fieldtype": "Data", | ||
"in_list_view": 1, | ||
"label": "Title", | ||
"reqd": 1 | ||
}, | ||
{ | ||
"fieldname": "description", | ||
"fieldtype": "Long Text", | ||
"label": "Description" | ||
} | ||
], | ||
"links": [], | ||
"modified": "2022-11-17 17:31:49.113954", | ||
"modified_by": "Administrator", | ||
"module": "Setup", | ||
"name": "Incoterm", | ||
"naming_rule": "By fieldname", | ||
"owner": "Administrator", | ||
"permissions": [ | ||
{ | ||
"create": 1, | ||
"delete": 1, | ||
"email": 1, | ||
"export": 1, | ||
"print": 1, | ||
"read": 1, | ||
"report": 1, | ||
"role": "Accounts Manager", | ||
"share": 1, | ||
"write": 1 | ||
}, | ||
{ | ||
"create": 1, | ||
"delete": 1, | ||
"email": 1, | ||
"export": 1, | ||
"print": 1, | ||
"read": 1, | ||
"report": 1, | ||
"role": "Sales Manager", | ||
"share": 1, | ||
"write": 1 | ||
}, | ||
{ | ||
"create": 1, | ||
"delete": 1, | ||
"email": 1, | ||
"export": 1, | ||
"print": 1, | ||
"read": 1, | ||
"report": 1, | ||
"role": "Purchase Manager", | ||
"share": 1, | ||
"write": 1 | ||
}, | ||
{ | ||
"create": 1, | ||
"delete": 1, | ||
"email": 1, | ||
"export": 1, | ||
"print": 1, | ||
"read": 1, | ||
"report": 1, | ||
"role": "Stock Manager", | ||
"share": 1, | ||
"write": 1 | ||
}, | ||
{ | ||
"read": 1, | ||
"role": "Purchase User" | ||
}, | ||
{ | ||
"read": 1, | ||
"role": "Sales User" | ||
}, | ||
{ | ||
"read": 1, | ||
"role": "Accounts User" | ||
}, | ||
{ | ||
"read": 1, | ||
"role": "Stock User" | ||
} | ||
], | ||
"show_title_field_in_link": 1, | ||
"sort_field": "name", | ||
"sort_order": "ASC", | ||
"states": [], | ||
"title_field": "title", | ||
"translated_doctype": 1 | ||
} |
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 @@ | ||
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors | ||
# For license information, please see license.txt | ||
|
||
import frappe | ||
from frappe.model.document import Document | ||
|
||
|
||
class Incoterm(Document): | ||
pass | ||
|
||
|
||
def create_incoterms(): | ||
"""Create Incoterm records from incoterms.csv.""" | ||
import os | ||
from csv import DictReader | ||
|
||
with open(os.path.join(os.path.dirname(__file__), "incoterms.csv"), "r") as f: | ||
for incoterm in DictReader(f): | ||
if frappe.db.exists("Incoterm", incoterm["code"]): | ||
continue | ||
|
||
doc = frappe.new_doc("Incoterm") | ||
doc.update(incoterm) | ||
doc.save() |
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,12 @@ | ||
code,title | ||
EXW,Ex Works | ||
FCA,Free Carrier | ||
FAS,Free Alongside Ship | ||
FOB,Free On Board | ||
CPT,Carriage Paid To | ||
CIP,Carriage and Insurance Paid to | ||
CFR,Cost and Freight | ||
CIF,"Cost, Insurance and Freight" | ||
DAP,Delivered At Place | ||
DPU,Delivered At Place Unloaded | ||
DDP,Delivered Duty Paid |
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,9 @@ | ||
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors | ||
# See license.txt | ||
|
||
# import frappe | ||
from frappe.tests.utils import FrappeTestCase | ||
|
||
|
||
class TestIncoterm(FrappeTestCase): | ||
pass |