From fb7f008968263115ef490aa2b409a9e0a46e13ae Mon Sep 17 00:00:00 2001 From: Thibault Francois Date: Thu, 30 Oct 2014 15:39:54 +0100 Subject: [PATCH 001/147] [REMOVE] incompatible module with master --- website_multi/__init__.py | 2 - website_multi/__openerp__.py | 21 ----- website_multi/controllers/__init__.py | 1 - website_multi/controllers/main.py | 44 ---------- website_multi/data/data.xml | 37 -------- website_multi/models/__init__.py | 2 - website_multi/models/ir_ui_view.py | 102 ---------------------- website_multi/models/website.py | 116 -------------------------- website_multi/views/res_config.xml | 17 ---- website_multi/views/website_views.xml | 97 --------------------- 10 files changed, 439 deletions(-) delete mode 100644 website_multi/__init__.py delete mode 100644 website_multi/__openerp__.py delete mode 100644 website_multi/controllers/__init__.py delete mode 100644 website_multi/controllers/main.py delete mode 100644 website_multi/data/data.xml delete mode 100644 website_multi/models/__init__.py delete mode 100644 website_multi/models/ir_ui_view.py delete mode 100644 website_multi/models/website.py delete mode 100644 website_multi/views/res_config.xml delete mode 100644 website_multi/views/website_views.xml diff --git a/website_multi/__init__.py b/website_multi/__init__.py deleted file mode 100644 index 9f86759e..00000000 --- a/website_multi/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -import controllers -import models diff --git a/website_multi/__openerp__.py b/website_multi/__openerp__.py deleted file mode 100644 index 65b6270d..00000000 --- a/website_multi/__openerp__.py +++ /dev/null @@ -1,21 +0,0 @@ -{ - 'name': 'Multi Website', - 'category': 'Website', - 'summary': 'Build Multiple Websites', - 'website': 'https://www.odoo.com', - 'version': '1.0', - 'description': """ -OpenERP Multi Website -===================== - - """, - 'author': 'OpenERP SA', - 'depends': ['website'], - 'installable': True, - 'data': [ - 'data/data.xml', - 'views/res_config.xml', - 'views/website_views.xml', - ], - 'application': True, -} diff --git a/website_multi/controllers/__init__.py b/website_multi/controllers/__init__.py deleted file mode 100644 index 8ee9bae1..00000000 --- a/website_multi/controllers/__init__.py +++ /dev/null @@ -1 +0,0 @@ -import main diff --git a/website_multi/controllers/main.py b/website_multi/controllers/main.py deleted file mode 100644 index 87eefc90..00000000 --- a/website_multi/controllers/main.py +++ /dev/null @@ -1,44 +0,0 @@ -import re - -import werkzeug - -from openerp.addons.web import http -from openerp.http import request -from openerp.addons.website.controllers.main import Website - - -class website_multi(Website): - - @http.route('/', type='http', auth="public", website=True) - def index(self, **kw): - cr, uid, context = request.cr, request.uid, request.context - page = 'homepage' - main_menu = request.website.menu_id - first_menu = main_menu.child_id and main_menu.child_id[0] - if first_menu: - if not (first_menu.url.startswith(('/page/', '/?', '/#')) or (first_menu.url == '/')): - return request.redirect(first_menu.url) - if first_menu.url.startswith('/page/'): - return request.registry['ir.http'].reroute(first_menu.url) - return self.page(page) - - @http.route('/website/add/', type='http', auth="user", website=True) - def pagenew(self, path, noredirect=False, add_menu=None): - cr, uid, context = request.cr, request.uid, request.context - - xml_id = request.registry['website'].new_page(request.cr, request.uid, path, context=request.context) - if add_menu: - request.registry['website.menu'].create(cr, uid, { - 'name': path, - 'url': '/page/' + xml_id, - 'parent_id': request.website.menu_id.id, - 'website_id': request.website.id - }, context=context) - - # Reverse action in order to allow shortcut for /page/ - url = "/page/" + re.sub(r"^website\.", '', xml_id) - - if noredirect: - return werkzeug.wrappers.Response(url, mimetype='text/plain') - - return werkzeug.utils.redirect(url) diff --git a/website_multi/data/data.xml b/website_multi/data/data.xml deleted file mode 100644 index 2ced135e..00000000 --- a/website_multi/data/data.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - website.homepage - - - - - website.contactus - - - - - website.aboutus - - - - diff --git a/website_multi/models/__init__.py b/website_multi/models/__init__.py deleted file mode 100644 index 4e6e9a2f..00000000 --- a/website_multi/models/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -import ir_ui_view -import website diff --git a/website_multi/models/ir_ui_view.py b/website_multi/models/ir_ui_view.py deleted file mode 100644 index 4a9689d7..00000000 --- a/website_multi/models/ir_ui_view.py +++ /dev/null @@ -1,102 +0,0 @@ -from lxml import etree - -from openerp import tools -from openerp.osv import osv, fields, orm -from openerp import SUPERUSER_ID - - -class view(osv.osv): - - _inherit = "ir.ui.view" - - _columns = { - 'website_id': fields.many2one('website', ondelete='cascade', string="Website", copy=False), - 'key': fields.char('Key') - } - - _sql_constraints = [( - 'key_website_id_unique', - 'unique(key, website_id)', - 'Key must be unique per website.' - )] - - @tools.ormcache_context(accepted_keys=('website_id',)) - def get_view_id(self, cr, uid, xml_id, context=None): - if context and 'website_id' in context and not isinstance(xml_id, (int, long)): - domain = [ - ('key', '=', xml_id), - '|', - ('website_id', '=', context['website_id']), - ('website_id', '=', False) - ] - xml_ids = self.search(cr, uid, domain, order='website_id', limit=1, context=context) - if not xml_ids: - xml_id = self.pool['ir.model.data'].xmlid_to_res_id(cr, uid, xml_id, raise_if_not_found=True) - if self.read(cr, uid, xml_id, ['page'], context=context)['page']: - raise ValueError('Invalid template id: %r' % (xml_id,)) - else: - xml_id = xml_ids[0] - else: - xml_id = self.pool['ir.model.data'].xmlid_to_res_id(cr, uid, xml_id, raise_if_not_found=True) - return xml_id - - _read_template_cache = dict(accepted_keys=('lang', 'inherit_branding', 'editable', 'translatable', 'website_id')) - - @tools.ormcache_context(**_read_template_cache) - def _read_template(self, cr, uid, view_id, context=None): - arch = self.read_combined(cr, uid, view_id, fields=['arch'], context=context)['arch'] - arch_tree = etree.fromstring(arch) - - if 'lang' in context: - arch_tree = self.translate_qweb(cr, uid, view_id, arch_tree, context['lang'], context) - - self.distribute_branding(arch_tree) - root = etree.Element('templates') - root.append(arch_tree) - arch = etree.tostring(root, encoding='utf-8', xml_declaration=True) - return arch - - @tools.ormcache(size=0) - def read_template(self, cr, uid, xml_id, context=None): - if isinstance(xml_id, (int, long)): - view_id = xml_id - else: - if '.' not in xml_id: - raise ValueError('Invalid template id: %r' % (xml_id,)) - view_id = self.get_view_id(cr, uid, xml_id, context=context) - return self._read_template(cr, uid, view_id, context=context) - - def clear_cache(self): - self._read_template.clear_cache(self) - self.get_view_id.clear_cache(self) - - def get_inheriting_views_arch(self, cr, uid, view_id, model, context=None): - arch = super(view, self).get_inheriting_views_arch(cr, uid, view_id, model, context=context) - if not context or not 'website_id' in context: - return arch - - view_ids = [v for _, v in arch] - view_arch_to_add_per_key = {} - keep_view_ids = [] - for view_rec in self.browse(cr, SUPERUSER_ID, view_ids, context): - #case 1: there is no key, always keep the view - if not view_rec.key: - keep_view_ids.append(view_rec.id) - - #case 2: Correct website - elif view_rec.website_id and view_rec.website_id.id == context['website_id']: - view_arch_to_add_per_key[view_rec.key] = (view_rec.website_id.id, view_rec.id) - #case 3: no website add it if no website - if not view_rec.website_id: - view_web_id, view_id = view_arch_to_add_per_key.get(view_rec.key, (False, False)) - if not view_web_id: - view_arch_to_add_per_key[view_rec.key] = (False, view_rec.id) - #else: do nothing, you already have the right view - #case 4: website is wrong: do nothing - #Put all the view_id we keep together - keep_view_ids.extend([view_id for _, view_id in view_arch_to_add_per_key.values()]) - return [(arch, view_id) for arch, view_id in arch if view_id in keep_view_ids] - - - - diff --git a/website_multi/models/website.py b/website_multi/models/website.py deleted file mode 100644 index e1260217..00000000 --- a/website_multi/models/website.py +++ /dev/null @@ -1,116 +0,0 @@ -import openerp -from openerp import SUPERUSER_ID -from openerp.osv import orm, fields, osv -from openerp.addons.website.models.website import slugify -from openerp.addons.web.http import request -from werkzeug.exceptions import NotFound - - -class website(orm.Model): - - _inherit = "website" - - def _get_menu_website(self, cr, uid, ids, context=None): - res = [] - for menu in self.pool.get('website.menu').browse(cr, uid, ids, context=context): - if menu.website_id: - res.append(menu.website_id.id) - # IF a menu is changed, update all websites - return res - - def _get_menu(self, cr, uid, ids, name, arg, context=None): - result = {} - menu_obj = self.pool['website.menu'] - - for website_id in ids: - menu_ids = menu_obj.search(cr, uid, [ - ('parent_id', '=', False), - ('website_id', '=', website_id), - ], order='id', context=context) - result[website_id] = menu_ids and menu_ids[0] or False - - return result - - _columns = { - 'menu_id': fields.function( - _get_menu, - relation='website.menu', - type='many2one', - string='Main Menu', - store={ - 'website.menu': (_get_menu_website, ['sequence', 'parent_id', 'website_id'], 10) - } - ) - } - - _defaults = { - 'user_id': lambda s, c, u, x: s.pool['ir.model.data'].xmlid_to_res_id(c, SUPERUSER_ID, 'base.public_user'), - 'company_id': lambda s, c, u, x: s.pool['ir.model.data'].xmlid_to_res_id(c, SUPERUSER_ID, 'base.main_company'), - } - - def new_page(self, cr, uid, name, template='website.default_page', ispage=True, context=None): - context = context or {} - imd = self.pool['ir.model.data'] - view = self.pool['ir.ui.view'] - template_module, template_name = template.split('.') - - # completely arbitrary max_length - page_name = slugify(name, max_length=50) - page_xmlid = "%s.%s" % (template_module, page_name) - - try: - # existing page - imd.get_object_reference(cr, uid, template_module, page_name) - except ValueError: - # new page - _, template_id = imd.get_object_reference(cr, uid, template_module, template_name) - - page_id = view.copy(cr, uid, template_id, { - 'website_id': context.get('website_id'), - 'key': page_xmlid - }, context=context) - - page = view.browse(cr, uid, page_id, context=context) - - page.write({ - 'arch': page.arch.replace(template, page_xmlid), - 'name': page_name, - 'page': ispage, - }) - - return page_xmlid - - @openerp.tools.ormcache(skiparg=4) - def _get_current_website_id(self, cr, uid, domain_name, context=None): - ids = self.search(cr, uid, [('name', '=', domain_name)], context=context) - return ids and ids[0] or None - - def get_current_website(self, cr, uid, context=None): - domain_name = request.httprequest.environ.get('HTTP_HOST', '').split(':')[0] - website_id = self._get_current_website_id(cr, uid, domain_name, context=context) - request.context['website_id'] = website_id or 1 - return self.browse(cr, uid, website_id or 1, context=context) - - def get_template(self, cr, uid, ids, template, context=None): - if not isinstance(template, (int, long)) and '.' not in template: - template = 'website.%s' % template - View = self.pool['ir.ui.view'] - view_id = View.get_view_id(cr, uid, template, context=context) - if not view_id: - raise NotFound - return View.browse(cr, uid, view_id, context=context) - - -class ir_http(osv.AbstractModel): - _inherit = 'ir.http' - - def _auth_method_public(self): - if not request.session.uid: - domain_name = request.httprequest.environ.get('HTTP_HOST', '').split(':')[0] - website_id = self.pool['website']._get_current_website_id(request.cr, openerp.SUPERUSER_ID, domain_name, context=request.context) - if website_id: - request.uid = self.pool['website'].browse(request.cr, openerp.SUPERUSER_ID, website_id, request.context).user_id.id - else: - dummy, request.uid = self.pool['ir.model.data'].get_object_reference(request.cr, openerp.SUPERUSER_ID, 'base', 'public_user') - else: - request.uid = request.session.uid diff --git a/website_multi/views/res_config.xml b/website_multi/views/res_config.xml deleted file mode 100644 index b7816415..00000000 --- a/website_multi/views/res_config.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Website Multi Settings - website.config.settings - - - - 0 - - - - - - diff --git a/website_multi/views/website_views.xml b/website_multi/views/website_views.xml deleted file mode 100644 index a9343e93..00000000 --- a/website_multi/views/website_views.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - website.form - website - - - - 7.0 - - - - - - - - True - - -
- - -
-
-
-
- - - Websites Settings - website - tree,form - current - - - - Websites Settings - - - - - - - ir.ui.view - - - - - - - - - - - - - website.menu.search - website.menu - - - - - - - - - - - - - - - - Website Multi Website Menu Tree - website.menu - - - - - - - - - - Website Menu - website.menu - list - - - -
-
From c296411d568ad6465a6e83626cd63bead1a37133 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Thu, 9 Oct 2014 10:25:48 -0400 Subject: [PATCH 002/147] [IMP] runbot: add admin group for setups where other users need to administrate runbot Closes #43 --- runbot/__openerp__.py | 1 + runbot/security/ir.model.access.csv | 3 +++ runbot/security/runbot_security.xml | 12 ++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 runbot/security/runbot_security.xml diff --git a/runbot/__openerp__.py b/runbot/__openerp__.py index 9e6fa1bb..cd7b94f1 100644 --- a/runbot/__openerp__.py +++ b/runbot/__openerp__.py @@ -12,6 +12,7 @@ 'data': [ 'runbot.xml', 'res_config_view.xml', + 'security/runbot_security.xml', 'security/ir.model.access.csv', ], 'installable': True, diff --git a/runbot/security/ir.model.access.csv b/runbot/security/ir.model.access.csv index 08f60f33..634da009 100644 --- a/runbot/security/ir.model.access.csv +++ b/runbot/security/ir.model.access.csv @@ -2,3 +2,6 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_runbot_repo,runbot_repo,runbot.model_runbot_repo,,1,0,0,0 access_runbot_branch,runbot_branch,runbot.model_runbot_branch,,1,0,0,0 access_runbot_build,runbot_build,runbot.model_runbot_build,,1,0,0,0 +access_runbot_repo_admin,runbot_repo_admin,runbot.model_runbot_repo,runbot.group_runbot_admin,1,1,1,1 +access_runbot_branch_admin,runbot_branch_admin,runbot.model_runbot_branch,runbot.group_runbot_admin,1,1,1,1 +access_runbot_build_admin,runbot_build_admin,runbot.model_runbot_build,runbot.group_runbot_admin,1,1,1,1 diff --git a/runbot/security/runbot_security.xml b/runbot/security/runbot_security.xml new file mode 100644 index 00000000..26275bf7 --- /dev/null +++ b/runbot/security/runbot_security.xml @@ -0,0 +1,12 @@ + + + + + + Runbot Manager + + + + + + From 61ac2150d697d60aaaa534136c965ff26558e375 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Thu, 27 Nov 2014 15:48:38 +0100 Subject: [PATCH 003/147] [IMP] runbot: add route for opening last running build for any branch --- runbot/runbot.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/runbot/runbot.py b/runbot/runbot.py index a0906e75..612fca44 100644 --- a/runbot/runbot.py +++ b/runbot/runbot.py @@ -1105,6 +1105,9 @@ def build(self, build_id=None, search=None, **post): Logging = registry['ir.logging'] build = Build.browse(cr, uid, [int(build_id)])[0] + if not build.exists(): + return request.not_found() + real_build = build.duplicate_id if build.state == 'duplicate' else build # other builds @@ -1210,6 +1213,29 @@ def __init__(self, text, color): ] return request.render("runbot.badge_" + theme, data, headers=headers) + @http.route(['/runbot/b/'], type='http', auth="public", website=True) + def fast_launch(self, branch_name=False, **post): + pool, cr, uid, context = request.registry, request.cr, 1, request.context + Build = pool['runbot.build'] + + domain = [('branch_id.branch_name', '=', branch_name)] + builds = Build.search(cr, uid, domain, order="sequence desc", limit=1, context=context) + + if builds: + last_build = Build.browse(cr, uid, builds[0], context=context) + if last_build.state == 'duplicate': + last_build = last_build.duplicate_id + if last_build.state != 'running': + url = "/runbot/build/%s?ask_rebuild=1" % last_build.id + else: + url = ("http://%s/login?db=%s-all&login=admin&key=admin" % + (last_build.domain, last_build.dest)) + else: + return request.not_found() + return werkzeug.utils.redirect(url) + + + # kill ` ps faux | grep ./static | awk '{print $2}' ` # ps faux| grep Cron | grep -- '-all' | awk '{print $2}' | xargs kill # psql -l | grep " 000" | awk '{print $1}' | xargs -n1 dropdb From 3dadef3f6b54d7ef5f4c4e4a66443ac577973ecb Mon Sep 17 00:00:00 2001 From: Richard Mathot Date: Mon, 1 Dec 2014 15:59:11 +0100 Subject: [PATCH 004/147] [ADD] crm_profiling: deprecated module, moved to extra --- crm_profiling/__init__.py | 24 ++ crm_profiling/__openerp__.py | 52 ++++ crm_profiling/crm_profiling.py | 293 ++++++++++++++++++ crm_profiling/crm_profiling_demo.xml | 175 +++++++++++ crm_profiling/crm_profiling_view.xml | 200 ++++++++++++ crm_profiling/i18n/ar.po | 242 +++++++++++++++ crm_profiling/i18n/bg.po | 244 +++++++++++++++ crm_profiling/i18n/bs.po | 241 ++++++++++++++ crm_profiling/i18n/ca.po | 244 +++++++++++++++ crm_profiling/i18n/crm_profiling.pot | 229 ++++++++++++++ crm_profiling/i18n/cs.po | 237 ++++++++++++++ crm_profiling/i18n/da.po | 237 ++++++++++++++ crm_profiling/i18n/de.po | 246 +++++++++++++++ crm_profiling/i18n/el.po | 237 ++++++++++++++ crm_profiling/i18n/en_GB.po | 243 +++++++++++++++ crm_profiling/i18n/es.po | 243 +++++++++++++++ crm_profiling/i18n/es_AR.po | 243 +++++++++++++++ crm_profiling/i18n/es_CR.po | 243 +++++++++++++++ crm_profiling/i18n/es_EC.po | 243 +++++++++++++++ crm_profiling/i18n/es_MX.po | 252 +++++++++++++++ crm_profiling/i18n/es_PY.po | 243 +++++++++++++++ crm_profiling/i18n/es_VE.po | 252 +++++++++++++++ crm_profiling/i18n/et.po | 237 ++++++++++++++ crm_profiling/i18n/fi.po | 239 ++++++++++++++ crm_profiling/i18n/fr.po | 244 +++++++++++++++ crm_profiling/i18n/gl.po | 244 +++++++++++++++ crm_profiling/i18n/gu.po | 237 ++++++++++++++ crm_profiling/i18n/hr.po | 237 ++++++++++++++ crm_profiling/i18n/hu.po | 244 +++++++++++++++ crm_profiling/i18n/id.po | 237 ++++++++++++++ crm_profiling/i18n/it.po | 243 +++++++++++++++ crm_profiling/i18n/ja.po | 239 ++++++++++++++ crm_profiling/i18n/ko.po | 239 ++++++++++++++ crm_profiling/i18n/lt.po | 244 +++++++++++++++ crm_profiling/i18n/lv.po | 237 ++++++++++++++ crm_profiling/i18n/mk.po | 245 +++++++++++++++ crm_profiling/i18n/mn.po | 243 +++++++++++++++ crm_profiling/i18n/nb.po | 244 +++++++++++++++ crm_profiling/i18n/nl.po | 244 +++++++++++++++ crm_profiling/i18n/nl_BE.po | 237 ++++++++++++++ crm_profiling/i18n/pl.po | 239 ++++++++++++++ crm_profiling/i18n/pt.po | 244 +++++++++++++++ crm_profiling/i18n/pt_BR.po | 245 +++++++++++++++ crm_profiling/i18n/ro.po | 244 +++++++++++++++ crm_profiling/i18n/ru.po | 244 +++++++++++++++ crm_profiling/i18n/sk.po | 237 ++++++++++++++ crm_profiling/i18n/sl.po | 243 +++++++++++++++ crm_profiling/i18n/sq.po | 237 ++++++++++++++ crm_profiling/i18n/sr.po | 239 ++++++++++++++ crm_profiling/i18n/sr@latin.po | 239 ++++++++++++++ crm_profiling/i18n/sv.po | 243 +++++++++++++++ crm_profiling/i18n/tlh.po | 237 ++++++++++++++ crm_profiling/i18n/tr.po | 243 +++++++++++++++ crm_profiling/i18n/uk.po | 237 ++++++++++++++ crm_profiling/i18n/vi.po | 237 ++++++++++++++ crm_profiling/i18n/zh_CN.po | 237 ++++++++++++++ crm_profiling/i18n/zh_TW.po | 237 ++++++++++++++ crm_profiling/security/ir.model.access.csv | 8 + crm_profiling/test/process/profiling.yml | 68 ++++ crm_profiling/wizard/__init__.py | 23 ++ crm_profiling/wizard/open_questionnaire.py | 87 ++++++ .../wizard/open_questionnaire_view.xml | 81 +++++ 62 files changed, 13546 insertions(+) create mode 100644 crm_profiling/__init__.py create mode 100644 crm_profiling/__openerp__.py create mode 100644 crm_profiling/crm_profiling.py create mode 100644 crm_profiling/crm_profiling_demo.xml create mode 100644 crm_profiling/crm_profiling_view.xml create mode 100644 crm_profiling/i18n/ar.po create mode 100644 crm_profiling/i18n/bg.po create mode 100644 crm_profiling/i18n/bs.po create mode 100644 crm_profiling/i18n/ca.po create mode 100644 crm_profiling/i18n/crm_profiling.pot create mode 100644 crm_profiling/i18n/cs.po create mode 100644 crm_profiling/i18n/da.po create mode 100644 crm_profiling/i18n/de.po create mode 100644 crm_profiling/i18n/el.po create mode 100644 crm_profiling/i18n/en_GB.po create mode 100644 crm_profiling/i18n/es.po create mode 100644 crm_profiling/i18n/es_AR.po create mode 100644 crm_profiling/i18n/es_CR.po create mode 100644 crm_profiling/i18n/es_EC.po create mode 100644 crm_profiling/i18n/es_MX.po create mode 100644 crm_profiling/i18n/es_PY.po create mode 100644 crm_profiling/i18n/es_VE.po create mode 100644 crm_profiling/i18n/et.po create mode 100644 crm_profiling/i18n/fi.po create mode 100644 crm_profiling/i18n/fr.po create mode 100644 crm_profiling/i18n/gl.po create mode 100644 crm_profiling/i18n/gu.po create mode 100644 crm_profiling/i18n/hr.po create mode 100644 crm_profiling/i18n/hu.po create mode 100644 crm_profiling/i18n/id.po create mode 100644 crm_profiling/i18n/it.po create mode 100644 crm_profiling/i18n/ja.po create mode 100644 crm_profiling/i18n/ko.po create mode 100644 crm_profiling/i18n/lt.po create mode 100644 crm_profiling/i18n/lv.po create mode 100644 crm_profiling/i18n/mk.po create mode 100644 crm_profiling/i18n/mn.po create mode 100644 crm_profiling/i18n/nb.po create mode 100644 crm_profiling/i18n/nl.po create mode 100644 crm_profiling/i18n/nl_BE.po create mode 100644 crm_profiling/i18n/pl.po create mode 100644 crm_profiling/i18n/pt.po create mode 100644 crm_profiling/i18n/pt_BR.po create mode 100644 crm_profiling/i18n/ro.po create mode 100644 crm_profiling/i18n/ru.po create mode 100644 crm_profiling/i18n/sk.po create mode 100644 crm_profiling/i18n/sl.po create mode 100644 crm_profiling/i18n/sq.po create mode 100644 crm_profiling/i18n/sr.po create mode 100644 crm_profiling/i18n/sr@latin.po create mode 100644 crm_profiling/i18n/sv.po create mode 100644 crm_profiling/i18n/tlh.po create mode 100644 crm_profiling/i18n/tr.po create mode 100644 crm_profiling/i18n/uk.po create mode 100644 crm_profiling/i18n/vi.po create mode 100644 crm_profiling/i18n/zh_CN.po create mode 100644 crm_profiling/i18n/zh_TW.po create mode 100644 crm_profiling/security/ir.model.access.csv create mode 100644 crm_profiling/test/process/profiling.yml create mode 100644 crm_profiling/wizard/__init__.py create mode 100644 crm_profiling/wizard/open_questionnaire.py create mode 100644 crm_profiling/wizard/open_questionnaire_view.xml diff --git a/crm_profiling/__init__.py b/crm_profiling/__init__.py new file mode 100644 index 00000000..16035e48 --- /dev/null +++ b/crm_profiling/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +import crm_profiling +import wizard +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/crm_profiling/__openerp__.py b/crm_profiling/__openerp__.py new file mode 100644 index 00000000..8a44ee06 --- /dev/null +++ b/crm_profiling/__openerp__.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +{ + 'name': 'Customer Profiling', + 'version': '1.3', + 'category': 'Marketing', + 'description': """ +This module allows users to perform segmentation within partners. +================================================================= + +It uses the profiles criteria from the earlier segmentation module and improve it. +Thanks to the new concept of questionnaire. You can now regroup questions into a +questionnaire and directly use it on a partner. + +It also has been merged with the earlier CRM & SRM segmentation tool because they +were overlapping. + + **Note:** this module is not compatible with the module segmentation, since it's the same which has been renamed. + """, + 'author': 'OpenERP SA', + 'website': 'https://www.odoo.com/page/crm', + 'depends': ['base', 'crm'], + 'data': ['security/ir.model.access.csv', 'wizard/open_questionnaire_view.xml', 'crm_profiling_view.xml'], + 'demo': ['crm_profiling_demo.xml'], + 'test': [ + #'test/process/profiling.yml', #TODO:It's not debuging because problem to write data for open.questionnaire from partner section. + ], + 'installable': True, + 'auto_install': False, + 'images': ['images/profiling_questionnaires.jpeg','images/profiling_questions.jpeg'], +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/crm_profiling/crm_profiling.py b/crm_profiling/crm_profiling.py new file mode 100644 index 00000000..a8866e76 --- /dev/null +++ b/crm_profiling/crm_profiling.py @@ -0,0 +1,293 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp.osv import fields,osv +from openerp.osv import orm + +from openerp.tools.translate import _ + +def _get_answers(cr, uid, ids): + """ + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List of crm profiling’s IDs """ + + query = """ + select distinct(answer) + from profile_question_yes_rel + where profile IN %s""" + + cr.execute(query, (tuple(ids),)) + ans_yes = [x[0] for x in cr.fetchall()] + + query = """ + select distinct(answer) + from profile_question_no_rel + where profile IN %s""" + + cr.execute(query, (tuple(ids),)) + ans_no = [x[0] for x in cr.fetchall()] + + return [ans_yes, ans_no] + + +def _get_parents(cr, uid, ids): + """ + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List of crm profiling’s IDs + @return: Get parents's Id """ + + ids_to_check = ids + cr.execute(""" + select distinct(parent_id) + from crm_segmentation + where parent_id is not null + and id IN %s""",(tuple(ids),)) + + parent_ids = [x[0] for x in cr.fetchall()] + + trigger = False + for x in parent_ids: + if x not in ids_to_check: + ids_to_check.append(x) + trigger = True + + if trigger: + ids_to_check = _get_parents(cr, uid, ids_to_check) + + return ids_to_check + + +def test_prof(cr, uid, seg_id, pid, answers_ids=None): + + """ return True if the partner pid fetch the segmentation rule seg_id + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param seg_id: Segmentaion's ID + @param pid: partner's ID + @param answers_ids: Answers's IDs + """ + + ids_to_check = _get_parents(cr, uid, [seg_id]) + [yes_answers, no_answers] = _get_answers(cr, uid, ids_to_check) + temp = True + for y_ans in yes_answers: + if y_ans not in answers_ids: + temp = False + break + if temp: + for ans in answers_ids: + if ans in no_answers: + temp = False + break + if temp: + return True + return False + + +def _recompute_categ(self, cr, uid, pid, answers_ids): + """ Recompute category + @param self: The object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param pid: partner's ID + @param answers_ids: Answers's IDs + """ + + ok = [] + cr.execute(''' + select r.category_id + from res_partner_res_partner_category_rel r left join crm_segmentation s on (r.category_id = s.categ_id) + where r.partner_id = %s and (s.exclusif = false or s.exclusif is null) + ''', (pid,)) + for x in cr.fetchall(): + ok.append(x[0]) + + query = ''' + select id, categ_id + from crm_segmentation + where profiling_active = true''' + if ok != []: + query = query +''' and categ_id not in(%s)'''% ','.join([str(i) for i in ok ]) + query = query + ''' order by id ''' + + cr.execute(query) + segm_cat_ids = cr.fetchall() + + for (segm_id, cat_id) in segm_cat_ids: + if test_prof(cr, uid, segm_id, pid, answers_ids): + ok.append(cat_id) + return ok + + +class question(osv.osv): + """ Question """ + + _name="crm_profiling.question" + _description= "Question" + + _columns={ + 'name': fields.char("Question", required=True), + 'answers_ids': fields.one2many("crm_profiling.answer", "question_id", "Available Answers", copy=True), + } + + + +class questionnaire(osv.osv): + """ Questionnaire """ + + _name="crm_profiling.questionnaire" + _description= "Questionnaire" + + _columns = { + 'name': fields.char("Questionnaire", required=True), + 'description':fields.text("Description", required=True), + 'questions_ids': fields.many2many('crm_profiling.question','profile_questionnaire_quest_rel',\ + 'questionnaire', 'question', "Questions"), + } + + + +class answer(osv.osv): + _name="crm_profiling.answer" + _description="Answer" + _columns={ + "name": fields.char("Answer", required=True), + "question_id": fields.many2one('crm_profiling.question',"Question"), + } + + +class partner(osv.osv): + _inherit="res.partner" + _columns={ + "answers_ids": fields.many2many("crm_profiling.answer","partner_question_rel",\ + "partner","answer","Answers"), + } + + def _questionnaire_compute(self, cr, uid, answers, context=None): + """ + @param self: The object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param data: Get Data + @param context: A standard dictionary for contextual values """ + partner_id = context.get('active_id') + query = "select answer from partner_question_rel where partner=%s" + cr.execute(query, (partner_id,)) + for x in cr.fetchall(): + answers.append(x[0]) + self.write(cr, uid, [partner_id], {'answers_ids': [[6, 0, answers]]}, context=context) + return {} + + + def write(self, cr, uid, ids, vals, context=None): + """ + @param self: The object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List of crm profiling’s IDs + @param context: A standard dictionary for contextual values """ + + if 'answers_ids' in vals: + vals['category_id']=[[6, 0, _recompute_categ(self, cr, uid, ids[0], vals['answers_ids'][0][2])]] + + return super(partner, self).write(cr, uid, ids, vals, context=context) + + + +class crm_segmentation(osv.osv): + """ CRM Segmentation """ + + _inherit="crm.segmentation" + _columns={ + "answer_yes": fields.many2many("crm_profiling.answer","profile_question_yes_rel",\ + "profile","answer","Included Answers"), + "answer_no": fields.many2many("crm_profiling.answer","profile_question_no_rel",\ + "profile","answer","Excluded Answers"), + 'parent_id': fields.many2one('crm.segmentation', 'Parent Profile'), + 'child_ids': fields.one2many('crm.segmentation', 'parent_id', 'Child Profiles'), + 'profiling_active': fields.boolean('Use The Profiling Rules', help='Check\ + this box if you want to use this tab as part of the \ + segmentation rule. If not checked, the criteria beneath will be ignored') + } + + _constraints = [ + (osv.osv._check_recursion, 'Error ! You cannot create recursive profiles.', ['parent_id']) + ] + + def process_continue(self, cr, uid, ids, start=False): + """ + @param self: The object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List of crm segmentation’s IDs """ + + partner_obj = self.pool.get('res.partner') + categs = self.read(cr,uid,ids,['categ_id','exclusif','partner_id', \ + 'sales_purchase_active', 'profiling_active']) + for categ in categs: + if start: + if categ['exclusif']: + cr.execute('delete from res_partner_res_partner_category_rel where \ + category_id=%s', (categ['categ_id'][0],)) + partner_obj.invalidate_cache(cr, uid, ['category_id']) + + id = categ['id'] + + cr.execute('select id from res_partner order by id ') + partners = [x[0] for x in cr.fetchall()] + + if categ['sales_purchase_active']: + to_remove_list=[] + cr.execute('select id from crm_segmentation_line where segmentation_id=%s', (id,)) + line_ids = [x[0] for x in cr.fetchall()] + + for pid in partners: + if (not self.pool.get('crm.segmentation.line').test(cr, uid, line_ids, pid)): + to_remove_list.append(pid) + for pid in to_remove_list: + partners.remove(pid) + + if categ['profiling_active']: + to_remove_list = [] + for pid in partners: + + cr.execute('select distinct(answer) from partner_question_rel where partner=%s',(pid,)) + answers_ids = [x[0] for x in cr.fetchall()] + + if (not test_prof(cr, uid, id, pid, answers_ids)): + to_remove_list.append(pid) + for pid in to_remove_list: + partners.remove(pid) + + for partner in partner_obj.browse(cr, uid, partners): + category_ids = [categ_id.id for categ_id in partner.category_id] + if categ['categ_id'][0] not in category_ids: + cr.execute('insert into res_partner_res_partner_category_rel (category_id,partner_id) values (%s,%s)', (categ['categ_id'][0],partner.id)) + partner_obj.invalidate_cache(cr, uid, ['category_id'], [partner.id]) + + self.write(cr, uid, [id], {'state':'not running', 'partner_id':0}) + return True + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/crm_profiling/crm_profiling_demo.xml b/crm_profiling/crm_profiling_demo.xml new file mode 100644 index 00000000..ec93e6f1 --- /dev/null +++ b/crm_profiling/crm_profiling_demo.xml @@ -0,0 +1,175 @@ + + + + + + + + + Activity sector? + + + Number of employees? + + + Partner level? + + + Odoo partner? + + + + + + Base questionnaire + First questionnaire. + + + + + + + Services + + + + Telecom + + + + IT + + + + 1 to 50 + + + + 51 to 100 + + + + more than 100 + + + + ready + + + + silver + + + + gold + + + + yes + + + + no + + + + + + + + Telecom sector + + + + + + + + Odoo partners + + + True + + + Ready partners + + + + True + + + Silver partners + + + + True + + + Gold partners + + + + True + True + + + Service partners + + + True + + + Telecom partners + + + True + + + IT partners + + + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crm_profiling/crm_profiling_view.xml b/crm_profiling/crm_profiling_view.xml new file mode 100644 index 00000000..2dbb2e00 --- /dev/null +++ b/crm_profiling/crm_profiling_view.xml @@ -0,0 +1,200 @@ + + + + + + Questionnaires + crm_profiling.questionnaire + form + tree,form + You can create specific topic-related questionnaires to guide your team(s) in the sales cycle by helping them to ask the right questions. The segmentation tool allows you to automatically assign a partner to a category according to his answers to the different questionnaires. + + + + + + Questions + crm_profiling.question + form + tree,form + + + + + + + + Questionnaires + crm_profiling.questionnaire + + + + + + + + + + + + + Questionnaires + crm_profiling.questionnaire + +
+ + + + + + + + + +
+
+
+ + + + + Answers + crm_profiling.answer + + + + + + + + + + + + Answers + crm_profiling.answer + +
+ + + + +
+
+
+ + + + + Questions + crm_profiling.question + + + + + + + + + + + + Questions + crm_profiling.question + +
+ + + + + + + + + + + + + +
+ +
+
+ + + + res.partner.profile.form + res.partner + + + + + + + + - - : testing, running - - - Pending: - +
+ + + : testing, running +   + + Pending: +
From 8d9a2ae5ed7f5efac825f50695f631285bbcff00 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 3 Mar 2015 11:13:35 +0100 Subject: [PATCH 034/147] [IMP] runbot: better front page --- runbot/runbot.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runbot/runbot.xml b/runbot/runbot.xml index 2537e2bd..06c719a5 100644 --- a/runbot/runbot.xml +++ b/runbot/runbot.xml @@ -350,14 +350,14 @@
-
+

: testing, running   Pending: -

+

From 6d5d347d2eaf4b1ee6d9bb8df6bb8379adfe7013 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 27 Mar 2015 14:54:45 +0100 Subject: [PATCH 035/147] [IMP] runbot: :star: --- runbot/runbot.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runbot/runbot.xml b/runbot/runbot.xml index 06c719a5..339600e6 100644 --- a/runbot/runbot.xml +++ b/runbot/runbot.xml @@ -377,7 +377,7 @@ - +
From 871f25261c7eb966884190b5f03fa8b9752763b6 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 31 Mar 2015 12:58:58 +0200 Subject: [PATCH 036/147] [IMP] runbot: Allow restrict access to repo. --- runbot/__openerp__.py | 1 + runbot/runbot.py | 16 +++++++++------- runbot/runbot.xml | 1 + runbot/security/ir.model.access.csv | 6 +++--- runbot/security/ir.rule.csv | 7 +++++++ runbot/security/runbot_security.xml | 13 +++++++++++++ 6 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 runbot/security/ir.rule.csv diff --git a/runbot/__openerp__.py b/runbot/__openerp__.py index cd7b94f1..00df5bc3 100644 --- a/runbot/__openerp__.py +++ b/runbot/__openerp__.py @@ -14,6 +14,7 @@ 'res_config_view.xml', 'security/runbot_security.xml', 'security/ir.model.access.csv', + 'security/ir.rule.csv', ], 'installable': True, } diff --git a/runbot/runbot.py b/runbot/runbot.py index c4b53e54..17bbce4c 100644 --- a/runbot/runbot.py +++ b/runbot/runbot.py @@ -26,7 +26,7 @@ import werkzeug import openerp -from openerp import http +from openerp import http, SUPERUSER_ID from openerp.http import request from openerp.osv import fields, osv from openerp.tools import config, appdirs @@ -190,6 +190,7 @@ def _get_base(self, cr, uid, ids, field_name, arg, context=None): string='Extra dependencies', help="Community addon repos which need to be present to run tests."), 'token': fields.char("Github token"), + 'group_ids': fields.many2many('res.groups', string='Limited to groups'), } _defaults = { 'testing': 1, @@ -851,7 +852,8 @@ def force(self, cr, uid, ids, context=None): # Force it now if build.state == 'done' and build.result == 'skipped': - build.write({'state': 'pending', 'sequence':sequence, 'result': '' }) + values = {'state': 'pending', 'sequence':sequence, 'result': ''} + self.write(cr, SUPERUSER_ID, [build.id], values, context=context) # or duplicate it elif build.state in ['running', 'done', 'duplicate']: new_build = { @@ -865,7 +867,7 @@ def force(self, cr, uid, ids, context=None): 'subject': build.subject, 'modules': build.modules, } - self.create(cr, 1, new_build, context=context) + self.create(cr, SUPERUSER_ID, new_build, context=context) return build.repo_id.id def schedule(self, cr, uid, ids, context=None): @@ -1006,7 +1008,7 @@ class RunbotController(http.Controller): @http.route(['/runbot', '/runbot/repo/'], type='http', auth="public", website=True) def repo(self, repo=None, search='', limit='100', refresh='', **post): - registry, cr, uid = request.registry, request.cr, 1 + registry, cr, uid = request.registry, request.cr, request.uid branch_obj = registry['runbot.branch'] build_obj = registry['runbot.build'] @@ -1130,7 +1132,7 @@ def build_info(self, build): @http.route(['/runbot/build/'], type='http', auth="public", website=True) def build(self, build_id=None, search=None, **post): - registry, cr, uid, context = request.registry, request.cr, 1, request.context + registry, cr, uid, context = request.registry, request.cr, request.uid, request.context Build = registry['runbot.build'] Logging = registry['ir.logging'] @@ -1167,7 +1169,7 @@ def build(self, build_id=None, search=None, **post): @http.route(['/runbot/build//force'], type='http', auth="public", methods=['POST']) def build_force(self, build_id, **post): - registry, cr, uid, context = request.registry, request.cr, 1, request.context + registry, cr, uid, context = request.registry, request.cr, request.uid, request.context repo_id = registry['runbot.build'].force(cr, uid, [int(build_id)]) return werkzeug.utils.redirect('/runbot/repo/%s' % repo_id) @@ -1246,7 +1248,7 @@ def __init__(self, text, color): @http.route(['/runbot/b/', '/runbot//'], type='http', auth="public", website=True) def fast_launch(self, branch_name=False, repo=False, **post): - pool, cr, uid, context = request.registry, request.cr, 1, request.context + pool, cr, uid, context = request.registry, request.cr, request.uid, request.context Build = pool['runbot.build'] domain = [('branch_id.branch_name', '=', branch_name)] diff --git a/runbot/runbot.xml b/runbot/runbot.xml index 339600e6..bc7c5e46 100644 --- a/runbot/runbot.xml +++ b/runbot/runbot.xml @@ -27,6 +27,7 @@ + diff --git a/runbot/security/ir.model.access.csv b/runbot/security/ir.model.access.csv index 634da009..de4e5579 100644 --- a/runbot/security/ir.model.access.csv +++ b/runbot/security/ir.model.access.csv @@ -1,7 +1,7 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_runbot_repo,runbot_repo,runbot.model_runbot_repo,,1,0,0,0 -access_runbot_branch,runbot_branch,runbot.model_runbot_branch,,1,0,0,0 -access_runbot_build,runbot_build,runbot.model_runbot_build,,1,0,0,0 +access_runbot_repo,runbot_repo,runbot.model_runbot_repo,group_user,1,0,0,0 +access_runbot_branch,runbot_branch,runbot.model_runbot_branch,group_user,1,0,0,0 +access_runbot_build,runbot_build,runbot.model_runbot_build,group_user,1,0,0,0 access_runbot_repo_admin,runbot_repo_admin,runbot.model_runbot_repo,runbot.group_runbot_admin,1,1,1,1 access_runbot_branch_admin,runbot_branch_admin,runbot.model_runbot_branch,runbot.group_runbot_admin,1,1,1,1 access_runbot_build_admin,runbot_build_admin,runbot.model_runbot_build,runbot.group_runbot_admin,1,1,1,1 diff --git a/runbot/security/ir.rule.csv b/runbot/security/ir.rule.csv new file mode 100644 index 00000000..386145f5 --- /dev/null +++ b/runbot/security/ir.rule.csv @@ -0,0 +1,7 @@ +id,name,model_id/id,groups/id,domain_force,perm_read,perm_create,perm_write,perm_unlink +rule_repo,"limited to groups",model_runbot_repo,group_user,"['|', ('group_ids', '=', False), ('group_ids', 'in', [g.id for g in user.groups_id])]",1,1,1,1 +rule_repo_mgmt,"manager can see all",model_runbot_repo,group_runbot_admin,"[(1, '=', 1)]",1,1,1,1 +rule_branch,"limited to groups",model_runbot_branch,group_user,"['|', ('repo_id.group_ids', '=', False), ('repo_id.group_ids', 'in', [g.id for g in user.groups_id])]",1,1,1,1 +rule_branch_mgmt,"manager can see all",model_runbot_branch,group_runbot_admin,"[(1, '=', 1)]",1,1,1,1 +rule_build,"limited to groups",model_runbot_build,group_user,"['|', ('repo_id.group_ids', '=', False), ('repo_id.group_ids', 'in', [g.id for g in user.groups_id])]",1,1,1,1 +rule_build_mgmt,"manager can see all",model_runbot_build,group_runbot_admin,"[(1, '=', 1)]",1,1,1,1 diff --git a/runbot/security/runbot_security.xml b/runbot/security/runbot_security.xml index 26275bf7..122dd6ca 100644 --- a/runbot/security/runbot_security.xml +++ b/runbot/security/runbot_security.xml @@ -2,10 +2,23 @@ + + Runbot User + + + + + + + + + Runbot Manager + From ce86ee8700879b630516b8367f5bd234f66657da Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 31 Mar 2015 13:43:50 +0200 Subject: [PATCH 037/147] [FIX] runbot: read `ir.logging` as SUPERUSER --- runbot/runbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runbot/runbot.py b/runbot/runbot.py index 17bbce4c..f5dfac0b 100644 --- a/runbot/runbot.py +++ b/runbot/runbot.py @@ -1154,7 +1154,7 @@ def build(self, build_id=None, search=None, **post): # domain.append(('level', '=', level)) if search: domain.append(('name', 'ilike', search)) - logging_ids = Logging.search(cr, uid, domain) + logging_ids = Logging.search(cr, SUPERUSER_ID, domain) context = { 'repo': build.repo_id, From 1ed55d1f897fc5e27ed115dbfdf7c17488db3524 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 31 Mar 2015 13:45:36 +0200 Subject: [PATCH 038/147] [FIX] runbot: access `ir.logging` as SUPERUSER --- runbot/runbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runbot/runbot.py b/runbot/runbot.py index f5dfac0b..84a361cc 100644 --- a/runbot/runbot.py +++ b/runbot/runbot.py @@ -1160,7 +1160,7 @@ def build(self, build_id=None, search=None, **post): 'repo': build.repo_id, 'build': self.build_info(build), 'br': {'branch': build.branch_id}, - 'logs': Logging.browse(cr, uid, logging_ids), + 'logs': Logging.browse(cr, SUPERUSER_ID, logging_ids), 'other_builds': other_builds } #context['type'] = type From 8deebaec04136f573f6a69361fa2fc4afd6c252c Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 31 Mar 2015 13:51:17 +0200 Subject: [PATCH 039/147] [IMP] runbot: put groups in their own category. --- runbot/security/runbot_security.xml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/runbot/security/runbot_security.xml b/runbot/security/runbot_security.xml index 122dd6ca..c314c055 100644 --- a/runbot/security/runbot_security.xml +++ b/runbot/security/runbot_security.xml @@ -1,13 +1,16 @@ + + Runbot + - Runbot User - + User + - + @@ -15,8 +18,8 @@ - Runbot Manager - + Manager + From 9794d094aa269bc19d735fa73787e5bae24e5e3b Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 1 Apr 2015 18:03:33 +0200 Subject: [PATCH 040/147] [IMP] runbot: allow upload of bigger files. --- runbot/runbot.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/runbot/runbot.xml b/runbot/runbot.xml index bc7c5e46..0fe02ba9 100644 --- a/runbot/runbot.xml +++ b/runbot/runbot.xml @@ -571,6 +571,7 @@ http { include /etc/nginx/mime.types; server_names_hash_max_size 512; server_names_hash_bucket_size 256; + client_max_body_size 10M; index index.html; log_format full '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' From e2f6ea7562e37d672c541e102e90f8eb3db50666 Mon Sep 17 00:00:00 2001 From: Nicolas Seinlet Date: Wed, 8 Apr 2015 16:57:15 +0200 Subject: [PATCH 041/147] Set groups on buttons to avoid users with backend access to killall builds --- runbot/runbot.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runbot/runbot.xml b/runbot/runbot.xml index 0fe02ba9..569d99ed 100644 --- a/runbot/runbot.xml +++ b/runbot/runbot.xml @@ -13,9 +13,9 @@
From 44733671fd8f0fd707a0dc72ee26c6d8d80be76b Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Wed, 8 Apr 2015 17:29:55 +0200 Subject: [PATCH 042/147] [FIX] runbot: don't install website_instantclick by default This module should be simply deleted in a futur version. The implementation are not more supported with Odoo. Architecture need to be reviewed to allow the support of this library --- runbot/runbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runbot/runbot.py b/runbot/runbot.py index 84a361cc..90d25c18 100644 --- a/runbot/runbot.py +++ b/runbot/runbot.py @@ -682,7 +682,7 @@ def cmd(self, cr, uid, ids, context=None): else: l = glob.glob(build.server('addons', '*', '__init__.py')) modules = set(os.path.basename(os.path.dirname(i)) for i in l) - modules = modules - set(['auth_ldap', 'document_ftp', 'hw_escpos', 'hw_proxy', 'hw_scanner', 'base_gengo', 'website_gengo']) + modules = modules - set(['auth_ldap', 'document_ftp', 'hw_escpos', 'hw_proxy', 'hw_scanner', 'base_gengo', 'website_gengo', 'website_instantclick']) modules = ",".join(list(modules)) # commandline From 1db6de579d1de43eb3ee22c88b34f48fd310ae0d Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Mon, 13 Apr 2015 18:04:55 +0200 Subject: [PATCH 043/147] [IMP] runbot: change menu and remove black user_navbar Useless for employee who don't edit runbot --- runbot/runbot.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/runbot/runbot.xml b/runbot/runbot.xml index 569d99ed..c76d4d30 100644 --- a/runbot/runbot.xml +++ b/runbot/runbot.xml @@ -235,6 +235,24 @@ + + + + + +