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

fix: reposting failed status not updated #39970

Conversation

rohitwaghchaure
Copy link
Collaborator

If the reposting failed because of Accounting Period validation or any other validation then status was remaining as "In Progress" and not failed. User has to check the scheduled job log to check the error which is difficult for the non devs to understand.

Issue

The status was not updating because the frappe.message_log returns the dict in v15 where as it returns the string in the v14

  File "apps/erpnext/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py", line 298, in repost
    message += "<br>" + "Traceback: <br>" + traceback
      doc = <RepostItemValuation: 61631fc14b docstatus=1>
      traceback = 'Traceback with variables (most recent call last):\n  File "apps/erpnext/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py", line 281, in repost\n    repost_gl_entries(doc)\n      doc = <RepostItemValuation: 61631fc14b docstatus=1>\n      e = ClosedAccountingPeriod(\'You cannot create or cancel any accounting entries with in the closed Accounting Period test Test - FT\')\n  File "apps/erpnext/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py", line 358, in repost_gl_entries\n    repost_gle_for_stock_vouchers(\n      doc = <RepostItemValuation: 61631fc14b docstatus=1>\n      directly_dependent_transactions = [(\'Purchase Receipt\', \'MAT-PRE-2024-00041\'), (\'Purchase Receipt\', \'MAT-PRE-2024-00040-1\'), (\'Stock Entry\', \'MAT-STE-2023-00049\'), (\'Delivery Note\', \'MAT-DN-2023-00026\'), (\'Stock Entry\', \'MAT-STE-2023-00050\'), (\'Delivery Note\', \'MAT-DN-2023-00027\'), (\'Stock Entry\', \'MAT-STE-2023-00051\'), (\'Delivery Note\', \'MAT-DN-20...
      message = {'message': 'You cannot create or cancel any accounting entries with in the closed Accounting Period <strong>test Test - FT</strong>', 'title': 'Message', 'indicator': 'red', 'raise_exception': 1, '__frappe_exc_id': 'f0e63def1182a4d21a147c3a2c776be1423280449adcb959aee7017e'}
builtins.TypeError: unsupported operand type(s) for +=: '_dict' and 'str'

After Fix

The status has changed to Failed for the repost item valuation with error log

Screenshot 2024-02-20 at 11 50 07 AM

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Feb 20, 2024
@rohitwaghchaure rohitwaghchaure added backport version-15-hotfix and removed needs-tests This PR needs automated unit-tests. labels Feb 20, 2024
@rohitwaghchaure rohitwaghchaure merged commit d4264f7 into frappe:develop Feb 20, 2024
14 checks passed
mergify bot pushed a commit that referenced this pull request Feb 20, 2024
rohitwaghchaure added a commit that referenced this pull request Feb 20, 2024
fix: reposting failed status not updated (#39970)

(cherry picked from commit d4264f7)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
frappe-pr-bot pushed a commit that referenced this pull request Feb 21, 2024
## [15.14.4](v15.14.3...v15.14.4) (2024-02-21)

### Bug Fixes

* 'NoneType' object is not iterable (backport [#39977](#39977)) ([#39981](#39981)) ([0f87ec1](0f87ec1))
* **Bank Transaction:** precision for `(un)allocated_amount` ([bf5d2f5](bf5d2f5))
* batch filter not working in stock ledger report (backport [#39934](#39934)) ([#39935](#39935)) ([1513595](1513595))
* do not empty serial batch fields (backport [#39948](#39948)) ([#39956](#39956)) ([acd2e93](acd2e93))
* fetch company terms ([14fe0af](14fe0af))
* float division by zero ([b954bdf](b954bdf))
* group node in warehouse filter in Item-wise Sales Register ([74819b8](74819b8))
* **Issue:** create communication ([f5d7fbd](f5d7fbd))
* no need call for company method in sales invoice js ([bef38f7](bef38f7))
* not able to make purchase receipt ([3732946](3732946))
* party item code in Blanket Order ([518b22b](518b22b))
* reposting failed status not updated (backport [#39970](#39970)) ([#39972](#39972)) ([46f7569](46f7569))
* set batch created from bundle to batch field in stock transaction (backport [#39966](#39966)) ([#39987](#39987)) ([2ee51d3](2ee51d3))
* show active bom in the dropdown while making stock entry and MR (backport [#39974](#39974)) ([#39976](#39976)) ([7201448](7201448))
* update_dimension is required and not need party account method ([a56d5b8](a56d5b8))
* use serial batch fields not enabled for new stock entry ([40d4e32](40d4e32))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant