Skip to content

eleksbai/odoo_tutorials

 
 

Repository files navigation

Odoo tutorials

This repository hosts the code for the bases of the modules used in the official Odoo tutorials.

It has 3 branches for each Odoo version: one for the bases, one for the Discover the JS framework tutorial's solutions, and one for the Master the Odoo web framework tutorial's solutions. For example, 17.0, 17.0-discover-js-framework-solutions and 17.0-master-odoo-web-framework-solutions.

备注

服务器框架101课程

花了一些时间学习了odoo的官方教程。 教程是没有问题的,指向的一些示例代码可能已经过时。 官方教程似乎没有完整的教程源码作为参考,所以我把学习过程的写的代码放出来做参考。 学习过程优先按官网教程来,实在找不到可以参考一下我的代码。

学完后可以看下这个odoo的编码指南 ,我觉得这个写得比较细致,对新人比较友好。

启动配置参考

odoo-bin -c  dist/dev.conf.txt -u estate --dev xml

第 1 章:Owl 组件

web教程是在它配好的demo上进行修改。已经默认配好了网页路由。 通过这个入口来访问

slot本质是基于props,需要在props 定义出slot参数。

第 2 章:构建仪表板

服务中要注意生命周期的问题,使用useService可以放在setup里面,不能放在onWillStart里面 memoize, 将函数包装为缓存函数,只有在页面刷新时才会触发重新加载。页面切换不触发。

onWillStart 似乎必须放setup里面

响应式对象是一个对象,注意不能修改对象本身的应用,只能修改内部属性的值。 js中函数要注意当前绑定的this,可以手动来绑定。 可以用useState来接受一个reactive对象,注意不能直接改reactive的原始引用,只能修改其值。

About

A repository with the code for the bases and solutions of the official Odoo tutorials

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 69.0%
  • JavaScript 30.7%
  • SCSS 0.3%