Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to get a day from o.date_invoice in Aeroo

By
Giovanni
on 2/27/13, 12:54 PM 1,315 views

Hi community,

I need to take a day from o.date_invoice can someone help me

Thanks for yours opinions

0

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 12/16/13, 7:20 AM

Hello Giovanni,

You can get this with 2 ways.

(1) You can pass this date via function and convert this to date and get day from that.

Ex. In .py file

from datetime import datetime

In Init method update localcontext with {'get_day' : self.get_day}

def get_day(date_string): date = datetime.strptime(date_string , '%Y-%m-%d') return date.day

In ODS file.

You can call this method with Key name which is passed inside localcontext and pass o.date_invoice to it.

(2) You can pass datetime library from localcontext and access inside ODS file.

Thanks, Serpent Consulting Services.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 2/27/13, 12:54 PM
Seen: 1315 times
Last updated: 3/16/15, 8:10 AM