• 首页
  • 产品中心
    • 数式Oinone四大产品

      低代码开发平台无代码开发平台集成开发平台AI大模型开发
    • 数式Oinone体系能力

      用户与组织权限管理文件管理消息中心国际化业务审计
    • 数式Oinone核心产品特性

      低无一体面向软件公司场景无限制应用级扩容可分可合
  • 服务中心
    • 客户服务

      预约演示方案咨询私有部署找人定制
    • 开发者

      问答下载
    • Oinone学院

      社区学习

    《精讲面向软件公司的低代码平台——以Oinone为例》

  • 合作伙伴
    渠道申请伙伴名录专家库
  • 关于数式
0571-88757863

Chapter 13:Interact With Other Modules


In the previous chapter, we modified a module's behavior using inheritance. In our expense management business scenario, we hope to go further and implement a feature to automatically generate financial vouchers for customers. Suppose we have developed an accounting module based on Oinone, so it would be great to directly create accounting vouchers from our expense management module. In other words, once the status of an expense bill is set to "effective", the corresponding accounting voucher should be automatically generated in the accounting application.

I. Link Module

Reference: Documentation related to this topic can be found in "Module API".

Objectives: By the end of this section

  1. Add two modules: "account" and "expenses_account". Hide the expenses_account module in the AppFinder by setting its application attribute to false, and only display the "account" accounting module.
  2. Override the "accept" operation logic of the expenses.ExpenseBill model to automatically generate accounting vouchers when triggered.

Whenever we interact with other modules, we must remember Oinone's modular characteristics. Suppose you have developed both the expense management module and the accounting module. If we plan to sell the application to enterprise customers, some may need to transfer expense data to the accounting system for financial processing and generate corresponding accounting vouchers, while others may not.

For such scenarios, a common practice is to create a "link" module. In our example, this module will depend on the expenses (expense management) and account (accounting) modules and include the logic for creating accounting vouchers from expense bills in expense management. This way, the expense management and accounting modules can be installed independently. When both modules are installed, installing the link module will provide the new functionality.

Exercise

  1. Create the account module.
  2. Create a link module: Create the expenses_account module, set the application attribute to false, and add dependencies on the expenses and account modules.

Tip: You have done similar operations at the beginning of this tutorial, and the process is very similar.

  1. Add a voucher account.Voucher model to the account module with four fields: summary, subject, debitOrCredit, and amount.
  2. Create a menu "Voucher Management" for the account model and bind it to the account.Voucher model.
  3. In the expenses_account module, override the "accept" operation logic of the expenses.ExpenseBill model to automatically generate accounting vouchers when the operation is triggered.

Warning

The package paths of each module must not contain the same path; otherwise, it will cause metadata loading issues. Therefore, for the link module expenses_account, its package path is recommended to start with "link", such as pro.shushi.oinone.tutorials.link.expenses.account.

This chapter may be one of the most difficult covered so far, but it is closest to the actual development scenarios in Oinone.

Edit this page
Last Updated:1/14/26, 8:45 AM
Prev
Chapter 12:Inheritance
Next
Chapter 14:Customized Features
默认页脚
Copyright © 2026 Mr.Hope