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

Error: could not convert string to float: 'outstanding_amount' #37706

Closed
SanderVanDenBerk opened this issue Oct 26, 2023 · 2 comments
Closed
Labels

Comments

@SanderVanDenBerk
Copy link

SanderVanDenBerk commented Oct 26, 2023

Information about bug

When upgrading ERPNext from V13 to V14 according to this manual I encounter an error.

There is an issue when migrating the Doctype: Purchase Invoice. This is when executing the ERPNext patch: 'Executing erpnext.patches.v14_0.change_is_subcontracted_fieldtype in test-erp (_538750cc54da9304)' . See error log below.

Any idea/tips on how to fix this issue?

Module

buying

Version

ERPNext: v13.54.5 -> V14
Frappe Framework: v13.58.14 -> V14

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

      self = <frappe.database.mariadb.schema.MariaDBTable object at 0x7f9ab432ddb0>
  File "/home/bench/frappe-bench/apps/frappe/frappe/database/mariadb/schema.py", line 72, in alter
    col.build_for_alter_table(self.current_columns.get(col.fieldname.lower()))
      self = <frappe.database.mariadb.schema.MariaDBTable object at 0x7f9ab432ddb0>
      col = <frappe.database.schema.DbColumn object at 0x7f9ab41e5420>
  File "/home/bench/frappe-bench/apps/frappe/frappe/database/schema.py", line 247, in build_for_alter_table
    self.default_changed(current_def)
      self = <frappe.database.schema.DbColumn object at 0x7f9ab41e5420>
      current_def = {'name': 'paid_amount', 'type': 'decimal(21,9)', 'default': '0.000000000', 'index': 0, 'unique': 0}
      column_type = 'decimal(21,9)'
  File "/home/bench/frappe-bench/apps/frappe/frappe/database/schema.py", line 262, in default_changed
    return self.default_changed_for_decimal(current_def)
      self = <frappe.database.schema.DbColumn object at 0x7f9ab41e5420>
      current_def = {'name': 'paid_amount', 'type': 'decimal(21,9)', 'default': '0.000000000', 'index': 0, 'unique': 0}
  File "/home/bench/frappe-bench/apps/frappe/frappe/database/schema.py", line 302, in default_changed_for_decimal
    return float(current_def["default"]) != float(self.default)
      self = <frappe.database.schema.DbColumn object at 0x7f9ab41e5420>
      current_def = {'name': 'paid_amount', 'type': 'decimal(21,9)', 'default': '0.000000000', 'index': 0, 'unique': 0}
builtins.ValueError: could not convert string to float: 'outstanding_amount'
@SanderVanDenBerk
Copy link
Author

I have been debugging a bit further and I discovered that the table is not loaded in correctly in frappe (see screenshots). The default on the paid_amount is set to nothing (Null) be is filled with 'outstanding_amount'.

image

image

Anyone an idea where I can go looking further, this is blocking my upgrade to version 14.

@deepeshgarg007
Copy link
Member

@SanderVanDenBerk This is a data-related issue that you'll have to resolve at your end. Closing this issue

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants