Browse Source

[IMP] Add help

[FIX] license field
[IMP] Add template README.rst as default description

[FIX] PEP8 errors

[IMP] Take reviews into account
pull/107/head
Maxime Chambreuil 10 years ago
parent
commit
fa90610b3b
  1. 131
      module_prototyper/models/module_prototyper.py
  2. 6
      module_prototyper/tests/__init__.py
  3. 3
      module_prototyper/wizard/module_prototyper_module_export.py

131
module_prototyper/models/module_prototyper.py

@ -40,10 +40,15 @@ class ModulePrototyper(models.Model):
_name = "module_prototyper" _name = "module_prototyper"
_description = "Module Prototyper" _description = "Module Prototyper"
# In prevision of odoo might support other licences than AGPL in
# (near) future.
licence = fields.Char(
'Licence',
license = fields.Selection(
[('GPL-2', 'GPL Version 2'),
('GPL-2 or any later version', 'GPL-2 or later version'),
('GPL-3', 'GPL Version 3'),
('GPL-3 or any later version', 'GPL-3 or later version'),
('AGPL-3', 'Affero GPL-3'),
('Other OSI approved licence', 'Other OSI Approved Licence'),
('Other proprietary', 'Other Proprietary')],
string='License',
default='AGPL-3', default='AGPL-3',
) )
name = fields.Char( name = fields.Char(
@ -57,17 +62,93 @@ class ModulePrototyper(models.Model):
help=('The Module Name will be used as the displayed name of the ' help=('The Module Name will be used as the displayed name of the '
'exported module.') 'exported module.')
) )
summary = fields.Char('Summary', required=True)
description = fields.Text('Description', required=True)
author = fields.Char('Author', required=True)
maintainer = fields.Char('Maintainer')
website = fields.Char('Website')
summary = fields.Char('Summary', required=True,
help=('Enter a summary of your module'))
description = fields.Text(
'Description',
required=True,
help=('Enter the description of your module, what it does, how to'
'install, configure and use it, the roadmap or known issues.'
'The description will be exported in README.rst'),
default="""
Module name
===========
This module was written to extend the functionality of ... to support ...
and allow you to ...
Installation
============
To install this module, you need to:
* do this ...
Configuration
=============
To configure this module, you need to:
* go to ...
Usage
=====
To use this module, you need to:
* go to ...
For further information, please visit:
* https://www.odoo.com/forum/help-1
Known issues / Roadmap
======================
* ...
Credits
=======
Contributors
------------
* Firsname Lastname <email.address@example.org>
Maintainer
----------
.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
To contribute to this module, please visit http://odoo-community.org.
"""
)
author = fields.Char('Author', required=True, help=('Enter your name'))
maintainer = fields.Char(
'Maintainer',
help=('Enter the name of the person or organization who will'
'maintain this module')
)
website = fields.Char('Website', help=('Enter the URL of your website'))
icon_image = fields.Binary( icon_image = fields.Binary(
'Icon', 'Icon',
help=('The icon set up here will be used as the icon ' help=('The icon set up here will be used as the icon '
'for the exported module also') 'for the exported module also')
) )
version = fields.Char('Version', size=3, default='0.1')
version = fields.Char(
'Version',
size=3,
default='0.1',
help=('Enter the version of your module with 2 digits')
)
auto_install = fields.Boolean( auto_install = fields.Boolean(
'Auto Install', 'Auto Install',
default=False, default=False,
@ -82,7 +163,9 @@ class ModulePrototyper(models.Model):
dependency_ids = fields.Many2many( dependency_ids = fields.Many2many(
'ir.module.module', 'module_prototyper_module_rel', 'ir.module.module', 'module_prototyper_module_rel',
'module_prototyper_id', 'module_id', 'module_prototyper_id', 'module_id',
'Dependencies'
'Dependencies',
help=('Enter the list of required modules that need to be installed'
'for your module to work properly')
) )
data_ids = fields.Many2many( data_ids = fields.Many2many(
'ir.filters', 'ir.filters',
@ -100,28 +183,42 @@ class ModulePrototyper(models.Model):
) )
field_ids = fields.Many2many( field_ids = fields.Many2many(
'ir.model.fields', 'prototype_fields_rel', 'ir.model.fields', 'prototype_fields_rel',
'module_prototyper_id', 'field_id', 'Fields'
'module_prototyper_id', 'field_id', 'Fields',
help=('Enter the list of fields that you have created or modified'
'and want to export in this module. New models will be'
'exported as long as you choose one of his fields.')
) )
menu_ids = fields.Many2many( menu_ids = fields.Many2many(
'ir.ui.menu', 'prototype_menu_rel', 'ir.ui.menu', 'prototype_menu_rel',
'module_prototyper_id', 'menu_id', 'Menu Items'
'module_prototyper_id', 'menu_id', 'Menu Items',
help=('Enter the list of menu items that you have created and want'
'to export in this module. Related windows actions will be'
'exported as well.')
) )
view_ids = fields.Many2many( view_ids = fields.Many2many(
'ir.ui.view', 'prototype_view_rel', 'ir.ui.view', 'prototype_view_rel',
'module_prototyper_id', 'view_id', 'Views'
'module_prototyper_id', 'view_id', 'Views',
help=('Enter the list of views that you have created and want to'
'export in this module.')
) )
group_ids = fields.Many2many( group_ids = fields.Many2many(
'res.groups', 'prototype_groups_rel', 'res.groups', 'prototype_groups_rel',
'module_prototyper_id', 'group_id', 'Groups'
'module_prototyper_id', 'group_id', 'Groups',
help=('Enter the list of groups that you have created and want to'
'export in this module.')
) )
right_ids = fields.Many2many( right_ids = fields.Many2many(
'ir.model.access', 'prototype_rights_rel', 'ir.model.access', 'prototype_rights_rel',
'module_prototyper_id', 'right_id', 'module_prototyper_id', 'right_id',
'Access Rights'
'Access Rights',
help=('Enter the list of access rights that you have created and'
'want to export in this module.')
) )
rule_ids = fields.Many2many( rule_ids = fields.Many2many(
'ir.rule', 'prototype_rule_rel', 'ir.rule', 'prototype_rule_rel',
'module_prototyper_id', 'rule_id', 'Record Rules'
'module_prototyper_id', 'rule_id', 'Record Rules',
help=('Enter the list of record rules that you have created and'
'want to export in this module.')
) )
__data_files = [] __data_files = []

6
module_prototyper/tests/__init__.py

@ -19,8 +19,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################## ##############################################################################
from . import test_prototype_module_export
from . import test_prototype
from . import (
test_prototype_module_export,
test_prototype
)
checks = [ checks = [
test_prototype_module_export, test_prototype_module_export,

3
module_prototyper/wizard/module_prototyper_module_export.py

@ -30,12 +30,9 @@ class PrototypeModuleExport(models.TransientModel):
_name = "module_prototyper.module.export" _name = "module_prototyper.module.export"
name = fields.Char('File Name', readonly=True) name = fields.Char('File Name', readonly=True)
# It is implemented in order to manage previous and next versions
# of odoo
api_version = fields.Selection( api_version = fields.Selection(
[ [
('8.0', '8.0'), ('8.0', '8.0'),
# ('7.0', '7.0')
], ],
'API version', 'API version',
required=True, required=True,

Loading…
Cancel
Save