From 973d06d96f93e9af22182465e750d055907d0cc8 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Tue, 5 Dec 2023 17:17:12 +0000 Subject: [PATCH 01/15] chore(release): Bumped to Version 14.53.0 # [14.53.0](https://github.com/frappe/erpnext/compare/v14.52.1...v14.53.0) (2023-12-05) ### Bug Fixes * `OperationalError` while selecting Serial No in `Warranty Claim` (backport [#38394](https://github.com/frappe/erpnext/issues/38394)) ([#38413](https://github.com/frappe/erpnext/issues/38413)) ([49296cd](https://github.com/frappe/erpnext/commit/49296cd5cb97836156c29d644acd147c36c30c50)) * better overlap logic for job card (backport [#38432](https://github.com/frappe/erpnext/issues/38432)) ([#38521](https://github.com/frappe/erpnext/issues/38521)) ([6db63c9](https://github.com/frappe/erpnext/commit/6db63c971eb88ad68b916c1947e81806c0440638)) * consider the `Valuation Method` while picking incorrect SLE (backport [#38592](https://github.com/frappe/erpnext/issues/38592)) ([#38594](https://github.com/frappe/erpnext/issues/38594)) ([01b2a1f](https://github.com/frappe/erpnext/commit/01b2a1ffebe31f63741e98d4e4c07fc09716546e)) * debit credit mismatch in multi-currecy asset purchase receipt ([#38342](https://github.com/frappe/erpnext/issues/38342)) ([fd6a23c](https://github.com/frappe/erpnext/commit/fd6a23cf41997e1ada5adb7d28dcc091979aabcf)) * don't consider cancelled entries ([#38401](https://github.com/frappe/erpnext/issues/38401)) ([9345334](https://github.com/frappe/erpnext/commit/9345334196484f3d89c1be11bcb0598cf38cfab7)) * don't show non-stock items in Stock Analytics report (backport [#38543](https://github.com/frappe/erpnext/issues/38543)) ([#38544](https://github.com/frappe/erpnext/issues/38544)) ([2e333e6](https://github.com/frappe/erpnext/commit/2e333e6802ad880700920e5df70b87495a67a657)) * don't update previous doc on rate change (backport [#38493](https://github.com/frappe/erpnext/issues/38493)) ([#38523](https://github.com/frappe/erpnext/issues/38523)) ([b88c7d6](https://github.com/frappe/erpnext/commit/b88c7d63deebb331f49512191565f359221b75e7)) * exclude `invoice_doctypes` from party advance ([1042d4c](https://github.com/frappe/erpnext/commit/1042d4cfeb158a224ea722816fec346a940f2c98)) * exploded items in Subcontracting Receipt (backport [#38441](https://github.com/frappe/erpnext/issues/38441)) ([#38444](https://github.com/frappe/erpnext/issues/38444)) ([2908d96](https://github.com/frappe/erpnext/commit/2908d966b620c4462b96d79e46f08e6bed3ff1df)) * get dynamic link with parenttype contact ([12d3cda](https://github.com/frappe/erpnext/commit/12d3cda2d9bf2d8b5fd1c8b74db3011ecace487a)) * incorrect customer outstanding amount ([#38475](https://github.com/frappe/erpnext/issues/38475)) ([c07723d](https://github.com/frappe/erpnext/commit/c07723d49d065a29e9b6985c746c82cce1815d6d)) * incorrect material request quantity in Production Plan (backport [#38566](https://github.com/frappe/erpnext/issues/38566)) ([#38578](https://github.com/frappe/erpnext/issues/38578)) ([70965ef](https://github.com/frappe/erpnext/commit/70965efd941389b03280a39a41448800e0747a02)) * incorrect ordered qty for Subcontracting Order ([#38415](https://github.com/frappe/erpnext/issues/38415)) ([8e37087](https://github.com/frappe/erpnext/commit/8e370876cc14ec7ec5099b1fad003049680ed8b0)) * incorrect requested quantity for the subcontracting order (backport [#38455](https://github.com/frappe/erpnext/issues/38455)) ([#38471](https://github.com/frappe/erpnext/issues/38471)) ([497049b](https://github.com/frappe/erpnext/commit/497049b3fd7139c59b0f117ddaea9fbd2df98e18)) * item group filter in sales person wise report ([eee9062](https://github.com/frappe/erpnext/commit/eee906281480fbed66e3ad823bd4e0386ed07bd3)) * make create button translatable ([#38165](https://github.com/frappe/erpnext/issues/38165)) ([c71b31e](https://github.com/frappe/erpnext/commit/c71b31e3b8d577d99bfd904faa02c9b6022f6c6a)) * no fstring in translation ([#38381](https://github.com/frappe/erpnext/issues/38381)) ([cec2574](https://github.com/frappe/erpnext/commit/cec25740eae25dec8519af756636a521faf3e6b5)) * **pe:** show split alert only on splitting ([8d6d74c](https://github.com/frappe/erpnext/commit/8d6d74c23700dc22e27e2cfce4af0227a4ab3be3)) * **regional:** use net figures for sales calc ([#38260](https://github.com/frappe/erpnext/issues/38260)) ([d337533](https://github.com/frappe/erpnext/commit/d337533907a17ada35bfe0da070e0ee6ae13a24d)) * remove hardcoded, implicit rounding loss allowance ([419943a](https://github.com/frappe/erpnext/commit/419943a9d9ea748088702935844ed616f616400a)) * set cwip account before asset tests ([ecde1d5](https://github.com/frappe/erpnext/commit/ecde1d58b5f3dbc0bbbf2fc96a867b7e25ae5776)) * show item name as title instead of item group in BOM (backport [#38478](https://github.com/frappe/erpnext/issues/38478)) ([#38480](https://github.com/frappe/erpnext/issues/38480)) ([0df52d2](https://github.com/frappe/erpnext/commit/0df52d2c4f900e2110798347eac306c16536f8e7)) * SO ordered qty on PO item removal ([#38378](https://github.com/frappe/erpnext/issues/38378)) ([b7fe163](https://github.com/frappe/erpnext/commit/b7fe163de5ece72a91862695537274c6aeb7eb06)) * sql error while filtering on finance book in GL ([25ec1fc](https://github.com/frappe/erpnext/commit/25ec1fce6105249defd835601e0132735cdd189b)) * unset discount amount based on coupon code ([7fa97fa](https://github.com/frappe/erpnext/commit/7fa97fa7b58a83266c669c6fd7d170f66f162154)) * use `docstatus` instead of `status` (backport [#38439](https://github.com/frappe/erpnext/issues/38439)) ([#38442](https://github.com/frappe/erpnext/issues/38442)) ([2dc4b02](https://github.com/frappe/erpnext/commit/2dc4b02fc853ec1cf40ab1da1126811e0f9e2862)) * use predefined onload property `load_after_mapping` (backport [#38209](https://github.com/frappe/erpnext/issues/38209)) ([#38518](https://github.com/frappe/erpnext/issues/38518)) ([9f23b7e](https://github.com/frappe/erpnext/commit/9f23b7e46f52390317b13b29ca5ddbe9842effe1)) * **ux:** make valuation field read only when it can't be modified (backport [#38450](https://github.com/frappe/erpnext/issues/38450)) ([#38463](https://github.com/frappe/erpnext/issues/38463)) ([bec7fb5](https://github.com/frappe/erpnext/commit/bec7fb54936867f438bea60f42637089eedf9f8b)) * validate finance_books table length in asset ([#38584](https://github.com/frappe/erpnext/issues/38584)) ([14b908f](https://github.com/frappe/erpnext/commit/14b908f8ab243c94cf1bd0ecde52055dcdbc5e7b)) ### Features * `Company` filter in `Stock Ledger Variance` report (backport [#38553](https://github.com/frappe/erpnext/issues/38553)) ([#38573](https://github.com/frappe/erpnext/issues/38573)) ([6c89f35](https://github.com/frappe/erpnext/commit/6c89f351f46c7d1ba1d0d5129b0f59e093d91a59)) * shift depreciation for assets [v14] [backport of [#38327](https://github.com/frappe/erpnext/issues/38327)] ([#38404](https://github.com/frappe/erpnext/issues/38404)) ([d8c3935](https://github.com/frappe/erpnext/commit/d8c3935e64f240b938f90558554ef57d6b9f46f0)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index ca5062d835e..8406ce635b9 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.52.1" +__version__ = "14.53.0" def get_default_company(user=None): From 214861d68f81158d1c4dcac493dfbd2243c3e29e Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Tue, 12 Dec 2023 16:12:27 +0000 Subject: [PATCH 02/15] chore(release): Bumped to Version 14.54.0 # [14.54.0](https://github.com/frappe/erpnext/compare/v14.53.0...v14.54.0) (2023-12-12) ### Bug Fixes * 1st row depr. sch. value of asset put to less than 180 days acc. to I.T. S. 32 ([#38697](https://github.com/frappe/erpnext/issues/38697)) ([753a1b5](https://github.com/frappe/erpnext/commit/753a1b511d2696d241625f285a7db59e29092bd3)) * calc monthly_repayment_amount correctly in regenerate_repayment_schedule ([#38636](https://github.com/frappe/erpnext/issues/38636)) ([008400d](https://github.com/frappe/erpnext/commit/008400d287c26f78909abb1b09bb52a5ea94c1b3)) * format only if searched text contain link value text ([b28deaa](https://github.com/frappe/erpnext/commit/b28deaae2c0e3784c7cbe585ded11d5354d65c9c)) * limit end date to current date ([cbe15e1](https://github.com/frappe/erpnext/commit/cbe15e159a3f97f2e057df74370dbd35b0c661b1)) * typo in unittest ([#38673](https://github.com/frappe/erpnext/issues/38673)) ([c87a3c7](https://github.com/frappe/erpnext/commit/c87a3c7793d577a6544b65148f59899a14e19b8b)) * **ux:** don't update qty blindly (backport [#38608](https://github.com/frappe/erpnext/issues/38608)) ([#38638](https://github.com/frappe/erpnext/issues/38638)) ([29cd474](https://github.com/frappe/erpnext/commit/29cd474f44844ace9409cf4f304ef950a84f5616)) ### Features * add employee number to client user bootinfo (backport [#38477](https://github.com/frappe/erpnext/issues/38477)) ([#38602](https://github.com/frappe/erpnext/issues/38602)) ([c2a137f](https://github.com/frappe/erpnext/commit/c2a137f0fb48e9322436ada3e3cce849a236d231)) ### Reverts * Revert "refactor: bank transaction (backport #38182)" (#38653) ([7813efa](https://github.com/frappe/erpnext/commit/7813efad356a56de595f887896562818f43cae23)), closes [#38182](https://github.com/frappe/erpnext/issues/38182) [#38653](https://github.com/frappe/erpnext/issues/38653) [#38182](https://github.com/frappe/erpnext/issues/38182) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 8406ce635b9..0cdb9d54802 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.53.0" +__version__ = "14.54.0" def get_default_company(user=None): From 4908d03a885eb5cfb5e2f82d770938dcac42dfcb Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 00:30:36 +0530 Subject: [PATCH 03/15] Revert "fix(ux): don't update qty blindly" (backport #38728) (backport #38729) (#38733) Revert "fix(ux): don't update qty blindly" (backport #38728) (#38729) Revert "fix(ux): don't update qty blindly" (#38728) (cherry picked from commit 6851c5042fc5e2d3f45d070af18a33c24fc10794) Co-authored-by: Ankush Menat (cherry picked from commit 0d49dd364858cba27623f2ea92c6b07e704b4a9a) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- erpnext/public/js/controllers/transaction.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index ff00a3ade16..050b9dcd3db 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -441,6 +441,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe item.pricing_rules = '' return this.frm.call({ method: "erpnext.stock.get_item_details.get_item_details", + child: item, args: { doc: me.frm.doc, args: { @@ -489,19 +490,6 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe callback: function(r) { if(!r.exc) { frappe.run_serially([ - () => { - var child = locals[cdt][cdn]; - var std_field_list = ["doctype"] - .concat(frappe.model.std_fields_list) - .concat(frappe.model.child_table_field_list); - - for (var key in r.message) { - if (std_field_list.indexOf(key) === -1) { - if (key === "qty" && child[key]) continue; - child[key] = r.message[key]; - } - } - }, () => { var d = locals[cdt][cdn]; me.add_taxes_from_item_tax_template(d.item_tax_rate); From d53a9f6530aef2d6096aa5a070d5165dfc4ef834 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 00:38:47 +0530 Subject: [PATCH 04/15] fix: supplier removed on selection of item (backport #38712) (backport #38732) (#38735) fix: supplier removed on selection of item (backport #38712) (#38732) fix: supplier removed on selection of item (#38712) (cherry picked from commit db24e2488247eef326ef52a88dbae8e828893e7e) Co-authored-by: rohitwaghchaure (cherry picked from commit dda95ea8922c0f6073d36edf3c0a525fbfc7295e) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- erpnext/stock/get_item_details.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index daa7becc1f4..e47971d03e8 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -391,7 +391,6 @@ def get_basic_details(args, item, overwrite_warehouse=True): "net_amount": 0.0, "discount_percentage": 0.0, "discount_amount": flt(args.discount_amount) or 0.0, - "supplier": get_default_supplier(args, item_defaults, item_group_defaults, brand_defaults), "update_stock": args.get("update_stock") if args.get("doctype") in ["Sales Invoice", "Purchase Invoice"] else 0, @@ -411,6 +410,10 @@ def get_basic_details(args, item, overwrite_warehouse=True): } ) + default_supplier = get_default_supplier(args, item_defaults, item_group_defaults, brand_defaults) + if default_supplier: + out.supplier = default_supplier + if item.get("enable_deferred_revenue") or item.get("enable_deferred_expense"): out.update(calculate_service_end_date(args, item)) From b7fd24074dad093a96123398b249c1f73e93019a Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Wed, 13 Dec 2023 19:09:56 +0000 Subject: [PATCH 05/15] chore(release): Bumped to Version 14.54.1 ## [14.54.1](https://github.com/frappe/erpnext/compare/v14.54.0...v14.54.1) (2023-12-13) ### Bug Fixes * supplier removed on selection of item (backport [#38712](https://github.com/frappe/erpnext/issues/38712)) (backport [#38732](https://github.com/frappe/erpnext/issues/38732)) ([#38735](https://github.com/frappe/erpnext/issues/38735)) ([d53a9f6](https://github.com/frappe/erpnext/commit/d53a9f6530aef2d6096aa5a070d5165dfc4ef834)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 0cdb9d54802..380cd4477b0 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.54.0" +__version__ = "14.54.1" def get_default_company(user=None): From cdef0bd503cd6683283c2776f24daa070320297b Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Wed, 13 Dec 2023 11:25:21 +0530 Subject: [PATCH 06/15] fix: fetch exc rate of multi currency journals (cherry picked from commit 1b3ba25220ca4ef96df5416331ee2f78376da64a) --- .../payment_reconciliation.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py index a907dc7acf5..6ce79ee3ea6 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py @@ -539,6 +539,27 @@ class PaymentReconciliation(Document): invoice_exchange_map.update(purchase_invoice_map) + journals = [ + d.get("invoice_number") for d in invoices if d.get("invoice_type") == "Journal Entry" + ] + journals.extend( + [d.get("reference_name") for d in payments if d.get("reference_type") == "Journal Entry"] + ) + if journals: + journals = list(set(journals)) + journals_map = frappe._dict( + frappe.db.get_all( + "Journal Entry Account", + filters={"parent": ("in", journals), "account": ("in", [self.receivable_payable_account])}, + fields=[ + "parent as `name`", + "exchange_rate", + ], + as_list=1, + ) + ) + invoice_exchange_map.update(journals_map) + return invoice_exchange_map def validate_allocation(self): From 20a26c3dd44a2a28af16ccd486594982498a9c3a Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Thu, 14 Dec 2023 06:20:30 +0000 Subject: [PATCH 07/15] chore(release): Bumped to Version 14.54.2 ## [14.54.2](https://github.com/frappe/erpnext/compare/v14.54.1...v14.54.2) (2023-12-14) ### Bug Fixes * fetch exc rate of multi currency journals ([cdef0bd](https://github.com/frappe/erpnext/commit/cdef0bd503cd6683283c2776f24daa070320297b)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 380cd4477b0..585f8126daf 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.54.1" +__version__ = "14.54.2" def get_default_company(user=None): From 8657ba374a9f7e43279eb71104e29b0be53e3bf0 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Wed, 20 Dec 2023 04:46:08 +0000 Subject: [PATCH 08/15] chore(release): Bumped to Version 14.55.0 # [14.55.0](https://github.com/frappe/erpnext/compare/v14.54.2...v14.55.0) (2023-12-20) ### Bug Fixes * close PO on SCO close (backport [#38667](https://github.com/frappe/erpnext/issues/38667)) ([#38680](https://github.com/frappe/erpnext/issues/38680)) ([22b442d](https://github.com/frappe/erpnext/commit/22b442d593182184cb98a994520109737b8e479c)) * **customer:** contact creation for companies ([#38055](https://github.com/frappe/erpnext/issues/38055)) ([ed9b38b](https://github.com/frappe/erpnext/commit/ed9b38bc8d32dd7b03a221b92828dc05d7cc2df9)) * **customer:** quick form and integration fixes ([#37386](https://github.com/frappe/erpnext/issues/37386)) ([6ed7c66](https://github.com/frappe/erpnext/commit/6ed7c6610acf328b1378597d4361f9bc707cb2fa)) * error while filtering on name on reconciliation tool ([30b6321](https://github.com/frappe/erpnext/commit/30b6321fd5f471f0678552e5f728c4ec5f1bf746)) * fetch exc rate of multi currency journals ([bf585de](https://github.com/frappe/erpnext/commit/bf585de558ca7ac1ba08230177fbd1429b120568)) * fetch item_tax_template values if fields with fetch_from exisit ([24ae45c](https://github.com/frappe/erpnext/commit/24ae45ce84b98e68759fb285b9856dc4f1ac72f7)) * get customers for leaderboard ([9dfe342](https://github.com/frappe/erpnext/commit/9dfe3428383e8b7cbfc0cce343d98cddcde039a8)) * get items for leaderboard ([812b301](https://github.com/frappe/erpnext/commit/812b301aaba35f7bcb490da11047662f46077927)) * get sales partner for leaderboard ([c63f873](https://github.com/frappe/erpnext/commit/c63f873a6f731731785b921351f35cc56a00f98a)) * get sales person for leaderboard ([df93447](https://github.com/frappe/erpnext/commit/df93447d3039c2141c0d088383a10cc53f389777)) * get suppliers for leaderboard ([7477ff3](https://github.com/frappe/erpnext/commit/7477ff3b5cb7ef49c1642b901e32fc5fa295c855)) * if not budget then don't validate ([#38861](https://github.com/frappe/erpnext/issues/38861)) ([d375164](https://github.com/frappe/erpnext/commit/d375164100158db9b974742caa3e05062c481d7d)) * incoming rate for sales return with Moving Average valuation method ([#38849](https://github.com/frappe/erpnext/issues/38849)) ([7fdac62](https://github.com/frappe/erpnext/commit/7fdac62393ee1e96969cca38a4ce0c07993dce7e)) * incorrect limit ([#38818](https://github.com/frappe/erpnext/issues/38818)) ([e18dc5c](https://github.com/frappe/erpnext/commit/e18dc5cea37302aec374bb34cbd980a01ced6b35)) * Init internal child table values ([d593f81](https://github.com/frappe/erpnext/commit/d593f81a1604e408128f7c031d11bf21ffa42a13)) * item variant with manufacturer ([#38845](https://github.com/frappe/erpnext/issues/38845)) ([e0c8ff1](https://github.com/frappe/erpnext/commit/e0c8ff10daeed0829266aea9142805f68ceedb2b)) * not able to cancel SCR with Batch ([#38817](https://github.com/frappe/erpnext/issues/38817)) ([fb5090f](https://github.com/frappe/erpnext/commit/fb5090fd3f23ada507fe8abc5a899f4b06e48d7e)) * not able to make inter-company po from so ([#38826](https://github.com/frappe/erpnext/issues/38826)) ([23042df](https://github.com/frappe/erpnext/commit/23042dfc3c0d02374c5710ed679731b1910f9b9a)) * on closed unreserved the production plan qty ([#38848](https://github.com/frappe/erpnext/issues/38848)) ([2184e8e](https://github.com/frappe/erpnext/commit/2184e8ef58379f53ef8f1d069afa26e64796b073)) * Reset SLA on issue doesn't work (backport [#38789](https://github.com/frappe/erpnext/issues/38789)) ([#38790](https://github.com/frappe/erpnext/issues/38790)) ([942f34a](https://github.com/frappe/erpnext/commit/942f34a73456530ce6bd3723ed7adb10cbb83731)) * supplier removed on selection of item (backport [#38712](https://github.com/frappe/erpnext/issues/38712)) ([#38732](https://github.com/frappe/erpnext/issues/38732)) ([dda95ea](https://github.com/frappe/erpnext/commit/dda95ea8922c0f6073d36edf3c0a525fbfc7295e)) * timezone aware SLA banner (backport [#38745](https://github.com/frappe/erpnext/issues/38745)) ([#38746](https://github.com/frappe/erpnext/issues/38746)) ([73d525e](https://github.com/frappe/erpnext/commit/73d525e84da63a4392501b76111d895fdef6498c)) * **ux:** don't override Item Name and Description in MR (backport [#38720](https://github.com/frappe/erpnext/issues/38720)) ([#38762](https://github.com/frappe/erpnext/issues/38762)) ([f7bfbd8](https://github.com/frappe/erpnext/commit/f7bfbd82dd9eb82780bfad60194a4348ba2f03fa)) * validation error on reconciling PE to Journals as Invoice ([9836205](https://github.com/frappe/erpnext/commit/9836205725ae8891a76a462937700322177fe1dd)) * wrong currency in Stock Balance report (backport [#38778](https://github.com/frappe/erpnext/issues/38778)) ([#38779](https://github.com/frappe/erpnext/issues/38779)) ([e05b23c](https://github.com/frappe/erpnext/commit/e05b23c38825039c85648557c572c26a3fc913a4)) * wrong paid and cn amount on pos invoice ([77da0da](https://github.com/frappe/erpnext/commit/77da0da945583e153ef2b7b5a55e28a322d072d3)) ### Features * **RFQ:** special properties in print preview (backport [#38725](https://github.com/frappe/erpnext/issues/38725)) ([#38726](https://github.com/frappe/erpnext/issues/38726)) ([2290750](https://github.com/frappe/erpnext/commit/229075048bd17d945da6ef2b8af71f500db7e8ea)) * set lead name from email ([1469ca7](https://github.com/frappe/erpnext/commit/1469ca7d0b8d7b60da991a8e3b682517113481f3)) ### Performance Improvements * index `return_against` on delivery note (backport [#38827](https://github.com/frappe/erpnext/issues/38827)) ([#38831](https://github.com/frappe/erpnext/issues/38831)) ([4114760](https://github.com/frappe/erpnext/commit/4114760efd0628a2502cff4f4e0a81c54e4eeeb4)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 585f8126daf..634a41ce6e3 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.54.2" +__version__ = "14.55.0" def get_default_company(user=None): From afc049154d468abc056b628105680852d513b696 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 18:34:31 +0530 Subject: [PATCH 09/15] fix: allow to set rate manually for service item in BOM (backport #38880) (#38881) fix: allow to set rate manually for service item in BOM (#38880) (cherry picked from commit c2f692a4e4f3dd5089fe4949c6cd74574282fdb1) Co-authored-by: rohitwaghchaure --- erpnext/manufacturing/doctype/bom/bom.py | 3 ++ erpnext/manufacturing/doctype/bom/test_bom.py | 29 +++++++++++++++++++ .../doctype/bom_item/bom_item.json | 13 +++++++-- erpnext/patches.txt | 1 + .../v14_0/set_maintain_stock_for_bom_item.py | 19 ++++++++++++ 5 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 erpnext/patches/v14_0/set_maintain_stock_for_bom_item.py diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 6151af7e3ef..c22af3f22cb 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -661,6 +661,9 @@ class BOM(WebsiteGenerator): base_total_rm_cost = 0 for d in self.get("items"): + if not d.is_stock_item and self.rm_cost_as_per == "Valuation Rate": + continue + old_rate = d.rate d.rate = self.get_rm_rate( { diff --git a/erpnext/manufacturing/doctype/bom/test_bom.py b/erpnext/manufacturing/doctype/bom/test_bom.py index 051b475bcc3..2debf9191ef 100644 --- a/erpnext/manufacturing/doctype/bom/test_bom.py +++ b/erpnext/manufacturing/doctype/bom/test_bom.py @@ -698,6 +698,35 @@ class TestBOM(FrappeTestCase): bom.update_cost() self.assertFalse(bom.flags.cost_updated) + def test_bom_with_service_item_cost(self): + from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry + + rm_item = make_item(properties={"is_stock_item": 1, "valuation_rate": 1000.0}).name + + service_item = make_item(properties={"is_stock_item": 0}).name + + fg_item = make_item(properties={"is_stock_item": 1}).name + + from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom + + bom = make_bom(item=fg_item, raw_materials=[rm_item, service_item], do_not_save=True) + bom.rm_cost_as_per = "Valuation Rate" + + for row in bom.items: + if row.item_code == service_item: + row.rate = 566.00 + else: + row.rate = 800.00 + + bom.save() + + for row in bom.items: + if row.item_code == service_item: + self.assertEqual(row.is_stock_item, 0) + self.assertEqual(row.rate, 566.00) + else: + self.assertEqual(row.is_stock_item, 1) + def test_do_not_include_manufacturing_and_fixed_items(self): from erpnext.manufacturing.doctype.bom.bom import item_query diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.json b/erpnext/manufacturing/doctype/bom_item/bom_item.json index cb58af1f29a..dfd66120984 100644 --- a/erpnext/manufacturing/doctype/bom_item/bom_item.json +++ b/erpnext/manufacturing/doctype/bom_item/bom_item.json @@ -14,6 +14,7 @@ "bom_no", "source_warehouse", "allow_alternative_item", + "is_stock_item", "section_break_5", "description", "col_break1", @@ -185,7 +186,7 @@ "in_list_view": 1, "label": "Rate", "options": "currency", - "read_only": 1, + "read_only_depends_on": "eval:doc.is_stock_item == 1", "reqd": 1 }, { @@ -284,13 +285,21 @@ "fieldname": "do_not_explode", "fieldtype": "Check", "label": "Do Not Explode" + }, + { + "default": "0", + "fetch_from": "item_code.is_stock_item", + "fieldname": "is_stock_item", + "fieldtype": "Check", + "label": "Is Stock Item", + "read_only": 1 } ], "idx": 1, "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2023-11-14 18:35:51.378513", + "modified": "2023-12-20 16:21:55.477883", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM Item", diff --git a/erpnext/patches.txt b/erpnext/patches.txt index d96f45fd676..e0130c57e14 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -355,3 +355,4 @@ erpnext.patches.v14_0.clear_reconciliation_values_from_singles # below migration patch should always run last erpnext.patches.v14_0.migrate_gl_to_payment_ledger erpnext.stock.doctype.delivery_note.patches.drop_unused_return_against_index +erpnext.patches.v14_0.set_maintain_stock_for_bom_item \ No newline at end of file diff --git a/erpnext/patches/v14_0/set_maintain_stock_for_bom_item.py b/erpnext/patches/v14_0/set_maintain_stock_for_bom_item.py new file mode 100644 index 00000000000..f0b618f32d4 --- /dev/null +++ b/erpnext/patches/v14_0/set_maintain_stock_for_bom_item.py @@ -0,0 +1,19 @@ +import frappe + + +def execute(): + if not frappe.db.exists("BOM", {"docstatus": 1}): + return + + # Added is_stock_item to handle Read Only based on condition for the rate field + frappe.db.sql( + """ + UPDATE + `tabBOM Item` boi, + `tabItem` i + SET + boi.is_stock_item = i.is_stock_item + WHERE + boi.item_code = i.name + """ + ) From eefac19cc824a714bcd9b30bc80c8683596b6e96 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Wed, 20 Dec 2023 13:06:21 +0000 Subject: [PATCH 10/15] chore(release): Bumped to Version 14.55.1 ## [14.55.1](https://github.com/frappe/erpnext/compare/v14.55.0...v14.55.1) (2023-12-20) ### Bug Fixes * allow to set rate manually for service item in BOM (backport [#38880](https://github.com/frappe/erpnext/issues/38880)) ([#38881](https://github.com/frappe/erpnext/issues/38881)) ([afc0491](https://github.com/frappe/erpnext/commit/afc049154d468abc056b628105680852d513b696)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 634a41ce6e3..479473d991f 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.55.0" +__version__ = "14.55.1" def get_default_company(user=None): From 8aba707b6aaa7e89355d2b5afe81f625804f6506 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 21 Dec 2023 15:34:49 +0530 Subject: [PATCH 11/15] =?UTF-8?q?fix:=20reposting=20not=20fixing=20valuati?= =?UTF-8?q?on=20rate=20for=20sales=20return=20using=20movin=E2=80=A6=20(ba?= =?UTF-8?q?ckport=20#38895)=20(#38900)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: reposting not fixing valuation rate for sales return using movin… (#38895) fix: reposting not fixing valuation rate for sales return using moving average method (cherry picked from commit 3a668bbe9694fdd6e8265869c6943e42f889ac41) Co-authored-by: rohitwaghchaure --- erpnext/controllers/selling_controller.py | 4 +- .../delivery_note/test_delivery_note.py | 53 +++++++++++++++++++ erpnext/stock/stock_ledger.py | 19 ++++++- 3 files changed, 74 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index bac94f98af4..d3157e7037b 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -428,7 +428,9 @@ class SellingController(StockController): # Get incoming rate based on original item cost based on valuation method qty = flt(d.get("stock_qty") or d.get("actual_qty")) - if not d.incoming_rate: + if not d.incoming_rate or ( + get_valuation_method(d.item_code) == "Moving Average" and self.get("is_return") + ): d.incoming_rate = get_incoming_rate( { "item_code": d.item_code, diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py index 476b4959813..a931ee2c254 100644 --- a/erpnext/stock/doctype/delivery_note/test_delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py @@ -1382,6 +1382,59 @@ class TestDeliveryNote(FrappeTestCase): self.assertAlmostEqual(dn1.items[0].incoming_rate, 250.0) + def test_sales_return_valuation_for_moving_average_case2(self): + # Make DN return + # Make Bakcdated Purchase Receipt and check DN return valuation rate + # The rate should be recalculate based on the backdated purchase receipt + frappe.flags.print_debug_messages = False + item_code = make_item( + "_Test Item Sales Return with MA Case2", + {"is_stock_item": 1, "valuation_method": "Moving Average", "stock_uom": "Nos"}, + ).name + + make_stock_entry( + item_code=item_code, + target="_Test Warehouse - _TC", + qty=5, + basic_rate=100.0, + posting_date=add_days(nowdate(), -5), + ) + + dn = create_delivery_note( + item_code=item_code, + warehouse="_Test Warehouse - _TC", + qty=5, + rate=500, + posting_date=add_days(nowdate(), -4), + ) + + returned_dn = create_delivery_note( + is_return=1, + item_code=item_code, + return_against=dn.name, + qty=-5, + rate=500, + company=dn.company, + warehouse="_Test Warehouse - _TC", + expense_account="Cost of Goods Sold - _TC", + cost_center="Main - _TC", + posting_date=add_days(nowdate(), -1), + ) + + self.assertAlmostEqual(returned_dn.items[0].incoming_rate, 100.0) + + # Make backdated purchase receipt + make_stock_entry( + item_code=item_code, + target="_Test Warehouse - _TC", + qty=5, + basic_rate=200.0, + posting_date=add_days(nowdate(), -3), + ) + + returned_dn.reload() + self.assertAlmostEqual(returned_dn.items[0].incoming_rate, 200.0) + def create_delivery_note(**args): dn = frappe.new_doc("Delivery Note") diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 8a262497926..df1f544d7b1 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -16,6 +16,7 @@ from erpnext.stock.doctype.bin.bin import update_qty as update_bin_qty from erpnext.stock.doctype.inventory_dimension.inventory_dimension import get_inventory_dimensions from erpnext.stock.utils import ( get_incoming_outgoing_rate_for_cancel, + get_incoming_rate, get_or_make_bin, get_valuation_method, ) @@ -701,7 +702,23 @@ class update_entries_after(object): ) if self.valuation_method == "Moving Average": - rate = flt(self.data[self.args.warehouse].previous_sle.valuation_rate) + rate = get_incoming_rate( + { + "item_code": sle.item_code, + "warehouse": sle.warehouse, + "posting_date": sle.posting_date, + "posting_time": sle.posting_time, + "qty": sle.actual_qty, + "serial_no": sle.get("serial_no"), + "batch_no": sle.get("batch_no"), + "company": sle.company, + "voucher_type": sle.voucher_type, + "voucher_no": sle.voucher_no, + "allow_zero_valuation": self.allow_zero_rate, + "sle": sle.name, + } + ) + else: rate = get_rate_for_return( sle.voucher_type, From 0c13cb829cc95f2dff30b2276ada489ab74e39cc Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Thu, 21 Dec 2023 10:05:58 +0000 Subject: [PATCH 12/15] chore(release): Bumped to Version 14.55.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [14.55.2](https://github.com/frappe/erpnext/compare/v14.55.1...v14.55.2) (2023-12-21) ### Bug Fixes * reposting not fixing valuation rate for sales return using movin… (backport [#38895](https://github.com/frappe/erpnext/issues/38895)) ([#38900](https://github.com/frappe/erpnext/issues/38900)) ([8aba707](https://github.com/frappe/erpnext/commit/8aba707b6aaa7e89355d2b5afe81f625804f6506)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 479473d991f..ee200eeba9e 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.55.1" +__version__ = "14.55.2" def get_default_company(user=None): From a63b8df86722bf51b2dd534522331a24cd3f3340 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:10:04 +0530 Subject: [PATCH 13/15] feat: total_asset_cost field (backport #38879) (backport #38886) (#38907) feat: total_asset_cost field (backport #38879) (#38886) * feat: total_asset_cost field (#38879) (cherry picked from commit d370c60a6c840be23ec4094593b9bbf1d1dca88b) # Conflicts: # erpnext/assets/doctype/asset/asset.json # erpnext/assets/doctype/asset/asset.py # erpnext/patches.txt * chore: resolve conflicts in asset.json * chore: resolve conflicts in asset.py * chore: resolve conflicts in patches.txt --------- Co-authored-by: Anand Baburajan (cherry picked from commit 8169c7de0d06ce031f44c30016d1f17744655bf5) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- erpnext/assets/doctype/asset/asset.json | 13 +++++++++++-- .../assets/doctype/asset_repair/asset_repair.py | 6 ++++++ erpnext/patches.txt | 3 ++- .../v14_0/update_total_asset_cost_field.py | 17 +++++++++++++++++ 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 erpnext/patches/v14_0/update_total_asset_cost_field.py diff --git a/erpnext/assets/doctype/asset/asset.json b/erpnext/assets/doctype/asset/asset.json index 3b0d5d5e7fb..3dc8d29542f 100644 --- a/erpnext/assets/doctype/asset/asset.json +++ b/erpnext/assets/doctype/asset/asset.json @@ -35,6 +35,7 @@ "purchase_receipt", "purchase_invoice", "available_for_use_date", + "total_asset_cost", "column_break_23", "gross_purchase_amount", "asset_quantity", @@ -532,6 +533,14 @@ "label": "Capitalized In", "options": "Asset Capitalization", "read_only": 1 + }, + { + "depends_on": "eval:doc.docstatus > 0", + "fieldname": "total_asset_cost", + "fieldtype": "Currency", + "label": "Total Asset Cost", + "options": "Company:company:default_currency", + "read_only": 1 } ], "idx": 72, @@ -565,7 +574,7 @@ "link_fieldname": "target_asset" } ], - "modified": "2023-11-20 21:05:45.216899", + "modified": "2023-12-20 16:50:21.128595", "modified_by": "Administrator", "module": "Assets", "name": "Asset", @@ -609,4 +618,4 @@ "states": [], "title_field": "asset_name", "track_changes": 1 -} \ No newline at end of file +} diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.py b/erpnext/assets/doctype/asset_repair/asset_repair.py index 47453e30308..f978e768af4 100644 --- a/erpnext/assets/doctype/asset_repair/asset_repair.py +++ b/erpnext/assets/doctype/asset_repair/asset_repair.py @@ -46,6 +46,9 @@ class AssetRepair(AccountsController): self.increase_asset_value() + if self.capitalize_repair_cost: + self.asset_doc.total_asset_cost += self.repair_cost + if self.get("stock_consumption"): self.check_for_stock_items_and_warehouse() self.decrease_stock_quantity() @@ -68,6 +71,9 @@ class AssetRepair(AccountsController): self.decrease_asset_value() + if self.capitalize_repair_cost: + self.asset_doc.total_asset_cost -= self.repair_cost + if self.get("stock_consumption"): self.increase_stock_quantity() if self.get("capitalize_repair_cost"): diff --git a/erpnext/patches.txt b/erpnext/patches.txt index e0130c57e14..c755a90818d 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -352,7 +352,8 @@ erpnext.patches.v14_0.create_accounting_dimensions_in_supplier_quotation erpnext.patches.v14_0.update_zero_asset_quantity_field execute:frappe.db.set_single_value("Buying Settings", "project_update_frequency", "Each Transaction") erpnext.patches.v14_0.clear_reconciliation_values_from_singles +erpnext.patches.v14_0.update_total_asset_cost_field # below migration patch should always run last erpnext.patches.v14_0.migrate_gl_to_payment_ledger erpnext.stock.doctype.delivery_note.patches.drop_unused_return_against_index -erpnext.patches.v14_0.set_maintain_stock_for_bom_item \ No newline at end of file +erpnext.patches.v14_0.set_maintain_stock_for_bom_item diff --git a/erpnext/patches/v14_0/update_total_asset_cost_field.py b/erpnext/patches/v14_0/update_total_asset_cost_field.py new file mode 100644 index 00000000000..57cf71b6134 --- /dev/null +++ b/erpnext/patches/v14_0/update_total_asset_cost_field.py @@ -0,0 +1,17 @@ +import frappe + + +def execute(): + asset = frappe.qb.DocType("Asset") + frappe.qb.update(asset).set(asset.total_asset_cost, asset.gross_purchase_amount).run() + + asset_repair_list = frappe.db.get_all( + "Asset Repair", + filters={"docstatus": 1, "repair_status": "Completed", "capitalize_repair_cost": 1}, + fields=["asset", "repair_cost"], + ) + + for asset_repair in asset_repair_list: + frappe.qb.update(asset).set( + asset.total_asset_cost, asset.total_asset_cost + asset_repair.repair_cost + ).where(asset.name == asset_repair.asset).run() From 3abb91b2c4299ad96330ba66e992bd9ba7d60763 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Thu, 21 Dec 2023 11:41:51 +0000 Subject: [PATCH 14/15] chore(release): Bumped to Version 14.56.0 # [14.56.0](https://github.com/frappe/erpnext/compare/v14.55.2...v14.56.0) (2023-12-21) ### Features * total_asset_cost field (backport [#38879](https://github.com/frappe/erpnext/issues/38879)) (backport [#38886](https://github.com/frappe/erpnext/issues/38886)) ([#38907](https://github.com/frappe/erpnext/issues/38907)) ([a63b8df](https://github.com/frappe/erpnext/commit/a63b8df86722bf51b2dd534522331a24cd3f3340)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index ee200eeba9e..85dbe99af84 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.55.2" +__version__ = "14.56.0" def get_default_company(user=None): From 0d7cb1a9be9d76bc29dd88eca18b3731b106ec57 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:12:01 +0530 Subject: [PATCH 15/15] chore: additional_asset_cost field (backport #38904) (backport #38905) (#38908) chore: additional_asset_cost field (backport #38904) (#38905) * chore: additional_asset_cost field (#38904) (cherry picked from commit 283763dfb2affa6a0b7bb29e19123c3e1fb27f30) # Conflicts: # erpnext/assets/doctype/asset/asset.py * chore: resolve conflicts in asset.py --------- Co-authored-by: Anand Baburajan (cherry picked from commit 3b9feffc00ec6c1f0e99bd4670030efc71509595) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- erpnext/assets/doctype/asset/asset.json | 11 ++++++++++- erpnext/assets/doctype/asset/asset.py | 1 + erpnext/assets/doctype/asset_repair/asset_repair.py | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/erpnext/assets/doctype/asset/asset.json b/erpnext/assets/doctype/asset/asset.json index 3dc8d29542f..91ae62bfad7 100644 --- a/erpnext/assets/doctype/asset/asset.json +++ b/erpnext/assets/doctype/asset/asset.json @@ -36,6 +36,7 @@ "purchase_invoice", "available_for_use_date", "total_asset_cost", + "additional_asset_cost", "column_break_23", "gross_purchase_amount", "asset_quantity", @@ -541,6 +542,14 @@ "label": "Total Asset Cost", "options": "Company:company:default_currency", "read_only": 1 + }, + { + "depends_on": "eval:doc.docstatus > 0", + "fieldname": "additional_asset_cost", + "fieldtype": "Currency", + "label": "Additional Asset Cost", + "options": "Company:company:default_currency", + "read_only": 1 } ], "idx": 72, @@ -574,7 +583,7 @@ "link_fieldname": "target_asset" } ], - "modified": "2023-12-20 16:50:21.128595", + "modified": "2023-12-21 16:46:20.732869", "modified_by": "Administrator", "module": "Assets", "name": "Asset", diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py index 92a349abb3e..f83d7071aa7 100644 --- a/erpnext/assets/doctype/asset/asset.py +++ b/erpnext/assets/doctype/asset/asset.py @@ -48,6 +48,7 @@ class Asset(AccountsController): if self.get("schedules"): self.validate_expected_value_after_useful_life() + self.total_asset_cost = self.gross_purchase_amount self.status = self.get_status() def on_submit(self): diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.py b/erpnext/assets/doctype/asset_repair/asset_repair.py index f978e768af4..b348e13ca83 100644 --- a/erpnext/assets/doctype/asset_repair/asset_repair.py +++ b/erpnext/assets/doctype/asset_repair/asset_repair.py @@ -48,6 +48,7 @@ class AssetRepair(AccountsController): if self.capitalize_repair_cost: self.asset_doc.total_asset_cost += self.repair_cost + self.asset_doc.additional_asset_cost += self.repair_cost if self.get("stock_consumption"): self.check_for_stock_items_and_warehouse() @@ -73,6 +74,7 @@ class AssetRepair(AccountsController): if self.capitalize_repair_cost: self.asset_doc.total_asset_cost -= self.repair_cost + self.asset_doc.additional_asset_cost -= self.repair_cost if self.get("stock_consumption"): self.increase_stock_quantity()