[MERGE] from trunk

bzr revid: chm@openerp.com-20140312140429-4x94dc1x70yfik1w
bzr revid: chm@openerp.com-20140313122048-1zrqhq6dbtv8jpad
This commit is contained in:
chm@openerp.com 2014-03-13 13:20:48 +01:00
commit 2390c9179b
10 changed files with 260 additions and 30 deletions

View File

@ -2,3 +2,4 @@ import controllers
import auth_oauth
import res_users
import res_config
import ir_configparameter

View File

@ -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})

View File

@ -2,6 +2,17 @@
<openerp>
<data noupdate="1">
<!-- After installation of the module, open the related menu -->
<record id="action_client_calendar_menu" model="ir.actions.client">
<field name="name">Open Calendar</field>
<field name="tag">reload</field>
<field name="params" eval="{'menu_id': ref('calendar.mail_menu_calendar')}"/>
</record>
<record id="base.open_menu" model="ir.actions.todo">
<field name="action_id" ref="action_client_calendar_menu"/>
<field name="state">open</field>
</record>
<!-- Expense-related subtypes for messaging / Chatter -->
<record id="calendar.subtype_invitation" model="mail.message.subtype">
<field name="name">Invitation</field>
@ -401,7 +412,7 @@
</div>
<div style="height: 50px;text-align: left;font-size : 14px;border-collapse: separate;margin-top:10px">
<strong style="margin-left:12px">Dear ${object.cn}</strong> ,<br/>
<p style="margin-left:12px">this it a reminder for the event below : </p>
<p style="margin-left:12px">That is a reminder for the event below : </p>
</div>
<div style="height: auto;margin-left:12px;margin-top:30px;">
<table>

View File

@ -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 <EMAIL@ADDRESS>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\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 <betty2349@gmail.com>\n"
"Language-Team: Chinese (Simplified) <zh_CN@li.org>\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 ""

View File

@ -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.

View File

@ -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):

View File

@ -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;
}

View File

@ -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)

View File

@ -5,6 +5,9 @@
<template id="contactus_form" name="Contact Form" inherit_id="website.contactus" inherit_option_id="website.contactus">
<xpath expr="//div[@name='mail_button']" position="replace">
<form action="/crm/contactus" method="post" class="form-horizontal mt32" >
<t t-foreach="kwargs" t-as="kwarg">
<input type="hidden" t-att-name="kwarg[0]" t-att-value="kwarg[1]"/>
</t>
<div t-attf-class="form-group #{error and 'contact_name' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="contact_name">Your Name</label>
<div class="col-md-7 col-sm-8">

View File

@ -11,20 +11,14 @@ inject = [
class TestUi(openerp.tests.HttpCase):
def test_01_admin_shop_tour(self):
#self.phantom_js("/", "openerp.website.Tour.run_test('shop')", "openerp.website.Tour.Shop", login="admin")
# AssertionError: Error: Time overlaps to arrive to step 5: 'New product created'
print 'FIXME TODO ERROR FAILED test_01_admin_shop_tour has been deactivated due to systematic errors'
self.phantom_js("/", "openerp.website.Tour.run_test('shop')", "openerp.website.Tour.Shop", login="admin")
def test_02_admin_checkout(self):
# self.phantom_js("/", "openerp.website.Tour.run_test('shop_buy_product')", "openerp.website.Tour", login="admin")
# AssertionError: TypeError: 'undefined' is not an object (evaluating 'website.Tour.tours[id].run')
print 'FIXME TODO ERROR FAILED test_02_admin_checkout has been deactivated due to systematic errors'
self.phantom_js("/", "openerp.website.Tour.run_test('shop_buy_product')", "openerp.website.Tour", login="admin")
@unittest2.expectedFailure
def test_03_demo_checkout(self):
self.phantom_js("/", "openerp.website.Tour.run_test('shop_buy_product')", "openerp.website.Tour.ShopTest", login="demo", inject=inject)
@unittest2.expectedFailure
def test_04_public_checkout(self):
self.phantom_js("/", "openerp.website.Tour.run_test('shop_buy_product')", "openerp.website.Tour.ShopTest", inject=inject)