- Utility to update cost in all BOMs without cron jobs or background jobs (run immediately)
- Re-use util wherever all bom costs are to be updated
- Skip explicit commits if in test
- Specify company in test records (dirty data sometimes, company wh mismatch)
- Skip background jobs queueing if in test
fix: Auto Insert Item Price If Missing when discount & blank UOM (#31168)
* fix: Auto Insert Item Price If Missing when discount and blank UOM
fixes wrong item price insert when discount is used and adds uom=stock_uom instead of blank as price is converted to stock uom
* unit tests added for item with discount
I have added test for auto_insert_price where discount is used.
* unit test issue fixed
fixed make_sales_order as some of the test that depended on it were failing due to passing of incorrect parameters.
Co-authored-by: Ankush Menat <me@ankush.dev>
(cherry picked from commit b3ccc4bfb9)
Co-authored-by: maharshivpatel <39730881+maharshivpatel@users.noreply.github.com>
* fix: incorrect billed_qty when item has multiple Delivery note
sales order analysis report returns incorrect billed_qty value for
an SO item has multiple delivery notes
(cherry picked from commit 0331e37982)
* test: multiple delivery notes and billed quantity
(cherry picked from commit 4f1bfbb93d)
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
* fix(job card): only hold during draft state (#31243)
(cherry picked from commit ee5bc58e9b)
# Conflicts:
# erpnext/patches.txt
* chore: conflicts
Co-authored-by: Ankush Menat <me@ankush.dev>
fix(Sales Register): incorrect query with dimensions
If accounting dimension is also part of the default filters then same
query is repeated with incorrect syntax.
e.g. `item_group = (child1, child2)` instead of `in` query.
fix: don't add default filter if they are part of dimensions to be
added.
(cherry picked from commit c3219ebad1)
Co-authored-by: Ankush Menat <ankush@frappe.io>
- `get_valuation_rate`: if no bins are found return 0, SLEs do not exist either
- `get_valuation_rate`: Compute average valuation rate via query
- `get_rm_rate_map`: set order_by as None to avoid creating sort index (modified) each time query runs (seen in process list)
- BOM Update Batch: add status field and hide `boms_updated` so that users can see progress without loading all updated boms (too much data)
- BOM Update Batch: set batch row status to completed after job runs
- BOM Update Log: remove `parent_boms` field (just pass parent boms to processing function) & remove Paused state (not used)
- Move job to long queue to avoid choking default queue
- `update_cost_in_boms`: use `get_doc` as each BOM is accessed only once. Use `for_update` to lock BOM row
- Commit after every 100 BOMs