Skip to content
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

Order part default value is -0 #752

Closed
a7hybnj2 opened this issue Apr 23, 2020 · 3 comments · Fixed by #880
Closed

Order part default value is -0 #752

a7hybnj2 opened this issue Apr 23, 2020 · 3 comments · Fixed by #880
Labels
bug Identifies a bug which needs to be addressed help wanted Assistance required starter Good issue for a developer new to the project user interface User interface

Comments

@a7hybnj2
Copy link

Descripting

Not a huge bug/issue but would require less clicks if fixed. When you double click it just selects the 0 so if there is the - sign you have to triple click to select the whole line.

Steps to reproduce

  1. Go to a part
  2. Select the purchase order tab
  3. Hit order part
  4. Observe that the qty is set to -0

Screenshots

Screen Shot 2020-04-23 at 11 36 31 AM

Version Information

Screen Shot 2020-04-23 at 11 46 30 AM

@SchrodingersGat SchrodingersGat added bug Identifies a bug which needs to be addressed help wanted Assistance required starter Good issue for a developer new to the project user interface User interface labels Apr 24, 2020
@SchrodingersGat
Copy link
Member

What browser are you using?

@a7hybnj2
Copy link
Author

Firefox

@eeintech
Copy link
Contributor

eeintech commented Jun 25, 2020

I stumbled upon the same issue and I believe it is due to the quantity_to_order property of the Part model:

	@property
	def quantity_to_order(self):
		""" Return the quantity needing to be ordered for this part. """

		required = -1 * self.net_stock
		return max(required, 0)

So that replacing:
required = -1 * self.net_stock
with:
required = self.net_stock
solves it.

Not sure what good it brings to multiply the net_stock by -1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies a bug which needs to be addressed help wanted Assistance required starter Good issue for a developer new to the project user interface User interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants