stock.py 968 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # -*- coding: utf-8 -*-
  2. ##############################################################################
  3. # For copyright and license notices, see __openerp__.py file in module root
  4. # directory
  5. ##############################################################################
  6. from openerp import models, fields
  7. class StockWarehouse(models.Model):
  8. _inherit = 'stock.warehouse'
  9. store_id = fields.Many2one(
  10. 'res.store',
  11. 'Store'
  12. )
  13. class StockLocation(models.Model):
  14. _inherit = 'stock.location'
  15. store_id = fields.Many2one(
  16. 'res.store'
  17. )
  18. class StockPickingType(models.Model):
  19. _inherit = 'stock.picking.type'
  20. store_id = fields.Many2one(
  21. related='warehouse_id.store_id',
  22. store=True,
  23. readonly=True,
  24. )
  25. class StockPicking(models.Model):
  26. _inherit = 'stock.picking'
  27. store_id = fields.Many2one(
  28. related='picking_type_id.store_id',
  29. store=True,
  30. readonly=True,
  31. )