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

How to add dynamically changing date on our custom form on top?

By
savita
on 5/30/16, 2:40 AM 239 views

i created a form and now i want to add date on top of the page which should show todays date? How to do that?

0
savita
On 5/31/16, 1:21 AM

I want to add on top(header part) not below part..so kindly help me with how to add above part..in ACTION Part...??

0

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 5/30/16, 8:19 AM

HI,

You can use computed fields: because its is computed on-the-fly.

Define a Date field with compute. Please try this script:


    date = fields.Date(compute='_compute_date', string='Date')

    def _compute_date(self):

        for record in self:

            end = datetime.date.today()

            record.date = end


Hope this helps.


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: 5/30/16, 2:40 AM
Seen: 239 times
Last updated: 5/31/16, 1:48 AM