Odoo Help


Unique File Number per Task

aci aisha
on 2/23/15, 1:33 AM 867 views


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?


use _sql_constraints

Atchuthan - Technical Consultant, Sodexis Inc
on 2/23/15, 1:56 AM

I tried..but no use

aci aisha
on 2/23/15, 2:07 AM



| 5 3 8
Pondicherry, India
On 2/23/15, 1:59 AM

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'), 

Ddnt work properly

aci aisha
on 2/23/15, 2:07 AM

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

on 2/23/15, 2:18 AM

Thanks,Its working

aci aisha
on 2/23/15, 3:43 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/23/15, 1:33 AM
Seen: 867 times
Last updated: 3/16/15, 8:10 AM