-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/LAN-699' into LAN-699
- Loading branch information
Showing
11 changed files
with
251 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import frappe | ||
|
||
from landa.water_body_management.doctype.water_body.water_body import build_water_body_cache | ||
|
||
|
||
def execute(): | ||
build_water_body_cache() # Cache all Water Bodies | ||
|
||
fishing_areas = frappe.get_all("Fishing Area", pluck="name") | ||
for area in fishing_areas: | ||
build_water_body_cache(fishing_area=area) # Cache Fishing Area wise |
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,17 @@ | ||
import frappe | ||
|
||
from landa.workspace import LANDA_WORKSPACES | ||
|
||
|
||
def execute(): | ||
"""Hide custom reports in existing customized landa workspaces.""" | ||
for workspace in frappe.get_all( | ||
"Workspace", | ||
filters={ | ||
"for_user": ("is", "set"), | ||
"hide_custom": 0, | ||
"extends": ("in", LANDA_WORKSPACES), | ||
}, | ||
pluck="name", | ||
): | ||
frappe.db.set_value("Workspace", workspace, "hide_custom", 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from frappe.desk.doctype.workspace.workspace import Workspace | ||
|
||
LANDA_WORKSPACES = ( | ||
"Water Body Management", | ||
"Organization Management", | ||
"Order Management", | ||
) | ||
|
||
|
||
def validate(doc: Workspace, method=None) -> None: | ||
# Custom reports (possibly of other users) should not be visible | ||
if doc.for_user and doc.hide_custom == 0 and doc.extends in LANDA_WORKSPACES: | ||
doc.hide_custom = 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