diff --git a/addons/auth_oauth/__init__.py b/addons/auth_oauth/__init__.py index a56db75633b..08c1dd3d6b5 100644 --- a/addons/auth_oauth/__init__.py +++ b/addons/auth_oauth/__init__.py @@ -2,3 +2,4 @@ import controllers import auth_oauth import res_users import res_config +import ir_configparameter diff --git a/addons/auth_oauth/ir_configparameter.py b/addons/auth_oauth/ir_configparameter.py new file mode 100644 index 00000000000..b0fa17ffa5b --- /dev/null +++ b/addons/auth_oauth/ir_configparameter.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +from openerp import SUPERUSER_ID +from openerp.osv import osv + +class ir_configparameter(osv.Model): + _inherit = 'ir.config_parameter' + + def init(self, cr, force=False): + super(ir_configparameter, self).init(cr, force=force) + if force: + IMD = self.pool['ir.model.data'] + oauth_oe = IMD.xmlid_to_object(cr, SUPERUSER_ID, 'auth_oauth.provider_openerp') + dbuuid = self.get_param(cr, SUPERUSER_ID, 'database.uuid') + oauth_oe.write({'client_id': dbuuid}) diff --git a/addons/calendar/calendar_data.xml b/addons/calendar/calendar_data.xml index 4435e8a4324..ff93a29a634 100644 --- a/addons/calendar/calendar_data.xml +++ b/addons/calendar/calendar_data.xml @@ -2,6 +2,17 @@ + + + Open Calendar + reload + + + + + open + + Invitation @@ -401,7 +412,7 @@
Dear ${object.cn} ,
-

this it a reminder for the event below :

+

That is a reminder for the event below :

diff --git a/addons/l10n_be_invoice_bba/i18n/zh_CN.po b/addons/l10n_be_invoice_bba/i18n/zh_CN.po new file mode 100644 index 00000000000..f821806edcd --- /dev/null +++ b/addons/l10n_be_invoice_bba/i18n/zh_CN.po @@ -0,0 +1,146 @@ +# Chinese (Simplified) translation for openobject-addons +# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-11-24 02:53+0000\n" +"PO-Revision-Date: 2014-03-13 05:55+0000\n" +"Last-Translator: LaoBiao.JX \n" +"Language-Team: Chinese (Simplified) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-03-13 06:16+0000\n" +"X-Generator: Launchpad (build 16963)\n" + +#. module: l10n_be_invoice_bba +#: sql_constraint:account.invoice:0 +msgid "Invoice Number must be unique per Company!" +msgstr "发票号必须在公司范围内唯一" + +#. module: l10n_be_invoice_bba +#: model:ir.model,name:l10n_be_invoice_bba.model_account_invoice +msgid "Invoice" +msgstr "发票" + +#. module: l10n_be_invoice_bba +#: constraint:res.partner:0 +msgid "Error ! You cannot create recursive associated members." +msgstr "错误,您不能创建循环引用的会员用户" + +#. module: l10n_be_invoice_bba +#: constraint:account.invoice:0 +msgid "Invalid BBA Structured Communication !" +msgstr "BBA结构化传输有误!" + +#. module: l10n_be_invoice_bba +#: selection:res.partner,out_inv_comm_algorithm:0 +msgid "Random" +msgstr "随机" + +#. module: l10n_be_invoice_bba +#: help:res.partner,out_inv_comm_type:0 +msgid "Select Default Communication Type for Outgoing Invoices." +msgstr "" + +#. module: l10n_be_invoice_bba +#: help:res.partner,out_inv_comm_algorithm:0 +msgid "" +"Select Algorithm to generate the Structured Communication on Outgoing " +"Invoices." +msgstr "" + +#. module: l10n_be_invoice_bba +#: code:addons/l10n_be_invoice_bba/invoice.py:109 +#: code:addons/l10n_be_invoice_bba/invoice.py:135 +#, python-format +msgid "" +"The daily maximum of outgoing invoices with an automatically generated BBA " +"Structured Communications has been exceeded!\n" +"Please create manually a unique BBA Structured Communication." +msgstr "自动生成结构化BBA传输已超出每日销售发票的最大值,请手动建立BBA结构化传输" + +#. module: l10n_be_invoice_bba +#: code:addons/l10n_be_invoice_bba/invoice.py:150 +#, python-format +msgid "Error!" +msgstr "" + +#. module: l10n_be_invoice_bba +#: code:addons/l10n_be_invoice_bba/invoice.py:121 +#, python-format +msgid "" +"The Partner should have a 3-7 digit Reference Number for the generation of " +"BBA Structured Communications!\n" +"Please correct the Partner record." +msgstr "" + +#. module: l10n_be_invoice_bba +#: constraint:res.partner:0 +msgid "Error: Invalid ean code" +msgstr "错误:无效的EAN编码" + +#. module: l10n_be_invoice_bba +#: code:addons/l10n_be_invoice_bba/invoice.py:108 +#: code:addons/l10n_be_invoice_bba/invoice.py:120 +#: code:addons/l10n_be_invoice_bba/invoice.py:134 +#: code:addons/l10n_be_invoice_bba/invoice.py:162 +#: code:addons/l10n_be_invoice_bba/invoice.py:172 +#: code:addons/l10n_be_invoice_bba/invoice.py:197 +#, python-format +msgid "Warning!" +msgstr "警告!" + +#. module: l10n_be_invoice_bba +#: selection:res.partner,out_inv_comm_algorithm:0 +msgid "Customer Reference" +msgstr "客户参考号" + +#. module: l10n_be_invoice_bba +#: field:res.partner,out_inv_comm_type:0 +msgid "Communication Type" +msgstr "讯息类型" + +#. module: l10n_be_invoice_bba +#: code:addons/l10n_be_invoice_bba/invoice.py:173 +#: code:addons/l10n_be_invoice_bba/invoice.py:198 +#, python-format +msgid "" +"The BBA Structured Communication has already been used!\n" +"Please create manually a unique BBA Structured Communication." +msgstr "" + +#. module: l10n_be_invoice_bba +#: selection:res.partner,out_inv_comm_algorithm:0 +msgid "Date" +msgstr "事务处理日期" + +#. module: l10n_be_invoice_bba +#: model:ir.model,name:l10n_be_invoice_bba.model_res_partner +msgid "Partner" +msgstr "合作伙伴" + +#. module: l10n_be_invoice_bba +#: code:addons/l10n_be_invoice_bba/invoice.py:151 +#, python-format +msgid "" +"Unsupported Structured Communication Type Algorithm '%s' !\n" +"Please contact your OpenERP support channel." +msgstr "不支持的结构化传输算法类型\"%s\"!请联系你的OpenERP 维护人员" + +#. module: l10n_be_invoice_bba +#: field:res.partner,out_inv_comm_algorithm:0 +msgid "Communication Algorithm" +msgstr "" + +#. module: l10n_be_invoice_bba +#: code:addons/l10n_be_invoice_bba/invoice.py:163 +#, python-format +msgid "" +"Empty BBA Structured Communication!\n" +"Please fill in a unique BBA Structured Communication." +msgstr "" diff --git a/addons/report/controllers/main.py b/addons/report/controllers/main.py index 1a839fc2c1f..0dae5f41288 100644 --- a/addons/report/controllers/main.py +++ b/addons/report/controllers/main.py @@ -488,7 +488,7 @@ class Report(http.Controller): return request.make_response(barcode, headers=[('Content-Type', 'image/png')]) - @http.route('/report/download/', type='http', auth="user") + @http.route('/report/download', type='http', auth="user") def report_attachment(self, data, token): """This function is used by 'qwebactionmanager.js' in order to trigger the download of a report of any type. @@ -515,7 +515,7 @@ class Report(http.Controller): response.set_cookie('fileToken', token) return response - @http.route('/report/check_wkhtmltopdf/', type='json', auth="user") + @http.route('/report/check_wkhtmltopdf', type='json', auth="user") def check_wkhtmltopdf(self): """Check the presence of wkhtmltopdf and return its version. If wkhtmltopdf cannot be found, return False. diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index f73138313ab..47c0853d6be 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -79,6 +79,9 @@ class ir_http(orm.AbstractModel): return self._dispatch() def _postprocess_args(self, arguments, rule): + if not getattr(request, 'website_enabled', False): + return super(ir_http, self)._postprocess_args(arguments, rule) + for arg, val in arguments.items(): # Replace uid placeholder by the current request.uid if isinstance(val, orm.browse_record) and isinstance(val._uid, RequestUID): diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index a5cf89b3a4e..c89bf9ec2fb 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -106,6 +106,7 @@ }, canUndo: false, editorFocus: true, + context: 'a', }); //noinspection JSValidateTypes editor.addCommand('image', { @@ -115,6 +116,7 @@ }, canUndo: false, editorFocus: true, + context: 'img', }); editor.ui.addButton('Link', { @@ -205,8 +207,9 @@ icon: '/website/static/src/img/bglink.png', modes: { wysiwyg: true }, editorFocus: true, + context: 'a', panel: { - css: '/website/static/lib/bootstrap/css/bootstrap.css', + css: '/web/static/lib/bootstrap/css/bootstrap.css', attributes: { 'role': 'listbox', 'aria-label': label }, }, @@ -346,14 +349,40 @@ requires: 'widget', init: function (editor) { + var specials = { + // Can't find the correct ACL rule to only allow img tags + image: { content: '*' }, + html: { text: '*' }, + monetary: { + text: { + selector: 'span.oe_currency_value', + allowedContent: { } + } + } + }; + _(specials).each(function (editable, type) { + editor.widgets.add(type, { + draggable: false, + editables: editable, + upcast: function (el) { + return el.attributes['data-oe-type'] === type; + + } + }); + }); editor.widgets.add('oeref', { - editables: { text: '*' }, draggable: false, - + editables: { + text: { + selector: '*', + allowedContent: { } + }, + }, upcast: function (el) { - var matches = el.attributes['data-oe-type'] && el.attributes['data-oe-type'] !== 'monetary'; - if (!matches) { return false; } - + var type = el.attributes['data-oe-type']; + if (!type || (type in specials)) { + return false; + } if (el.attributes['data-oe-original']) { while (el.children.length) { el.children[0].remove(); @@ -363,16 +392,9 @@ )); } return true; - }, - }); - editor.widgets.add('monetary', { - editables: { text: 'span.oe_currency_value' }, - draggable: false, - - upcast: function (el) { - return el.attributes['data-oe-type'] === 'monetary'; } }); + editor.widgets.add('icons', { draggable: false, @@ -383,7 +405,11 @@ }); }, upcast: function (el) { - return el.hasClass('fa'); + return el.hasClass('fa') + // ignore ir.ui.view (other data-oe-model should + // already have been matched by oeref and + // monetary? + && !el.attributes['data-oe-model']; } }); } @@ -645,6 +671,11 @@ previous = null; }, 'btn-sm'); + function is_icons_widget(element) { + var w = editor.widgets.getByElement(element); + return w && w.name === 'icons'; + } + // previous is the state of the button-trigger: it's the // currently-ish hovered element which can trigger a button showing. // -ish, because when moving to the button itself ``previous`` is @@ -654,9 +685,15 @@ // Back from edit button -> ignore if (previous && previous === this) { return; } + // hover button should appear for "editable" links and images + // (img and a nodes whose *attributes* are editable, they + // can not be "editing hosts") *or* for non-editing-host + // elements bearing an ``fa`` class. These should have been + // made into CKE widgets which are editing hosts by + // definition, so instead check if the element has been + // converted/upcasted to an fa widget var selected = new CKEDITOR.dom.element(this); - // FIXME: fa nodes may not be editable widgets (?) - if (!is_editable_node(selected) && !selected.hasClass('fa')) { + if (!(is_editable_node(selected) || is_icons_widget(selected))) { return; } diff --git a/addons/website_crm/controllers/main.py b/addons/website_crm/controllers/main.py index 85ffc950a3f..c1680ce22ff 100644 --- a/addons/website_crm/controllers/main.py +++ b/addons/website_crm/controllers/main.py @@ -15,8 +15,18 @@ class contactus(http.Controller): ) return url + @http.route(['/page/website.contactus'], type='http', auth="public", website=True, multilang=True) + def contact(self, **kwargs): + values = {} + for field in ['description', 'partner_name', 'phone', 'contact_name', 'email_from', 'name']: + if kwargs.get(field): + values[field] = kwargs.pop(field) + values.update(kwargs=kwargs.items()) + print values + return request.website.render("website.contactus", values) + @http.route(['/crm/contactus'], type='http', auth="public", website=True, multilang=True) - def contactus(self, description=None, partner_name=None, phone=None, contact_name=None, email_from=None, name=None): + def contactus(self, description=None, partner_name=None, phone=None, contact_name=None, email_from=None, name=None, **kwargs): post = {} post['description'] = description post['partner_name'] = partner_name @@ -35,6 +45,7 @@ class contactus(http.Controller): if not post.get(field): error.add(field) if error: + values.update(kwargs=kwargs.items()) return request.website.render("website.contactus", values) # if not given: subject is contact name @@ -48,9 +59,19 @@ class contactus(http.Controller): except ValueError: pass + environ = request.httprequest.headers.environ + post['description'] = "%s\n-----------------------------\nIP: %s\nUSER_AGENT: %s\nACCEPT_LANGUAGE: %s\nREFERER: %s" % ( + post['description'], + environ.get("REMOTE_ADDR"), + environ.get("HTTP_USER_AGENT"), + environ.get("HTTP_ACCEPT_LANGUAGE"), + environ.get("HTTP_REFERER")) + for field in kwargs.items(): + post['description'] = "%s\n%s: %s" % (post['description'], field[0], field[1]) + request.registry['crm.lead'].create(request.cr, SUPERUSER_ID, post, request.context) company = request.website.company_id values = { - 'google_map_url': self.generate_google_map_url(company.street, company.city, company.zip, company.country_id and company.country_id.name_get()[0][1] or '') + 'google_map_url': self.generate_google_map_url(company.street, company.city, company.zip, company.country_id and company.country_id.name_get()[0][1] or ''), } return request.website.render("website_crm.contactus_thanks", values) diff --git a/addons/website_crm/views/website_crm.xml b/addons/website_crm/views/website_crm.xml index 64ae477679a..a60a2c6843e 100644 --- a/addons/website_crm/views/website_crm.xml +++ b/addons/website_crm/views/website_crm.xml @@ -5,6 +5,9 @@