Odoo Help


How should i get days of a month automatically(ie,In Jan it should come 31,Feb it should be 28...) in my report

on 2/6/14, 2:59 AM 890 views

I am using Openoffice+ base_report_designer module for printing this requirement.

But i dont know how to implement this.. Can any one help me ?

On 2/6/14, 3:56 AM

In python create function using current date to calculate End of the Current month.

The below link may be useful to Create function in python report file and call in Openoffice


report \attendance_errors.py

def __init__(self, cr, uid, name, context):
    super(attendance_print, self).__init__(cr, uid, name, context=context)
        'time': time,
        'lst': self._lst,
        'total': self._lst_total,

def _get_employees(self, emp_ids):
    emp_obj_list = self.pool.get('hr.employee').browse(self.cr, self.uid, emp_ids)
    return emp_obj_list

report \attendance_errors.sxw file open with openoffice

[[ repeatIn(get_employees(data['form']['emp_ids']),'employee') ]]

How can we connect this code to our reports.

on 2/6/14, 4:49 AM

eg: get_periods function is defined in the py file for getting the month and call this functin in report like this. [[get_periods(o.value)]] But Error message like this " name 'get_periods' is not defined " (I manually send the report to server.) Place the .rml and .py file in the report folder of hr_attendance module . Then upgrade the module.

on 2/6/14, 4:54 AM

Example given in the report/attendance_errors.py updated the code

on 2/6/14, 5:17 AM

Or Without using python code. How can we implement this.

on 2/6/14, 5:18 AM

report in .ODT format

on 2/6/14, 5:19 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 2/6/14, 2:59 AM
Seen: 890 times
Last updated: 3/16/15, 8:10 AM