-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: validate department based on company in expense claim #2582
base: develop
Are you sure you want to change the base?
Conversation
d224f77
to
6880dfc
Compare
@@ -83,6 +88,14 @@ def set_status(self, update=False): | |||
else: | |||
self.status = status | |||
|
|||
def validate_company_and_department(self): | |||
if self.department: | |||
if self.company != frappe.db.get_value("Department", self.department, "company"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nesting not needed here? Can combine with line number 92 using "and"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nesting not needed here? Can combine with line number 92 using "and"
yes
d5826f7
to
5d3e23b
Compare
Can you fix tests related to this validation too? |
yes working on it |
5d3e23b
to
a4e8952
Compare
51a1bab
to
e86ef6d
Compare
Issue:
allowing to submit expense claim with different departments with different companies
ref: 28450
Solution:
added filter for department field and validation for department based on company
Before:
before.webm
After:
after.webm
Backport needed for v15