fix: undefined variables
This commit is contained in:
parent
9fec0a5c68
commit
2d62c500c4
@ -315,9 +315,8 @@ def update_args_for_pricing_rule(args):
|
||||
if not (args.item_group and args.brand):
|
||||
try:
|
||||
args.item_group, args.brand = frappe.get_cached_value("Item", args.item_code, ["item_group", "brand"])
|
||||
except TypeError:
|
||||
# invalid item_code
|
||||
return item_details
|
||||
except frappe.DoesNotExistError:
|
||||
return
|
||||
if not args.item_group:
|
||||
frappe.throw(_("Item Group not mentioned in item master for item {0}").format(args.item_code))
|
||||
|
||||
|
@ -28,10 +28,10 @@ class AppointmentBookingSettings(Document):
|
||||
to_time = datetime.datetime.strptime(
|
||||
self.min_date+record.to_time, self.format_string)
|
||||
timedelta = to_time-from_time
|
||||
self.validate_from_and_to_time(from_time, to_time)
|
||||
self.validate_from_and_to_time(from_time, to_time, record)
|
||||
self.duration_is_divisible(from_time, to_time)
|
||||
|
||||
def validate_from_and_to_time(self, from_time, to_time):
|
||||
def validate_from_and_to_time(self, from_time, to_time, record):
|
||||
if from_time > to_time:
|
||||
err_msg = _('<b>From Time</b> cannot be later than <b>To Time</b> for {0}').format(record.day_of_week)
|
||||
frappe.throw(_(err_msg))
|
||||
|
@ -96,8 +96,6 @@ def get_columns():
|
||||
}
|
||||
]
|
||||
|
||||
return columns
|
||||
|
||||
|
||||
def get_vehicle_log_data(filters):
|
||||
start_date, end_date = get_period_dates(filters)
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
|
||||
class SanctionedLoanAmount(Document):
|
||||
|
Loading…
x
Reference in New Issue
Block a user