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.

69 lines
3.4 KiB

  1. # -*- encoding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # OpenERP, Open Source Management Solution
  5. # This module copyright (C) 2010 - 2014 Savoir-faire Linux
  6. # (<http://www.savoirfairelinux.com>).
  7. #
  8. # This program is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU Affero General Public License as
  10. # published by the Free Software Foundation, either version 3 of the
  11. # License, or (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU Affero General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU Affero General Public License
  19. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. #
  21. ##############################################################################
  22. from openerp.osv import fields, osv
  23. class prototype(osv.osv):
  24. _name = "prototype"
  25. _description = "Prototype"
  26. _columns = {
  27. 'name': fields.char('Technical Name', required=True),
  28. 'category_id': fields.many2one('ir.module.category', 'Category'),
  29. 'shortdesc': fields.char('Module Name', required=True),
  30. 'summary': fields.char('Summary', required=True),
  31. 'description': fields.html('Description', required=True),
  32. 'author': fields.char('Author', required=True),
  33. 'maintainer': fields.char('Maintainer'),
  34. 'website': fields.char('Website'),
  35. 'icon_image': fields.binary('Icon'),
  36. 'version': fields.char('Version', size=3),
  37. 'auto_install': fields.boolean('Auto Install'),
  38. # Relations
  39. 'depends': fields.many2many('ir.module.module', 'prototype_module_rel',
  40. 'prototype_id', 'module_id',
  41. 'Dependencies'),
  42. 'data': fields.many2many('ir.filters', 'prototype_data_rel',
  43. 'prototype_id', 'filter_id',
  44. 'Data filters', help="The records matching the filters will be added as data."),
  45. 'demo': fields.many2many('ir.filters', 'prototype_demo_rel',
  46. 'prototype_id', 'filter_id',
  47. 'Demo filters', help="The records matching the filters will be added as demo data."),
  48. 'fields': fields.many2many('ir.model.fields', 'prototype_fields_rel',
  49. 'prototype_id', 'field_id', 'Fields'),
  50. 'menu': fields.many2many('ir.ui.menu', 'prototype_menu_rel',
  51. 'prototype_id', 'menu_id', 'Menu Items'),
  52. 'views': fields.many2many('ir.ui.view', 'prototype_view_rel',
  53. 'prototype_id', 'view_id', 'Views'),
  54. 'groups': fields.many2many('res.groups', 'prototype_groups_rel',
  55. 'prototype_id', 'group_id', 'Groups'),
  56. 'rights': fields.many2many('ir.model.access', 'prototype_rights_rel',
  57. 'prototype_id', 'right_id',
  58. 'Access Rights'),
  59. 'rules': fields.many2many('ir.rule', 'prototype_rule_rel',
  60. 'prototype_id', 'rule_id', 'Record Rules'),
  61. }
  62. _defaults = {
  63. 'auto_install': False,
  64. 'version': '0.1',
  65. }