I would like to know how could I get all picking references related to a given source origin sales order.
So basically I would like to retrieve in python a list of picking OUT orders (WH/OUT/...) that has a given sales order as origin (for example "SO-015" reference).
So far I am trying to include in a parser the following code:
def _get_related_picking(self, value):
if value:
stock_picking_pool = self.pool.get('stock.picking')
stock_picking_ids = stock_picking_pool.search(self.cr, self.uid, [('origin', '=', value)])
if stock_picking_ids:
return stock_picking_ids
else
return ""
Then I register the funcion with self.localcontext.update and call it from the XML report using
<span t-esc="get_related_picking(l.origin)"/>
But I got the following error:
QWebException: ""'NoneType' object is not callable" while evaluating
'get_related_picking(l.origin)'" while evaluating
"translate_doc(doc_id, doc_model, 'partner_id.lang', 'custom_reports.invoice_custom_document')"
can you post the wrapper class and report class ..