Upgrade to v13.39.1 frappe and erpnext throws error `frappe.exceptions.ValidationError: A field with the name 'total_taxes_and_charges' already exists in doctype Expense Claim.`
See original GitHub issueDescription of the issue
When upgrading from frappe 13.17.1 to v13.39.1 together with upgrading erpnext from v13.17.0 to v13.39.1 the following error is thrown:
frappe.exceptions.ValidationError: A field with the name 'total_taxes_and_charges' already exists in doctype Expense Claim.
Context information (for bug reports)
Output of bench version
5.7.2
INFO: A newer version of bench is available: 5.7.2 → 5.14.3
After upgrading to 5.14.3 the error remains the same.
Steps to reproduce the issue
- cd ~/frappe-bench/apps/frappe/
- git checkout v13.39.1
- cd ~/frappe-bench/apps/erpnext
- git checkout v13.39.1
- cd ~/frappe-benache
- bench setup requirements
- bench build
- bench --site erpnext.example.com migrate
Observed result
Error is shown, migration stops
Expected result
Migration should finish without errors.
Stacktrace / full error message
Updating DocTypes for frappe : [========================================] 100%
Updating DocTypes for erpnext : [========================================] 100%
Updating DocTypes for erpnextswiss : [========================================] 100%
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 110, in <module>
main()
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
click.Group(commands=commands)(prog_name="bench")
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 31, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 407, in migrate
migrate(context.verbose, skip_failing=skip_failing, skip_search_index=skip_search_index)
File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 79, in migrate
sync_fixtures()
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/fixtures.py", line 22, in sync_fixtures
import_doc(fixtures_path)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/data_import.py", line 181, in import_doc
import_file_by_path(
File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 146, in import_file_by_path
import_doc(
File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 275, in import_doc
doc.insert()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 254, in insert
self.run_method("before_insert")
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 941, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1261, in composer
return composed(self, method, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1243, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 938, in fn
return method_object(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 44, in before_insert
frappe.throw(
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 504, in throw
msgprint(
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 479, in msgprint
_raise_exception()
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 434, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: A field with the name 'total_taxes_and_charges' already exists in doctype Expense Claim.
Additional information
OS version / distribution, Frappe
install method, etc.
Ubuntu 20.04, native installation We have customized doctype in ERPNEXT / Non Profit / Member The table tabExpenseClaims is empty
Maybe this is related to that bug: https://github.com/frappe/erpnext/issues/23981
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
frappe.exceptions.ValidationError: A field with the name ...
ValidationError : A field with the name 'customer_group' already exists in doctype Sales Order. when i try to restore the db from v12...
Read more >Update Error: frappe.exceptions.ValidationError: Options must ...
Hi, we get this when trying to update, our current version are: erpnext 10.1.42 frappe 10.1.39 This problem is similar to this one...
Read more >frappe.exceptions.ValidationError: Fieldtype cannot be ...
ValidationError : Fieldtype cannot be changed from Data to Currency - ERPNext Forum.
Read more >Error Migrating from v12 to v13 - ERPNext Forum
Hi, I am trying to migrate from v12 to v13 but i am getting error as frappe.exceptions.
Read more >frappe.exceptions.ValidationError: item_code field cannot be ...
Got this error when i ran bench update frappe.exceptions.ValidationError: item_code field cannot be set as unique in tabItem, as there are ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, I found this in /apps/erpnextswiss/erpnextswiss/fixtures/custom_field.json
So next step would be to check on the app side and close this issue?
yes.