Skip to content

Commit

Permalink
Merge branch 'develop' into early-payment-loss
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra authored Mar 6, 2023
2 parents 7f2e7ba + 53efc8f commit ee12313
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion erpnext/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@

scheduler_events = {
"cron": {
"0/5 * * * *": [
"0/15 * * * *": [
"erpnext.manufacturing.doctype.bom_update_log.bom_update_log.resume_bom_cost_update_jobs",
],
"0/30 * * * *": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def resume_bom_cost_update_jobs():
["name", "boms_updated", "status"],
)
incomplete_level = any(row.get("status") == "Pending" for row in bom_batches)
if not bom_batches or incomplete_level:
if not bom_batches or not incomplete_level:
continue

# Prep parent BOMs & updated processed BOMs for next level
Expand Down Expand Up @@ -252,6 +252,9 @@ def get_processed_current_boms(
current_boms = []

for row in bom_batches:
if not row.boms_updated:
continue

boms_updated = json.loads(row.boms_updated)
current_boms.extend(boms_updated)
boms_updated_dict = {bom: True for bom in boms_updated}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
get_datetime,
get_datetime_str,
get_link_to_form,
get_system_timezone,
get_time,
get_time_zone,
get_weekdays,
getdate,
nowdate,
Expand Down Expand Up @@ -981,7 +981,7 @@ def convert_utc_to_user_timezone(utc_timestamp, user):


def get_tz(user):
return frappe.db.get_value("User", user, "time_zone") or get_time_zone()
return frappe.db.get_value("User", user, "time_zone") or get_system_timezone()


@frappe.whitelist()
Expand Down
3 changes: 2 additions & 1 deletion erpnext/utilities/doctype/video/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from frappe import _
from frappe.model.document import Document
from frappe.utils import cint
from frappe.utils.data import get_system_timezone
from pyyoutube import Api


Expand Down Expand Up @@ -64,7 +65,7 @@ def update_youtube_data():

frequency = get_frequency(frequency)
time = datetime.now()
timezone = pytz.timezone(frappe.utils.get_time_zone())
timezone = pytz.timezone(get_system_timezone())
site_time = time.astimezone(timezone)

if frequency == 30:
Expand Down
5 changes: 3 additions & 2 deletions erpnext/www/book_appointment/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import frappe
import pytz
from frappe import _
from frappe.utils.data import get_system_timezone

WEEKDAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]

Expand Down Expand Up @@ -125,7 +126,7 @@ def filter_timeslots(date, timeslots):

def convert_to_guest_timezone(guest_tz, datetimeobject):
guest_tz = pytz.timezone(guest_tz)
local_timezone = pytz.timezone(frappe.utils.get_time_zone())
local_timezone = pytz.timezone(get_system_timezone())
datetimeobject = local_timezone.localize(datetimeobject)
datetimeobject = datetimeobject.astimezone(guest_tz)
return datetimeobject
Expand All @@ -134,7 +135,7 @@ def convert_to_guest_timezone(guest_tz, datetimeobject):
def convert_to_system_timezone(guest_tz, datetimeobject):
guest_tz = pytz.timezone(guest_tz)
datetimeobject = guest_tz.localize(datetimeobject)
system_tz = pytz.timezone(frappe.utils.get_time_zone())
system_tz = pytz.timezone(get_system_timezone())
datetimeobject = datetimeobject.astimezone(system_tz)
return datetimeobject

Expand Down

0 comments on commit ee12313

Please sign in to comment.