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.

85 lines
3.1 KiB

  1. # -*- coding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # Odoo, Open Source Management Solution
  5. #
  6. # Copyright (c) All rights reserved:
  7. # (c) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
  8. # (c) 2012 Domsense srl (<http://www.domsense.com>)
  9. # (c) 2015 Anubía, soluciones en la nube,SL (http://www.anubia.es)
  10. # Alejandro Santana <alejandrosantana@anubia.es>
  11. # (c) 2015 Savoir-faire Linux <http://www.savoirfairelinux.com>)
  12. # Agathe Mollé <agathe.molle@savoirfairelinux.com>
  13. #
  14. # This program is free software: you can redistribute it and/or modify
  15. # it under the terms of the GNU Affero General Public License as
  16. # published by the Free Software Foundation, either version 3 of the
  17. # License, or (at your option) any later version.
  18. #
  19. # This program is distributed in the hope that it will be useful,
  20. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. # GNU Affero General Public License for more details.
  23. #
  24. # You should have received a copy of the GNU Affero General Public License
  25. # along with this program. If not, see http://www.gnu.org/licenses
  26. #
  27. ##############################################################################
  28. from openerp import fields, models
  29. class SuperCalendarConfiguratorLine(models.Model):
  30. _name = 'super.calendar.configurator.line'
  31. name = fields.Many2one(
  32. comodel_name='ir.model',
  33. string='Model',
  34. required=True,
  35. )
  36. domain = fields.Char(
  37. string='Domain',
  38. )
  39. configurator_id = fields.Many2one(
  40. comodel_name='super.calendar.configurator',
  41. string='Configurator',
  42. )
  43. description_type = fields.Selection(
  44. [('field', 'Field'),
  45. ('code', 'Code')],
  46. string="Description Type",
  47. default='field',
  48. )
  49. description_field_id = fields.Many2one(
  50. comodel_name='ir.model.fields',
  51. string='Description field',
  52. domain="[('ttype', 'in', ('char', 'text')), ('model_id', '=', name)]",
  53. )
  54. description_code = fields.Text(
  55. string='Description field',
  56. help=("""Use '${o}' to refer to the involved object.
  57. E.g.: '${o.project_id.name}'"""),
  58. )
  59. date_start_field_id = fields.Many2one(
  60. comodel_name='ir.model.fields',
  61. string='Start date field',
  62. domain="[('ttype', 'in', ('datetime', 'date')), "
  63. "('model_id', '=', name)]",
  64. required=True,
  65. )
  66. date_stop_field_id = fields.Many2one(
  67. comodel_name='ir.model.fields',
  68. string='End date field',
  69. domain="[('ttype', 'in', ('datetime', 'date')), "
  70. "('model_id', '=', name)]",
  71. )
  72. duration_field_id = fields.Many2one(
  73. comodel_name='ir.model.fields',
  74. string='Duration field',
  75. domain="[('ttype', '=', 'float'), ('model_id', '=', name)]",
  76. )
  77. user_field_id = fields.Many2one(
  78. comodel_name='ir.model.fields',
  79. string='User field',
  80. domain="[('ttype', '=', 'many2one'), ('model_id', '=', name)]",
  81. )