0
所以它很簡單,我得到添加一個簡單的約束時錯誤(IdentationError:意外的ident),我直接添加於Postgres沒有問題添加SQL由蟒蛇約束
class fleet_site(osv.Model):
_name = 'fleet.site'
_description = 'Information du site'
_order= 'name asc'
_columns = {
'name': fields.char('Nom', help='Nom du site', required=True),
'vehicle_ids': fields.one2many('fleet.vehicle','site_id','Vehicules')
}
_sql_constraints = [('fleet_site_name_unique','unique(name)', 'Le nom du site existe')]