From eff434f8c98f53b4a535ac631387b2d6749f225a Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 7 Jul 2014 12:44:45 +0200 Subject: [PATCH 1/5] add standard files --- .coveragerc | 19 ++++++++++++++++++ .gitignore | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 22 +++++++++++++++++++++ README.md | 12 ++++++++++++ 4 files changed, 109 insertions(+) create mode 100644 .coveragerc create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 README.md diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..a06f8bfe --- /dev/null +++ b/.coveragerc @@ -0,0 +1,19 @@ +# Config file .coveragerc + +[report] +omit = + /usr/* + */bin/* + */lib/* + */odoo/* + */openerp/* + */tests/* + *__init__.py + +# Regexes for lines to exclude from consideration +exclude_lines = + # Have to re-enable the standard pragma + pragma: no cover + + # Don't complain about null context checking + if context is None: diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..890ff010 --- /dev/null +++ b/.gitignore @@ -0,0 +1,56 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +bin/ +build/ +develop-eggs/ +dist/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo + +# Pycharm +.idea + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +# Rope +.ropeproject + +# Sphinx documentation +docs/_build/ + +# Backup files +*~ +*.swp diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..77c360fc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +language: python +python: + - "2.7" + +virtualenv: + system_site_packages: true + +install: + - git clone https://github.com/gurneyalex/maintainer-quality-tools.git $HOME/maintainer-quality-tools + - export PATH=$HOME/maintainer-quality-tools/travis:$PATH + - $HOME/maintainer-quality-tools/travis/travis_install_nightly 6.1 + - pip install coveralls flake8 + +services: + - postgresql + +script: + - travis_run_flake8 + - travis_run_tests 6.1 openerp_test + +after_success: + coveralls diff --git a/README.md b/README.md new file mode 100644 index 00000000..f189d392 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +[![Build Status](https://travis-ci.org/OCA/web.svg?branch=6.1)](https://travis-ci.org/OCA/web) +[![Coverage Status](https://img.shields.io/coveralls/OCA/web.svg)](https://coveralls.io/r/OCA/web?branch=6.1) + +Web addons for Odoo +=================== + +This project aims to deal with modules related to the webclient of Odoo. You'll find modules that: + +- Add facilities to the UI +- Add widgets +- Ease the import/export features +- Generally add clientside functionality From 989ca9dbfe1d97fa8052ced0fd1af861785de9d2 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 7 Jul 2014 14:25:58 +0200 Subject: [PATCH 2/5] [FIX] pass flake8 --- hide_duplicate_button/__init__.py | 2 +- hide_duplicate_button/__openerp__.py | 13 ++- web_ckeditor4/__init__.py | 1 - web_ckeditor4/__openerp__.py | 108 +++++++++--------- web_export_view/__init__.py | 2 +- web_export_view/__openerp__.py | 26 +++-- web_export_view/controllers.py | 8 +- web_hide_buttons/__openerp__.py | 2 +- .../model/basemodel.py | 1 + web_print_from_browser/__init__.py | 1 - web_widget_classes/__openerp__.py | 18 +-- 11 files changed, 95 insertions(+), 87 deletions(-) diff --git a/hide_duplicate_button/__init__.py b/hide_duplicate_button/__init__.py index 034ec576..5786e9b1 100644 --- a/hide_duplicate_button/__init__.py +++ b/hide_duplicate_button/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # Copyright (C) 2013 Agile Business Group sagl () # Copyright (C) 2013 Domsense srl () # diff --git a/hide_duplicate_button/__openerp__.py b/hide_duplicate_button/__openerp__.py index 5bbf0172..ed46f06a 100644 --- a/hide_duplicate_button/__openerp__.py +++ b/hide_duplicate_button/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # Copyright (C) 2013 Agile Business Group sagl () # Copyright (C) 2013 Domsense srl () # @@ -23,20 +23,21 @@ 'name': 'Hide duplicate button', 'version': '0.1', 'category': 'Web', - 'description': """As 'duplicate' button often produce inconveniences when modules don't correctly handle the 'copy' methods, this module allow to hide 'duplicate' button for every form view""", + 'description': """As 'duplicate' button often produce inconveniences when +modules don't correctly handle the 'copy' methods, this module allow to hide +'duplicate' button for every form view""", 'author': 'Agile Business Group', 'website': 'http://www.agilebg.com', 'license': 'AGPL-3', 'depends': [ - 'web', - ], + 'web', + ], 'init_xml': [], 'update_xml': [], 'demo_xml': [], 'active': False, 'installable': True, - 'css' : [ + 'css': [ "static/css/duplicate_button.css", ], } - diff --git a/web_ckeditor4/__init__.py b/web_ckeditor4/__init__.py index a97ee816..fae962cc 100644 --- a/web_ckeditor4/__init__.py +++ b/web_ckeditor4/__init__.py @@ -19,4 +19,3 @@ # along with this program. If not, see . # ############################################################################## - diff --git a/web_ckeditor4/__openerp__.py b/web_ckeditor4/__openerp__.py index 977a6345..fd9af107 100644 --- a/web_ckeditor4/__openerp__.py +++ b/web_ckeditor4/__openerp__.py @@ -51,60 +51,60 @@ #cd trunk #git checkout remotes/origin/release/4.1.x #and uncomment the lines below -# 'static/lib/trunk/ckeditor.js', -# 'static/lib/trunk/core/event.js', -# 'static/lib/trunk/core/editor_basic.js', -# 'static/lib/trunk/core/env.js', -# 'static/lib/trunk/core/ckeditor_basic.js', -# 'static/lib/trunk/core/dom.js', -# 'static/lib/trunk/core/tools.js', -# 'static/lib/trunk/core/dtd.js', -# 'static/lib/trunk/core/dom/event.js', -# 'static/lib/trunk/core/dom/domobject.js', -# 'static/lib/trunk/core/dom/node.js', -# 'static/lib/trunk/core/dom/window.js', -# 'static/lib/trunk/core/dom/document.js', -# 'static/lib/trunk/core/dom/nodelist.js', -# 'static/lib/trunk/core/dom/element.js', -# 'static/lib/trunk/core/dom/documentfragment.js', -# 'static/lib/trunk/core/dom/walker.js', -# 'static/lib/trunk/core/dom/range.js', -# 'static/lib/trunk/core/dom/iterator.js', -# 'static/lib/trunk/core/command.js', -# 'static/lib/trunk/core/ckeditor_base.js', -# 'static/lib/trunk/core/config.js', -# 'static/lib/trunk/core/filter.js', -# 'static/lib/trunk/core/focusmanager.js', -# 'static/lib/trunk/core/keystrokehandler.js', -# 'static/lib/trunk/core/lang.js', -# 'static/lib/trunk/core/scriptloader.js', -# 'static/lib/trunk/core/resourcemanager.js', -# 'static/lib/trunk/core/plugins.js', -# 'static/lib/trunk/core/ui.js', -# 'static/lib/trunk/core/editor.js', -# 'static/lib/trunk/core/htmlparser.js', -# 'static/lib/trunk/core/htmlparser/basicwriter.js', -# 'static/lib/trunk/core/htmlparser/node.js', -# 'static/lib/trunk/core/htmlparser/comment.js', -# 'static/lib/trunk/core/htmlparser/text.js', -# 'static/lib/trunk/core/htmlparser/cdata.js', -# 'static/lib/trunk/core/htmlparser/fragment.js', -# 'static/lib/trunk/core/htmlparser/filter.js', -# 'static/lib/trunk/core/htmldataprocessor.js', -# 'static/lib/trunk/core/htmlparser/element.js', -# 'static/lib/trunk/core/template.js', -# 'static/lib/trunk/core/ckeditor.js', -# 'static/lib/trunk/core/creators/inline.js', -# 'static/lib/trunk/core/creators/themedui.js', -# 'static/lib/trunk/core/editable.js', -# 'static/lib/trunk/core/selection.js', -# 'static/lib/trunk/core/style.js', -# 'static/lib/trunk/core/dom/comment.js', -# 'static/lib/trunk/core/dom/elementpath.js', -# 'static/lib/trunk/core/dom/text.js', -# 'static/lib/trunk/core/dom/rangelist.js', -# 'static/lib/trunk/core/skin.js', -# 'static/lib/trunk/core/_bootstrap.js', + #'static/lib/trunk/ckeditor.js', + #'static/lib/trunk/core/event.js', + #'static/lib/trunk/core/editor_basic.js', + #'static/lib/trunk/core/env.js', + #'static/lib/trunk/core/ckeditor_basic.js', + #'static/lib/trunk/core/dom.js', + #'static/lib/trunk/core/tools.js', + #'static/lib/trunk/core/dtd.js', + #'static/lib/trunk/core/dom/event.js', + #'static/lib/trunk/core/dom/domobject.js', + #'static/lib/trunk/core/dom/node.js', + #'static/lib/trunk/core/dom/window.js', + #'static/lib/trunk/core/dom/document.js', + #'static/lib/trunk/core/dom/nodelist.js', + #'static/lib/trunk/core/dom/element.js', + #'static/lib/trunk/core/dom/documentfragment.js', + #'static/lib/trunk/core/dom/walker.js', + #'static/lib/trunk/core/dom/range.js', + #'static/lib/trunk/core/dom/iterator.js', + #'static/lib/trunk/core/command.js', + #'static/lib/trunk/core/ckeditor_base.js', + #'static/lib/trunk/core/config.js', + #'static/lib/trunk/core/filter.js', + #'static/lib/trunk/core/focusmanager.js', + #'static/lib/trunk/core/keystrokehandler.js', + #'static/lib/trunk/core/lang.js', + #'static/lib/trunk/core/scriptloader.js', + #'static/lib/trunk/core/resourcemanager.js', + #'static/lib/trunk/core/plugins.js', + #'static/lib/trunk/core/ui.js', + #'static/lib/trunk/core/editor.js', + #'static/lib/trunk/core/htmlparser.js', + #'static/lib/trunk/core/htmlparser/basicwriter.js', + #'static/lib/trunk/core/htmlparser/node.js', + #'static/lib/trunk/core/htmlparser/comment.js', + #'static/lib/trunk/core/htmlparser/text.js', + #'static/lib/trunk/core/htmlparser/cdata.js', + #'static/lib/trunk/core/htmlparser/fragment.js', + #'static/lib/trunk/core/htmlparser/filter.js', + #'static/lib/trunk/core/htmldataprocessor.js', + #'static/lib/trunk/core/htmlparser/element.js', + #'static/lib/trunk/core/template.js', + #'static/lib/trunk/core/ckeditor.js', + #'static/lib/trunk/core/creators/inline.js', + #'static/lib/trunk/core/creators/themedui.js', + #'static/lib/trunk/core/editable.js', + #'static/lib/trunk/core/selection.js', + #'static/lib/trunk/core/style.js', + #'static/lib/trunk/core/dom/comment.js', + #'static/lib/trunk/core/dom/elementpath.js', + #'static/lib/trunk/core/dom/text.js', + #'static/lib/trunk/core/dom/rangelist.js', + #'static/lib/trunk/core/skin.js', + #'static/lib/trunk/core/_bootstrap.js', #end of ckeditor debug 'static/src/js/web_ckeditor4.js', ], diff --git a/web_export_view/__init__.py b/web_export_view/__init__.py index 09691964..994ad368 100644 --- a/web_export_view/__init__.py +++ b/web_export_view/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # Copyright (C) 2012 Agile Business Group sagl () # Copyright (C) 2012 Domsense srl () # diff --git a/web_export_view/__openerp__.py b/web_export_view/__openerp__.py index 41008b3d..aff44ffd 100644 --- a/web_export_view/__openerp__.py +++ b/web_export_view/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # Copyright (C) 2012 Domsense srl () # Copyright (C) 2012-2013 Agile Business Group sagl # () @@ -28,21 +28,30 @@ WEB EXPORT VIEW =============== -One of the best OpenERP’s features is exporting custom data to CSV/XLS. You can do it by clicking on the export link in the sidebar. The export action allows use to configure what to be exported by selecting fields, etc, and allows you to save your export as a template so that you can export it once again without having to configure it again. +One of the best OpenERP’s features is exporting custom data to CSV/XLS. You can +do it by clicking on the export link in the sidebar. The export action allows +use to configure what to be exported by selecting fields, etc, and allows you +to save your export as a template so that you can export it once again without +having to configure it again. -That feature is as great and advanced as limited for an everyday-customer-experience. A lot of customers want simply to export the tree view they are looking to. +That feature is as great and advanced as limited for an +everyday-customer-experience. A lot of customers want simply to export the tree +view they are looking to. -If you miss this feature as us, probably you’ll find an answer into our web_export_view module. +If you miss this feature as us, probably you’ll find an answer into our +web_export_view module. -After you installed it, you’ll find an additional link ‘Export current view’ right below the ‘Export’ one. By clicking on it you’ll get a XLS file contains the same data of the tree view you are looking at, headers included. +After you installed it, you’ll find an additional link ‘Export current view’ +right below the ‘Export’ one. By clicking on it you’ll get a XLS file contains +the same data of the tree view you are looking at, headers included. """, 'author': 'Agile Business Group', 'website': 'http://www.agilebg.com', 'license': 'AGPL-3', 'depends': ['web'], - 'external_dependencies' : { - 'python' : ['xlwt'], - }, + 'external_dependencies': { + 'python': ['xlwt'], + }, 'data': [], 'active': False, 'auto_install': False, @@ -50,4 +59,3 @@ After you installed it, you’ll find an additional link ‘Export current view 'static/js/web_advanced_export.js', ], } - diff --git a/web_export_view/controllers.py b/web_export_view/controllers.py index 51af7041..d4ca9176 100644 --- a/web_export_view/controllers.py +++ b/web_export_view/controllers.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # Copyright (C) 2012 Agile Business Group sagl () # Copyright (C) 2012 Domsense srl () # @@ -75,9 +75,9 @@ class ExcelExportView(ExcelExport): @openerpweb.httprequest def index(self, req, data, token): data = json.loads(data) - model = data.get('model',[]) - columns_headers = data.get('headers',[]) - rows = data.get('rows',[]) + model = data.get('model', []) + columns_headers = data.get('headers', []) + rows = data.get('rows', []) context = req.session.eval_context(req.context) lang = context.get('lang', 'en_US') diff --git a/web_hide_buttons/__openerp__.py b/web_hide_buttons/__openerp__.py index 53a7fec6..581d855d 100755 --- a/web_hide_buttons/__openerp__.py +++ b/web_hide_buttons/__openerp__.py @@ -1,6 +1,6 @@ # -*- encoding: utf-8 -*- ############################################################################## -# +# # Copyright (C) 2013 Therp B.V. () # # This program is free software: you can redistribute it and/or modify diff --git a/web_import_models_with_inherits/model/basemodel.py b/web_import_models_with_inherits/model/basemodel.py index 07ab0522..70db3008 100644 --- a/web_import_models_with_inherits/model/basemodel.py +++ b/web_import_models_with_inherits/model/basemodel.py @@ -20,6 +20,7 @@ ############################################################################## from openerp.osv.orm import BaseModel + def get_fields_inherits(self, cr, uid, context=None): """ Pass the values of the _inherits dictionary diff --git a/web_print_from_browser/__init__.py b/web_print_from_browser/__init__.py index a97ee816..fae962cc 100644 --- a/web_print_from_browser/__init__.py +++ b/web_print_from_browser/__init__.py @@ -19,4 +19,3 @@ # along with this program. If not, see . # ############################################################################## - diff --git a/web_widget_classes/__openerp__.py b/web_widget_classes/__openerp__.py index 39af35d2..ab5d2d5d 100644 --- a/web_widget_classes/__openerp__.py +++ b/web_widget_classes/__openerp__.py @@ -19,16 +19,16 @@ # ############################################################################## { - "name" : "CSS classes for widgets", - "version" : "1.0", - "author" : "Therp BV", + "name": "CSS classes for widgets", + "version": "1.0", + "author": "Therp BV", "complexity": "normal", "description": """ For simple UI changes, having classes attached to widgets giving information about the model being displayed can be essential. For instance, to apply some CSS to the name field in forms for tasks, - + :: .oe_model_project_task input[name='name'] @@ -38,11 +38,11 @@ will be enough. """, - "category" : "Dependency", - "depends" : [ + "category": "Dependency", + "depends": [ 'web', ], - "data" : [ + "data": [ ], "js": [ ], @@ -53,7 +53,7 @@ ], "auto_install": False, "installable": True, - "external_dependencies" : { - 'python' : [], + "external_dependencies": { + 'python': [], }, } From 6d09155d0fd440f8f47ad572311cd40754a842ce Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 7 Jul 2014 14:52:40 +0200 Subject: [PATCH 3/5] [FIX] adapt to change in maintainers-tools --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 77c360fc..8cc68a69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ services: script: - travis_run_flake8 - - travis_run_tests 6.1 openerp_test + - travis_run_tests 6.1 after_success: coveralls From 31c2581f6f5cba05d557bd4ea81c0ae88827efe9 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 7 Jul 2014 15:27:12 +0200 Subject: [PATCH 4/5] [IMP] Sandy's suggestions --- .coveragerc | 7 ++----- .travis.yml | 5 +---- README.md | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.coveragerc b/.coveragerc index a06f8bfe..cbd4a493 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,12 +1,9 @@ # Config file .coveragerc [report] +include = + */OCA/web/* omit = - /usr/* - */bin/* - */lib/* - */odoo/* - */openerp/* */tests/* *__init__.py diff --git a/.travis.yml b/.travis.yml index 8cc68a69..07863bb8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,12 +8,9 @@ virtualenv: install: - git clone https://github.com/gurneyalex/maintainer-quality-tools.git $HOME/maintainer-quality-tools - export PATH=$HOME/maintainer-quality-tools/travis:$PATH - - $HOME/maintainer-quality-tools/travis/travis_install_nightly 6.1 + - travis_install_nightly 6.1 - pip install coveralls flake8 -services: - - postgresql - script: - travis_run_flake8 - travis_run_tests 6.1 diff --git a/README.md b/README.md index f189d392..55e0e63f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![Build Status](https://travis-ci.org/OCA/web.svg?branch=6.1)](https://travis-ci.org/OCA/web) -[![Coverage Status](https://img.shields.io/coveralls/OCA/web.svg)](https://coveralls.io/r/OCA/web?branch=6.1) +[![Coverage Status](https://coveralls.io/repos/OCA/web/badge.png?branch=6.1)](https://coveralls.io/r/OCA/web?branch=6.1) Web addons for Odoo =================== From 855074aa9cfd3651b558fcad2327fb04a053dffe Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 7 Jul 2014 15:38:07 +0200 Subject: [PATCH 5/5] [DEL] redundant readme file --- README | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 README diff --git a/README b/README deleted file mode 100644 index 00c1af68..00000000 --- a/README +++ /dev/null @@ -1,8 +0,0 @@ -This project aim to deal with modules related to the webclient of OpenERP. You'll find modules that: - - - Add facilities to the UI - - Ease the import/export features - - Add tabs - - ... - -