fix: Bulk update of valid upto field wasn't working (bp #28242)
* fix: Bulk update of valid upto field wasn't working Check in dates for the price list was failing because valid_upto field was string. Converting to date fixed the problem. * chore: extend fix and cleanup whitespace Co-authored-by: Ankush Menat <ankush@frappe.io> (cherry picked from commit 95a5ef1d416d54ecf0f557586b341b0dce2a0b05) Co-authored-by: fatihustaoglu <46131068+fatihustaoglu@users.noreply.github.com>
This commit is contained in:
parent
114028e473
commit
25f647f067
@ -6,6 +6,7 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
from frappe.utils import getdate
|
||||||
|
|
||||||
|
|
||||||
class ItemPriceDuplicateItem(frappe.ValidationError):
|
class ItemPriceDuplicateItem(frappe.ValidationError):
|
||||||
@ -27,7 +28,7 @@ class ItemPrice(Document):
|
|||||||
|
|
||||||
def validate_dates(self):
|
def validate_dates(self):
|
||||||
if self.valid_from and self.valid_upto:
|
if self.valid_from and self.valid_upto:
|
||||||
if self.valid_from > self.valid_upto:
|
if getdate(self.valid_from) > getdate(self.valid_upto):
|
||||||
frappe.throw(_("Valid From Date must be lesser than Valid Upto Date."))
|
frappe.throw(_("Valid From Date must be lesser than Valid Upto Date."))
|
||||||
|
|
||||||
def update_price_list_details(self):
|
def update_price_list_details(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user