How to pass wizard data to

Jakub Parcheta


I try to pass start_date and stop_date from wizard to,

is there any other way to do it then my way? I tried self.env['model.wizard'] but does not work.

Wizard .py:

class GetDatesWizard(models.TransientModel):

    _name = 'get.dates.wizard'

    start_date = fields.Date("Start date")

    stop_date = fields.Date("Stop date")

    def create_report(self):

        return {

            'name': 'generate report',

            'type': 'ir.actions.act_window',

            'res_model': '',

            'view_mode': 'pivot',


Report .py:

class CostPlateReport(models.Model):

    _name = ""

    _order = 'date desc'

    partner = fields.Many2one('res.partner','Client')

    date = fields.Date('Date')

    plate = fields.Char('Plato')

    cost = fields.Float('Cost')

    def _query(self, with_clause='', fields={}, groupby='', from_clause=''):

        with_ = ("WITH %s" % with_clause) if with_clause else ""

         last_wizard_record = self.env['fechas.informe.nutricion.wizard'].search([ ])[-1]

        start_date =  last_wizard_record.start_date  # does not work

        stop_date = last_wizard_record.stop_date    # does not work

        select_ = """

            min( as id, as date,m.partner as partner, as plate,pc.cost as cost


        for field in fields.values(): 

            select_ += field

        from_ = """

                irco_menu m

                    join irco_menu_plates p on (

                        join res_partner r on (

                        join product_template pt on (

                            join irco_plate_cost pc on (

                            join product_product pp on (


        """ % from_clause

        groupby_ = """

  ,,m.partner,,pc.cost  %s

        """ % (groupby)

        return "%s (SELECT %s FROM %s WHERE m.state = 'done' GROUP BY %s)" % (with_, select_, from_, groupby_)


    def init(self):

        tools.drop_view_if_exists(, self._table)"""CREATE or REPLACE VIEW %s as (%s)""" % (self._table, self._query()))