Odoo Help

0

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

By
savita
on 5/30/16, 2:40 AM 433 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 KS
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.


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.

Register

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)

Stats

Asked: 5/30/16, 2:40 AM
Seen: 433 times
Last updated: 5/31/16, 1:48 AM