I have a problem where user chooses a month and on the basis of that i have to choose starting and ending date of that month.(e.g -> If user chooses January the output should come 01/01/2019 and 31/01/2019)
I am able to fetch the current months starting and ending date by using postgresql query.
This gives current months starting date - 
 @api.model
    def get_start_date(self):
        self.env.cr.execute(""" select date(date_trunc('month', 
                                               current_date));""")
        first_date = self.env.cr.dictfetchall()
        for f in first_date:
            first_new_date = f['date']
            return first_new_date
This gives ending date -
@api.model
    def get_end_date(self):
        self.env.cr.execute(""" select date(date_trunc('month', 
                   current_date) + interval '1 month - 1 day'); """)
        end_date = self.env.cr.dictfetchall()
        for f in end_date:
            end_last_date = f['date']
            return end_last_date
I want if user select January for selection field it should give January's starting and ending date.
if you want to store that data in db use store=True: 
output_field = fields.Char(compute='_get_data', store=True) (or fields.Data)
and then use onchange method:
@api.onchange('selection_field_name')
def _get_data(self):
    if self.selection_field_name:
        self.output_field = **do some calculations**
I need to fetch months starting date and ending date on the basis of the month chosen by the user in odoo