Skip to content

fix: do not update gst_tax_type for unregistered company (backport #3436) #3448

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

Open
wants to merge 1 commit into
base: version-14-hotfix
Choose a base branch
from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jun 12, 2025

If GST Settings have taxes for an unregistered company, then an error is raised.
Frappe Support Issue: https://support.frappe.io/app/hd-ticket/40270

Traceback with variables (most recent call last):
  File "apps/frappe/frappe/app.py", line 116, in application
    response = frappe.api.handle(request)
      request = <Request 'http://dummy.localhost:8002/api/method/frappe.desk.form.save.savedocs' [POST]>
      response = None
      rollback = True
      e = TypeError("unsupported operand type(s) for /: 'NoneType' and 'int'")
  File "apps/frappe/frappe/api/__init__.py", line 60, in handle
    data = endpoint(**arguments)
      request = <Request 'http://dummy.localhost:8002/api/method/frappe.desk.form.save.savedocs' [POST]>
      endpoint = <function handle_rpc_call at 0x7f6a11ebe0c0>
      arguments = {'method': 'frappe.desk.form.save.savedocs'}
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
      method = 'frappe.desk.form.save.savedocs'
      frappe = <module 'frappe' from 'apps/frappe/frappe/__init__.py'>
  File "apps/frappe/frappe/handler.py", line 51, in handle
    data = execute_cmd(cmd)
      cmd = 'frappe.desk.form.save.savedocs'
      data = None
  File "apps/frappe/frappe/handler.py", line 84, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
      cmd = 'frappe.desk.form.save.savedocs'
      from_async = False
      server_script = None
      method = <function savedocs at 0x7f6a110d1b20>
  File "apps/frappe/frappe/__init__.py", line 1472, in call
    return fn(*args, **newargs)
      fn = <function savedocs at 0x7f6a110d1b20>
      args = ()
      kwargs = {'doc': '{"name":"POS-CLO-2025-00002","owner":"receptionist.delhi@gmail.com","creation":"2025-06-03 13:35:39.383635","modified":"2025-06-09 13:38:39.071706","modified_by":"Administrator","docstatus":0,"idx":0,"period_start_date":"2025-06-02 19:54:16.890349","period_end_date":"2025-06-09 13:29:54","posting_date":"2025-06-03","posting_time":"13:35:32","pos_opening_entry":"POS-OPE-2025-00002","status":"Failed","company":"8848 Digital (Demo)","pos_profile":"Gynoveda Delhi Clinic","user":"receptionist.delhi@gmail.com","grand_total":0,"net_total":0,"total_quantity":0,"error_message":"unsupported operand type(s) for /: \'NoneType\' and \'int\'","doctype":"POS Closing Entry","pos_transactions":[{"name":"eg222jkmb7","owner":"receptionist.delhi@gmail.com","creation":"2025-06-03 13:35:39.383635","modified":"2025-06-09 13:29:55.201461","modified_by":"Administrator","docstatus":0,"idx":1,"pos_invoice":"ACC-PSINV-2025-00015","posting_date":"2025-06-02","customer":"CUST-2025-00016","grand_total":3540...
      newargs = {'doc': '{"name":"POS-CLO-2025-00002","owner":"receptionist.delhi@gmail.com","creation":"2025-06-03 13:35:39.383635","modified":"2025-06-09 13:38:39.071706","modified_by":"Administrator","docstatus":0,"idx":0,"period_start_date":"2025-06-02 19:54:16.890349","period_end_date":"2025-06-09 13:29:54","posting_date":"2025-06-03","posting_time":"13:35:32","pos_opening_entry":"POS-OPE-2025-00002","status":"Failed","company":"8848 Digital (Demo)","pos_profile":"Gynoveda Delhi Clinic","user":"receptionist.delhi@gmail.com","grand_total":0,"net_total":0,"total_quantity":0,"error_message":"unsupported operand type(s) for /: \'NoneType\' and \'int\'","doctype":"POS Closing Entry","pos_transactions":[{"name":"eg222jkmb7","owner":"receptionist.delhi@gmail.com","creation":"2025-06-03 13:35:39.383635","modified":"2025-06-09 13:29:55.201461","modified_by":"Administrator","docstatus":0,"idx":1,"pos_invoice":"ACC-PSINV-2025-00015","posting_date":"2025-06-02","customer":"CUST-2025-00016","grand_total":3540...
  File "apps/frappe/frappe/utils/typing_validations.py", line 32, in wrapper
    return func(*args, **kwargs)
      args = ()
      kwargs = {'doc': '{"name":"POS-CLO-2025-00002","owner":"receptionist.delhi@gmail.com","creation":"2025-06-03 13:35:39.383635","modified":"2025-06-09 13:38:39.071706","modified_by":"Administrator","docstatus":0,"idx":0,"period_start_date":"2025-06-02 19:54:16.890349","period_end_date":"2025-06-09 13:29:54","posting_date":"2025-06-03","posting_time":"13:35:32","pos_opening_entry":"POS-OPE-2025-00002","status":"Failed","company":"8848 Digital (Demo)","pos_profile":"Gynoveda Delhi Clinic","user":"receptionist.delhi@gmail.com","grand_total":0,"net_total":0,"total_quantity":0,"error_message":"unsupported operand type(s) for /: \'NoneType\' and \'int\'","doctype":"POS Closing Entry","pos_transactions":[{"name":"eg222jkmb7","owner":"receptionist.delhi@gmail.com","creation":"2025-06-03 13:35:39.383635","modified":"2025-06-09 13:29:55.201461","modified_by":"Administrator","docstatus":0,"idx":1,"pos_invoice":"ACC-PSINV-2025-00015","posting_date":"2025-06-02","customer":"CUST-2025-00016","grand_total":3540...
      apply_condition = <function whitelist.<locals>.innerfn.<locals>.<lambda> at 0x7f6a110d1a80>
      func = <function savedocs at 0x7f6a11036f20>
  File "apps/frappe/frappe/desk/form/save.py", line 41, in savedocs
    doc.submit()
      doc = <POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>
      action = 'Submit'
      child = <POSClosingEntryDetail: doctype=POS Closing Entry Detail eg22g7hhjb docstatus=1 parent=POS-CLO-2025-00002>
  File "apps/frappe/frappe/utils/typing_validations.py", line 32, in wrapper
    return func(*args, **kwargs)
      args = (<POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>,)
      kwargs = {}
      apply_condition = <function whitelist.<locals>.innerfn.<locals>.<lambda> at 0x7f6a149023e0>
      func = <function Document.submit at 0x7f6a14902340>
  File "apps/frappe/frappe/model/document.py", line 1215, in submit
    return self._submit()
      self = <POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>
  File "apps/frappe/frappe/model/document.py", line 1198, in _submit
    return self.save()
      self = <POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>
  File "apps/frappe/frappe/model/document.py", line 484, in save
    return self._save(*args, **kwargs)
      self = <POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>
      args = ()
      kwargs = {}
  File "apps/frappe/frappe/model/document.py", line 537, in _save
    self.run_post_save_methods()
      self = <POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>
      ignore_permissions = None
      ignore_version = None
  File "apps/frappe/frappe/model/document.py", line 1318, in run_post_save_methods
    self.run_method("on_submit")
      self = <POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>
  File "apps/frappe/frappe/model/document.py", line 1128, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
      self = <POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>
      method = 'on_submit'
      args = ()
      kwargs = {}
      fn = <function Document.run_method.<locals>.fn at 0x7f6a082ae2a0>
  File "apps/frappe/frappe/model/document.py", line 1518, in composer
    return composed(self, method, *args, **kwargs)
      self = <POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>
      args = ()
      kwargs = {}
      hooks = []
      method = 'on_submit'
      doc_events = {'*': {'on_update': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.core.doctype.file.utils.attach_files_to_document', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply', 'frappe.automation.doctype.assignment_rule.assignment_rule.update_due_date', 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type', 'frappe.core.doctype.permission_log.permission_log.make_perm_log'], 'after_rename': ['frappe.desk.notifications.clear_doctype_notifications'], 'on_cancel': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply'], 'on_trash': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions'], 'on_update_after_submit': ...
      composed = <function Document.hook.<locals>.compose.<locals>.runner at 0x7f6a08094680>
      compose = <function Document.hook.<locals>.compose at 0x7f6a08032c00>
      f = <function Document.run_method.<locals>.fn at 0x7f6a082ae2a0>
  File "apps/frappe/frappe/model/document.py", line 1496, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
      self = <POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>
      method = 'on_submit'
      args = ()
      kwargs = {}
      add_to_return_value = <function Document.hook.<locals>.add_to_return_value at 0x7f6a08032a20>
      fn = <function Document.run_method.<locals>.fn at 0x7f6a082ae2a0>
      hooks = ()
  File "apps/frappe/frappe/model/document.py", line 1125, in fn
    return method_object(*args, **kwargs)
      self = <POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>
      args = ()
      kwargs = {}
      method_object = <bound method POSClosingEntry.on_submit of <POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>>
      method = 'on_submit'
  File "apps/erpnext/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.py", line 205, in on_submit
    consolidate_pos_invoices(closing_entry=self)
      self = <POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>
  File "apps/erpnext/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py", line 504, in consolidate_pos_invoices
    create_merge_logs(invoice_by_customer, closing_entry)
      pos_invoices = None
      closing_entry = <POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>
      invoices = [<POSInvoiceReference: doctype=POS Invoice Reference op4hl0sau9 docstatus=1 parent=op4kq5f3sv>, <POSInvoiceReference: doctype=POS Invoice Reference eg2226ihfi docstatus=1 parent=POS-CLO-2025-00002>, <POSInvoiceReference: doctype=POS Invoice Reference eg22in79cr docstatus=1 parent=POS-CLO-2025-00002>]
      invoice_by_customer = {'CUST-2025-00016': {'ba31d78dce1309334e91766136badf2e15c1e111fd230db105b40fd984e6d0a0': [<POSInvoiceReference: doctype=POS Invoice Reference op4hl0sau9 docstatus=1 parent=op4kq5f3sv>]}, 'CUST-2025-00017': {'ba31d78dce1309334e91766136badf2e15c1e111fd230db105b40fd984e6d0a0': [<POSInvoiceReference: doctype=POS Invoice Reference eg2226ihfi docstatus=1 parent=POS-CLO-2025-00002>, <POSInvoiceReference: doctype=POS Invoice Reference eg22in79cr docstatus=1 parent=POS-CLO-2025-00002>]}}
  File "apps/erpnext/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py", line 590, in create_merge_logs
    merge_log.submit()
      invoice_by_customer = {'CUST-2025-00016': {'ba31d78dce1309334e91766136badf2e15c1e111fd230db105b40fd984e6d0a0': [<POSInvoiceReference: doctype=POS Invoice Reference op4hl0sau9 docstatus=1 parent=op4kq5f3sv>]}, 'CUST-2025-00017': {'ba31d78dce1309334e91766136badf2e15c1e111fd230db105b40fd984e6d0a0': [<POSInvoiceReference: doctype=POS Invoice Reference eg2226ihfi docstatus=1 parent=POS-CLO-2025-00002>, <POSInvoiceReference: doctype=POS Invoice Reference eg22in79cr docstatus=1 parent=POS-CLO-2025-00002>]}}
      closing_entry = <POSClosingEntry: doctype=POS Closing Entry POS-CLO-2025-00002 docstatus=1>
      customer = 'CUST-2025-00016'
      invoices_acc_dim = {'ba31d78dce1309334e91766136badf2e15c1e111fd230db105b40fd984e6d0a0': [<POSInvoiceReference: doctype=POS Invoice Reference op4hl0sau9 docstatus=1 parent=op4kq5f3sv>]}
      invoices = [<POSInvoiceReference: doctype=POS Invoice Reference op4hl0sau9 docstatus=1 parent=op4kq5f3sv>]
      _invoices = [<POSInvoiceReference: doctype=POS Invoice Reference op4hl0sau9 docstatus=1 parent=op4kq5f3sv>]
      merge_log = <POSInvoiceMergeLog: doctype=POS Invoice Merge Log op4kq5f3sv docstatus=1>
      message_log = "unsupported operand type(s) for /: 'NoneType' and 'int'"
      error_message = "unsupported operand type(s) for /: 'NoneType' and 'int'"
  File "apps/frappe/frappe/utils/typing_validations.py", line 32, in wrapper
    return func(*args, **kwargs)
      args = (<POSInvoiceMergeLog: doctype=POS Invoice Merge Log op4kq5f3sv docstatus=1>,)
      kwargs = {}
      apply_condition = <function whitelist.<locals>.innerfn.<locals>.<lambda> at 0x7f6a149023e0>
      func = <function Document.submit at 0x7f6a14902340>
  File "apps/frappe/frappe/model/document.py", line 1215, in submit
    return self._submit()
      self = <POSInvoiceMergeLog: doctype=POS Invoice Merge Log op4kq5f3sv docstatus=1>
  File "apps/frappe/frappe/model/document.py", line 1198, in _submit
    return self.save()
      self = <POSInvoiceMergeLog: doctype=POS Invoice Merge Log op4kq5f3sv docstatus=1>
  File "apps/frappe/frappe/model/document.py", line 484, in save
    return self._save(*args, **kwargs)
      self = <POSInvoiceMergeLog: doctype=POS Invoice Merge Log op4kq5f3sv docstatus=1>
      args = ()
      kwargs = {}
  File "apps/frappe/frappe/model/document.py", line 537, in _save
    self.run_post_save_methods()
      self = <POSInvoiceMergeLog: doctype=POS Invoice Merge Log op4kq5f3sv docstatus=1>
      ignore_permissions = None
      ignore_version = None
  File "apps/frappe/frappe/model/document.py", line 1318, in run_post_save_methods
    self.run_method("on_submit")
      self = <POSInvoiceMergeLog: doctype=POS Invoice Merge Log op4kq5f3sv docstatus=1>
  File "apps/frappe/frappe/model/document.py", line 1128, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
      self = <POSInvoiceMergeLog: doctype=POS Invoice Merge Log op4kq5f3sv docstatus=1>
      method = 'on_submit'
      args = ()
      kwargs = {}
      fn = <function Document.run_method.<locals>.fn at 0x7f6a08085b20>
  File "apps/frappe/frappe/model/document.py", line 1518, in composer
    return composed(self, method, *args, **kwargs)
      self = <POSInvoiceMergeLog: doctype=POS Invoice Merge Log op4kq5f3sv docstatus=1>
      args = ()
      kwargs = {}
      hooks = []
      method = 'on_submit'
      doc_events = {'*': {'on_update': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.core.doctype.file.utils.attach_files_to_document', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply', 'frappe.automation.doctype.assignment_rule.assignment_rule.update_due_date', 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type', 'frappe.core.doctype.permission_log.permission_log.make_perm_log'], 'after_rename': ['frappe.desk.notifications.clear_doctype_notifications'], 'on_cancel': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply'], 'on_trash': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions'], 'on_update_after_submit': ...
      composed = <function Document.hook.<locals>.compose.<locals>.runner at 0x7f6a08085a80>
      compose = <function Document.hook.<locals>.compose at 0x7f6a080862a0>
      f = <function Document.run_method.<locals>.fn at 0x7f6a08085b20>
  File "apps/frappe/frappe/model/document.py", line 1496, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
      self = <POSInvoiceMergeLog: doctype=POS Invoice Merge Log op4kq5f3sv docstatus=1>
      method = 'on_submit'
      args = ()
      kwargs = {}
      add_to_return_value = <function Document.hook.<locals>.add_to_return_value at 0x7f6a08085c60>
      fn = <function Document.run_method.<locals>.fn at 0x7f6a08085b20>
      hooks = ()
  File "apps/frappe/frappe/model/document.py", line 1125, in fn
    return method_object(*args, **kwargs)
      self = <POSInvoiceMergeLog: doctype=POS Invoice Merge Log op4kq5f3sv docstatus=1>
      args = ()
      kwargs = {}
      method_object = <bound method POSInvoiceMergeLog.on_submit of <POSInvoiceMergeLog: doctype=POS Invoice Merge Log op4kq5f3sv docstatus=1>>
      method = 'on_submit'
  File "apps/erpnext/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py", line 127, in on_submit
    sales_invoice_doc = self.process_merging_into_sales_invoice(sales)
      self = <POSInvoiceMergeLog: doctype=POS Invoice Merge Log op4kq5f3sv docstatus=1>
      pos_invoice_docs = [<POSInvoice: doctype=POS Invoice ACC-PSINV-2025-00015 docstatus=1>]
      returns = []
      sales = [<POSInvoice: doctype=POS Invoice ACC-PSINV-2025-00015 docstatus=1>]
      sales_invoice = ''
      credit_notes = {}
      sales_invoice_doc = None
  File "apps/erpnext/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py", line 158, in process_merging_into_sales_invoice
    sales_invoice.save()
      self = <POSInvoiceMergeLog: doctype=POS Invoice Merge Log op4kq5f3sv docstatus=1>
      data = [<POSInvoice: doctype=POS Invoice ACC-PSINV-2025-00015 docstatus=1>]
      sales_invoice = <SalesInvoice: doctype=Sales Invoice SINV-25-00012>
  File "apps/frappe/frappe/model/document.py", line 484, in save
    return self._save(*args, **kwargs)
      self = <SalesInvoice: doctype=Sales Invoice SINV-25-00012>
      args = ()
      kwargs = {}
  File "apps/frappe/frappe/model/document.py", line 506, in _save
    return self.insert()
      self = <SalesInvoice: doctype=Sales Invoice SINV-25-00012>
      ignore_permissions = None
      ignore_version = None
  File "apps/frappe/frappe/model/document.py", line 414, in insert
    self.run_before_save_methods()
      self = <SalesInvoice: doctype=Sales Invoice SINV-25-00012>
      ignore_permissions = None
      ignore_links = None
      ignore_if_duplicate = False
      ignore_mandatory = None
      set_name = None
      set_child_names = True
  File "apps/frappe/frappe/model/document.py", line 1279, in run_before_save_methods
    self.run_method("before_save")
      self = <SalesInvoice: doctype=Sales Invoice SINV-25-00012>
  File "apps/frappe/frappe/model/document.py", line 1128, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
      self = <SalesInvoice: doctype=Sales Invoice SINV-25-00012>
      method = 'before_save'
      args = ()
      kwargs = {}
      fn = <function Document.run_method.<locals>.fn at 0x7f69e40f77e0>
  File "apps/frappe/frappe/model/document.py", line 1518, in composer
    return composed(self, method, *args, **kwargs)
      self = <SalesInvoice: doctype=Sales Invoice SINV-25-00012>
      args = ()
      kwargs = {}
      hooks = [<function update_gst_details at 0x7f696410ba60>]
      method = 'before_save'
      doc_events = {'*': {'on_update': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.core.doctype.file.utils.attach_files_to_document', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply', 'frappe.automation.doctype.assignment_rule.assignment_rule.update_due_date', 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type', 'frappe.core.doctype.permission_log.permission_log.make_perm_log'], 'after_rename': ['frappe.desk.notifications.clear_doctype_notifications'], 'on_cancel': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply'], 'on_trash': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions'], 'on_update_after_submit': ...
      handler = 'india_compliance.gst_india.overrides.transaction.update_gst_details'
      composed = <function Document.hook.<locals>.compose.<locals>.runner at 0x7f69c46904a0>
      compose = <function Document.hook.<locals>.compose at 0x7f69c4690360>
      f = <function Document.run_method.<locals>.fn at 0x7f69e40f77e0>
  File "apps/frappe/frappe/model/document.py", line 1500, in runner
    add_to_return_value(self, f(self, method, *args, **kwargs))
      self = <SalesInvoice: doctype=Sales Invoice SINV-25-00012>
      method = 'before_save'
      args = ()
      kwargs = {}
      f = <function update_gst_details at 0x7f696410ba60>
      add_to_return_value = <function Document.hook.<locals>.add_to_return_value at 0x7f69c4690400>
      fn = <function Document.run_method.<locals>.fn at 0x7f69e40f77e0>
      hooks = (<function update_gst_details at 0x7f696410ba60>,)
  File "apps/india_compliance/india_compliance/gst_india/overrides/transaction.py", line 1748, in update_gst_details
    ItemGSTDetails().update(doc)
      doc = <SalesInvoice: doctype=Sales Invoice SINV-25-00012>
      method = 'before_save'
  File "apps/india_compliance/india_compliance/gst_india/overrides/transaction.py", line 1196, in update
    self.set_item_name_wise_tax_details()
      self = <india_compliance.gst_india.overrides.transaction.ItemGSTDetails object at 0x7f69e4120f90>
      doc = <SalesInvoice: doctype=Sales Invoice SINV-25-00012>
  File "apps/india_compliance/india_compliance/gst_india/overrides/transaction.py", line 1247, in set_item_name_wise_tax_details
    tax_amount = self.get_item_tax_amount(item, tax_rate, tax)
      self = <india_compliance.gst_india.overrides.transaction.ItemGSTDetails object at 0x7f69e4120f90>
      tax_differences = {'sgst': 270.0, 'cgst': 270.0}
      last_item_with_tax = None
      last_item_defaults = None
      item = <SalesInvoiceItem: doctype=Sales Invoice Item op4qumjj1e parent=SINV-25-00012>
      item_defaults = {'count': 0, 'cgst_rate': 0, 'cgst_amount': 0, 'sgst_rate': 0, 'sgst_amount': 0, 'igst_rate': 0, 'igst_amount': 0, 'cess_rate': 0, 'cess_amount': 0, 'cess_non_advol_rate': 0, 'cess_non_advol_amount': 0}
      tax_amount = 0
      tax_row = <SalesTaxesandCharges: doctype=Sales Taxes and Charges op4qcqd7eq parent=SINV-25-00012>
      tax = 'sgst'
      tax_rate_field = 'sgst_rate'
      tax_amount_field = 'sgst_amount'
      old = {'Gynoveda Anti Pigmentation Ayurvedic Cream': {'tax_rate': 9.0, 'tax_amount': 270.0, 'net_amount': 0.0}}
      tax_rate = 9.0
  File "apps/india_compliance/india_compliance/gst_india/overrides/transaction.py", line 1438, in get_item_tax_amount
    multiplier = item.qty if tax == "cess_non_advol" else item.taxable_value / 100
      self = <india_compliance.gst_india.overrides.transaction.ItemGSTDetails object at 0x7f69e4120f90>
      item = <SalesInvoiceItem: doctype=Sales Invoice Item op4qumjj1e parent=SINV-25-00012>
      tax_rate = 9.0
      tax = 'sgst'
      precision = 3
builtins.TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of GST tax account mapping when GST validations are ignored, ensuring smoother processing for documents where validations are bypassed.

This is an automatic backport of pull request #3436 done by [Mergify](https://mergify.com).

Copy link

coderabbitai bot commented Jun 12, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Join our Discord community for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant