AttributeError: 'SalesInvoice' object has no attribute 'ewaybill'

Hey there,

I am unable to generate eway bill json with my instance, the server is throwing this error "AttributeError: ‘SalesInvoice’ object has no attribute ‘ewaybill’ "

Please see the below screenshot -

please help !

Run the following command in your bench instance:

bench execute erpnext.patches.v11_0.ewaybill_fields_gst_india.execute

I suspect you still need to run DB migration on this site. You can do so with bench migrate.

@snv

Thanks a lot for your reply.

I tried to run the command mentioned by you, it failed with an error mentioned below

frappe@ubuntu:~/frappe-bench$ bench execute erpnext.patches.v11_0.ewaybill_field s_gst_india.execute
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, instal l the package from PyPI with: pip install frappe-bench

Traceback (most recent call last):
File “/usr/lib/python3.5/runpy.py”, line 184, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 99, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/decorato rs.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 26, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 15 4, in execute
ret = frappe.get_attr(method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v11_0/ewaybill_fi elds_gst_india.py”, line 10, in execute
make_custom_fields()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/india/setup.py”, line 509, in make_custom_fields
create_custom_fields(custom_fields, update=update)
File “/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field /custom_field.py”, line 150, in create_custom_fields
custom_field.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 27 3, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 32 6, in _save
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 92 7, in run_post_save_methods
self.run_method(“on_update”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 79 7, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 10 73, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 10 56, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 79 1, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field /custom_field.py”, line 65, in on_update
frappe.db.updatedb(self.dt)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.p y”, line 291, in updatedb
db_table.sync()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/schema.py”, line 3 7, in sync
self.alter()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/schema.py” , line 86, in alter
raise e
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/schema.py” , line 75, in alter
frappe.db.sql(query)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 171, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursor s.py”, line 170, in execute
result = self._query(query)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursor s.py”, line 328, in _query
conn.query(q)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/connec tions.py”, line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/connec tions.py”, line 732, in _read_query_result
result.read()
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/connec tions.py”, line 1075, in read
first_packet = self.connection._read_packet()
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/connec tions.py”, line 684, in _read_packet
packet.check_error()
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/protoc ol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/err.py ", line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.DataError: (1265, “Data truncated for column ‘is_inter_state’ at row 1”)
frappe@ubuntu:~/frappe-bench$

please help.

If you don’t have data in that column in the database, remove it. Otherwise, alter it:

hi @snv

I have tried to delete is_inter_state column in mysql terminal, unable to do so, I am no developer, can you please help with this too ?