pymysql.err.DataError: (1264, "Out of range value for column 'base_total' at row 1")

When I submit Sales Order at that time Purchase Order automatically generate then on Purchase Order save below error comes:-

 Traceback (most recent call last): (desk.min.js, line 1)
  File "apps/frappe/frappe/app.py", line 68, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 31, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 67, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1208, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/save.py", line 19, in savedocs
    doc.submit()
  File "apps/frappe/frappe/model/document.py", line 937, in submit
    return self._submit()
  File "apps/frappe/frappe/model/document.py", line 925, in _submit
    return self.save()
  File "apps/frappe/frappe/model/document.py", line 285, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 339, in _save
    self.run_post_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1005, in run_post_save_methods
    self.run_method("on_submit")
  File "apps/frappe/frappe/model/document.py", line 866, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1159, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1144, in runner
    add_to_return_value(self, f(self, method, *args, **kwargs))
  File "apps/custom_app/custom_app/custom_app/doctype/sales_order/sales_order.py", line 45, in on_sales_order_after_submit
    purchase_order.save()
  File "apps/frappe/frappe/model/document.py", line 285, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 307, in _save
    return self.insert()
  File "apps/frappe/frappe/model/document.py", line 250, in insert
    self.db_insert()
  File "apps/frappe/frappe/model/base_document.py", line 363, in db_insert
    frappe.db.sql("""INSERT INTO tab{doctype} ({columns})
  File "apps/frappe/frappe/database/database.py", line 148, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.8/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "env/lib/python3.8/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "env/lib/python3.8/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "env/lib/python3.8/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "env/lib/python3.8/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "env/lib/python3.8/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "env/lib/python3.8/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "env/lib/python3.8/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.DataError: (1264, "Out of range value for column 'base_total' at row 1")

See what is the amount reflecting in the purchase order in Total(Base Currency) when the PO is automatically generated.

Is the sales order currency and the purchase order currency same?

This clearly shows that the value in Total(base currency) in PO is invalid.