You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.4 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2016 Ursa Information Systems <http://ursainfosystems.com>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from openerp import fields, models
  5. class ResPartner(models.Model):
  6. _inherit = 'res.partner'
  7. caloric_intake = fields.Float("Calories")
  8. caloric_intake_uom = fields.Many2one(
  9. "product.uom", "Calories UoM",
  10. domain=lambda self: [('category_id', '=',
  11. self.env.ref(
  12. 'product_uom.product_category_energy').id)]
  13. )
  14. carbohydrate_intake = fields.Float("Carbohydrate")
  15. carbohydrate_intake_uom = fields.Many2one(
  16. "product.uom", "Carbohydrate UoM",
  17. domain=lambda self: [('category_id', '=',
  18. self.env.ref('product.product_uom_categ_kgm').id)
  19. ]
  20. )
  21. fat_intake = fields.Float("Fat")
  22. fat_intake_uom = fields.Many2one(
  23. "product.uom", "Fat UoM",
  24. domain=lambda self: [('category_id', '=',
  25. self.env.ref('product.product_uom_categ_kgm').id)
  26. ]
  27. )
  28. protein_intake = fields.Float("Protein")
  29. protein_intake_uom = fields.Many2one(
  30. "product.uom", "Protein UoM",
  31. domain=lambda self: [('category_id', '=',
  32. self.env.ref('product.product_uom_categ_kgm').id)
  33. ]
  34. )