Add reverse one2many field

This commit is contained in:
Alexis de Lattre
2015-09-14 23:57:21 +02:00
parent 165d042a6b
commit 1f04ef8b92

View File

@@ -37,6 +37,12 @@ class StockLocation(models.Model):
_inherit = 'stock.location'
name = fields.Char(translate=False)
# with the 'quant_ids' field below, you can for example search empty stock
# locations with self.env['stock.location'].search([
# ('child_ids', '=', False), ('quant_ids', '=', False),
# ('usage', '=', 'internal')])
quant_ids = fields.One2many(
'stock.quant', 'location_id', string="Related Quants")
class StockPickingType(models.Model):