Comment 1 for bug 323638

Revision history for this message
Ferdinand (office-chricar) wrote :

IMHO a nonsense
code may be unique not ref - Notes may never be unique !
if code is unique it must be mandatory

class res_partner_function(osv.osv):
    _name = 'res.partner.function'
    _description = 'Function of the contact'
    _columns = {
        'name': fields.char('Function Name', size=64, required=True),
        'code': fields.char('Code', size=8),
        'ref':fields.char('Notes', size=32, required=True),
    }
    _order = 'name'
    _sql_constraints = [
        ('ref_uniq', 'unique (ref)', 'The Notes of the Partner Function must be unique !')
    ]
res_partner_function()