-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: material demand report improvements
- Loading branch information
1 parent
3f50d5f
commit c20379a
Showing
9 changed files
with
161 additions
and
51 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
27 changes: 25 additions & 2 deletions
27
inventory_tools/inventory_tools/doctype/inventory_tools_settings/inventory_tools_settings.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 |
---|---|---|
@@ -1,9 +1,32 @@ | ||
# Copyright (c) 2023, AgriTheory and contributors | ||
# For license information, please see license.txt | ||
|
||
# import frappe | ||
import frappe | ||
from frappe.model.document import Document | ||
|
||
|
||
class InventoryToolsSettings(Document): | ||
pass | ||
def validate(self): | ||
if self.update_warehouse_path: | ||
create_warehouse_path_custom_field() | ||
|
||
|
||
def create_warehouse_path_custom_field(): | ||
if frappe.db.exists("Custom Field", "Warehouse-warehouse_path"): | ||
return | ||
cf = frappe.new_doc("Custom Field") | ||
cf.field_name = "" | ||
cf.field_type = "Data" | ||
cf.label = "Warehouse Path" | ||
# cf.save() | ||
|
||
# property setter for warehouse path | ||
|
||
|
||
@frappe.whitelist() | ||
def create_inventory_tools_settings(doc, method=None) -> None: | ||
if frappe.db.exists("Inventory Tools Settings", {"company": doc.name}): | ||
return | ||
its = frappe.new_doc("Inventory Tools Settings") | ||
its.company = doc.name | ||
its.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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Copyright (c) 2023, AgriTheory and Contributors | ||
# See license.txt | ||
|
||
import json | ||
|
||
import frappe | ||
|
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Copyright (c) 2023, AgriTheory and Contributors | ||
# See license.txt | ||
|
||
import json | ||
import types | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Copyright (c) 2023, AgriTheory and Contributors | ||
# See license.txt | ||
|
||
import json | ||
|
||
import frappe | ||
|
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