Search Here

Playing with Date field in Odoo

 In this article, you will learn how to use and convert Odoo date field (which is in string format by default) into a python date object using datetime package provided by the python built-in library.

How to use and manipulate the Date field in Odoo

How to use and manipulate the Date field in Odoo

To create a date field in Odoo we will use fields. Date, the attribute type of this field in PostgreSQL is a date, but when we print this field value it gives a date in string. To manipulate and perform some action on that date field we need to convert this date value from a string into a date object. To do that we will use a python built-in package named datetime.


Get the First Date of every month between two dates in python

In this part, you will learn how to extract the first date of every month provided by two dates (start and end date). In Odoo date field stores values in string format. To extract the first date of each month we need to convert the string date into a python date object.


Post a Comment

0 Comments