1 Star 0 Fork 45

qindaoli / odoojs

forked from letsdoo / odoojs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
LGPL-3.0

重要升级

  1. 2023-8-20 odoojs 重要升级
  2. 使用旧版的 请到分支 odoojs-vue3-rpc-v1

联系我们

  1. QQ 群 2684913
  2. odoojs@outlook.com
  3. 北京斑马线科技有限公司负责维护 odoojs 的所有代码
  4. 欢迎有志于 odoo 前后端分离项目的 个人/团队, 共同维护 odoojs
  5. odoojs 团队提供 odoojs 前后端分离 解决方案付费培训服务, 请加入 qq 群, 联系群群管理员

odoojs 介绍

  1. odoojs 是 odoo 前后端分离解决方案
  2. odoojs 以 odoo 为服务端. 全新实现独立的前端
  3. 依赖核心模块 odoojs-rpc, odoojs-api
  4. odoojs-rpc 是一个 javascript 库, 是前端访问 odoo 的接口.
  5. odoojs-api 是一个 javascript 库, 是管理 action, menu, view 的工具.
  6. 导入 odoo-rpc. "import rpc from 'odoojs-rpc'"
  7. 导入 odoo-api. "import api from 'odoojs-api'"
  8. odoojs 通过 odoojs-rpc 从 odoo 服务端获取所有的数据.
  9. odoojs 通过 odoojs-api 管理所有的 menu, action, view
  10. odoojs 自定义 所有的 menu, action, view. 需要 自行创建 addons_odoo
  11. odoojs 基于 vue3 前端架构.
  12. odoojs 选择 ant-design-vue v4 作为 ui 库.
  13. odoojs 实现了 官方 odoo 前端的所有功能.
  14. odoojs 自动识别 odoo 服务端已安装的模块.
  15. odoojs 根据已经安装模块, 自行处理相应的 menu, action, view.
  16. 非 odoo 官方的自定义模块. 需要在 odoo 服务端安装.
  17. 同时 使用 odoojs 提供的 addons 扩展功能, 定义相应的 menu, action, view.
  18. 因此 odoojs 适配 自定义模块的扩展.
  19. odoojs 可以选择 ant-design-vue 之外的 ui 库.
  20. 仅需替换 odoojs 中相应的 ui 组件即可.
  21. odoojs 可以选择 vue3 之外的 其他前端架构.
  22. 而保持 odoojs-rpc, odoojs-api, addons 不变.
  23. odoojs 支持多语言. 仅需 增加相应语言的 addons 补丁包.

规划

  1. 建立 基于 odoojs 的中国本地化 ERP 产品
  2. 建立 基于 odoojs 的开发模式. 服务于广大 odoo 实施团队
  3. 建立 基于 odoojs 的服务模式. 为 ERP 使用方提供 自定义 ERP 系统的解决方案

odoojs 技术原理

技术路线

  1. odoo 官方源码做服务端
  2. odoojs 实现前后端分离
  3. odoojs 前端 暂时选择 vue 架构. 但不限. 可以选择 react
  4. odoojs 前端 暂时选择 UI 库 antd-vue. 但不限. 可选择其他常用的 UI 库
  5. odoojs 完全支持 移动 web 端. 只需选择适用的 UI 库即可
  6. odoojs 完全支持 移动端 app. 只需直接使用 odoojs-rpc 做 服务端访问接口即可
  7. odoojs 完全支持小程序等特定的客户端. 只需要使用 小程序专用的组件即可

odoojs 流程

  1. odoojs 前端程序, 启动后, 首先加载所有自定义的 menu, action, view.
  2. 渲染 menu.
  3. 在一个 menu 选中后, 获取到对应的 action.
  4. 根据 action, 获取 相应的 tree view 或者 form view.
  5. 根据 view, 获取对应的 model, fields. 以及 html 要素.
  6. 根据 model, fields 从 odoo 服务端获取数据.
  7. 获取到的数据, 在 view 中, 各 field 自行使用相应组件进行渲染显示.
  8. view 中的 field, 支持 readonly, visible, required, domain 等属性.

odoojs 编辑页面的流程

  1. 需要编辑数据时, 将 view 设置为编辑状态.
  2. 在编辑状态下, 创建一个 editmodel.
  3. editmodel 由 odoojs-rpc 进行管理, 在前端页面中无需额外关心.
  4. 该 editmodel 管理所有的编辑中的数据.
  5. view 中某个字段 field 编辑后, 触发 onchange.
  6. onchange 在 editmodel 中进行排队. 以确保 onchange 顺序依次触发.
  7. onchange 访问 odoo 服务端, 获取数据. 更新到 editmodel. 并返回到 view.
  8. view 渲染数据.
  9. view 编辑完成, 触发 commit.
  10. commit 与 onchang 一样 在 editmodel 中排队.
  11. commit 访问 odoo 服务端, 发送 create or write 请求, 更新数据到服务端.
  12. commit 之后, 销毁 editmodel, view 回到只读状态.
  13. view 发送 read 请求, 重新获取数据, 并渲染到 view 中.

odoojs one2many 字段的处理

  1. main view 渲染显示数据.
  2. main view 中, 各 field 由相应的 field 组件进行渲染.
  3. one2many 字段的 sub tree view, sub form view 在 main view 中已定义
  4. main view 读取数据时, 已经嵌套获取 one2many 字段的数据
  5. one2many 字段 sub tree view 渲染数据.
  6. one2many 字段 sub form view 以弹窗方式 显示单条数据.

odoojs one2many 字段的编辑处理

  1. main view 进入编辑状态.
  2. one2many 字段 sub tree view 为编辑状态, 显示 create 按钮.
  3. pick one sub record or new sub record, 创建 sub form view.
  4. sub form view 创建 sub editmodel.
  5. sub form view 触发 onchange, 访问 odoo 服务端, 更新到 sub editmodel.
  6. sub form view 触发 commit. 销毁 sub editmodel. 更新数据到 sub tree view.
  7. sub tree view 触发 main view 的 onchage.
  8. main view 的 commit 之前, 从 sub tree view 获取 one2many 字段的数据.
  9. main view 触发 commit

分支管理

master 分支

  1. 基于 vue 3.2.x 和 antv 4.x.x
  2. odoojs-rpc 升级
  3. 更新为 odoojs-rpc odoojs-api 两个依赖库

odoojs-vue3-rpc-v1 分支

  1. 基于 vue 3.2.x 和 antv 3.2.x
  2. odoojs-rpc 为旧版本

odoojs-vue2 分支

  1. 基于 vue2 和 antv1.7.8
  2. 扬弃 odoo 官方的 menu、action、view,
  3. 在 odoojs 前端全部重新定义 menu、action、view
  4. odoorpc 代码更新, 优化 menu、action、view 的处理
  5. 2023-3-6 创建该分支, 基于原 master 分支创建
  6. 2023-3-6 之后, master 另做他用

odoojs-classic 分支

  1. 直接读取 odoo 服务端的 menu、action、view, 在 odoojs 前端呈现
  2. 该分支保留了 odoo 官方原汁原味的前端功能
  3. 2022-10-10 创建该分支, 基于原 master 分支创建
  4. 2022-10-10 之后, master 另做他用

更新历史

最新更新 2023-8-20

  1. 创建 odoojs-vue3-rpc-old 分支
  2. odoojs-rpc 升级. 旧代码保留于此

最新更新 2023-3-8

  1. 创建 odoojs-vue2 分支
  2. odoojs-vue2 分支. 基于 vue2 和 antv1.7.8
  3. 更新 master 分支. 基于 vue 3.2.13 和 antv 3.2.15

最新更新 2022-10-10

  1. 基于原有 master 分支, 创建 odoojs-classic 分支
  2. odoojs-classic 分支, 直接读取 odoo 服务端的 menu、action、view, 在 odoojs 前端呈现
  3. odoojs-classic 分支,保留了 odoo 官方原汁原味的前端功能
  4. master 分支, 继续维护最新的代码
  5. master 分支, 扬弃 odoo 官方的 menu、action、view, 在 odoojs 前端全部重新定义
  6. master 分支的 odoorpc 代码更新, 优化 menu、action、view 的处理

2022-2-13

  1. odoorpc 优化
  2. odooapi 优化
  3. 调整 api.my.home 接口. 从 odoorpc 移动到 odooapi

2022-2-7

  1. portal 页面. /my/home
  2. 自定义菜单.
  3. 自定义 xml

2022-1-25

  1. 使用 this.$route.meta.routes 存路由历史
  2. 使用 localStorage 存 routes. 页面手动刷新时, 保留路由历史
  3. 页头 title. 数据取自 routes. 显示层级结构
  4. action.load 时,仅 load action。 不再直接 load_views, 而在需要时 由页面 load views
  5. 附件上传与下载

2022-1-23

odoorpc/odooapi 完善.

  1. session info store in request class
  2. ir.filters 功能
  3. o2m tree view. line edit
  4. kanban view. button click event
  5. file import api

UI 组件完善

  1. pivot view / graph view / calendar view
  2. 收藏按钮
  3. o2m tree view. line edit
  4. kanban view. dropdown menu

2022-1-12

odoorpc/odooapi 代码更新. 纯函数方式
UI 组件完善

2021-12-3

选择 ant-design-vue 做 UI
odoorpc/odoojs 代码优化

2021-7-26

odoojs 重大改进
访问 odoo 的方式更简洁

2020-8-30

之前使用 react 实现的 odoojs
之后 使用 vue

GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.

简介

odoojs 是一个 javascript 类库, 是前端访问 odoo 的接口, 是 odoo 在前端开发中的代言者. 展开 收起
NodeJS
LGPL-3.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
NodeJS
1
https://gitee.com/qindaoli/odoojs.git
git@gitee.com:qindaoli/odoojs.git
qindaoli
odoojs
odoojs
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891