zoukankan      html  css  js  c++  java
  • Odoo 看板视图

    动态管理记录阶段

    # 1. 新建 state 模型, 存储动态阶段
    # 2. fold 字段,用于收缩起阶段
    # 3.
    

    看板视图上添加进度条

    <progressbar
      field="popularity"
      colors='{"low": "success", "medium": "warning", "high": "danger"}'/>
    

    group_expand属性

    # group_expand 属性
    		修改字段的分组的行为。默认字段分组显示了所有阶段
        
    # group_create 从看板中禁用添加列选项    <kanban  group_create="false"></kanban>
    # sequence 排序
    # group_edit  和 group_delete   编辑 和删除
    # fold 字段 表示进行折叠并且列会显示为一条很细的线
    # active  看板在列表中存档记录和或者归档记录
    # quick_create  直接从看板视图创建记录  <kanban quick_create="false"
    
    

    看板视图 显示颜色、标签 和 优先级

    <!--on_create="quick_create"   视图看板上创建-->
    <kanban default_group_by="stage_id" 
            			on_create="quick_create"   
            			quick_create_view="my_library.library_book_rent_view_form_minimal" >
        <field name="stage_id"/>
        <field name="color"/>
        <templates>
            <t t-name="kanban-box">
                <!-- t-attfclass="#{kanban_color(record.color.raw_value)} oe_kanban_global_click"  颜色-->
                <!-- -->
                <div t-attfclass="#{kanban_color(record.color.raw_value)} oe_kanban_global_click">
                    <div class="o_dropdown_kanban dropdown">
                        <a class="dropdown-toggle o-no-caret btn"
                           role="button" data-toggle="dropdown">
                            <span class="fa fa-ellipsis-v"/>
                        </a>
                        <div class="dropdown-menu" role="menu">
                            <t t-if="widget.editable">
                                <a role="menuitem" type="edit" class="dropdown-item">Edit</a>
                            </t>
                            <t t-if="widget.deletable">
                                <a role="menuitem" type="delete" class="dropdown-item">Delete</a>
                            </t>
                            <ul class="oe_kanban_colorpicker" data-field="color"/>
                        </div>
                    </div>
                    <div class="oe_kanban_content">
                        <div class="oe_kanban_card oe_kanban_global_click">
                            <div>
                                <i class="fa fa-user"/>
                                <b>
                                    <field name="borrower_id"/>
                                </b>
                            </div>
                            <div class="text-muted">
                                <i class="fa fa-book"/>
                                <field name="book_id"/>
                            </div>
                            <span class="oe_kanban_list_many2many">
                                <field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
                            </span>
                            <div>
                                <field name="popularity" widget="priority"/>
                            </div>
                        </div>
                    </div>
                </div>
            </t>
        </templates>
    </kanban>
    

    ##################################################################

    创建服务端动作

    #  通过描述要执行的动作。这些动作随后可由事件触发器调用,或在满足某些时间条件时自动触发
    
    
     <!-- server actions to add option in the menu "More" -->
        <record id="aa" model="ir.actions.server">
                      <field name="name">Hellow</field>
                      <field name="model_id" ref="sale.xxxx"/>
                      <field name="binding_model_id" ref="product.xxxx"/>
                      <field name="state">code</field>
                      <field name="code">
                                if records:
                                  records.push_product_ebay()
                      </field>
        </record>
    
        
    #  参数解释
    		mould_id   : 当前的动作是在哪个模型上运行的
        	binding_model_id : 绑定的模型,当前动作将会出现在绑定的模型的视图中
            state  : 服务器动作的类型,四种:code 执行py代码。object_create 创建一条新记录。object_write 更新记录 。 multi 执行多个动作
            code : 对应state 类型 code ,为当前动作运行时,执行的Python代码
            ref : reference的缩写,值是一个外部ID 。
            
            
            # code 里, 可以直接用的变量
            	 env  : odoo 运行的环境
                 model : 动作出发对应的odoo 模型实例
                 record : 动作触发时对应的单个记录(在表单中运行对应的是当前表单所指向的记录)
    			 records :动作触发时对应的记录集合
                 python库 :time  datetime
                 log : 记录日志信息
                 Warning  : 通过raise Waring('')  抛出警告异常
    

    使用 Python 代码服务端动作

    根据时间条件使用自动化动作

    根据事件条件使用自动化动作

    创建基于QWeb的PDF报告

  • 相关阅读:
    每日一篇文献:Robotic pick-and-place of novel objects in clutter with multi-affordance grasping and cross-domain image matching
    每日一篇文献:Intuitive Bare-Hand Teleoperation of a Robotic Manipulator Using Virtual Reality and Leap Motion
    每日一篇文献:Virtual Kinesthetic Teaching for Bimanual Telemanipulation
    HEBI Robotic Arm VR Teleoperation
    「iQuotient Case」AR device teleoperated robotic arm
    VR and Digital Twin Based Teleoperation of Robotic Arm
    HEBI Robotic Arm VR Teleoperation
    Human Robot Interaction
    Immersive Teleoperation Project
    机器人演示学习
  • 原文地址:https://www.cnblogs.com/dengz/p/14582180.html
Copyright © 2011-2022 走看看