* fix: Respect system precision for user facing balance qty values
- `get_precision` -> `set_precision`
- Use system wide currency precision for `stock_value`
- Round of qty defiiciency as per user defined precision (system flt precision), so that it is WYSIWYG for users
* fix: Consider system precision when validating future negative qty
* test: Immediate Negative Qty precision test
- Test for Immediate Negative Qty precision
- Stock Entry Negative Qty message: Format available qty in system precision
- Pass `stock_uom` as confugrable option in `make_item`
* test: Future Negative Qty validation with precision
* fix: Use `get_field_precision` for currency precision as it used to
- `get_field_precision` defaults to number format for precision (maintain old behaviour)
- Don't pass `currency` to `get_field_precision` as its not used anymore
(cherry picked from commit d6078aa911)
# Conflicts:
# erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py
fix: UOM handling for transaction without item (#31389)
If invoice is made without item code then UOM, Stock UOM and
conversion_factor all need to be manually added, this is confusing and
leads missing them out leads to errors.
Simplest solution:
- if either UOM exists then set both to same uom conversion factor to
- also set conversion factor based on UOM conversions
(cherry picked from commit 10583eb3ce)
Co-authored-by: Ankush Menat <ankush@frappe.io>
* fix: transaction date gets unset in material request (#31327)
* fix: set date correctly in material request
* fix: use only `transaction_date` in `get_item_details`
* fix: resolve merge conflict
Co-authored-by: Sagar Vora <sagar@resilient.tech>
* fix: dont use cached doc for GLE reposts
ported from https://github.com/frappe/erpnext/pull/31240
* perf: GLE reposting with progress and chunking
If stock voucher count goes >1000 then fetching all gles and reposting
them all at once requires much more memory and can cause crash.
- This PR ensures that GLE reposting is done in chunks of 100 vouchers.
- This PR also starts keeping track of how many such chunks were
processed so in future progress is resumed in event of timeout.
* test: add "actual" test for chunked GLE reposting
- Use `get_default_bom` in sales_order.py (reduce duplicate utility functions)
- Remove redundant if else in `get_work_order_items`
- `get_default_bom`: If no BOM and template exists try to fetch template BOM
- test: `get_work_order_items` via SO and if right BOM is picked
(cherry picked from commit 9f2d325e67)
- Loop over PO supplied items and update them as data from SE will exclude a row if supplied qty becomes 0 on cancel
- Use DB API insteaf of raw SQL
(cherry picked from commit fa1d9d548e)
- Use doc.status directly for indicator - single source of truth
- Update status to cancelled when doc is cancelled
(cherry picked from commit 39ec0aca95)
* refactor: remove add_fetch (#31315)
- Sales Team already had fetch from set up
- Set up fetch from on sales partner in sales transaction
Reason for removal: the JS code applies arbitrarily to any field called "sales_person"
(cherry picked from commit 1646fbe478)
# Conflicts:
# erpnext/selling/sales_common.js
* chore: conflicts
Co-authored-by: Ankush Menat <ankush@frappe.io>