This question has been flagged
1 Reply
2209 Views

Friends,

I created a many2one field(named file_no_tn) in project.task.form.When i select the value of another field field_type as "Trademark" this field displayed.For each task i add a file_no_tn for it.But the file_no_tn should be unique for task.Is it posible?

For example,

For task T1,

we select file_no as TM 4533

Then for Task T2,

we should not hav to select TN 4533 again

but now we can select

How can we make restriction for this selection?

Thanks

Avatar
Discard
Author

I tried..but no use

Best Answer

Hi, you can use this sql constraint

    _sql_constraints = [('file_no_tm_uniq','unique(file_type_ids,file_no_tm)','This File Number is Already Selected'), 
                        ]

Avatar
Discard
Author

Ddnt work properly

i will work.give the correct field names in the parameters and upgrade the module

Author

Thanks,Its working