Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3243 Lượt xem

Dear sir/madam

i need to display calender date before 2005.where should i alter the code.
 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

The ultimate source is in the odoo/odoo/addons/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js which sets the yearRange to be c-10:c+10, i.e. current - 10 years to current + 10 years.  That's why you are seeing years from 2005 to 2025 this year.  The DatePicker instance, I think, is instantiated in the odoo/odoo/addons/web/static/src/js/view_form.js file (search for the start method of instance.web.DateTimeWidget).  You can either change it from that file (add yearRange in setDefaults to your satisfaction) or override the start method of instance.web.DateTimeWidget.

Ảnh đại diện
Huỷ bỏ