Compare commits

..

41 Commits

Author SHA1 Message Date
Frappe PR Bot
054b20a2ae chore(release): Bumped to Version 16.22.0
# [16.22.0](https://github.com/frappe/erpnext/compare/v16.21.1...v16.22.0) (2026-06-10)

### Bug Fixes

* **accounts:** include asset items in purchase receipt validation ([#55150](https://github.com/frappe/erpnext/issues/55150)) ([0984c86](0984c86583))
* Add authorization checks on internal functions (backport [#55709](https://github.com/frappe/erpnext/issues/55709)) ([#55726](https://github.com/frappe/erpnext/issues/55726)) ([2ae6451](2ae6451f10))
* add company filter to Budget Against dimension options ([bfc6f44](bfc6f44fb0))
* add custom dimensions filters in Gross and Net profit report (backport [#55110](https://github.com/frappe/erpnext/issues/55110)) ([#55584](https://github.com/frappe/erpnext/issues/55584)) ([5d7e69d](5d7e69d8cf))
* Add likely missing escapes (backport [#55574](https://github.com/frappe/erpnext/issues/55574)) ([#55581](https://github.com/frappe/erpnext/issues/55581)) ([6a503f8](6a503f834c))
* aggregate child cost center data in Budget Variance Report ([4f2611c](4f2611cbe8))
* allow specific methods to run ([c9a5b00](c9a5b0026e))
* bypass project permission check when updating consumed material … (backport [#55645](https://github.com/frappe/erpnext/issues/55645)) ([#55707](https://github.com/frappe/erpnext/issues/55707)) ([4471666](4471666c8c))
* **cheque_print_template:** print format creation from cheque print template requires system manager (backport [#55708](https://github.com/frappe/erpnext/issues/55708)) ([#55712](https://github.com/frappe/erpnext/issues/55712)) ([38dd298](38dd2982f3))
* disallow BOM finished good item in secondary items table (backport [#55710](https://github.com/frappe/erpnext/issues/55710)) ([#55719](https://github.com/frappe/erpnext/issues/55719)) ([ecd3a19](ecd3a19912))
* do not allow to make changes in SABB after submit ([a03e3bf](a03e3bfe9f))
* don't allow to submit job card with hold status ([b4c850d](b4c850da1c))
* drop ignore_permissions handling from add_ac ([c0cf9aa](c0cf9aa1a7))
* duplicating a Customer/Supplier shouldn't inherit the source's primary contact and address (backport [#55421](https://github.com/frappe/erpnext/issues/55421)) ([#55609](https://github.com/frappe/erpnext/issues/55609)) ([808e51d](808e51db19))
* handle multi-select stock ageing filters ([#55775](https://github.com/frappe/erpnext/issues/55775)) ([e48ffe6](e48ffe6ef0))
* handle separator rows in financial statement formatter ([d8afc00](d8afc00ab5))
* include CRM Deal in `quotation to` filters ([f7e6542](f7e6542bcd))
* item report view ([7dfae51](7dfae51044))
* **item:** format integer numeric variant attributes without decimals (backport [#55561](https://github.com/frappe/erpnext/issues/55561)) ([#55564](https://github.com/frappe/erpnext/issues/55564)) ([fffba84](fffba84868))
* linter issue ([dd83705](dd837052ef))
* minor fixes in report print formats ([#55151](https://github.com/frappe/erpnext/issues/55151)) ([80f7aff](80f7aff3f9))
* move Company filter at the start ([3fb6437](3fb6437d26))
* naming series issue ([6eecf07](6eecf0701e))
* prevent double rounding in inclusive tax calculations (backport [#52512](https://github.com/frappe/erpnext/issues/52512)) ([#55570](https://github.com/frappe/erpnext/issues/55570)) ([37b61f0](37b61f06ae))
* prevent leakage of party-derived fields in cross doctype transactions (backport [#55336](https://github.com/frappe/erpnext/issues/55336)) ([#55579](https://github.com/frappe/erpnext/issues/55579)) ([7904385](7904385b90))
* prevent negative amounts in common party JE on return invoices (backport [#55034](https://github.com/frappe/erpnext/issues/55034)) ([#55064](https://github.com/frappe/erpnext/issues/55064)) ([9eb0e3c](9eb0e3c82e))
* prevent selling items from sample retention warehouse (backport [#55613](https://github.com/frappe/erpnext/issues/55613)) ([#55634](https://github.com/frappe/erpnext/issues/55634)) ([84d205f](84d205f553))
* **process statement of accounts:** validate pdf_name and validate permission before triggering send_auto_email (backport [#55781](https://github.com/frappe/erpnext/issues/55781)) ([#55783](https://github.com/frappe/erpnext/issues/55783)) ([e15879a](e15879acd1))
* **profit-and-loss-statement-report:** margin calculation the report showing null% for empty cell ([04fe76b](04fe76bf83))
* **profit-and-loss-statement:** margin calculation the report showing null% for empty cell ([b3d3f13](b3d3f13fc5))
* **profit-loss-report:** handle zero base values and prevent null% display ([90ac065](90ac065930))
* remove item name from update items dialog item code column (backport [#55718](https://github.com/frappe/erpnext/issues/55718)) ([#55723](https://github.com/frappe/erpnext/issues/55723)) ([497c3a5](497c3a5e83))
* restrict already invoiced qty in intercompany purchase invoice ([#55768](https://github.com/frappe/erpnext/issues/55768)) ([e90a6ec](e90a6ecf1c))
* **selling:** consider delivered qty (backport [#55597](https://github.com/frappe/erpnext/issues/55597)) ([#55607](https://github.com/frappe/erpnext/issues/55607)) ([142ab3c](142ab3ce2a))
* simplify New Zealand sales accounts ([93de14c](93de14c421))
* skip empty spacer rows in compute_growth_view_data (P&L growth view) ([18afcf0](18afcf0c01))
* spelling of Payment Reconciliation in sidebar (backport [#55599](https://github.com/frappe/erpnext/issues/55599)) ([#55602](https://github.com/frappe/erpnext/issues/55602)) ([40cf77e](40cf77e7f0))
* sql injection ([02a29a8](02a29a85a7))
* Stock Reservation blocks Subcontracting operation within the same Work Order ([1c0dace](1c0dace3d6))
* **stock:** add validation for work order seial nos and batch nos (backport [#55604](https://github.com/frappe/erpnext/issues/55604)) ([#55605](https://github.com/frappe/erpnext/issues/55605)) ([7de77a8](7de77a8916))
* **stock:** change valuation rate column label in stock ledger entry/report (backport [#55323](https://github.com/frappe/erpnext/issues/55323)) ([#55394](https://github.com/frappe/erpnext/issues/55394)) ([c6560be](c6560be58d))
* **stock:** set stock received but not billed account for purchase ([#55149](https://github.com/frappe/erpnext/issues/55149)) ([90667b2](90667b2de2))
* **subscription:** bill on creation and keep status in sync with invoices (backport [#55615](https://github.com/frappe/erpnext/issues/55615)) ([#55701](https://github.com/frappe/erpnext/issues/55701)) ([0f069e1](0f069e13da))
* **subscription:** correct billing/deferred bugs and tighten guards (backport [#55554](https://github.com/frappe/erpnext/issues/55554)) ([#55610](https://github.com/frappe/erpnext/issues/55610)) ([dee7bd8](dee7bd8d64))
* **taxes:** add category and add_deduct_tax fields to tax entries (backport [#55753](https://github.com/frappe/erpnext/issues/55753)) ([#55773](https://github.com/frappe/erpnext/issues/55773)) ([9a6fae9](9a6fae9fdd))
* update add_total_row_account to control blank row addition ([e8a6933](e8a6933ff3))
* update formatter to handle blank rows in financial statements ([f657503](f657503ea3))
* update items respects workflow "Only Allow Edit For" role ([#55667](https://github.com/frappe/erpnext/issues/55667)) ([76b9b6a](76b9b6a34e))
* use new_doc with field allowlist in CRM integration endpoints ([d941ccf](d941ccfe3c))
* **UX:** Accounts settings cleanup (backport [#55470](https://github.com/frappe/erpnext/issues/55470)) ([#55603](https://github.com/frappe/erpnext/issues/55603)) ([3917415](3917415368))
* **UX:** stock settings form cleanup ([f6f542f](f6f542fadc))
* validate fg and materials qty in the disassemble entry ([4453c10](4453c1072a))
* work order status should be in process if material transfer is skipped (backport [#55641](https://github.com/frappe/erpnext/issues/55641) to version-16-hotfix) ([#55642](https://github.com/frappe/erpnext/issues/55642)) ([32011c3](32011c3364))

### Features

* add item where used report ([#55714](https://github.com/frappe/erpnext/issues/55714)) ([8f85cce](8f85cce4cf))
* add New Zealand chart of accounts ([107a446](107a446d98))
* added cost of goods sold (backport [#54974](https://github.com/frappe/erpnext/issues/54974)) ([#55552](https://github.com/frappe/erpnext/issues/55552)) ([20af709](20af7093ac))
* create sales invoice from pick list (backport [#55594](https://github.com/frappe/erpnext/issues/55594)) ([#55635](https://github.com/frappe/erpnext/issues/55635)) ([743afc9](743afc972d))
* item prices list view ([#54853](https://github.com/frappe/erpnext/issues/54853)) ([12c1940](12c1940e0b))
* show non stock items and secondary items in work order (backport [#55631](https://github.com/frappe/erpnext/issues/55631)) ([#55636](https://github.com/frappe/erpnext/issues/55636)) ([3f983c9](3f983c9e4d))

### Performance Improvements

* batch status check for on-hold/closed documents, remove N+1 queries (backport [#54798](https://github.com/frappe/erpnext/issues/54798)) ([#55573](https://github.com/frappe/erpnext/issues/55573)) ([0274afe](0274afe560))
* **transaction:** exit early before backend query (backport [#55556](https://github.com/frappe/erpnext/issues/55556)) ([#55558](https://github.com/frappe/erpnext/issues/55558)) ([6a1c384](6a1c384f9b))
2026-06-10 00:25:19 +00:00
Mihir Kandoi
03f6b7a50e Merge pull request #55764 from frappe/version-16-hotfix 2026-06-10 05:53:43 +05:30
Frappe PR Bot
6bcab7cfc8 chore(release): Bumped to Version 16.21.1
## [16.21.1](https://github.com/frappe/erpnext/compare/v16.21.0...v16.21.1) (2026-06-03)

### Bug Fixes

* item report view ([656d1bd](656d1bd6e3))
2026-06-03 09:43:23 +00:00
Nishka Gosalia
39c8161011 Merge pull request #55593 from frappe/mergify/bp/version-16/pr-55592
fix: item report view (backport #55591) (backport #55592)
2026-06-03 15:11:44 +05:30
nishkagosalia
656d1bd6e3 fix: item report view
(cherry picked from commit bca917380d)
(cherry picked from commit 7dfae51044)
2026-06-03 09:39:24 +00:00
Frappe PR Bot
ecb572de92 chore(release): Bumped to Version 16.21.0
# [16.21.0](https://github.com/frappe/erpnext/compare/v16.20.1...v16.21.0) (2026-06-02)

### Bug Fixes

* asset scrap flow related changes ([e3f03a2](e3f03a21c3))
* billing address does not belongs to the company error ([e1f29de](e1f29de078))
* **book_appointment:** when scheduling is disabled, block API endpoints (backport [#55455](https://github.com/frappe/erpnext/issues/55455)) ([#55457](https://github.com/frappe/erpnext/issues/55457)) ([aa5dfde](aa5dfde23b))
* changes as per review ([8b1d981](8b1d9817a6))
* check perm for account (backport [#55479](https://github.com/frappe/erpnext/issues/55479)) ([#55483](https://github.com/frappe/erpnext/issues/55483)) ([0c946f2](0c946f2420))
* **custom_financial_template:** sum account closing balances across dimensions ([3359e20](3359e20d06))
* import DateTimeLikeObject ([d82e03e](d82e03edb6))
* **issue:** check permission before issue status modification (backport [#55458](https://github.com/frappe/erpnext/issues/55458)) ([#55460](https://github.com/frappe/erpnext/issues/55460)) ([7c5d617](7c5d617049))
* item master list view UI cleanup ([2d554c0](2d554c05d6))
* **je:** preserve account on duplicate row when party row exists (backport [#55180](https://github.com/frappe/erpnext/issues/55180)) ([#55512](https://github.com/frappe/erpnext/issues/55512)) ([fe585dc](fe585dc225))
* Make Distributed Discount Amount field read only ([29441b7](29441b7249))
* **manufacturing:** allow to edit batch size while creating a work order (backport [#55058](https://github.com/frappe/erpnext/issues/55058)) ([#55326](https://github.com/frappe/erpnext/issues/55326)) ([ae92a82](ae92a82930))
* material transfer in transit issue ([356bb78](356bb7878f))
* merge conflicts ([b74e365](b74e365421))
* new bom version should not recalculate operations through routing (backport [#55370](https://github.com/frappe/erpnext/issues/55370)) ([#55372](https://github.com/frappe/erpnext/issues/55372)) ([933ac01](933ac0108c))
* over order allowance setting fix ([41b2de3](41b2de35a9))
* pick correct name when creating user from RFQ (backport [#55468](https://github.com/frappe/erpnext/issues/55468)) ([#55472](https://github.com/frappe/erpnext/issues/55472)) ([fc842fb](fc842fb45f))
* **pos:** escape html output in pos page templates (backport [#55527](https://github.com/frappe/erpnext/issues/55527)) ([#55529](https://github.com/frappe/erpnext/issues/55529)) ([224426e](224426e06b))
* **pos:** escape item data on pos item selector (backport [#55503](https://github.com/frappe/erpnext/issues/55503)) ([#55508](https://github.com/frappe/erpnext/issues/55508)) ([5393c93](5393c93675))
* **pos:** preserve contacts and enforce permissions in set_customer_info (backport [#55463](https://github.com/frappe/erpnext/issues/55463)) ([#55466](https://github.com/frappe/erpnext/issues/55466)) ([ef2700b](ef2700bec6))
* **ppr:** make default_advance_account optional ([7a7cc31](7a7cc31523))
* **quotation:** made customer contact column visible (backport [#55433](https://github.com/frappe/erpnext/issues/55433)) ([#55435](https://github.com/frappe/erpnext/issues/55435)) ([2feb8eb](2feb8eb370))
* **regional:** Japanese CT Rate (backport [#54998](https://github.com/frappe/erpnext/issues/54998)) ([#55438](https://github.com/frappe/erpnext/issues/55438)) ([7426aaf](7426aaf1e2))
* resolve conflict ([abe19e1](abe19e1212))
* **selling:** handle None values while grouping opportunities by utm … (backport [#55300](https://github.com/frappe/erpnext/issues/55300)) ([#55328](https://github.com/frappe/erpnext/issues/55328)) ([198970c](198970cdee))
* set a fallback value if no fiscal year set ([1521410](1521410125))
* stock reco for legacy serial nos ([67c922c](67c922cdf3))
* **stock:** add warning message to notify the user to configure the inspection ([1679680](1679680d8e))
* **stock:** allow to create quality inspection after purchase/delivery ([51a140a](51a140a2bd))
* **stock:** change qb to qb get_query to fix filter issues (backport [#55443](https://github.com/frappe/erpnext/issues/55443)) ([#55445](https://github.com/frappe/erpnext/issues/55445)) ([277a072](277a0723ef))
* **stock:** get_actual_qty during cancellations (backport [#55388](https://github.com/frappe/erpnext/issues/55388)) ([#55392](https://github.com/frappe/erpnext/issues/55392)) ([faa1573](faa15731cb))
* **tds:** treat NULL and empty-string tax_withholding_group as equivalent ([82e12d2](82e12d2d52))
* unable to submit subcontracted job card (backport [#55537](https://github.com/frappe/erpnext/issues/55537)) ([#55540](https://github.com/frappe/erpnext/issues/55540)) ([ceb1042](ceb10422ae))
* update default_advance_account type ([0bbc493](0bbc493213))
* use fiscal year instead of calendar year in accounting dashboard number cards ([81d10d3](81d10d32f2))
* use get_query instead of get_all for data fetching ([7cbef15](7cbef15596))
* **UX:** Move title field to More Info ([20592fc](20592fc25d))

### Features

* build and upload assets to GitHub Releases ([4c05ebc](4c05ebc21e))
* over order allowance setting ([08eaaa5](08eaaa5b83))
* **payment-entry:** warn user before cancelling reconciled payment entry ([61d6d2f](61d6d2f344))
2026-06-02 16:55:08 +00:00
Mihir Kandoi
23181b3962 Merge pull request #55547 from frappe/version-16-hotfix 2026-06-02 22:23:38 +05:30
ruthra kumar
4af265c48f Merge pull request #55502 from frappe/mergify/bp/version-16/pr-55495
fix: opening bal double counting in Process Period Closing Voucher (backport #55495)
2026-06-01 16:00:41 +05:30
ruthra kumar
ce97a74c5f test: prevent double counting of opening balances
(cherry picked from commit 7f2af123ee)
2026-06-01 09:36:47 +00:00
ruthra kumar
e955b4a3b9 refactor: color coded status in list view
(cherry picked from commit cfeffbb354)
2026-06-01 09:36:46 +00:00
ruthra kumar
de42a9e86e refactor: tabbed view for process period closing voucher
(cherry picked from commit 1960c81619)
2026-06-01 09:36:46 +00:00
ruthra kumar
5206b279b6 refactor: only consider non-opening balance for Balance sheet accounts
(cherry picked from commit a2b8334046)
2026-06-01 09:36:46 +00:00
Frappe PR Bot
9af618d6bf chore(release): Bumped to Version 16.20.1
## [16.20.1](https://github.com/frappe/erpnext/compare/v16.20.0...v16.20.1) (2026-06-01)

### Bug Fixes

* billing address does not belongs to the company error ([d6b7791](d6b7791f18))
2026-06-01 06:08:21 +00:00
rohitwaghchaure
3c3cde4362 Merge pull request #55475 from frappe/mergify/bp/version-16/pr-55425
fix: billing address does not belongs to the company error (backport #55417) (backport #55425)
2026-06-01 11:36:44 +05:30
Rohit Waghchaure
d6b7791f18 fix: billing address does not belongs to the company error
(cherry picked from commit 9df07b367a)
(cherry picked from commit e1f29de078)
2026-06-01 06:02:05 +00:00
Frappe PR Bot
ff46d20b25 chore(release): Bumped to Version 16.20.0
# [16.20.0](https://github.com/frappe/erpnext/compare/v16.19.1...v16.20.0) (2026-05-27)

### Bug Fixes

* consider batchwise valuation in stock ageing report (backport [#54919](https://github.com/frappe/erpnext/issues/54919)) ([#55230](https://github.com/frappe/erpnext/issues/55230)) ([a1457c7](a1457c759d))
* consumed operation cost calculation (backport [#54858](https://github.com/frappe/erpnext/issues/54858)) ([#55133](https://github.com/frappe/erpnext/issues/55133)) ([dfc9144](dfc91441b4))
* correct description for Is Rate Adjustment Entry (Debit Note) checkbox ([a39733d](a39733ddd0))
* correct remarks for foreign currency payment entries ([f3f8f32](f3f8f327df))
* corrected the pricing rule taking the wrong value (backport [#54894](https://github.com/frappe/erpnext/issues/54894)) ([#55124](https://github.com/frappe/erpnext/issues/55124)) ([1a75c14](1a75c14308))
* default use_for_shopping_cart to 0 in set_taxes ([54be4ee](54be4ee275))
* don't reset net_purchase_amount for Composite Asset if already set ([99642b9](99642b9636))
* edit stock uom qty for purchase documents (backport [#55135](https://github.com/frappe/erpnext/issues/55135)) ([#55179](https://github.com/frappe/erpnext/issues/55179)) ([123b4ad](123b4ad563))
* **employee:** js error if user does not have write permission for date field (backport [#55312](https://github.com/frappe/erpnext/issues/55312)) ([#55314](https://github.com/frappe/erpnext/issues/55314)) ([4dff5a7](4dff5a7820))
* faster range calculation on process period closing voucher ([e56ee38](e56ee383bc))
* fg valuation rate in repack entry when multiple FGs ([7b6adce](7b6adce89a))
* inclusive tax amount not considered while setting LCV from purchase invoice ([bd4c244](bd4c24493c))
* incorrect error message string in sales order (backport [#55090](https://github.com/frappe/erpnext/issues/55090)) ([#55095](https://github.com/frappe/erpnext/issues/55095)) ([17bc2b6](17bc2b691f))
* invalid filter on item_group (backport [#55186](https://github.com/frappe/erpnext/issues/55186)) ([#55188](https://github.com/frappe/erpnext/issues/55188)) ([ea86347](ea863477a4))
* item price with party condition (backport [#55100](https://github.com/frappe/erpnext/issues/55100)) ([#55107](https://github.com/frappe/erpnext/issues/55107)) ([cc438a4](cc438a4600))
* job card buttons color (backport [#55252](https://github.com/frappe/erpnext/issues/55252)) ([#55261](https://github.com/frappe/erpnext/issues/55261)) ([69c6ed3](69c6ed3cd9))
* **manufacturing:** fetch from_bom name in production plan (backport [#55085](https://github.com/frappe/erpnext/issues/55085)) ([#55092](https://github.com/frappe/erpnext/issues/55092)) ([36aca51](36aca51fbb))
* **manufacturing:** remove forecast_qty and adjust_qty fields from sa… (backport [#55129](https://github.com/frappe/erpnext/issues/55129)) ([#55136](https://github.com/frappe/erpnext/issues/55136)) ([bde7f16](bde7f1660e))
* **payment_entry:** sync paid/received amounts for cross-currency entries (backport [#55270](https://github.com/frappe/erpnext/issues/55270)) ([#55272](https://github.com/frappe/erpnext/issues/55272)) ([705814f](705814f066))
* pos profile form cleanup (backport [#52436](https://github.com/frappe/erpnext/issues/52436)) ([#55285](https://github.com/frappe/erpnext/issues/55285)) ([1f14ef2](1f14ef2344))
* prevent AttributeError in batch query filters (backport [#55257](https://github.com/frappe/erpnext/issues/55257)) ([#55279](https://github.com/frappe/erpnext/issues/55279)) ([bfd37dc](bfd37dcc21))
* **project:** update customer and sales order as no copy ([1e61ca1](1e61ca162f))
* removed redundant code ([a7eb3ac](a7eb3acd1a))
* **sales_invoice:** skip stock update for POS invoices linked to Delivery Note (backport [#55311](https://github.com/frappe/erpnext/issues/55311)) ([#55313](https://github.com/frappe/erpnext/issues/55313)) ([cd7e1bb](cd7e1bbff1))
* set bin details when adding item using update items (backport [#55096](https://github.com/frappe/erpnext/issues/55096)) ([#55098](https://github.com/frappe/erpnext/issues/55098)) ([bb87ffc](bb87ffc90a))
* single variant creation error ([82b0372](82b0372d5b))
* slow query ([66c9170](66c9170465))
* **stock:** apply posting datetime filters while fetching available batches (backport [#54976](https://github.com/frappe/erpnext/issues/54976)) ([#55185](https://github.com/frappe/erpnext/issues/55185)) ([edf6bea](edf6bea2ee))
* **stock:** remove precision for valuation rate while creating sle (backport [#55249](https://github.com/frappe/erpnext/issues/55249)) ([#55260](https://github.com/frappe/erpnext/issues/55260)) ([9600ecd](9600ecd61c))
* **stock:** remove recalculate current qty function (backport [#54774](https://github.com/frappe/erpnext/issues/54774)) ([#55075](https://github.com/frappe/erpnext/issues/55075)) ([56a9b37](56a9b37fac))
* use passed posting date in make_reverse_gl_entries ([3ce9cf2](3ce9cf2bd8))
* valuation rate missing for standalone credit notes for moving av… (backport [#55102](https://github.com/frappe/erpnext/issues/55102)) ([#55104](https://github.com/frappe/erpnext/issues/55104)) ([b11365b](b11365b8c2))

### Features

* add get_parent_supplier_groups using query builder ([82793cb](82793cbd4d))
* add party groups functionality to party specific item (backport [#54988](https://github.com/frappe/erpnext/issues/54988)) ([#55245](https://github.com/frappe/erpnext/issues/55245)) ([a618f4c](a618f4cca4))
* allow creation of any number of variants in multiple item variant creation dialog ([27db98d](27db98d222))
* pending qty in job card ([b372e6f](b372e6f118))

### Performance Improvements

* skip delink_original_entry during cancellation when Immutable Ledger is enabled ([#55130](https://github.com/frappe/erpnext/issues/55130)) ([8a4cb28](8a4cb28d90))
* skip delink_original_entry during cancellation when Immutable Ledger is enabled (backport [#55130](https://github.com/frappe/erpnext/issues/55130)) ([#55166](https://github.com/frappe/erpnext/issues/55166)) ([92689e0](92689e05da))
2026-05-27 01:22:47 +00:00
mergify[bot]
d215fa7623 chore: remove frappe-semgrep-rules submodule (backport #55083) (#55319)
Co-authored-by: diptanilsaha <diptanil@frappe.io>
2026-05-27 01:21:08 +00:00
Diptanil Saha
bf8f7ba883 Merge pull request #55307 from frappe/version-16-hotfix
chore: release v16
2026-05-27 05:33:15 +05:30
Frappe PR Bot
6ef4a2d82c chore(release): Bumped to Version 16.19.1
## [16.19.1](https://github.com/frappe/erpnext/compare/v16.19.0...v16.19.1) (2026-05-20)

### Bug Fixes

* faster range calculation on process period closing voucher ([fa4aa0c](fa4aa0c1b6))
2026-05-20 07:25:32 +00:00
ruthra kumar
e4e796146d Merge pull request #55082 from frappe/mergify/bp/version-16/pr-55072
perf: faster opening balance range calculation in process period closing voucher (backport #55072)
2026-05-20 12:53:58 +05:30
ruthra kumar
ea1d0cc277 refactor: ppcv select with for update and skip locked
(cherry picked from commit eba58b2837)
2026-05-20 06:51:01 +00:00
ruthra kumar
fa4aa0c1b6 fix: faster range calculation on process period closing voucher
(cherry picked from commit ee33574a6d)
2026-05-20 06:51:01 +00:00
Frappe PR Bot
fdfcbf72bd chore(release): Bumped to Version 16.19.0
# [16.19.0](https://github.com/frappe/erpnext/compare/v16.18.3...v16.19.0) (2026-05-20)

### Bug Fixes

* add filter subtitle in print formats ([c4037da](c4037daca8))
* add warehouse vaildation for repack entry (backport [#54866](https://github.com/frappe/erpnext/issues/54866)) ([#54901](https://github.com/frappe/erpnext/issues/54901)) ([596c257](596c2571f6))
* changes to gl print template ([caa524f](caa524f661))
* disallow editing on reversal journals ([6a53982](6a53982f4a))
* **general-ledger:** show raw GL entries when categorize_by is empty (backport [#54816](https://github.com/frappe/erpnext/issues/54816)) ([#54830](https://github.com/frappe/erpnext/issues/54830)) ([c041cd2](c041cd27b5))
* handle None delivery_date when sorting MPS data (backport [#55028](https://github.com/frappe/erpnext/issues/55028)) ([#55059](https://github.com/frappe/erpnext/issues/55059)) ([f272d32](f272d32f80))
* improve design and refactor ar print template ([059372a](059372add5))
* improve filter details render logic to avoid showing duplicate information ([040b31d](040b31d3a7))
* incoming rate for legacy serial no (backport [#54962](https://github.com/frappe/erpnext/issues/54962)) ([#54978](https://github.com/frappe/erpnext/issues/54978)) ([6bce78c](6bce78c66d))
* minor bug fixes for ar print template ([09b19f7](09b19f7a2a))
* minor bugs in print templates ([e1446fc](e1446fc6f4))
* minor changes in print template ([0ead229](0ead2296e6))
* minor changes in print template ([16bc28b](16bc28bd70))
* minor changes in print templates ([0d50e03](0d50e03595))
* minor text issues in print ([daaa4ca](daaa4ca0c8))
* normalize date comparison to avoid datatype mismatch ([42f6cb4](42f6cb40d1))
* **patch:** drop dead procedures first before other changes ([0df9591](0df9591910))
* **payment_entry:** fix paid/received amount calculation for multi-currency accounts (backport [#54963](https://github.com/frappe/erpnext/issues/54963)) ([#54970](https://github.com/frappe/erpnext/issues/54970)) ([48b09eb](48b09eb52e))
* posting date and time ([1c44c60](1c44c60dbd))
* prevent duplicate task execution and timestamp error in transaction deletion (backport [#55021](https://github.com/frappe/erpnext/issues/55021)) ([#55025](https://github.com/frappe/erpnext/issues/55025)) ([9857cc6](9857cc64d6))
* remove parent page ([10b4090](10b409005d))
* remove sql procedure method from AR report ([414319d](414319daeb))
* revamp print formats for accounts receivable summary and accounts payable summary reports ([928fab6](928fab6f7e))
* status not changing for dropshipped POs and SOs (backport [#54934](https://github.com/frappe/erpnext/issues/54934)) ([#54937](https://github.com/frappe/erpnext/issues/54937)) ([3c571a1](3c571a1691))
* stock balance showing incorrect value because of incorrect SLE ([0b3344b](0b3344bad9))
* **stock:** add whole number quantity validation in Stock Reconciliation (backport [#54922](https://github.com/frappe/erpnext/issues/54922)) ([#54925](https://github.com/frappe/erpnext/issues/54925)) ([c499454](c4994548c3))
* **stock:** ignore fetching warehouse account for asset items (backport [#54403](https://github.com/frappe/erpnext/issues/54403)) ([#54961](https://github.com/frappe/erpnext/issues/54961)) ([5e5b5cf](5e5b5cfa0c))
* **stock:** update buying amount calculation in gross profit report (backport [#55020](https://github.com/frappe/erpnext/issues/55020)) ([#55024](https://github.com/frappe/erpnext/issues/55024)) ([8870619](88706192d7))
* styling in trial_balance.html and print format ([9a18d31](9a18d318d9))
* toast message for item price insert ([#55009](https://github.com/frappe/erpnext/issues/55009)) ([c967792](c967792ccb))
* use route_options for Credit Note and Debit Note sidebar links (backport [#55026](https://github.com/frappe/erpnext/issues/55026)) ([#55063](https://github.com/frappe/erpnext/issues/55063)) ([1941c3b](1941c3b136))
* **UX:** Buying settings form cleanup ([#54731](https://github.com/frappe/erpnext/issues/54731)) ([e7ae296](e7ae296614))
* **UX:** Item master form cleanup ([#54538](https://github.com/frappe/erpnext/issues/54538)) ([0eb049c](0eb049cd85))
* validate company region in uae vat 201 (backport [#54899](https://github.com/frappe/erpnext/issues/54899)) ([#55055](https://github.com/frappe/erpnext/issues/55055)) ([4015c2b](4015c2b9a4))
* warn when accounting dimension fieldname conflicts with existing fields (backport [#55036](https://github.com/frappe/erpnext/issues/55036)) ([#55062](https://github.com/frappe/erpnext/issues/55062)) ([68a5eae](68a5eae3ff))

### Features

* add print format for accounts payable report ([1c6dc80](1c6dc80b70))
* introduce print format for Accounts Receivable report ([4e7f2ee](4e7f2eeaa0))
* introduce print formats for financial statements ([3283c46](3283c461f1))
* print format for report trial balance ([1d08448](1d08448d1a))

### Reverts

* Revert "fix: debit credit not equal in purchase transactions for mult… (backport [#54906](https://github.com/frappe/erpnext/issues/54906)) ([#54908](https://github.com/frappe/erpnext/issues/54908)) ([0d07083](0d07083299))
2026-05-20 04:10:54 +00:00
diptanilsaha
fb7f820885 Merge pull request #55051 from frappe/version-16-hotfix
chore: release v16
2026-05-20 09:39:15 +05:30
ruthra kumar
799d6d159c Merge pull request #54960 from frappe/mergify/bp/version-16/pr-54941
fix: flag to disable opening balance calculation in general ledger (backport #54941)
2026-05-15 14:31:57 +05:30
ruthra kumar
48f59a033f refactor: flag to disable opening balance calculation
(cherry picked from commit 28a2230d02)
2026-05-15 07:32:52 +00:00
Frappe PR Bot
2807c9f08f chore(release): Bumped to Version 16.18.3
## [16.18.3](https://github.com/frappe/erpnext/compare/v16.18.2...v16.18.3) (2026-05-14)

### Bug Fixes

* status not changing for dropshipped POs and SOs (backport [#54934](https://github.com/frappe/erpnext/issues/54934)) (backport [#54937](https://github.com/frappe/erpnext/issues/54937)) ([#54938](https://github.com/frappe/erpnext/issues/54938)) ([5271773](5271773595))
2026-05-14 09:39:02 +00:00
mergify[bot]
5271773595 fix: status not changing for dropshipped POs and SOs (backport #54934) (backport #54937) (#54938)
fix: status not changing for dropshipped POs and SOs (backport #54934) (#54937)

fix: status not changing for dropshipped POs and SOs (#54934)

* fix: status not changing for dropshipped POs and SOs

* test: change test case to accomodate new flow

(cherry picked from commit 78a79120ea)


(cherry picked from commit 3c571a1691)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2026-05-14 09:37:26 +00:00
Frappe PR Bot
dd35cd1f84 chore(release): Bumped to Version 16.18.2
## [16.18.2](https://github.com/frappe/erpnext/compare/v16.18.1...v16.18.2) (2026-05-14)

### Bug Fixes

* posting date and time ([ab09029](ab090295d9))
2026-05-14 05:35:39 +00:00
rohitwaghchaure
77a6299e8b Merge pull request #54931 from frappe/mergify/bp/version-16/pr-54928
fix: posting date and time (backport #54905) (backport #54928)
2026-05-14 11:04:07 +05:30
rohitwaghchaure
b79ec7cbdd chore: fix linter issue
(cherry picked from commit 3c993377aa)
(cherry picked from commit 21ada7799c)
2026-05-14 02:04:52 +00:00
rohitwaghchaure
927360dd1d chore: fixed test case
(cherry picked from commit c740f77a6f)
(cherry picked from commit f4e66914c6)
2026-05-14 02:04:52 +00:00
Rohit Waghchaure
ab090295d9 fix: posting date and time
(cherry picked from commit fb6c05f186)
(cherry picked from commit 1c44c60dbd)
2026-05-14 02:04:51 +00:00
Frappe PR Bot
c4b7b15824 chore(release): Bumped to Version 16.18.1
## [16.18.1](https://github.com/frappe/erpnext/compare/v16.18.0...v16.18.1) (2026-05-13)

### Reverts

* Revert "fix: debit credit not equal in purchase transactions for mult… (backport [#54906](https://github.com/frappe/erpnext/issues/54906)) (backport [#54908](https://github.com/frappe/erpnext/issues/54908)) ([#54916](https://github.com/frappe/erpnext/issues/54916)) ([cfd3847](cfd3847255))
2026-05-13 10:16:21 +00:00
mergify[bot]
cfd3847255 Revert "fix: debit credit not equal in purchase transactions for mult… (backport #54906) (backport #54908) (#54916)
Revert "fix: debit credit not equal in purchase transactions for mult… (backport #54906) (#54908)

Revert "fix: debit credit not equal in purchase transactions for mult… (#54906)

* Revert "fix: debit credit not equal in purchase transactions for multi currency"

This reverts commit 75bcea57f4.

* Revert "test: add test case"

This reverts commit 1d30a202c3.

* Revert "fix: include rejected qty in tax (purchase receipt)"

This reverts commit 8c9a88abbe.

(cherry picked from commit cf5e8ce878)


(cherry picked from commit 0d07083299)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2026-05-13 10:14:46 +00:00
Frappe PR Bot
dc914adb62 chore(release): Bumped to Version 16.18.0
# [16.18.0](https://github.com/frappe/erpnext/compare/v16.17.0...v16.18.0) (2026-05-12)

### Bug Fixes

* added permission validation for `deactivate_sales_person` (backport [#54884](https://github.com/frappe/erpnext/issues/54884)) ([#54886](https://github.com/frappe/erpnext/issues/54886)) ([98de025](98de025a09))
* check if item is dropshipped before updating quantity (backport [#54825](https://github.com/frappe/erpnext/issues/54825)) ([#54827](https://github.com/frappe/erpnext/issues/54827)) ([0db7e1e](0db7e1e56b))
* **crm:** handle empty _assign in appointment auto assignment (backport [#54782](https://github.com/frappe/erpnext/issues/54782)) ([#54795](https://github.com/frappe/erpnext/issues/54795)) ([f36bdaa](f36bdaadae))
* decimal issue ([8b9b83a](8b9b83a9df))
* do not rely on client side to update quantities during partial d… (backport [#54804](https://github.com/frappe/erpnext/issues/54804)) ([#54821](https://github.com/frappe/erpnext/issues/54821)) ([f24b556](f24b556336))
* fetch get_item_tax_template while update items (backport [#53708](https://github.com/frappe/erpnext/issues/53708)) ([#54767](https://github.com/frappe/erpnext/issues/54767)) ([4fbaea1](4fbaea17f8))
* incorrect serial nos picked during disassemble (backport [#54757](https://github.com/frappe/erpnext/issues/54757)) ([#54760](https://github.com/frappe/erpnext/issues/54760)) ([66ae590](66ae590adc))
* incorrect validation thrown for drop shipped PI (backport [#54751](https://github.com/frappe/erpnext/issues/54751)) ([#54753](https://github.com/frappe/erpnext/issues/54753)) ([379ebbe](379ebbe8c4))
* raw material should not have target warehouse in manufacture entry (backport [#54849](https://github.com/frappe/erpnext/issues/54849)) ([#54861](https://github.com/frappe/erpnext/issues/54861)) ([3dbadfa](3dbadfadd5))
* rename supplier wise stock analytics report ([7086db1](7086db1e1c))
* **stock:** apply filters for rejected warehouse in pick list (backport [#54733](https://github.com/frappe/erpnext/issues/54733)) ([#54776](https://github.com/frappe/erpnext/issues/54776)) ([cf0d9df](cf0d9dfbfd))
* **stock:** ignore reserved qty for stock levels in batch (backport [#54790](https://github.com/frappe/erpnext/issues/54790)) ([#54797](https://github.com/frappe/erpnext/issues/54797)) ([338d190](338d1904c1))
* **stock:** priorities pick list parent warehouse (backport [#54788](https://github.com/frappe/erpnext/issues/54788)) ([#54793](https://github.com/frappe/erpnext/issues/54793)) ([d3bc629](d3bc629f68))
* **task:** update depends_on for closing date and review date [#54850](https://github.com/frappe/erpnext/issues/54850) (backport [#54852](https://github.com/frappe/erpnext/issues/54852)) ([#54863](https://github.com/frappe/erpnext/issues/54863)) ([b962a1a](b962a1a0cd))
* validate variant values (backport [#54831](https://github.com/frappe/erpnext/issues/54831)) ([#54839](https://github.com/frappe/erpnext/issues/54839)) ([87b798b](87b798b936))

### Features

* partial delivery in dropshipping (backport [#54787](https://github.com/frappe/erpnext/issues/54787)) ([#54800](https://github.com/frappe/erpnext/issues/54800)) ([f64f871](f64f871d45))
* Philippines chart of account (backport [#53918](https://github.com/frappe/erpnext/issues/53918)) ([#54888](https://github.com/frappe/erpnext/issues/54888)) ([8f03108](8f0310859d))
2026-05-12 18:49:27 +00:00
diptanilsaha
41bff45d7a Merge pull request #54865 from frappe/version-16-hotfix
chore: release v16
2026-05-13 00:17:54 +05:30
Frappe PR Bot
7b494dc9e8 chore(release): Bumped to Version 16.17.0
# [16.17.0](https://github.com/frappe/erpnext/compare/v16.16.0...v16.17.0) (2026-05-05)

### Bug Fixes

* accounts and account types in German CoA "SKR 03" (backport [#54711](https://github.com/frappe/erpnext/issues/54711)) ([#54713](https://github.com/frappe/erpnext/issues/54713)) ([982810a](982810a700))
* add missing fields in set_currency_labels (backport [#54689](https://github.com/frappe/erpnext/issues/54689)) ([#54690](https://github.com/frappe/erpnext/issues/54690)) ([bca893a](bca893a508))
* Backfill `not_applicable` on Item Tax Template Details for German companies (backport [#54682](https://github.com/frappe/erpnext/issues/54682)) ([#54686](https://github.com/frappe/erpnext/issues/54686)) ([a22d773](a22d773341))
* copy project from first row to new rows (backport [#53295](https://github.com/frappe/erpnext/issues/53295)) ([#54620](https://github.com/frappe/erpnext/issues/54620)) ([e24ab72](e24ab72c0d))
* correct project filter in buying doctypes (backport [#54644](https://github.com/frappe/erpnext/issues/54644)) ([#54652](https://github.com/frappe/erpnext/issues/54652)) ([86cf256](86cf256358))
* correct titles set to {customer_name} or {supplier_name} text strings (backport [#54656](https://github.com/frappe/erpnext/issues/54656)) ([#54669](https://github.com/frappe/erpnext/issues/54669)) ([38cfeb1](38cfeb1bb7))
* dont show serial/batch button when PR is submitted (backport [#54642](https://github.com/frappe/erpnext/issues/54642)) ([#54646](https://github.com/frappe/erpnext/issues/54646)) ([6dbc17d](6dbc17d71a))
* error when creating quotation from CRM (backport [#54722](https://github.com/frappe/erpnext/issues/54722)) ([#54725](https://github.com/frappe/erpnext/issues/54725)) ([2cd4c1a](2cd4c1a052))
* hide payment and payment request buttons based on permissions in invoices and orders (backport [#53920](https://github.com/frappe/erpnext/issues/53920)) ([#54736](https://github.com/frappe/erpnext/issues/54736)) ([e60490d](e60490dceb))
* incorrect expense account book in purchase return (backport [#54681](https://github.com/frappe/erpnext/issues/54681)) ([#54693](https://github.com/frappe/erpnext/issues/54693)) ([0dade2c](0dade2c38c))
* mark item tax templates as not applicable (backport [#54673](https://github.com/frappe/erpnext/issues/54673)) ([#54677](https://github.com/frappe/erpnext/issues/54677)) ([126e13b](126e13be25))
* **payment_entry:** convert the date args to string type before escaping in `get_outstanding_reference_documents` (backport [#54639](https://github.com/frappe/erpnext/issues/54639)) ([#54648](https://github.com/frappe/erpnext/issues/54648)) ([19a8ebe](19a8ebe8a5))
* **project:** use user.email for invitations and skip disabled users. (backport [#54561](https://github.com/frappe/erpnext/issues/54561)) ([#54667](https://github.com/frappe/erpnext/issues/54667)) ([288cdf3](288cdf3bf0))
* py error on sales forecast doctype (backport [#54641](https://github.com/frappe/erpnext/issues/54641)) ([#54643](https://github.com/frappe/erpnext/issues/54643)) ([7bd360a](7bd360aa29))
* Remove bom stock report link from manufacturing workspace ([0f27881](0f27881fed))
* **selling:** blanket order ordered qty recalculation on sales order status change (backport [#54593](https://github.com/frappe/erpnext/issues/54593)) ([#54623](https://github.com/frappe/erpnext/issues/54623)) ([9db03bc](9db03bc520))
* set valid_from in created Item Price (backport [#54696](https://github.com/frappe/erpnext/issues/54696)) ([#54700](https://github.com/frappe/erpnext/issues/54700)) ([bbb4e79](bbb4e79d0a))
* show correct status in Serial No Ledger (backport [#54567](https://github.com/frappe/erpnext/issues/54567)) ([#54626](https://github.com/frappe/erpnext/issues/54626)) ([d6f2ff6](d6f2ff6b87))
* show in and out qty in the stock ledger report for stock recos ([d27cf48](d27cf48b19))
* skip depreciation rescheduling when asset is fully depreciated on sale ([d3c893d](d3c893d08b))
* skip rescheduling only for asset being disposed ([07a957c](07a957c164))
* use RecoverableErrors isinstance check for repost timeout status (backport [#54543](https://github.com/frappe/erpnext/issues/54543)) ([#54649](https://github.com/frappe/erpnext/issues/54649)) ([b300159](b3001595ab))

### Features

* copy terms attachments to transactions (backport [#53403](https://github.com/frappe/erpnext/issues/53403)) ([#54661](https://github.com/frappe/erpnext/issues/54661)) ([bd932da](bd932da08b))
* **ux:** Naming series dialog ([#54554](https://github.com/frappe/erpnext/issues/54554)) ([48ebb4c](48ebb4ca61))

### Performance Improvements

* max recursion depth error in serial no (backport [#54629](https://github.com/frappe/erpnext/issues/54629)) ([#54631](https://github.com/frappe/erpnext/issues/54631)) ([808214f](808214fd95))
2026-05-05 16:32:20 +00:00
diptanilsaha
ed69dafbe8 Merge pull request #54740 from frappe/version-16-hotfix 2026-05-05 22:00:39 +05:30
Frappe PR Bot
4d5c665e22 chore(release): Bumped to Version 16.16.0
# [16.16.0](https://github.com/frappe/erpnext/compare/v16.15.1...v16.16.0) (2026-04-28)

### Bug Fixes

* **`get_stock_balance`:** validate inventory dimension fieldnames (backport [#54587](https://github.com/frappe/erpnext/issues/54587)) ([#54589](https://github.com/frappe/erpnext/issues/54589)) ([9f04fcc](9f04fcc190))
* add filter labels and required filters for financial report validation ([e6f0bb6](e6f0bb66e2))
* add party type for dynamic link support ([c6d4802](c6d4802857))
* always exclude pcv entries except for closing account head ([446c111](446c111653))
* avoid double reduction of pe reference outstanding (backport [#54193](https://github.com/frappe/erpnext/issues/54193)) ([#54613](https://github.com/frappe/erpnext/issues/54613)) ([5de4b01](5de4b013ea))
* correct display depends on condition ([#54556](https://github.com/frappe/erpnext/issues/54556)) ([0df38a8](0df38a841e))
* debit credit not equal in purchase transactions for multi currency (backport [#54456](https://github.com/frappe/erpnext/issues/54456)) ([#54564](https://github.com/frappe/erpnext/issues/54564)) ([d9a9a5b](d9a9a5bcde))
* delivery schedule in the sales order ([386f499](386f49978e))
* duplicate entries being shown in batch exists in future transact… (backport [#54604](https://github.com/frappe/erpnext/issues/54604)) ([#54606](https://github.com/frappe/erpnext/issues/54606)) ([1111771](11117710d3))
* **edi:** restrict Code List imports to files and trusted backend URLs (backport [#54137](https://github.com/frappe/erpnext/issues/54137)) ([#54266](https://github.com/frappe/erpnext/issues/54266)) ([2a244d1](2a244d162b)), closes [#54488](https://github.com/frappe/erpnext/issues/54488)
* ensure fiscal year is checked before validating date filters in financial statements ([fba7871](fba78711cc))
* ensure tax withholding entries respect date range of category ([719d982](719d982a07))
* filter opening entries in first year in custom financial statement ([6bd6e62](6bd6e62c8c))
* filter overdue purchase order items by company (backport [#54099](https://github.com/frappe/erpnext/issues/54099)) ([#54611](https://github.com/frappe/erpnext/issues/54611)) ([8f8bf13](8f8bf13b41))
* hide feature flag controlled fields on install ([45dc2c4](45dc2c40fd))
* make inv dimen reqd only in delivery note (backport [#54546](https://github.com/frappe/erpnext/issues/54546)) ([#54552](https://github.com/frappe/erpnext/issues/54552)) ([d56df96](d56df96f73))
* **manufacturing:** remove conversion factor for stock qty (backport [#54525](https://github.com/frappe/erpnext/issues/54525)) ([#54573](https://github.com/frappe/erpnext/issues/54573)) ([f14751d](f14751d538))
* negative quantity check in validate_item_qty (backport [#54559](https://github.com/frappe/erpnext/issues/54559)) ([#54572](https://github.com/frappe/erpnext/issues/54572)) ([f7fa394](f7fa394aea))
* **payment_entry:** escape arguments on invoice and order fetching sql queries (backport [#54582](https://github.com/frappe/erpnext/issues/54582)) ([#54586](https://github.com/frappe/erpnext/issues/54586)) ([5289aa0](5289aa0ab3))
* **PCV:** set correct filters of `from_date` and `to_date` on General Ledger Report on clicking `Ledger` button (backport [#54522](https://github.com/frappe/erpnext/issues/54522)) ([#54524](https://github.com/frappe/erpnext/issues/54524)) ([f3996fb](f3996fb971))
* preserve inventory dimensions when raw materials are reset (backport [#54440](https://github.com/frappe/erpnext/issues/54440)) ([#54493](https://github.com/frappe/erpnext/issues/54493)) ([456e99b](456e99b352))
* py error on stock ageing report (backport [#54467](https://github.com/frappe/erpnext/issues/54467)) ([#54469](https://github.com/frappe/erpnext/issues/54469)) ([090aab3](090aab33fb))
* skip BudgetValidation when cancelling GL entries ([1b14673](1b146738c4))
* **stock:** add stock entry in batch master connection ([62bbe28](62bbe28a72))
* **stock:** remove validation for transfer_qty field (backport [#54542](https://github.com/frappe/erpnext/issues/54542)) ([#54545](https://github.com/frappe/erpnext/issues/54545)) ([cc85370](cc85370d54))
* **stock:** set incoming rate as zero for outward sle (backport [#54514](https://github.com/frappe/erpnext/issues/54514)) ([#54533](https://github.com/frappe/erpnext/issues/54533)) ([cabea2f](cabea2f288))
* **stock:** show available qty in warehouse link field (backport [#54474](https://github.com/frappe/erpnext/issues/54474)) ([#54484](https://github.com/frappe/erpnext/issues/54484)) ([f7b87ed](f7b87ed0e3))
* **stock:** show item code in serial and batch selector dialog ([85d1eb8](85d1eb8379))
* summing of values could be zero even if values exist ([d51ce66](d51ce66cb2))
* update account identification to avoid using name_field in financial statements ([7b60ec8](7b60ec8457))
* update fiscal year filter to use mandatory_depends_on instead of reqd ([6570796](6570796fba))
* update status of quotation in patch (backport [#54577](https://github.com/frappe/erpnext/issues/54577)) ([#54580](https://github.com/frappe/erpnext/issues/54580)) ([134e4b7](134e4b7446))

### Features

* add setting to hide Subscription references across doctypes ([#54576](https://github.com/frappe/erpnext/issues/54576)) ([15b6633](15b6633fc3))
* Add XLSX styling support to custom financial report templates ([#52612](https://github.com/frappe/erpnext/issues/52612)) ([055ff56](055ff56ce4))
* Add XLSX styling support to custom financial report templates (backport [#52612](https://github.com/frappe/erpnext/issues/52612)) ([#54485](https://github.com/frappe/erpnext/issues/54485)) ([df3fbed](df3fbeded2))
* danish_bosnian_address_template (backport [#54093](https://github.com/frappe/erpnext/issues/54093)) ([#54516](https://github.com/frappe/erpnext/issues/54516)) ([5c0d2cb](5c0d2cb474))
* enhance account category with root type ([#53190](https://github.com/frappe/erpnext/issues/53190)) ([96bab08](96bab08ae0))
2026-04-28 21:03:29 +00:00
diptanilsaha
e09487d140 Merge pull request #54583 from frappe/version-16-hotfix 2026-04-29 02:31:54 +05:30
23 changed files with 64 additions and 343 deletions

View File

@@ -6,7 +6,7 @@ import frappe
from frappe.model.document import Document
from frappe.utils.user import is_website_user
__version__ = "16.15.1"
__version__ = "16.22.0"
def get_default_company(user=None):

View File

@@ -2294,9 +2294,6 @@ def get_outstanding_reference_documents(args, validate=False):
if args.get("party_type") == "Member":
return
if args.get("party_type") and args.get("party"):
frappe.has_permission(args["party_type"], "read", args["party"], throw=True)
if not args.get("get_outstanding_invoices") and not args.get("get_orders_to_be_billed"):
args["get_outstanding_invoices"] = True
@@ -2788,7 +2785,6 @@ def get_reference_details(
):
total_amount = outstanding_amount = exchange_rate = account = None
frappe.has_permission(reference_doctype, "read", reference_name, throw=True)
ref_doc = frappe.get_lazy_doc(reference_doctype, reference_name)
company_currency = ref_doc.get("company_currency") or erpnext.get_company_currency(ref_doc.company)

View File

@@ -93,6 +93,8 @@ def get_party_details(
):
if not party:
return frappe._dict()
if not frappe.db.exists(party_type, party):
frappe.throw(_("{0}: {1} does not exists").format(party_type, party))
return _get_party_details(
party,
account,
@@ -103,7 +105,7 @@ def get_party_details(
price_list,
currency,
doctype,
False,
ignore_permissions,
fetch_payment_terms_template,
party_address,
company_address,

View File

@@ -928,28 +928,8 @@ class ReceivablePayableReport:
if self.filters.project:
self.qb_selection_filter.append(self.ple.project.isin(self.filters.project))
self.add_user_permission_filters()
self.add_accounting_dimensions_filters()
def add_user_permission_filters(self):
# Party is a dynamic link, so match conditions cannot auto-apply Customer/Supplier user permissions
from frappe.core.doctype.user_permission.user_permission import get_user_permissions
from frappe.permissions import get_allowed_docs_for_doctype
user_permissions = get_user_permissions()
if not user_permissions:
return
for party_type in self.party_type:
if party_type not in user_permissions:
continue
allowed_parties = get_allowed_docs_for_doctype(user_permissions[party_type], party_type)
self.qb_selection_filter.append(
(self.ple.party_type != party_type) | self.ple.party.isin(allowed_parties or [""])
)
def get_cost_center_conditions(self):
cost_center_list = get_cost_centers_with_children(self.filters.cost_center)
self.qb_selection_filter.append(self.ple.cost_center.isin(cost_center_list))

View File

@@ -1245,44 +1245,3 @@ class TestAccountsReceivable(ERPNextTestSuite, AccountsTestMixin):
self.assertEqual(len(report[1]), 1)
row = report[1][0]
self.assertEqual([si.name, project.name, 60], [row.voucher_no, row.project, row.outstanding])
def test_accounts_receivable_respects_user_permissions(self):
# Party is a dynamic link on Payment Ledger Entry, so user permissions on Customer
# must be applied explicitly. The report should only show permitted customers.
original_customer = self.customer
second_customer = "_Test AR Perm Customer"
# create_customer overrides self.customer, so build the restricted invoice first
self.create_customer(customer_name=second_customer)
self.create_sales_invoice(no_payment_schedule=True)
self.customer = original_customer
allowed_invoice = self.create_sales_invoice(no_payment_schedule=True)
test_user = "test_ar_user_permission@example.com"
if not frappe.db.exists("User", test_user):
user = frappe.new_doc("User")
user.email = test_user
user.first_name = "AR Perm"
user.append("roles", {"role": "Accounts User"})
user.save()
frappe.permissions.add_user_permission("Customer", original_customer, test_user)
filters = {
"company": self.company,
"party_type": "Customer",
"report_date": today(),
"range": "30, 60, 90, 120",
}
frappe.set_user(test_user)
try:
report = execute(filters)
finally:
frappe.set_user("Administrator")
parties = {row.party for row in report[1]}
self.assertIn(original_customer, parties)
self.assertNotIn(second_customer, parties)
self.assertEqual(allowed_invoice.customer, original_customer)

View File

@@ -303,7 +303,6 @@ def get_balance_on(
)
if party_type and party:
frappe.has_permission(party_type, "read", party, throw=True)
cond.append(
f"""gle.party_type = {frappe.db.escape(party_type)} and gle.party = {frappe.db.escape(party)} """
)

View File

@@ -15,7 +15,7 @@ from frappe.utils import get_url
from frappe.utils.print_format import download_pdf
from frappe.utils.user import get_user_fullname
from erpnext.accounts.party import _get_party_details, get_party_account_currency
from erpnext.accounts.party import get_party_account_currency, get_party_details
from erpnext.buying.utils import validate_for_items
from erpnext.controllers.buying_controller import BuyingController
from erpnext.stock.doctype.material_request.material_request import set_missing_values
@@ -447,7 +447,7 @@ def make_supplier_quotation_from_rfq(source_name, target_doc=None, for_supplier=
def postprocess(source, target_doc):
if for_supplier:
target_doc.supplier = for_supplier
args = _get_party_details(for_supplier, party_type="Supplier", ignore_permissions=True)
args = get_party_details(for_supplier, party_type="Supplier", ignore_permissions=True)
target_doc.currency = args.currency or get_party_account_currency(
"Supplier", for_supplier, source.company
)

View File

@@ -119,12 +119,12 @@ class TestSupplier(ERPNextTestSuite):
self.assertEqual(supplier.country, "Greece")
def test_party_details_tax_category(self):
from erpnext.accounts.party import _get_party_details
from erpnext.accounts.party import get_party_details
frappe.delete_doc_if_exists("Address", "_Test Address With Tax Category-Billing")
# Tax Category without Address
details = _get_party_details("_Test Supplier With Tax Category", party_type="Supplier")
details = get_party_details("_Test Supplier With Tax Category", party_type="Supplier")
self.assertEqual(details.tax_category, "_Test Tax Category 1")
address = frappe.get_doc(
@@ -139,7 +139,7 @@ class TestSupplier(ERPNextTestSuite):
).insert()
# Tax Category with Address
details = _get_party_details("_Test Supplier With Tax Category", party_type="Supplier")
details = get_party_details("_Test Supplier With Tax Category", party_type="Supplier")
self.assertEqual(details.tax_category, "_Test Tax Category 2")
# Rollback

View File

@@ -13,7 +13,7 @@ from frappe.utils.data import nowtime
import erpnext
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_dimensions
from erpnext.accounts.doctype.budget.budget import validate_expense_against_budget
from erpnext.accounts.party import _get_party_details
from erpnext.accounts.party import get_party_details
from erpnext.buying.utils import update_last_purchase_rate, validate_for_items
from erpnext.controllers.accounts_controller import get_taxes_and_charges
from erpnext.controllers.sales_and_purchase_return import get_rate_for_return
@@ -218,7 +218,7 @@ class BuyingController(SubcontractingController):
# set contact and address details for supplier, if they are not mentioned
if getattr(self, "supplier", None):
self.update_if_missing(
_get_party_details(
get_party_details(
self.supplier,
party_type="Supplier",
doctype=self.doctype,

View File

@@ -77,8 +77,7 @@
"fieldname": "customer_email",
"fieldtype": "Data",
"label": "Email",
"reqd": 1,
"options": "Email"
"reqd": 1
},
{
"fieldname": "linked_docs_section",
@@ -103,7 +102,7 @@
}
],
"links": [],
"modified": "2026-06-06 13:05:59.300573",
"modified": "2024-03-27 13:05:59.300573",
"modified_by": "Administrator",
"module": "CRM",
"name": "Appointment",

View File

@@ -611,9 +611,6 @@ erpnext.buying.get_items_from_product_bundle = function (frm) {
fieldname: "product_bundle",
options: "Product Bundle",
reqd: 1,
get_query: () => {
return { filters: { disabled: 0 } };
},
},
{
fieldtype: "Currency",

View File

@@ -53,7 +53,7 @@ class TestCustomer(ERPNextTestSuite):
doc.delete()
def test_party_details(self):
from erpnext.accounts.party import _get_party_details
from erpnext.accounts.party import get_party_details
to_check = {
"selling_price_list": None,
@@ -75,7 +75,7 @@ class TestCustomer(ERPNextTestSuite):
"Contact", "_Test Contact for _Test Customer-_Test Customer", "is_primary_contact", 1
)
details = _get_party_details("_Test Customer")
details = get_party_details("_Test Customer")
for key, value in to_check.items():
val = details.get(key)
@@ -85,10 +85,10 @@ class TestCustomer(ERPNextTestSuite):
self.assertEqual(value, val)
def test_party_details_tax_category(self):
from erpnext.accounts.party import _get_party_details
from erpnext.accounts.party import get_party_details
# Tax Category without Address
details = _get_party_details("_Test Customer With Tax Category")
details = get_party_details("_Test Customer With Tax Category")
self.assertEqual(details.tax_category, "_Test Tax Category 1")
frappe.get_doc(
@@ -120,13 +120,13 @@ class TestCustomer(ERPNextTestSuite):
# Tax Category from Billing Address
settings.determine_address_tax_category_from = "Billing Address"
settings.save()
details = _get_party_details("_Test Customer With Tax Category")
details = get_party_details("_Test Customer With Tax Category")
self.assertEqual(details.tax_category, "_Test Tax Category 2")
# Tax Category from Shipping Address
settings.determine_address_tax_category_from = "Shipping Address"
settings.save()
details = _get_party_details("_Test Customer With Tax Category")
details = get_party_details("_Test Customer With Tax Category")
self.assertEqual(details.tax_category, "_Test Tax Category 3")
# Rollback

View File

@@ -65,12 +65,9 @@
},
{
"default": "0",
"description": "A disabled Product Bundle cannot be selected in transactions.",
"fieldname": "disabled",
"fieldtype": "Check",
"in_standard_filter": 1,
"label": "Disabled",
"no_copy": 1
"label": "Disabled"
},
{
"fieldname": "column_break_eonk",
@@ -80,7 +77,7 @@
"icon": "fa fa-sitemap",
"idx": 1,
"links": [],
"modified": "2026-06-10 16:00:00.000000",
"modified": "2024-03-27 13:10:19.599302",
"modified_by": "Administrator",
"module": "Selling",
"name": "Product Bundle",

View File

@@ -1,12 +0,0 @@
// Copyright (c) 2026, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.listview_settings["Product Bundle"] = {
add_fields: ["disabled"],
get_indicator(doc) {
if (doc.disabled) {
return [__("Disabled"), "grey", "disabled,=,1"];
}
return [__("Active"), "green", "disabled,=,0"];
},
};

View File

@@ -7,7 +7,7 @@ from frappe import _, qb
from frappe.query_builder import Criterion
from erpnext import get_default_company
from erpnext.accounts.party import _get_party_details
from erpnext.accounts.party import get_party_details
def execute(filters=None):
@@ -125,7 +125,7 @@ def get_data(filters=None):
def get_customer_details(filters):
customer_details = _get_party_details(party=filters.get("customer"), party_type="Customer")
customer_details = get_party_details(party=filters.get("customer"), party_type="Customer")
customer_details.update(
{"company": get_default_company(), "price_list": customer_details.get("selling_price_list")}
)

View File

@@ -4,8 +4,6 @@
import frappe
from frappe import _
from frappe.query_builder import Case, CustomFunction
from frappe.query_builder.functions import Count, Max, Sum
from frappe.utils import cint
@@ -26,69 +24,50 @@ def execute(filters=None):
customers = get_sales_details(doctype)
data = []
for row in customers:
if cint(row[8]) >= cint(days_since_last_order):
row.insert(7, get_last_sales_amt(row[0], doctype))
data.append(row)
for cust in customers:
if cint(cust[8]) >= cint(days_since_last_order):
cust.insert(7, get_last_sales_amt(cust[0], doctype))
data.append(cust)
return columns, data
def get_sales_details(doctype):
customer = frappe.qb.DocType("Customer")
sales_doctype = frappe.qb.DocType(doctype)
date_diff = CustomFunction("DATEDIFF", ["d1", "d2"])
current_date = CustomFunction("CURRENT_DATE", [])
cond = """sum(so.base_net_total) as 'total_order_considered',
max(so.posting_date) as 'last_order_date',
DATEDIFF(CURRENT_DATE, max(so.posting_date)) as 'days_since_last_order' """
if doctype == "Sales Order":
total_considered = Sum(
Case()
.when(
sales_doctype.status == "Stopped",
sales_doctype.base_net_total * sales_doctype.per_delivered / 100,
)
.else_(sales_doctype.base_net_total)
)
date_col = sales_doctype.transaction_date
else:
total_considered = Sum(sales_doctype.base_net_total)
date_col = sales_doctype.posting_date
cond = """sum(if(so.status = "Stopped",
so.base_net_total * so.per_delivered/100,
so.base_net_total)) as 'total_order_considered',
max(so.transaction_date) as 'last_order_date',
DATEDIFF(CURRENT_DATE, max(so.transaction_date)) as 'days_since_last_order'"""
last_order_date = Max(date_col)
days_since_last_order = date_diff(current_date(), last_order_date)
return (
frappe.qb.from_(customer)
.inner_join(sales_doctype)
.on(customer.name == sales_doctype.customer)
.select(
customer.name,
customer.customer_name,
customer.territory,
customer.customer_group,
Count(sales_doctype.name).distinct().as_("num_of_order"),
Sum(sales_doctype.base_net_total).as_("total_order_value"),
total_considered.as_("total_order_considered"),
last_order_date.as_("last_order_date"),
days_since_last_order.as_("days_since_last_order"),
)
.where(sales_doctype.docstatus == 1)
.groupby(customer.name)
.orderby(days_since_last_order, order=frappe.qb.desc)
).run(as_list=True)
return frappe.db.sql(
f"""select
cust.name,
cust.customer_name,
cust.territory,
cust.customer_group,
count(distinct(so.name)) as 'num_of_order',
sum(base_net_total) as 'total_order_value', {cond}
from `tabCustomer` cust, `tab{doctype}` so
where cust.name = so.customer and so.docstatus = 1
group by cust.name
order by 'days_since_last_order' desc """,
as_list=1,
)
def get_last_sales_amt(customer, doctype):
sales_doctype = frappe.qb.DocType(doctype)
date_col = sales_doctype.transaction_date if doctype == "Sales Order" else sales_doctype.posting_date
res = (
frappe.qb.from_(sales_doctype)
.select(sales_doctype.base_net_total)
.where((sales_doctype.customer == customer) & (sales_doctype.docstatus == 1))
.orderby(date_col, order=frappe.qb.desc)
.limit(1)
).run()
cond = "posting_date"
if doctype == "Sales Order":
cond = "transaction_date"
res = frappe.db.sql(
f"""select base_net_total from `tab{doctype}`
where customer = %s and docstatus = 1 order by {cond} desc
limit 1""",
customer,
)
return res and res[0][0] or 0

View File

@@ -1,52 +0,0 @@
# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe.utils import add_days, getdate, today
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.selling.report.inactive_customers.inactive_customers import execute
from erpnext.tests.utils import ERPNextTestSuite
class TestInactiveCustomers(ERPNextTestSuite):
def setUp(self):
self.customer = frappe.get_doc(doctype="Customer", customer_name="_Test Inactive Customer").insert()
self.last_order_date = add_days(today(), -120)
so = make_sales_order(
customer=self.customer.name,
transaction_date=self.last_order_date,
qty=5,
rate=200,
)
so.submit()
self.sales_order = so
def test_invalid_doctype_is_rejected(self):
self.assertRaises(
frappe.ValidationError,
execute,
{"doctype": "Purchase Order", "days_since_last_order": 30},
)
def test_inactive_customer_is_listed_with_expected_columns(self):
columns, data = execute({"doctype": "Sales Order", "days_since_last_order": 30})
row = self.get_customer_row(data)
self.assertIsNotNone(row, "Inactive customer should be present in the report")
# Column contract: the report relies on positional access.
self.assertEqual(row[0], self.customer.name)
self.assertEqual(row[7], 1000) # Last Order Amount inserted at index 7 (5 * 200)
self.assertEqual(getdate(row[8]), getdate(self.last_order_date)) # Last Order Date
self.assertGreaterEqual(row[9], 30) # Days Since Last Order
def test_recent_customer_is_excluded(self):
_columns, data = execute({"doctype": "Sales Order", "days_since_last_order": 200})
self.assertIsNone(
self.get_customer_row(data),
"Customer ordering within the threshold must be excluded",
)
def get_customer_row(self, data):
return next((row for row in data if row[0] == self.customer.name), None)

View File

@@ -13,8 +13,6 @@ def execute(filters=None):
if not filters:
filters = {}
validate_filters(filters)
columns = get_columns(filters)
entries = get_entries(filters)
item_details = get_item_details()
@@ -51,17 +49,10 @@ def execute(filters=None):
return columns, data
def validate_filters(filters):
ALLOWED_DOCTYPES = ["Sales Order", "Sales Invoice", "Delivery Note"]
def get_columns(filters):
if not filters.get("doc_type"):
msgprint(_("Please select the document type first"), raise_exception=1)
if filters.get("doc_type") not in ALLOWED_DOCTYPES:
frappe.throw(_("{0}, {1} or {2} are the only allowed options.").format(*ALLOWED_DOCTYPES))
def get_columns(filters):
columns = [
{
"label": _(filters["doc_type"]),

View File

@@ -89,7 +89,7 @@
"icon": "icon-legal",
"idx": 1,
"links": [],
"modified": "2026-06-06 16:35:34.394675",
"modified": "2026-04-29 22:51:49.285298",
"modified_by": "Administrator",
"module": "Setup",
"name": "Terms and Conditions",
@@ -135,7 +135,7 @@
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"role": "Accounts User",
"share": 1,
"write": 1
},
@@ -152,15 +152,6 @@
"read": 1,
"role": "HR Manager",
"write": 1
},
{
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"share": 1
}
],
"quick_entry": 1,

View File

@@ -294,7 +294,7 @@ def get_product_bundle_component_rows(item):
def get_product_bundle_parent_rows(item):
rows = frappe.get_all(
"Product Bundle",
filters={"new_item_code": item, "docstatus": 0},
filters={"new_item_code": item, "disabled": 0, "docstatus": 0},
fields=["name", "new_item_code", "disabled"],
order_by="name asc",
)
@@ -463,7 +463,7 @@ def get_product_bundle_map(bundle_names):
row.name: row
for row in frappe.get_all(
"Product Bundle",
filters={"name": ["in", bundle_names], "docstatus": 0},
filters={"name": ["in", bundle_names], "disabled": 0, "docstatus": 0},
fields=["name", "new_item_code", "disabled"],
)
}

View File

@@ -140,7 +140,7 @@ def get_items(filters):
item.brand,
item.stock_uom,
)
.where((IfNull(item.disabled, 0) == 0) & (IfNull(pb.disabled, 0) == 0))
.where(IfNull(item.disabled, 0) == 0)
)
if item_code := filters.get("item_code"):

View File

@@ -306,11 +306,6 @@ class FIFOSlots:
# prepare single sle voucher detail lookup
self.prepare_stock_reco_voucher_wise_count()
if stock_ledger_entries is None:
# nested queries invalidate the streaming cursor below,
# so batchwise valuation flags must be resolved beforehand
self._prefetch_batchwise_valuations()
with frappe.db.unbuffered_cursor():
if stock_ledger_entries is None:
stock_ledger_entries = self._get_stock_ledger_entries()
@@ -428,38 +423,12 @@ class FIFOSlots:
def _get_batchwise_valuation(self, batch_no: str):
if batch_no not in self.batchwise_valuation_by_batch:
# only reachable when stock ledger entries are passed in directly;
# the streaming path prefetches all flags before iteration
self.batchwise_valuation_by_batch[batch_no] = frappe.db.get_value(
"Batch", batch_no, "use_batchwise_valuation"
)
return self.batchwise_valuation_by_batch[batch_no]
def _prefetch_batchwise_valuations(self) -> None:
sle = frappe.qb.DocType("Stock Ledger Entry")
batch = frappe.qb.DocType("Batch")
to_date = get_datetime(self.filters.get("to_date") + " 23:59:59")
query = (
frappe.qb.from_(sle)
.left_join(batch)
.on(sle.batch_no == batch.name)
.select(sle.batch_no, batch.use_batchwise_valuation)
.distinct()
.where(
(sle.batch_no.isnotnull())
& (sle.company == self.filters.get("company"))
& (sle.posting_datetime <= to_date)
& (sle.is_cancelled != 1)
)
)
query = self._apply_filter(query, sle, "item_code")
for batch_no, use_batchwise_valuation in query.run():
self.batchwise_valuation_by_batch[batch_no] = use_batchwise_valuation
def _init_key_stores(self, row: dict) -> tuple:
"Initialise keys and FIFO Queue."

View File

@@ -1434,80 +1434,6 @@ class TestStockAgeing(ERPNextTestSuite):
item_result["fifo_queue"], [[batch_no.upper(), 1, 5.0, getdate(add_days(base_date, -2)), 50.0]]
)
def test_legacy_batch_no_sle_with_streaming_cursor(self):
"""SLEs carrying the legacy batch_no field must not trigger nested
queries while entries stream through an unbuffered cursor."""
from unittest.mock import patch
from frappe.utils import add_days, nowdate
from erpnext.stock.doctype.item.test_item import make_item
from erpnext.stock.doctype.serial_and_batch_bundle.test_serial_and_batch_bundle import (
get_batch_from_bundle,
)
from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import (
create_stock_reconciliation,
)
suffix = frappe.generate_hash(length=8).upper()
item_code = make_item(
f"Test Stock Ageing Legacy Batch {suffix}",
{
"is_stock_item": 1,
"has_batch_no": 1,
"create_new_batch": 1,
"batch_number_series": f"SA-LEG-{suffix}-.###",
"valuation_method": "FIFO",
},
).name
warehouse = "_Test Warehouse - _TC"
base_date = nowdate()
reco = create_stock_reconciliation(
item_code=item_code,
warehouse=warehouse,
qty=10,
rate=10,
posting_date=add_days(base_date, -2),
posting_time="10:00:00",
)
batch_no = get_batch_from_bundle(reco.items[0].serial_and_batch_bundle)
frappe.db.set_value("Batch", batch_no, "use_batchwise_valuation", 1)
create_stock_reconciliation(
item_code=item_code,
warehouse=warehouse,
qty=5,
rate=10,
batch_no=batch_no,
posting_date=add_days(base_date, -1),
posting_time="10:00:00",
)
# mimic pre-bundle data where SLEs carry batch_no directly
frappe.db.set_value(
"Stock Ledger Entry",
{"item_code": item_code},
"batch_no",
batch_no,
)
filters = frappe._dict(
company="_Test Company",
to_date=base_date,
ranges=["30", "60", "90"],
item_code=item_code,
)
fifo_slots = FIFOSlots(filters)
# fetch row by row so the streaming result set is still active
# while each stock ledger entry is processed
with patch("frappe.database.database.SQL_ITERATOR_BATCH_SIZE", 1):
slots = fifo_slots.generate()
self.assertEqual(fifo_slots.batchwise_valuation_by_batch.get(batch_no), 1)
self.assertEqual(slots[item_code]["total_qty"], 5.0)
def generate_item_and_item_wh_wise_slots(filters, sle):
"Return results with and without 'show_warehouse_wise_stock'"