I want to add a custom field to the Product Moves reporting in Inventory > Reporting menu.
I try with this code but I got always an undefined value. What's wrong please?
class stockMoveLine(models.Model):
_inherit = 'stock.move.line'
categ_id = fields.Many2one('product.category', 'Product Category', readonly=True)
def _query(self, with_clause='', fields={}, groupby='', from_clause=''):
fields['categ_id'] = ', s.categ_id as categ_id'
groupby += ', s.categ_id'
return super(stockMoveLine, self)._query(with_clause, fields, groupby, from_clause)
Thanks.