[MERGE] trunk

bzr revid: sle@openerp.com-20140424093103-pekfio3gv2s721ro
This commit is contained in:
Simon Lejeune 2014-04-24 11:31:03 +02:00
commit 0f869fd64b
9 changed files with 1287 additions and 65 deletions

View File

@ -33,7 +33,6 @@
<graph string="Leads Analysis" type="pivot" stacked="True">
<field name="date_deadline" type="row"/>
<field name="user_id" type="col"/>
<field name="stage_id" type="col"/>
<field name="planned_revenue" type="measure"/>
</graph>
</field>

1251
addons/hr_payroll/i18n/fa.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,6 @@
<graph string="Recruitment Analysis" type="pivot">
<field name="stage_id" type="row"/>
<field name="date_create" interval="week" type="col"/>
<field name="date_create" interval="day" type="col"/>
</graph>
</field>
</record>

View File

@ -109,8 +109,7 @@ class mail_notification(osv.Model):
Administrator
</p>
<div>
<small>Sent by <a ...>Your Company</a> using <a ...>OpenERP</a>.</small> OR
<small>Sent by Administrator using <a ...>OpenERP</a>.</small>
<small>Sent from <a ...>Your Company</a> using <a ...>OpenERP</a>.</small>
</div>
"""
footer = ""
@ -132,7 +131,7 @@ class mail_notification(osv.Model):
company = "<a style='color:inherit' href='%s'>%s</a>" % (website_url, user.company_id.name)
else:
company = user.company_id.name
sent_by = _('Sent by %(company)s using %(openerp)s.')
sent_by = _('Sent from %(company)s using %(openerp)s')
signature_company = '<small>%s</small>' % (sent_by % {
'company': company,
'openerp': "<a style='color:inherit' href='https://www.openerp.com/'>OpenERP</a>"

View File

@ -147,6 +147,8 @@ class mail_mail(osv.Model):
def _get_partner_access_link(self, cr, uid, mail, partner=None, context=None):
"""Generate URLs for links in mails: partner has access (is user):
link to action_mail_redirect action that will redirect to doc or Inbox """
if context is None:
context = {}
if partner and partner.user_ids:
base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')
# the parameters to encode for the query and fragment part of url
@ -161,7 +163,7 @@ class mail_mail(osv.Model):
fragment.update(model=mail.model, res_id=mail.res_id)
url = urljoin(base_url, "/web?%s#%s" % (urlencode(query), urlencode(fragment)))
return _("""<span class='oe_mail_footer_access'><small>Access your messages and documents <a style='color:inherit' href="%s">in OpenERP</a></small></span>""") % url
return _("""<span class='oe_mail_footer_access'><small>about <a style='color:inherit' href="%s">%s %s</a></small></span>""") % (url, context.get('model_name', ''), mail.record_name)
else:
return None
@ -233,10 +235,19 @@ class mail_mail(osv.Model):
email sending process has failed
:return: True
"""
if context is None:
context = {}
ir_mail_server = self.pool.get('ir.mail_server')
for mail in self.browse(cr, SUPERUSER_ID, ids, context=context):
try:
# TDE note: remove me when model_id field is present on mail.message - done here to avoid doing it multiple times in the sub method
if mail.model:
model_id = self.pool['ir.model'].search(cr, SUPERUSER_ID, [('model', '=', mail.model)], context=context)[0]
model = self.pool['ir.model'].browse(cr, SUPERUSER_ID, model_id, context=context)
else:
model = None
if model:
context['model_name'] = model.name
# handle attachments
attachments = []
for attach in mail.attachment_ids:

View File

@ -39,8 +39,8 @@ class mail_mail(osv.Model):
if partner and not partner.user_ids:
contex_signup = dict(context, signup_valid=True)
signup_url = partner_obj._get_signup_url_for_action(cr, SUPERUSER_ID, [partner.id],
model=mail.model, res_id=mail.res_id,
context=contex_signup)[partner.id]
return _("""<span class='oe_mail_footer_access'><small>Access your messages and documents through <a style='color:inherit' href="%s">our Customer Portal</a></small></span>""") % signup_url
model=mail.model, res_id=mail.res_id,
context=contex_signup)[partner.id]
return _(""", <span class='oe_mail_footer_access'><small>access %s %s through <a style='color:inherit' href="%s">our Customer Portal</a></small></span>""") % (context.get('model_name', ''), mail.record_name, signup_url)
else:
return super(mail_mail, self)._get_partner_access_link(cr, uid, mail, partner=partner, context=context)

View File

@ -130,6 +130,7 @@
*/
var dummy = function () {};
var website = openerp.website;
website.add_template_file('/website/static/src/xml/website.snippets.xml');
@ -161,7 +162,6 @@
return this._super.apply(this, arguments);
},
save: function () {
website.snippet.clean_for_save = true;
this.snippets.clean_for_save();
this._super();
},
@ -362,15 +362,21 @@
},
clean_for_save: function () {
var self = this;
$(website.snippet.globalSelector).each(function () {
var $snippet = $(this);
self.make_active($snippet);
self.make_active(false);
var editor = $snippet.data("snippet-editor");
if (editor) {
editor.clean_for_save();
$("*[contentEditable], *[attributeEditable]")
.removeAttr('contentEditable')
.removeAttr('attributeEditable');
var options = website.snippet.options;
var template = website.snippet.templateOptions;
for (var k in options) {
if (template[k] && options[k].prototype.clean_for_save !== dummy) {
var $snippet = this.dom_filter(template[k].selector);
$snippet.each(function () {
new options[k](self, null, $(this), k).clean_for_save();
});
}
});
}
},
make_active: function ($snippet) {
if ($snippet && this.$active_snipped_id && this.$active_snipped_id.get(0) === $snippet.get(0)) {
@ -854,8 +860,7 @@
}
},
clean_for_save: function () {
}
clean_for_save: dummy
});
website.snippet.options.background = website.snippet.Option.extend({
@ -943,8 +948,7 @@
this.id = this.unique_id();
this.$target.attr("id", this.id);
this.$target.find("[data-slide]").attr("data-cke-saved-href", "#" + this.id);
this.$target.find("[data-slide-to]").attr("data-target", "#" + this.id);
this.$target.find("[data-target]").attr("data-target", "#" + this.id);
this.rebind_event();
},
on_clone: function ($clone) {
@ -964,7 +968,7 @@
},
clean_for_save: function () {
this._super();
this.$target.find(".item").removeClass("next prev left right");
$(".carousel").find(".item").removeClass("next prev left right active");
if(!this.$target.find(".item.active").length) {
this.$target.find(".item:first").addClass("active");
}
@ -1519,9 +1523,6 @@
});
},
onFocus : function () {
// don't open media editor before clean for save
if (website.snippet.clean_for_save) return;
var self = this;
if (this.$target.parent().data("oe-field") === "image") {
this.$overlay.addClass("hidden");
@ -1761,19 +1762,6 @@
}
this.$overlay.removeClass('oe_active');
},
/* clean_for_save
* function called just before save vue
*/
clean_for_save: function () {
for (var i in this.styles){
this.styles[i].clean_for_save();
}
this.$target.removeAttr('contentEditable')
.find('*').removeAttr('contentEditable');
this.$target.removeAttr('attributeEditable')
.find('*').removeAttr('attributeEditable');
},
});
})();

View File

@ -21,22 +21,6 @@
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.osv import osv
class Website(osv.Model):
_inherit = "website"
def preprocess_request(self, cr, uid, ids, request, context=None):
project_obj = request.registry['project.project']
project_ids = project_obj.search(cr, uid, [('privacy_visibility', "=", "public")], context=request.context)
request.context.update({
'website_project_ids': project_obj.browse(cr, uid, project_ids, context=request.context)
})
return super(Website, self).preprocess_request(cr, uid, ids, request, context=None)
class website_project(http.Controller):

View File

@ -2,15 +2,6 @@
<openerp>
<data>
<!-- Layout add nav and footer -->
<template id="footer_custom" inherit_id="website.layout" name="Footer Project's Links">
<xpath expr="//footer//ul[@name='products']" position="inside">
<li t-foreach="website_project_ids" t-as="project">
<a t-attf-href="/project/#{ project.id }"><span t-field="project.name"/></a>
</li>
</xpath>
</template>
<!-- Project -->
<template id="task_kanban_card" name="TaskKanban">
<div class="thumbnail">