gawel
gawel

Reputation: 2048

How to change default dates values set for hr.holidays form in Odoo 8

I would like to change the defaults values set for date_from and date_to fields in the hr.holidays form but I can't figure out where those values came from.

There is no _defaults in the model and no defaults= in the fields definition.

Any hint ?

Upvotes: 2

Views: 653

Answers (2)

DASADIYA CHAITANYA
DASADIYA CHAITANYA

Reputation: 2892

You can check the sale module check the sale.py for Odoo 9.0 community addons but Odoo 8.0 some module is not yet migrated for new API and do apply your own function make it as your own logic and call it on your field attribute.

FOR EXAMPLE :

@api.model
def _default_note(self):
    return self.env.user.company_id.sale_note

note = fields.Text('Terms and conditions', default=_default_note)

I hope my answer may helpful for you :)

Upvotes: -1

gawel
gawel

Reputation: 2048

I finally figured out where those values are set. It's hardcoded in the web_calendar.js script. See:

https://github.com/odoo/odoo/blob/8.0/addons/web_calendar/static/src/js/web_calendar.js#L627

Upvotes: 2

Related Questions