Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
30212 Weergaven

order_id = fields.Many2one('sale.order', string='Order Reference', required=True, ondelete='cascade', index=True, copy=False)


What index and copy means?

What about ondelete='cascade'?

Avatar
Annuleer
Beste antwoord

copy=False
If you put copy=False to a field, When you duplicate a record, That value is not copied to duplicating (Newly created)record.

ondelete='cascade'

If you put this to a Many2one field, the deletion of record will cause to deletion of one2one records according to that record.
Eg:

When you delete a Sale Order, It will delete sale order lines also.

Index=True

you can speed the database search performance. However, you should be careful not to add indexes on too many fields because the size of the database can rapidly increase. What means, you should carefully detect the most searchable fields and to create indexes for them only.

Hope it may help you :)

Avatar
Annuleer
Auteur

Thanks, it helps.

Happy To help you. :)

Gerelateerde posts Antwoorden Weergaven Activiteit
1
apr. 19
2654
2
sep. 18
14474
1
feb. 18
3813
1
nov. 24
2106
1
jan. 21
3574