-
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.
Merge pull request #33022 from barredterra/incoterms
feat: Incoterms in buying and selling
- Loading branch information
Showing
20 changed files
with
347 additions
and
15 deletions.
There are no files selected for viewing
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
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
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
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
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
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
31 changes: 31 additions & 0 deletions
31
erpnext/patches/v14_0/create_incoterms_and_migrate_shipment.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,31 @@ | ||
import frappe | ||
|
||
from erpnext.setup.doctype.incoterm.incoterm import create_incoterms | ||
|
||
|
||
def execute(): | ||
create_incoterms() | ||
migrate_shipments() | ||
|
||
|
||
def migrate_shipments(): | ||
if not frappe.db.count("Shipment"): | ||
return | ||
|
||
OLD_VALUES = [ | ||
"EXW (Ex Works)", | ||
"FCA (Free Carrier)", | ||
"FOB (Free On Board)", | ||
"FAS (Free Alongside Ship)", | ||
"CPT (Carriage Paid To)", | ||
"CIP (Carriage and Insurance Paid to)", | ||
"CFR (Cost and Freight)", | ||
"DPU (Delivered At Place Unloaded)", | ||
"DAP (Delivered At Place)", | ||
"DDP (Delivered Duty Paid)", | ||
] | ||
shipment = frappe.qb.DocType("Shipment") | ||
for old_value in OLD_VALUES: | ||
frappe.qb.update(shipment).set(shipment.incoterm, old_value[:3]).where( | ||
shipment.incoterm == old_value | ||
).run() |
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
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
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) { | ||
|
||
// }, | ||
// }); |
Oops, something went wrong.