Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue of asset value_after_depreciation field getting updated twice if workflow is enabled in Journal Entry #35821

Merged
merged 4 commits into from
Jun 21, 2023

Conversation

saeedkola
Copy link
Contributor

@saeedkola saeedkola commented Jun 21, 2023

Please provide enough information so that others can review your pull request:

Explain the details for making this change. What existing problem does the pull request solve?

The asset value_after_depreciation field is getting updated 2 times if workflow is enabled on the Journal Entry Doctype
The make_depreciation_entry def checks if workflow exists for JE, and leaves the depreciation entry in draft state, but it still updates the value_after_depreciation field in the finance_book table of the asset.
And after the workflow is completed the update_asset_value() method updates it again, reducing it even further, for the same depreciation entry

This fix will not update the asset value if JE has workflow, it will only update when JE is submitted

Screenshots/GIFs
Asset depreciation issue

…wice if workflow is enabled in Journal Entry
@anandbaburajan
Copy link
Contributor

Thanks @saeedkola! LGTM.

@anandbaburajan anandbaburajan added backport develop instructs mergify to frontport PR to develop branch backport version-14-hotfix backport to version 14 labels Jun 21, 2023
@anandbaburajan anandbaburajan merged commit 000ebe4 into frappe:version-13-hotfix Jun 21, 2023
mergify bot pushed a commit that referenced this pull request Jun 21, 2023
…wice if workflow is enabled in Journal Entry (#35821)

* Fixes issue of asset value_after_depreciation field getting updated twice if workflow is enabled in Journal Entry

* chore: remove unnecessary line break

* chore: formatting

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit 000ebe4)

# Conflicts:
#	erpnext/assets/doctype/asset/depreciation.py
mergify bot pushed a commit that referenced this pull request Jun 21, 2023
…wice if workflow is enabled in Journal Entry (#35821)

* Fixes issue of asset value_after_depreciation field getting updated twice if workflow is enabled in Journal Entry

* chore: remove unnecessary line break

* chore: formatting

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit 000ebe4)
anandbaburajan pushed a commit that referenced this pull request Jun 21, 2023
…ice if workflow is enabled in Journal Entry (backport #35821) (#35827)

Fixes issue of asset value_after_depreciation field getting updated twice if workflow is enabled in Journal Entry (#35821)

* Fixes issue of asset value_after_depreciation field getting updated twice if workflow is enabled in Journal Entry

* chore: remove unnecessary line break

* chore: formatting

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit 000ebe4)

Co-authored-by: saeedkola <mohammedsaeedk@gmail.com>
anandbaburajan added a commit that referenced this pull request Jun 21, 2023
…ice if workflow is enabled in Journal Entry (backport #35821) (#35826)

* Fixes issue of asset value_after_depreciation field getting updated twice if workflow is enabled in Journal Entry (#35821)

* Fixes issue of asset value_after_depreciation field getting updated twice if workflow is enabled in Journal Entry

* chore: remove unnecessary line break

* chore: formatting

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit 000ebe4)

# Conflicts:
#	erpnext/assets/doctype/asset/depreciation.py

* chore: resolve conflicts

---------

Co-authored-by: saeedkola <mohammedsaeedk@gmail.com>
Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
@saeedkola saeedkola deleted the version-13-hotfix branch June 22, 2023 05:42
frappe-pr-bot pushed a commit that referenced this pull request Jun 28, 2023
# [14.28.0](v14.27.14...v14.28.0) (2023-06-28)

### Bug Fixes

* asset capitalization ([#35832](#35832)) ([fb823b5](fb823b5))
* asset movement ([#35918](#35918)) ([e16c148](e16c148))
* delivery trip driver is only required on submit (backport [#35876](#35876)) ([#35893](#35893)) ([fc051d1](fc051d1))
* don't allow to make reposting entry for closing stock balance period ([e68b088](e68b088))
* filter parent warehouses not showing (backport [#35897](#35897)) ([#35899](#35899)) ([87ba196](87ba196))
* incorrect cost center error in bank reconciliation ([cacb0f6](cacb0f6))
* issue of asset value_after_depreciation field getting updated twice if workflow is enabled in Journal Entry (backport [#35821](#35821)) ([#35827](#35827)) ([20f2bef](20f2bef))
* make credit note and debit note exclusive ([#35781](#35781)) ([fafb46e](fafb46e))
* multiple Work Orders agaist same production plan ([8ddfc34](8ddfc34))
* no permission for accounts settings on payment reconciliation ([200ddbf](200ddbf))
* Payment Term must be mandatory if `Allocate Payment based on ..` is checked ([#35798](#35798)) ([3dd3935](3dd3935))
* POS Closing Entry load all invoices with one request on save ([#35819](#35819)) ([8ecca2a](8ecca2a))
* reconcile invoice against credit note. ([#35604](#35604)) ([5c388a1](5c388a1))
* Remove special treatment for P&L Accounts ([#35602](#35602)) ([b023448](b023448))
* Set Asset cost center default as PR or PI Item Cost Center while auto creating ([#35844](#35844)) ([4a7d75b](4a7d75b))
* show non-depreciable assets in fixed asset register ([#35858](#35858)) ([42d0944](42d0944))
* TDS amount calculation post LDC breach ([851b887](851b887))
* use correct fieldname for purchase receipt column in item_wise_purchase_register report ([#35828](#35828)) ([8f13b48](8f13b48))
* **ux:** PO Get Items From Open Material Requests (backport [#35894](#35894)) ([#35895](#35895)) ([2ef2057](2ef2057))

### Features

* Auto set Party in Bank Transaction ([#34675](#34675)) ([d53b197](d53b197))
* Provision to send Accounts Receivable Reports using Process SOA ([#35789](#35789)) ([21d560c](21d560c)), closes [#35707](#35707)

### Performance Improvements

* improve item wise register reports ([#35908](#35908)) ([33ee011](33ee011))
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 13.51.7 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport develop instructs mergify to frontport PR to develop branch backport version-14-hotfix backport to version 14 released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants