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

method end date cannot < start date [Closed]

By
Susi
on 2/13/15, 2:05 AM 715 views

The Question has been closed

by
Susi
on 01/21/2016 23:15:41

i have field start date & end date, and i want end date can't be filled less then start date , and  there will be warning if end date filled < start date

how, should i code method...thanks before

1

Baiju

--Baiju--
3154
| 5 4 8
Kochi, India
--Baiju--
ODOO technical and functional

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

Baiju
On 2/13/15, 2:47 AM

Hi Susi,

You can add sql constraint for this as follows:-

_sql_constraints = [
        ('date_check', "CHECK ( (start_date <= end_date))", "The start date must be anterior to the end date.")
    ]

This will check the condition and if condition fails it will show the given message.

Hope this helps.

2

Vasanth

--Vasanth--
3458
| 5 3 8
Pondicherry, India
--Vasanth--
Vasanth
On 2/13/15, 2:22 AM

Hi

this link can help for youe question :

https://www.odoo.com/forum/help-1/question/how-to-validate-star-date-is-less-than-the-current-date-or-not-50921#answer-50926

0
Susi
On 2/13/15, 3:28 AM

its work thank u

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/13/15, 2:05 AM
Seen: 715 times
Last updated: 1/21/16, 11:15 PM