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: patch #44191

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Conversation

rohitwaghchaure
Copy link
Collaborator

Patch failing while migrating from v13 to v14

 File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v13_0/item_reposting_for_incorrect_sl_and_gl.py", line 61, in execute
    update_entries_after(
      doctypes_to_reload = [('setup', 'company'), ('stock', 'repost_item_valuation'), ('stock', 'stock_entry_detail'), ('stock', 'purchase_receipt_item'), ('stock', 'delivery_note_item'), ('stock', 'packed_item'), ('accounts', 'sales_invoice_item'), ('accounts', 'purchase_invoice_item'), ('buying', 'purchase_receipt_item_supplied'), ('subcontracting', 'subcontracting_receipt_item'), ('subcontracting', 'subcontracting_receipt_supplied_item')]
      module = 'subcontracting'
      doctype = 'subcontracting_receipt_supplied_item'
      reposting_project_deployed_on = datetime.datetime(2024, 11, 12, 9, 24, 36)
      posting_date = datetime.date(2024, 11, 12)
      posting_time = datetime.time(9, 24, 36)
      company_list = ['Arjuna']
      data = [{'name': 'MAT-SLE-2024-53213', 'item_code': 'Bird', 'warehouse': 'Bahan Baku - ARJ', 'voucher_type': 'Purchase Receipt', 'voucher_no': 'MAT-PRE-2024-00613', 'posting_date': datetime.date(2024, 11, 11), 'posting_time': datetime.timedelta(seconds=19246), 'company': 'Arjuna'}, {'name': 'MAT-SLE-2024-53223', 'item_code': 'BUMBU MARINASI GEPREKIN', 'warehouse': 'Bahan Penolong - ARJ', 'voucher_type': 'Stock Entry', 'voucher_no': 'MAT-STE-2024-02525', 'posting_date': datetime.date(2024, 11, 11), 'posting_time': datetime.timedelta(seconds=19625), 'company': 'Arjuna'}, {'name': 'MAT-SLE-2024-53221', 'item_code': 'Bird', 'warehouse': 'Bahan Baku - ARJ', 'voucher_type': 'Purchase Receipt', 'voucher_no': 'MAT-PRE-2024-00618', 'posting_date': datetime.date(2024, 11, 11), 'posting_time': datetime.timedelta(seconds=19797), 'company': 'Arjuna'}, {'name': 'MAT-SLE-2024-53228', 'item_code': 'Bird', 'warehouse': 'Bahan Baku - ARJ', 'voucher_type': 'Stock Entry', 'voucher_no': 'MAT-STE-2024-02527', 'pos...
      total_sle = 60
      i = 0
      d = {'name': 'MAT-SLE-2024-53213', 'item_code': 'Bird', 'warehouse': 'Bahan Baku - ARJ', 'voucher_type': 'Purchase Receipt', 'voucher_no': 'MAT-PRE-2024-00613', 'posting_date': datetime.date(2024, 11, 11), 'posting_time': datetime.timedelta(seconds=19246), 'company': 'Arjuna'}
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py", line 359, in __init__
    self.build()
      self = <erpnext.stock.stock_ledger.update_entries_after object at 0x7fc6e0422890>
      args = {'item_code': 'Bird', 'warehouse': 'Bahan Baku - ARJ', 'posting_date': datetime.date(2024, 11, 11), 'posting_time': datetime.timedelta(seconds=19246), 'voucher_type': 'Purchase Receipt', 'voucher_no': 'MAT-PRE-2024-00613', 'sle_id': 'MAT-SLE-2024-53213'}
      allow_zero_rate = False
      allow_negative_stock = True
      via_landed_cost_voucher = False
      verbose = 1
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py", line 407, in build
    self.process_sle_against_current_timestamp()
      self = <erpnext.stock.stock_ledger.update_entries_after object at 0x7fc6e0422890>
      future_sle_exists = <function future_sle_exists at 0x7fc6e00bbbe0>
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py", line 428, in process_sle_against_current_timestamp
    sl_entries = self.get_sle_against_current_voucher()
      self = <erpnext.stock.stock_ledger.update_entries_after object at 0x7fc6e0422890>
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py", line 435, in get_sle_against_current_voucher
    return frappe.db.sql(
      self = <erpnext.stock.stock_ledger.update_entries_after object at 0x7fc6e0422890>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 244, in sql
    self._cursor.execute(query, values)
      self = <frappe.database.mariadb.database.MariaDBDatabase object at 0x7fc6e1538070>
      query = 'select\n\t\t\t\t*, posting_datetime as "timestamp"\n\t\t\tfrom\n\t\t\t\t`tabStock Ledger Entry`\n\t\t\twhere\n\t\t\t\titem_code = %(item_code)s\n\t\t\t\tand warehouse = %(warehouse)s\n\t\t\t\tand is_cancelled = 0\n\t\t\t\tand (\n\t\t\t\t\tposting_datetime = %(posting_datetime)s\n\t\t\t\t)\n\t\t\t\tand creation = %(creation)s\n\t\t\torder by\n\t\t\t\tcreation ASC\n\t\t\tfor update'
 
      conn = <pymysql.connections.Connection object at 0x7fc6e08df040>
builtins.KeyError: 'creation'

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Nov 18, 2024
@rohitwaghchaure rohitwaghchaure merged commit 495528a into frappe:develop Nov 18, 2024
13 of 14 checks passed
mergify bot pushed a commit that referenced this pull request Nov 22, 2024
(cherry picked from commit 495528a)
rohitwaghchaure added a commit that referenced this pull request Nov 22, 2024
mergify bot pushed a commit that referenced this pull request Nov 22, 2024
(cherry picked from commit 495528a)
(cherry picked from commit 8b02402)
rohitwaghchaure added a commit that referenced this pull request Nov 22, 2024
frappe-pr-bot pushed a commit that referenced this pull request Nov 22, 2024
## [15.43.3](v15.43.2...v15.43.3) (2024-11-22)

### Bug Fixes

* patch ([#44191](#44191)) ([5f752e2](5f752e2))
@rohitwaghchaure rohitwaghchaure added the backport version-14-hotfix backport to version 14 label Nov 22, 2024
mergify bot pushed a commit that referenced this pull request Nov 22, 2024
(cherry picked from commit 495528a)
rohitwaghchaure added a commit that referenced this pull request Nov 22, 2024
mergify bot pushed a commit that referenced this pull request Nov 22, 2024
(cherry picked from commit 495528a)
(cherry picked from commit 3643c60)
rohitwaghchaure added a commit that referenced this pull request Nov 22, 2024
frappe-pr-bot pushed a commit that referenced this pull request Nov 22, 2024
## [14.77.2](v14.77.1...v14.77.2) (2024-11-22)

### Bug Fixes

* patch ([#44191](#44191)) ([d1295d1](d1295d1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport version-14-hotfix backport to version 14 backport version-15-hotfix needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant