'How to remove seconds of datetime field in odoo14

i created two datetime field in odoo14 like start_time and end_time

a.py

start_time = fields.Datetime(string='Start Time', required=True)
end_time = fields.Datetime(string='End Time', required=True)

a.xml

<field name="start_time" widget="daterange" {"related_end_date": "end_time"}' required="1" decoration-danger="overlapping"/>
<field name="end_time" widget="daterange" options='{"related_start_date": "start_time"}' required="1" decoration-danger="overlapping"/>

How can i remove the seconds part only; datetime format should be the active datetime format in the database and i don't want to create or edit the active format

Please help me to fix this.

Thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source