- 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>
fix: Reset represents company on disabling internal customer and supplier (#31302)
(cherry picked from commit c13e5ad741)
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
- Remove `auto_commit_on_many_writes` in `update_cost_in_level()` as commits happen every N BOMs
- Auto commit every 50 BOMs
- test: Remove hacky `frappe.flags.in_test` returns
- test: Enqueue `now` if in tests (for update cost and replace bom)
- Replace BOM: Copy bom object to `_doc_before_save` so that version.py finds a difference between the two
- Replace BOM: Add reference to version
- Update Cost: Unset `processed_boms` if Log is completed (useless after completion)
- test: `update_cost_in_all_boms_in_test` works close to actual prod implementation (only call Cron job manually)
- Test: use `enqueue_replace_bom` so that test works closest to production behaviour
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
fix: Use `frappe.as_unicode` to decode output of redis module list (#31282)
- As of redis 7, a list is added to the result of fetching the module list
- This list cannot be "decoded",so use `frappe.as_unicode` that handles bytes as well as other types
(cherry picked from commit 2832731601)
Co-authored-by: Marica <maricadsouza221197@gmail.com>
- 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>