* 快捷标签
   提供快捷标签是为了简化代码的编码,把复杂的工作封装化
  
* 找到封装化的源码:
  openerp/tools/convert.py   xml_import
      self._tags = {
            'record': self._tag_record,
            'delete': self._tag_delete,
            'function': self._tag_function,
            'menuitem': self._tag_menuitem,
            'template': self._tag_template,
            'workflow': self._tag_workflow,
            'report': self._tag_report,

            'ir_set': self._tag_ir_set,
            'act_window': self._tag_act_window,
            'url': self._tag_url,
            'assert': self._tag_assert,
        }
       
   可以看到系统常用到的快捷标签
    # record  对应模型 ir.model.data
    # delete 删除指定模型满足一定条件的记录
    # function 执行指定模型中方法
    # menuitem 对应模型 ir.ui.menu  定义菜单
    # template 对应模型 ir.ui.view   定义视图
    # workflow  触发工作流
    # report  对应模型 ir.actions.report.xml
    # ir_set
    # act_window 对应模型 ir.actions.act_window
    # url 对应模型 ir.actions.act_url
    # assert
   
    使用权限是 标签用 groups ,模型确用 groups_id
   
   
* record标签是定义数据最基础的一个
      <record ...>
        <field >....</field>
          .....
      </record>   
     
* delete
    <?xml version="1.0" encoding="utf-8"?>
    <openerp>
        <data noupdate="1">
            <delete model="ir.rule" search="[('id', '=',
            ref('todo_app.todo_task_user_rule'))]" />
           
            <record >self</field>
    </record>
 

* assert

相关文章:

  • 2021-10-17
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2021-12-21
  • 2021-06-08
猜你喜欢
  • 2022-12-23
  • 2021-08-30
  • 2021-12-10
  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案