move_event.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # -*- coding: utf-8 -*-
  2. # @authors: Alexander Ezquevo <alexander@acysos.com>
  3. # Copyright (C) 2015 Acysos S.L.
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  5. from openerp import models, fields
  6. class MoveEvent(models.Model):
  7. _name = 'farm.move.event'
  8. _inherit = {'farm.event': 'AbstractEvent_id'}
  9. _auto = True
  10. from_location = fields.Many2one(comodel_name='stock.location',
  11. string='Origin', required=True,
  12. domain=[('usage', '=', 'internal'),
  13. ('silo', '=', False), ])
  14. to_location = fields.Many2one(comodel_name='stock.location',
  15. string='Destination', required=True,
  16. domain=[('usage', '=', 'internal'),
  17. ('silo', '=', False), ])
  18. quantity = fields.Integer(string='Quantity', required=True,
  19. default=1)
  20. unit_price = fields.Float(string='Unit Price', required=True,
  21. digits=(16, 4),
  22. help='Unitary cost of Animal or Group for'
  23. 'analytical accounting.')
  24. uom = fields.Many2one(comodel_name='product.uom', string='UOM')
  25. weight = fields.Float(string='Weight', digits=(16, 2))
  26. move = fields.Many2one(comodel_name='stock.move', string='Stock Move',
  27. readonly=True)
  28. weight_record = fields.Selection(
  29. string='Weight Record',
  30. selection=[(None, ''),
  31. ('farm.animal.weight', 'Animal Weight'),
  32. ('farm.animal.group.weight', 'Group Weight'), ],
  33. readonly=True)