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.

1

date deadline on tasks

By
Chacha
on 4/28/15, 12:42 PM 588 views

how to modify the creation form of a task such as it generates a warning message or block when the date deadline is anterior to the created date.

Ans: You must inherit model project.task and add constrains function (test dates), like this: ____________________________________________________________________________ @api.one @api.constrains('name', 'description') def _check_description(self): if self.name == self.description: raise ValidationError("Fields name and description must be different") ____________________________________________________________________________ Thanks for the above answer, I am very new to Odoo, please can you orient me on where exactly this contraints should be inserted. Thanks in advance for your reaction and help

Chacha
on 4/29/15, 5:24 AM

You must create own module. See https://www.odoo.com/documentation/8.0/howtos/backend.html

zbik
on 4/30/15, 12:07 PM
1

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 4/28/15, 1:09 PM

You must inherit model project.task and add constrains function (test dates), like this:

 

@api.one
@api.constrains('name', 'description')
def _check_description(self):
   if self.name == self.description:
      raise ValidationError("Fields name and description must be different")

0
ankita
On 5/1/15, 4:02 AM

Hello,

You have to create your own form and inherit model project.task then create a onchange method to show the warning

def onchange_deadlinedate(self, cr, uid, ids,create_date, deadline_date, context=None):

context = context or {}

warning = {}

if create_date != False and deadline_date != False:

if (deadline_date>=create_date):

warning = {

'message':

  Create date Should be greater than dead line date!"

}

return {'warning': warning}

else:

return {'warning': warning}

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: 4/28/15, 12:42 PM
Seen: 588 times
Last updated: 12/22/15, 8:02 AM