人财事物信息化 - setup-doctype.py

DocType README
EMPLOYEE
employee Employee master.
employee_group
employee_group_table
branch Location belonging to the organization where Employees can belong.
department Department where Employee belongs.
designation Employee Designation.
employee_education Education detail for parent Employee.
employee_external_work_history External work history details of parent Employee.
employee_internal_work_history Work history details of parent Employee within the organization.
driver
driving_license_category
vehicle
holiday Holiday date in Holiday List.
holiday_list List of Holidays.
ITEM
uom Unit of Measure (UoM) of an Item.
uom_conversion_factor
website_item_group Alternate grouping of parent Item (for website, so an Item can be listed under multiple groups).
brand Brand of an Item.
item_group Item classification (tree).
TRANSACTION
company Company against which all transactions are made. This is not the Customer or Supplier, this is the company that is the host of the system. Multiple companies can be created as host companies with each user having a different right.
target_detail Target set for Sales Person, Territory or Sales Partner.
quotation_lost_reason Reason master for losing quotations.
quotation_lost_reason_detail
sales_person Sales User for whom sales targets can be set.
sales_partner Partner / dealer / distributor who sells products (maybe for commission) and for whom targets can be set.
territory Territory against with any sale can be tagged and targets can be set.
party_type
customer_group Customer classification (tree).
supplier_group
terms_and_conditions Order / Contract terms that can be attached to any sale or purchase transaction.
incoterm
currency_exchange
transaction_deletion_record
transaction_deletion_record_item
WORKFLOW
authorization_control Tool to define Authorization Rules (limits above which only specified roles have right to Submit).
authorization_rule Rule to define limits on transactions, above which only specified Role can Submit.
email_digest Details of automated daily, weekly, monthly digests sent to users.
email_digest_recipient
global_defaults Global defaults and settings for various modules.
print_heading Custom title for print main heading. e.g. "Pro Forma Invoice"

根据ERPNext V15版本中erpnext/setup目录的文件列表,结合ERP系统的一般架构逻辑,以下是对各Python文件的函数依赖关系分析、学习顺序推荐及关联说明:

一、文件功能与依赖关系分析

  • __init__.py 是Python包的初始化文件,通常用于导出模块内的类、函数或变量,让其他文件可通过from erpnext.setup import ...调用。 依赖:无直接依赖(被其他文件依赖)。
  • utils.py 工具函数集合,可能包含通用的配置处理、数据校验、格式转换等功能,供其他文件调用。 依赖:可能依赖系统基础库,不直接依赖本目录其他业务文件;其他文件(如install.pysetup_wizard.py)可能依赖其工具函数。
  • install.py 负责系统安装初始化逻辑,如数据库表创建、默认数据写入、权限配置等。 依赖:可能调用utils.py的工具函数,以及default_energy_point_rules.pydefault_success_action.py中的默认规则数据。
  • default_energy_point_rules.pydefault_success_action.py 定义系统默认的“能量点规则”和“成功动作”(ERPNext的激励机制相关配置)。 依赖:可能依赖utils.py进行数据格式处理,被install.pysetup_wizard.py调用以初始化默认配置。
  • demo.py 生成演示数据的脚本,用于系统部署后填充示例数据(如测试公司、用户、订单等)。 依赖:可能依赖utils.py处理数据生成逻辑,也可能调用setup_wizard.py中的配置项。
  • setup_wizard.py 系统设置向导的核心逻辑,处理用户安装后的初始化配置流程(如公司信息、会计期间、基础设置等)。 依赖:依赖utils.py的工具函数,可能调用install.py中的部分初始化方法,以及default_*文件中的默认配置。

二、学习顺序推荐(从基础到业务)

  1. __init__.py 先了解该文件导出的模块内容,明确setup目录对外提供的核心功能。
  2. utils.py 掌握通用工具函数,为理解其他文件的业务逻辑打基础。
  3. default_energy_point_rules.pydefault_success_action.py 学习系统默认配置数据的结构,理解ERPNext的激励机制设计。
  4. install.py 理解系统安装的底层逻辑,关联前面的默认配置文件和工具函数。
  5. setup_wizard.py 结合安装逻辑,学习用户交互层面的配置流程,理解其与安装过程的衔接。
  6. demo.py 最后学习演示数据生成,因其依赖前面的配置和初始化逻辑,属于辅助功能。

三、关联脑图核心节点(层级关系)

erpnext/setup
├─ 基础框架
│  ├─ __init__.py(模块导出)
│  └─ utils.py(通用工具函数)
├─ 默认配置
│  ├─ default_energy_point_rules.py(能量点规则)
│  └─ default_success_action.py(成功动作配置)
├─ 安装与初始化
│  ├─ install.py(底层安装逻辑)
│  └─ setup_wizard.py(用户配置向导)
└─ 辅助功能
   └─ demo.py(演示数据生成)

核心关联:

  • 工具层(utils.py)支撑所有业务文件;
  • 配置文件(default_*)为安装和设置向导提供默认数据;
  • 安装逻辑(install.py)与设置向导(setup_wizard.py)共同完成系统初始化,前者偏底层,后者偏用户交互。

以上分析基于ERP系统的通用逻辑,具体函数依赖需结合代码细节进一步确认,但此学习顺序可覆盖核心关联关系。

Discard
Save
Review Changes ← Back to Content
Message Status Space Raised By Last update on