commit 36902ec12b38a4fcfe59bab3ac2bcfbd41a203bf Author: Valentin Lab Date: Wed Jan 28 11:59:35 2015 +0700 first import diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..99cf5ff --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.*~ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5f8d963 --- /dev/null +++ b/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2012-2015, Valentin Lab +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..6b5b4c0 --- /dev/null +++ b/README.rst @@ -0,0 +1,113 @@ +================= +cookiecutter-odoo +================= + +A modified cookiecutter_ template for OpenERP/Odoo. + +.. _cookiecutter: https://github.com/audreyr/cookiecutter + +Maturity +-------- + +Alpha release. Uses a modified version of cookiecutter_ templating +system. To install this version do:: + + pip install git+https://github.com/0k/cookiecutter + +We plan to have v7 and v8 template in the same repository with sane +branch naming. + +We intend to produce compatible and full project for corresponding +`branch in the odoo github repository`_. + +.. _branch in the odoo github repository: https://github.com/odoo/odoo/branches + + +Features +-------- + +* OpenERP/Odoo version: + + - Odoo 8.0 + +* Include: + + - report + - security + - web (xml, css, js) + - views + - models + + +Usage +----- + +First install `cookiecutter`_ from our repositories:: + + $ pip install git+https://github.com/0k/cookiecutter + +Now run with this repo:: + + $ cookiecutter gh:0k/cookiecutter-odoo + +Branch selection can be done with ``--checkout``:: + + $ cookiecutter gh:0k/cookiecutter-odoo --checkout 8.0 + +For more info about cookiecutter_ options and usage, please check `cookiecutter documentation`_. + +Please bear in mind that we are using a fork. + +.. _cookiecutter documentation: http://cookiecutter.readthedocs.org/ + + +Contributing +============ + +Any suggestion or issue is welcome. Push request are very welcome, +please check out the guidelines. + + +Push Request Guidelines +----------------------- + +You can send any code. I'll look at it and will integrate it myself in +the code base and leave you as the author. This process can take time and +it'll take less time if you follow the following guidelines: + +- check your python code with PEP8 or pylint. Try to stick to 80 columns wide. +- avoid tabs +- separate your commits per smallest concern. +- each commit should pass the tests (to allow easy bisect) +- each functionality/bugfix commit should contain the code, tests, + and doc. +- prior minor commit with typographic or code cosmetic changes are + very welcome. These should be tagged thanks to an ending ``!minor`` + in their commit summary. +- the commit message should follow gitchangelog rules (check the git + log to get examples) +- if the commit fixes an issue or finished the implementation of a + feature, please mention it in the summary. + +If you have some questions about guidelines which is not answered here, +please check the current ``git log``, you might find previous commit that +would show you how to deal with your issue. + + +License +======= + +Copyright (c) 2012-2015 Valentin Lab. + +Licensed under the `BSD License`_. + +.. _BSD License: http://raw.github.com/0k/cookiecutter-odoo/master/LICENSE + + +Thanks +====== + +- `sudokeys`_ funding this package and providing great `OpenERP/Odoo`_ solutions. + +.. _sudokeys: http://www.sudokeys.com +.. _OpenERP/Odoo: http://www.odoo.com diff --git a/cookiecutter.yml b/cookiecutter.yml new file mode 100644 index 0000000..134b742 --- /dev/null +++ b/cookiecutter.yml @@ -0,0 +1,27 @@ +context: + name: + help: "Module name (ie: sale_trinkets)" + regex: '[a-zA-Z0-9_]+' + email: + help: "Author email (ie: john.doe@example.com)" + regex: '[a-zA-Z0-9_.]+@[a-zA-Z0-9_.-]+\.[a-zA-Z0-9_.-]+' + author: + help: "Author Name (ie: John Doe)" + regex: '.+' + website: + help: "Website (ie: http://www.yourwebsite.com)" + default: + regex: '[^ ]+' + description: + help: Short description of your module + default: "{{name}} OpenERP/Odoo module." + category: + help: "Module category (ie: Hidden, Tools, Website, ...)" + default: Tools + license_years: + help: "License Years (ie: 2015, or 2012-2014)" + regexp: '[0-9,- ]+' + version: + help: "Module Version (ie: 0.1)" + default: "0.1" + diff --git a/{{name}}/LICENSE b/{{name}}/LICENSE new file mode 100644 index 0000000..7fba712 --- /dev/null +++ b/{{name}}/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) {{license_years}}, {{author}} +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/{{name}}/README.rst b/{{name}}/README.rst new file mode 100644 index 0000000..929fd1b --- /dev/null +++ b/{{name}}/README.rst @@ -0,0 +1,7 @@ +===================== +{{name}} +===================== + +{{description}} + +This is an OpenERP/Odoo addons. diff --git a/{{name}}/__init__.py b/{{name}}/__init__.py new file mode 100644 index 0000000..00a3204 --- /dev/null +++ b/{{name}}/__init__.py @@ -0,0 +1,6 @@ +## package holder + +import models +import wizard +import test + diff --git a/{{name}}/__openerp__.py b/{{name}}/__openerp__.py new file mode 100644 index 0000000..701f89f --- /dev/null +++ b/{{name}}/__openerp__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +{ + 'name': '{{name}}', + 'version': '{{version}}', + 'author': '{{author}}', + 'category': '{{category}}', + 'complexity': 'normal', +{%- if website %} + 'website': '{{ website }}', +{%- endif %} + 'data': [ + 'data/templates.xml', + 'security/security.xml', + 'security/ir.model.access.csv', + 'views/view.xml', + 'actions/act_window.xml', + 'menu.xml', + 'data/data.xml', + ], + 'depends': [ + 'base', + ], + 'qweb': [ + "static/src/xml/*.xml", + ], + 'test': [ + ], + 'installable': True, + 'auto_install': False, +} diff --git a/{{name}}/actions/act_window.xml b/{{name}}/actions/act_window.xml new file mode 100644 index 0000000..446c08e --- /dev/null +++ b/{{name}}/actions/act_window.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + diff --git a/{{name}}/controllers/__init__.py b/{{name}}/controllers/__init__.py new file mode 100644 index 0000000..067df5d --- /dev/null +++ b/{{name}}/controllers/__init__.py @@ -0,0 +1,4 @@ +## package holder + +import main + diff --git a/{{name}}/controllers/main.py b/{{name}}/controllers/main.py new file mode 100644 index 0000000..f51bb8c --- /dev/null +++ b/{{name}}/controllers/main.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +import logging +import openerp +import openerp.modules.registry +from openerp.modules import get_module_resource +from openerp.tools.translate import _ +from openerp import http + +from openerp.http import request, serialize_exception as _serialize_exception + +_logger = logging.getLogger(__name__) + + +## +## Web Controllers +## + +# class Main(http.Controller): +# +# @http.route('/{{name}}', type='http', auth="none") +# def index(self, s_action=None, db=None, **kw): +# return http.local_redirect('/web', query=request.params, keep_hash=True) +# +# @http.route([ +# '/{{name}}/', +# '/{{name}}//', +# ], type='json', auth="user") +# def load_needaction(self, menu_ids): +# """ Loads needaction counters for specific menu ids. +# +# :return: needaction data +# :rtype: dict(menu_id: {'needaction_enabled': boolean, 'needaction_counter': int}) +# """ +# return request.session.model('ir.ui.menu').get_needaction_data(menu_ids, request.context) +# diff --git a/{{name}}/data/data.xml b/{{name}}/data/data.xml new file mode 100644 index 0000000..e2f114a --- /dev/null +++ b/{{name}}/data/data.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/{{name}}/data/templates.xml b/{{name}}/data/templates.xml new file mode 100644 index 0000000..078c9de --- /dev/null +++ b/{{name}}/data/templates.xml @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/{{name}}/i18n/README b/{{name}}/i18n/README new file mode 100644 index 0000000..b4c86ab --- /dev/null +++ b/{{name}}/i18n/README @@ -0,0 +1 @@ +This directory should contain the *.po for OpenERP/Odoo translation. diff --git a/{{name}}/menu.xml b/{{name}}/menu.xml new file mode 100644 index 0000000..2eeeb87 --- /dev/null +++ b/{{name}}/menu.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/{{name}}/models.py b/{{name}}/models.py new file mode 100644 index 0000000..cb23557 --- /dev/null +++ b/{{name}}/models.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +import logging + +from openerp.osv import orm, fields +from openerp.tools.translate import _ + +_logger = logging.getLogger(__name__) + +## +## Models +## + +# class mymodel(orm.Model): +# +# _name = '{{name}}.mymodel' +# _inherit = "res.company" +# +# _columns = { +# 'res_model': fields.char('Model'), +# 'file': fields.binary(i +# 'File', help="File to check"), +# 'partner_id': fields.many2one( +# 'res.partner', +# string="Attached Partner", +# domain="[('type', '=', 'other')]",), +# } +# diff --git a/{{name}}/security/ir.model.access.csv b/{{name}}/security/ir.model.access.csv new file mode 100644 index 0000000..301b7da --- /dev/null +++ b/{{name}}/security/ir.model.access.csv @@ -0,0 +1 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink diff --git a/{{name}}/security/security.xml b/{{name}}/security/security.xml new file mode 100644 index 0000000..3c8d44e --- /dev/null +++ b/{{name}}/security/security.xml @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/{{name}}/static/src/css/main.css b/{{name}}/static/src/css/main.css new file mode 100644 index 0000000..5867cf2 --- /dev/null +++ b/{{name}}/static/src/css/main.css @@ -0,0 +1,11 @@ +/** + * Main css of {{name}} addon. + */ + + +/* +.oe-{{name}} { + color: black +} +*/ + diff --git a/{{name}}/static/src/js/main.js b/{{name}}/static/src/js/main.js new file mode 100644 index 0000000..8a73a7e --- /dev/null +++ b/{{name}}/static/src/js/main.js @@ -0,0 +1,22 @@ +openerp.{{name}} = function (instance) { + + var _t = instance.web._t, + _lt = instance.web._lt; + var QWeb = instance.web.qweb; + + + // instance.web.views.add('kanban', 'instance.{{name}}.MyView'); + + // instance.{{name}}.MyView = instance.web.View.extend({ + // template: "MyView", + // display_name: _lt('MyView'), + // default_nr_columns: 1, + // view_type: "myview", + // quick_create_class: "instance.{{name}}.QuickCreate", + // number_of_color_schemes: 10, + // init: function (parent, dataset, view_id, options) { + // this._super(parent, dataset, view_id, options); + // } + // }); + +}; diff --git a/{{name}}/static/src/xml/main.xml b/{{name}}/static/src/xml/main.xml new file mode 100644 index 0000000..e368584 --- /dev/null +++ b/{{name}}/static/src/xml/main.xml @@ -0,0 +1,23 @@ + + + + + + + + diff --git a/{{name}}/views/view.xml b/{{name}}/views/view.xml new file mode 100644 index 0000000..1788a52 --- /dev/null +++ b/{{name}}/views/view.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/{{name}}/wizard/__init__.py b/{{name}}/wizard/__init__.py new file mode 100644 index 0000000..e69de29