丰茂德 00c3f1e5d9 update erpnext_china/erpnext_china/doctype/cash_flow/cash_flow.py.
如果是0的话不会报错,Frappe 内置的浮点数转换工具,能自动把 None 转为 0.0




Traceback with variables (most recent call last):
  File "apps/frappe/frappe/app.py", line 120, in application
    response = frappe.api.handle(request)
      request = <Request 'http://fjnb.fengmaode.top/api/method/frappe.desk.form.save.savedocs' [POST]>
      response = None
      rollback = True
      e = TypeError("unsupported operand type(s) for -: 'NoneType' and 'NoneType'")
  File "apps/frappe/frappe/api/__init__.py", line 52, in handle
    data = endpoint(**arguments)
      request = <Request 'http://fjnb.fengmaode.top/api/method/frappe.desk.form.save.savedocs' [POST]>
      endpoint = <function handle_rpc_call at 0x7f05c7187a60>
      arguments = {'method': 'frappe.desk.form.save.savedocs'}
  File "apps/frappe/frappe/api/v1.py", line 40, 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 53, in handle
    data = execute_cmd(cmd)
      cmd = 'frappe.desk.form.save.savedocs'
      data = None
  File "apps/frappe/frappe/handler.py", line 86, 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 0x7f05c4f73560>
  File "apps/frappe/frappe/__init__.py", line 1758, in call
    return fn(*args, **newargs)
      fn = <function savedocs at 0x7f05c4f73560>
      args = ()
      kwargs = {'doc': '{"docstatus":0,"doctype":"Cash Flow","name":"new-cash-flow-atvfarhlik","__islocal":1,"__unsaved":1,"owner":"1060778506@qq.com","company":"临沂市丰境电子商务有限责任公司","month":"3","items":[{"docstatus":0,"doctype":"Cash Flow Item","name":"new-cash-flow-item-irbetrlihv","__islocal":1,"__unsaved":1,"owner":"1060778506@qq.com","manual_split":0,"voucher_type":"","cost_center":"主 - 丰境","parent":"new-cash-flow-atvfarhlik","parentfield":"items","parenttype":"Cash Flow","idx":1,"__unedited":false,"account":"5001_fj - 主营业务收入 - 丰境","cash_flow_code":"1"},{"docstatus":0,"doctype":"Cash Flow Item","name":"new-cash-flow-item-ncakubzghz","__islocal":1,"__unsaved":1,"owner":"1060778506@qq.com","manual_split":0,"voucher_type":"","cost_center":"主 - 丰境","parent":"new-cash-flow-atvfarhlik","parentfield":"items","parenttype":"Cash Flow","idx":2,"__unedited":false,"account":"2000_fj - 负债类-负债 - 丰境","cash_flow_code":"16"}],"cash_flow_subtotal":[],"fiscal_year":"2026","idx":0}', 'action': 'Save', 'cmd': 'frappe.de...
      newargs = {'doc': '{"docstatus":0,"doctype":"Cash Flow","name":"new-cash-flow-atvfarhlik","__islocal":1,"__unsaved":1,"owner":"1060778506@qq.com","company":"临沂市丰境电子商务有限责任公司","month":"3","items":[{"docstatus":0,"doctype":"Cash Flow Item","name":"new-cash-flow-item-irbetrlihv","__islocal":1,"__unsaved":1,"owner":"1060778506@qq.com","manual_split":0,"voucher_type":"","cost_center":"主 - 丰境","parent":"new-cash-flow-atvfarhlik","parentfield":"items","parenttype":"Cash Flow","idx":1,"__unedited":false,"account":"5001_fj - 主营业务收入 - 丰境","cash_flow_code":"1"},{"docstatus":0,"doctype":"Cash Flow Item","name":"new-cash-flow-item-ncakubzghz","__islocal":1,"__unsaved":1,"owner":"1060778506@qq.com","manual_split":0,"voucher_type":"","cost_center":"主 - 丰境","parent":"new-cash-flow-atvfarhlik","parentfield":"items","parenttype":"Cash Flow","idx":2,"__unedited":false,"account":"2000_fj - 负债类-负债 - 丰境","cash_flow_code":"16"}],"cash_flow_subtotal":[],"fiscal_year":"2026","idx":0}', 'action': 'Save'}
  File "apps/frappe/frappe/utils/typing_validations.py", line 32, in wrapper
    return func(*args, **kwargs)
      args = ()
      kwargs = {'doc': '{"docstatus":0,"doctype":"Cash Flow","name":"new-cash-flow-atvfarhlik","__islocal":1,"__unsaved":1,"owner":"1060778506@qq.com","company":"临沂市丰境电子商务有限责任公司","month":"3","items":[{"docstatus":0,"doctype":"Cash Flow Item","name":"new-cash-flow-item-irbetrlihv","__islocal":1,"__unsaved":1,"owner":"1060778506@qq.com","manual_split":0,"voucher_type":"","cost_center":"主 - 丰境","parent":"new-cash-flow-atvfarhlik","parentfield":"items","parenttype":"Cash Flow","idx":1,"__unedited":false,"account":"5001_fj - 主营业务收入 - 丰境","cash_flow_code":"1"},{"docstatus":0,"doctype":"Cash Flow Item","name":"new-cash-flow-item-ncakubzghz","__islocal":1,"__unsaved":1,"owner":"1060778506@qq.com","manual_split":0,"voucher_type":"","cost_center":"主 - 丰境","parent":"new-cash-flow-atvfarhlik","parentfield":"items","parenttype":"Cash Flow","idx":2,"__unedited":false,"account":"2000_fj - 负债类-负债 - 丰境","cash_flow_code":"16"}],"cash_flow_subtotal":[],"fiscal_year":"2026","idx":0}', 'action': 'Save'}
      apply_condition = <function whitelist.<locals>.innerfn.<locals>.<lambda> at 0x7f05c4f734c0>
      func = <function savedocs at 0x7f05c4f93a60>
  File "apps/frappe/frappe/desk/form/save.py", line 39, in savedocs
    doc.save()
      doc = <CashFlow: 临沂市丰境电子商务有限责任公司_2026_3>
      action = 'Save'
  File "apps/frappe/frappe/model/document.py", line 378, in save
    return self._save(*args, **kwargs)
      self = <CashFlow: 临沂市丰境电子商务有限责任公司_2026_3>
      args = ()
      kwargs = {}
  File "apps/frappe/frappe/model/document.py", line 400, in _save
    return self.insert()
      self = <CashFlow: 临沂市丰境电子商务有限责任公司_2026_3>
      ignore_permissions = None
      ignore_version = None
  File "apps/frappe/frappe/model/document.py", line 309, in insert
    self.run_before_save_methods()
      self = <CashFlow: 临沂市丰境电子商务有限责任公司_2026_3>
      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 1140, in run_before_save_methods
    self.run_method("validate")
      self = <CashFlow: 临沂市丰境电子商务有限责任公司_2026_3>
  File "apps/frappe/frappe/model/document.py", line 1011, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
      self = <CashFlow: 临沂市丰境电子商务有限责任公司_2026_3>
      method = 'validate'
      args = ()
      kwargs = {}
      fn = <function Document.run_method.<locals>.fn at 0x7f059c364ea0>
  File "apps/frappe/frappe/model/document.py", line 1371, in composer
    return composed(self, method, *args, **kwargs)
      self = <CashFlow: 临沂市丰境电子商务有限责任公司_2026_3>
      args = ()
      kwargs = {}
      hooks = [<function apply at 0x7f059c4ad3a0>, <function check_for_running_deletion_job at 0x7f059c7dede0>]
      method = 'validate'
      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.search.sqlite_search.update_doc_index'], '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', 'frappe.search.sqlite_search.delete_doc_index'...
      handler = 'erpnext.setup.doctype.transaction_deletion_record.transaction_deletion_record.check_for_running_deletion_job'
      composed = <function Document.hook.<locals>.compose.<locals>.runner at 0x7f059c367f60>
      compose = <function Document.hook.<locals>.compose at 0x7f059c367e20>
      f = <function Document.run_method.<locals>.fn at 0x7f059c364ea0>
  File "apps/frappe/frappe/model/document.py", line 1353, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
      self = <CashFlow: 临沂市丰境电子商务有限责任公司_2026_3>
      method = 'validate'
      args = ()
      kwargs = {}
      add_to_return_value = <function Document.hook.<locals>.add_to_return_value at 0x7f059c365080>
      fn = <function Document.run_method.<locals>.fn at 0x7f059c364ea0>
      hooks = (<function apply at 0x7f059c4ad3a0>, <function check_for_running_deletion_job at 0x7f059c7dede0>)
  File "apps/frappe/frappe/model/document.py", line 1008, in fn
    return method_object(*args, **kwargs)
      self = <CashFlow: 临沂市丰境电子商务有限责任公司_2026_3>
      args = ()
      kwargs = {}
      method_object = <bound method CashFlow.validate of <CashFlow: 临沂市丰境电子商务有限责任公司_2026_3>>
      method = 'validate'
  File "apps/erpnext_china/erpnext_china/erpnext_china/doctype/cash_flow/cash_flow.py", line 14, in validate
    self.sync_subtotal()
      self = <CashFlow: 临沂市丰境电子商务有限责任公司_2026_3>
  File "apps/erpnext_china/erpnext_china/erpnext_china/doctype/cash_flow/cash_flow.py", line 62, in sync_subtotal
    subtotal_by_type_map[cash_flow_type] += row.debit - row.credit
      self = <CashFlow: 临沂市丰境电子商务有限责任公司_2026_3>
      cash_flow_codes = [{'code': '1', 'cash_flow_name': '销售产成品、商品、提供劳务收到的现金', 'cash_flow_type': '一、经营活动产生的现金流量:', 'formula': None, 'is_outflow': 0}, {'code': '2', 'cash_flow_name': '收到的其他与经营活动有关的现金', 'cash_flow_type': '一、经营活动产生的现金流量:', 'formula': None, 'is_outflow': 0}, {'code': '3', 'cash_flow_name': '购买原材料、商品、接受劳务支付的现金', 'cash_flow_type': '一、经营活动产生的现金流量:', 'formula': None, 'is_outflow': 1}, {'code': '4', 'cash_flow_name': '支付的职工薪酬', 'cash_flow_type': '一、经营活动产生的现金流量:', 'formula': None, 'is_outflow': 1}, {'code': '5', 'cash_flow_name': '支付的税费', 'cash_flow_type': '一、经营活动产生的现金流量:', 'formula': None, 'is_outflow': 1}, {'code': '6', 'cash_flow_name': '支付的其他与经营活动有关的现金', 'cash_flow_type': '一、经营活动产生的现金流量:', 'formula': None, 'is_outflow': 1}, {'code': '7', 'cash_flow_name': '经营活动产生的现金流量净额', 'cash_flow_type': '一、经营活动产生的现金流量:', 'formula': 'type_subtotal', 'is_outflow': 0}, {'code': '8', 'cash_flow_name': '收回短期投资、长期债券投资和长期股权投资收到的现金', 'cash_flow_type': '二、投资活动产生的现金流量:', 'formula': None, 'is_outflow': 0}, {'code': '9', 'c...
      code_type_map = {'1': '一、经营活动产生的现金流量:', '2': '一、经营活动产生的现金流量:', '3': '一、经营活动产生的现金流量:', '4': '一、经营活动产生的现金流量:', '5': '一、经营活动产生的现金流量:', '6': '一、经营活动产生的现金流量:', '7': '一、经营活动产生的现金流量:', '8': '二、投资活动产生的现金流量:', '9': '二、投资活动产生的现金流量:', '10': '二、投资活动产生的现金流量:', '11': '二、投资活动产生的现金流量:', '12': '二、投资活动产生的现金流量:', '13': '二、投资活动产生的现金流量:', '14': '三、筹资活动产生的现金流量:', '15': '三、筹资活动产生的现金流量:', '16': '三、筹资活动产生的现金流量:', '17': '三、筹资活动产生的现金流量:', '18': '三、筹资活动产生的现金流量:', '19': '三、筹资活动产生的现金流量:', '20': '四、现金净增加额', '21': '', '22': '五、期末现金余额'}
      subtotal_by_code_map = {'1': 0}
      subtotal_by_type_map = {'一、经营活动产生的现金流量:': 0}
      row = <CashFlowItem: qqjkdgu2ik parent=临沂市丰境电子商务有限责任公司_2026_3>
      cash_flow_code = '1'
      cash_flow_type = '一、经营活动产生的现金流量:'
builtins.TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'

Signed-off-by: 丰茂德 <14475558+feng-maode@user.noreply.gitee.com>
2026-03-05 06:05:25 +00:00
2026-01-06 20:57:48 +08:00
2026-01-06 20:57:48 +08:00
2026-01-06 20:57:48 +08:00
2026-01-06 20:57:48 +08:00
2026-01-06 20:57:48 +08:00
2026-01-06 20:57:48 +08:00
2026-01-08 12:16:28 +08:00

ERPNext China ERPNext中国本地化

安装

没有设置默认站点的,install-app时请加--site参数

bench get-app erpnext_china https://gitee.com/yuzelin/erpnext_china.git
bench install-app erpnext_china

功能说明

一、界面中文汉化(简体)

  1. 在系统自带汉化基础上的人工汉化

二、中国科目表

  1. 系统首次初始化及初始化后创建新公司代码时可选中国会计科目表

三、创建公司时设置默认值

  1. 税务设置

  2. 创建税种:

    • 内销增值税
    • 外销增值税
    • 小规模纳税人
    • 一般纳税人
  3. 创建税率模板:

    • 13%
    • 0%
    • 1%
  4. 公司设置

  5. 分配默认科目

  6. 设置仓库库存科目

  7. 配置物料组费用科目

  8. 设置小数精度尾差科目

四、中国财务报表(新增工作区)

  1. 中国资产负债表

    • 需设置报表项与科目号对照及计算公式
    • 自动检查科目遗漏
  2. 中国利润表

    • 需设置报表项与科目号对照及计算公式
    • 自动检查科目遗漏
  3. 中国现金流量表(直接法)

    • 需预先设置现金流编码

五、初始化配置

基础设置

  1. 默认语言:中文
  2. 默认地区:中国
  3. 隐藏印度专用字段(如PAN)

app安装后设置

  1. 修改一词多义字段标签(如采购、销售税费明细中的税率)
  2. 隐藏本地化不适用字段(如PAN号等印度专用字段)
  3. 修改默认系统流水码前缀-改短

常见问题

  1. 是否与之前的中文汉化与开箱即用冲突

建议卸载中文汉化和开箱即用后再安装这个

License

MIT

S
Description
No description provided
Readme
4.9 MiB
Languages
Python 88%
JavaScript 12%