zoukankan      html  css  js  c++  java
  • odoo 瞬态模型中 *2many字段默认不让新建

    可以在xml中添加节点属性create="1"

        <record id="move_reserved_view_form" model="ir.ui.view">
            <field name="name">move.reserved.view.form</field>
            <field name="model">move.reserved</field>
            <field name="arch" type="xml">
                <form string="">
                    <sheet>
                        <group>
                            <!-- Add your fields here -->
                            <field name="product_id"/>
                            <field name="move_id"/>
                            <!-- <field name="quants" readonly="0"/> -->
                            <field name="quants" domain="[('product_id','=',product_id)]" 
                            context="{'search_default_internal_loc':1}">
                                <tree create="1"> 
                                    <!--如果不添加create属性,就不能添加数据.-->
    
                                    <control>
                                        <create string="添加明细"/>
                                    </control>
                                    <!-- <field name="id"/> -->
                                    <field name="product_id"/>
                                    <field name="quantity"/>
                                    <field name="reserved_quantity"/>
                                    <field name="product_color"/>
                                    <field name="product_level"/>
                                </tree>
                            </field>
    
                        </group>
                    </sheet>
                    <footer>
                        <button name="write_back_package" string="确定库存信息" type="object" class="oe_highlight"/>
                        or
                        <button string="Cancel" class="oe_link" special="cancel"/>
                    </footer>
                </form>
            </field>
        </record>
    
  • 相关阅读:
    0425正则数组
    0424php函数
    0424php基础
    string类例题
    数组分为一维数组,二维数组,多为数组
    string类 截取的长度 是否包含某个数
    循环语句2
    /异常语句try,catch.
    string类
    循环语句
  • 原文地址:https://www.cnblogs.com/qianxunman/p/12587328.html
Copyright © 2011-2022 走看看