Hello, Developers

I am making a module with a Report about products in location for to
see something this in report:

location: MyLocation

  product      quantity
product A          5
product B          3
product C          10


I get the view with path >Inventory &
Stock>Locations>MyLocation>Wizard (date_end)>Products (MyLocation),

but I can't get data of this view because this data is computed with a
context, so then the report .odt show this:

  product      quantity
product A          0
product B          0
product C          0

I need get the context in my class report something like:

context = {'stock_date_end': datetime.date(2012, 6, 7), 'locations':
[4], ... }

But I can't  get context, I tried this but did'nt work:

class StockProductReport(Report):
    _name = 'product.product'

    def __init__(self):
        super(StockProductReport, self).__init__()

    def parse(self, report, objects, datas, localcontext=None):
        location_obj = Pool().get('stock.location')
        uom_obj = Pool().get('product.uom')

        localcontext['stock_date_end'] =
Transaction().context.get('stock_date_end'):
        localcontext['locations'] =
Transaction().context.get('locations'):

        with Transaction().set_context(localcontext):
            for obj in objects:
                 <<to do something>>

        return super(StockProductReport, self).parse(report,
                objects, datas, localcontext)

StockProductReport()

I appreciate any help.

-- 
[email protected] mailing list

Reply via email to