Odoo Help


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.


Wizard date not appear

on 7/2/13, 2:16 AM 972 views

can someone help me when i want to generate report im using wizard there is date parameter but it is not appear

Blockquote 'date_to': fields.date("To Date", required=True), }

_defaults = {
    'date_from'     : lambda *x: time.strftime('%Y-%m-%d'),
    # 'date_to': time.strftime('%Y-%m-%d'),
    # 'date_to': datetime.now().strftime('%Y-%m-%d'),
    'date_to': lambda *x: time.strftime('%Y-%m-%d'),

def create_vat(self, cr, uid, ids, context=None):
    if context is None:
        context = {}
    datas = {'ids': context.get('active_ids', [])}
    datas['model'] = 'param.slow.movng.report'
    datas['form'] = self.read(cr, uid, ids)[0]
    #Modified by YH on 03 April 2013 for task [6112]
    return {
        'view_type' : 'report',
        'view_mode' : 'report',
        'view_id' : False,
        'type': 'ir.actions.report.xml',
        'report_name': 'slow.moving.report',
        'datas': datas,
        'nodestroy': True,
        'target' : 'new',
    #End Modified


Blockquote <openerp> <data>

    <record id="view_param_machine_efficiency_report" model="ir.ui.view">
        <field name="name">Daily Machine Efficiency (by machine) Report</field>
        <field name="model">param.machine.efficiency.report</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
        <form string="Machine Efficiency Report">                
            <separator string="Machine Efficiency Report" colspan="4"/>
            <label colspan="4" nolabel="1" string="This menu prints Machine Efficinecy Report"/>
            <field name="date_from"/>
            <field name="date_to"/>            
            <group col="2" colspan="4">
                <button icon='gtk-cancel' special="cancel"  string="Cancel" />
                <button name="create_vat" string="Print" colspan="1" type="object" icon="gtk-ok"/>


Hi , u said your date param is not appearing , can u let us know where ? your view or your report ?

on 7/2/13, 2:53 AM
On 7/2/13, 3:02 AM

Hi ,

u said your date param is not appearing ? from what i see is that in your create_vat function which you are trying to pass the "datas" into the report that you are calling and this is not the right way to pass the data to the report,

if you are using RML report to print report then for it to pick up your custom data, you need to do something like this ...

class slow_moving_report(report_sxw.rml_parse, common_report_header):

 def some_custom_fields ...

report_sxw.report_sxw('slow.moving.report', 'your.module', 'addons/your_module/report/slow_moving_report.rml', parser=your_module , header="internal")

you can take any module , i.e. sales module and look into the folder report and take a look how how it was created.

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

1 follower(s)


Asked: 7/2/13, 2:16 AM
Seen: 972 times
Last updated: 3/16/15, 8:10 AM