* 约定
    # 命名会用  蛇形式或驼峰式
        todo_task_stage 蛇形式
        class TodoTask 驼峰式
      变量名还是蛇形居多, 类名和方法名驼峰式居多
     
    # 模式
        from openerp import models
       
    # 字段
        from openerp import fields
       
    # 翻译
        from openerp import _
       
    # 接口
        from openerp import api
       
    # 异常
        from openerp import exceptions
       
    # 典型模块导入
        from openerp import models,fields,api,_
       
    # 类
        class Toto(models.Model):
           pass

        class Titi(models.TransientModel):
           pass
          
    # 新的异常类
        openerp.exceptions.Warning
       
    # 字段
        定义词义比较好的,不要一味缩写
       
    # 在模型中,不要去改变self 用一个方法,否则缓存都无效了
   
    # 数据库句柄 用当前的 self.env.cr
   
    # 约束 用上 @api.constrains

相关文章:

  • 2022-12-23
  • 2021-10-04
  • 2021-07-22
  • 2021-08-06
  • 2022-02-06
猜你喜欢
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
  • 2022-03-07
  • 2021-12-24
  • 2021-09-26
  • 2022-12-23
相关资源
相似解决方案