~akretion-team/openerp-product-attributes/openerp-product-attributes-image

« back to all changes in this revision

Viewing changes to base_custom_attributes/ir_model.py

[IMP] add a function to define allowed chars for database column name + cleaning code .py alignement

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- encoding: utf-8 -*-
2
2
###############################################################################
3
3
#                                                                             #
4
 
#   product_custom_attributes for OpenERP                                      #
5
 
#   Copyright (C) 2011 Akretion Benoît GUILLOT <benoit.guillot@akretion.com>  #
 
4
#   product_custom_attributes for OpenERP
 
5
#   Copyright (C) 2011 Akretion Benoît GUILLOT <benoit.guillot@akretion.com>
6
6
#                                                                             #
7
7
#   This program is free software: you can redistribute it and/or modify      #
8
8
#   it under the terms of the GNU Affero General Public License as            #
27
27
 
28
28
    _inherit = "ir.model.fields"
29
29
    _columns = {
30
 
        'field_description': fields.char('Field Label', required=True, size=256, translate=True),
 
30
        'field_description': fields.char(
 
31
            'Field Label',
 
32
            required=True,
 
33
            size=256,
 
34
            translate=True),
31
35
    }
32
36
    _sql_constraints = [
33
 
        ('name_model_uniq', 'unique (name, model_id)', 'The name of the field has to be uniq for a given model !'),
 
37
        ('name_model_uniq', 'unique (name, model_id)',
 
38
            'The name of the field has to be uniq for a given model !'),
34
39
    ]