Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
523 Visualizzazioni

How to control form view record duplication

Avatar
Abbandona
Risposta migliore

Hi,

This attribute serves to control the availability of the "Duplicate" option for a record within the form view.
example:

<record id="product_product_view_form" model="ir.ui.view">
<field name="name">product.product.view.form</field>
<field name="model">product.product</field>
            <field name="arch" type="xml">
                <form duplicate="0">
                    <group>
                        <!-- Field for Product Name -->
                        <field name="name"/>
                    </group>
                </form>
            </field>
        </record>


Hope it helps

Avatar
Abbandona
Risposta migliore

Hi Alex

Use sql Constrains or Api Constrains to avoid these duplication 

_sql_constraints = [
        ('name_uniq', 'UNIQUE (name)',  'You can not have two users with the same name !')
    ]

like these you can update each fields .

SQL Constrains 


Regards

Avatar
Abbandona