Odoo Help

Welcome!

This community 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.

0

Unique File Number per Task

By
aci aisha
on 2/23/15, 1:33 AM 534 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

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
3

Vasanth

--Vasanth--
3458
| 5 3 8
Pondicherry, India
--Vasanth--
Vasanth
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

Vasanth
on 2/23/15, 2:18 AM

Thanks,Its working

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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