-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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: use batch, serial in future sle check for neg qty #25675
fix: use batch, serial in future sle check for neg qty #25675
Conversation
0745669
to
1ad87a2
Compare
1ad87a2
to
a59fae4
Compare
bc6aea5
to
bcf1dc3
Compare
@18alantom add tests for this ? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed within a week if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing. |
1c8ea50
to
55b1f08
Compare
… validation fail (post merger)
3487014
to
45c862d
Compare
This PR was spuriously closed in the great PR purge of August 2021. Many a test has been patched to get CI to pass but to no avail, new patches fail! |
is_allow_neg = frappe.db.get_single_value('Stock Settings', 'allow_negative_stock') | ||
frappe.db.set_value('Stock Settings', 'Stock Settings', 'allow_negative_stock', 1) |
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.
Way too much duplicate code, should be a decorator instead, or if it applies class-wide then setupclass/teardownclass.
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.
@18alantom can you remove as many of these as possible? Let's try to get this merged without toggling of such flags 😅
If required change the test case to ERPNextTestCase to stop committing in other tests.
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.
Yup for sure, which is what I wanted to do almost as soon as I flipped the flag.
illegal_sequence_executor = create_stock_entry_sequence_executor(illegal_sequence) | ||
self.assertRaises(frappe.ValidationError, illegal_sequence_executor) |
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.
illegal_sequence_executor = create_stock_entry_sequence_executor(illegal_sequence) | |
self.assertRaises(frappe.ValidationError, illegal_sequence_executor) | |
self.assertRaises(frappe.ValidationError, create_stock_entries, illegal_sequence) |
args, kwargs can be passed to it directly, no need to create a partially applied funciton here.
def create_stock_entry_sequence_executor(sequence_of_entries): | ||
return lambda: create_stock_entries(sequence_of_entries) | ||
|
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.
def create_stock_entry_sequence_executor(sequence_of_entries): | |
return lambda: create_stock_entries(sequence_of_entries) |
Not required.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed within a week if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing. |
Closed cause #27945 |
Description