Merge branch 'server-trunk'
Conflicts: addons/mass_mailing/controllers/main.py
This commit is contained in:
commit
f4d78ae738
|
@ -542,17 +542,18 @@ class account_analytic_account(osv.osv):
|
||||||
'nodestroy': True,
|
'nodestroy': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
def on_change_template(self, cr, uid, ids, template_id, date_start=False, context=None):
|
def on_change_template(self, cr, uid, ids, template_id, date_start=False, fix_price_invoices=False, invoice_on_timesheets=False, recurring_invoices=False, context=None):
|
||||||
if not template_id:
|
if not template_id:
|
||||||
return {}
|
return {}
|
||||||
|
obj_analytic_line = self.pool.get('account.analytic.invoice.line')
|
||||||
res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, date_start=date_start, context=context)
|
res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, date_start=date_start, context=context)
|
||||||
|
|
||||||
template = self.browse(cr, uid, template_id, context=context)
|
template = self.browse(cr, uid, template_id, context=context)
|
||||||
|
|
||||||
if not ids:
|
if not fix_price_invoices:
|
||||||
res['value']['fix_price_invoices'] = template.fix_price_invoices
|
res['value']['fix_price_invoices'] = template.fix_price_invoices
|
||||||
res['value']['amount_max'] = template.amount_max
|
res['value']['amount_max'] = template.amount_max
|
||||||
if not ids:
|
if not invoice_on_timesheets:
|
||||||
res['value']['invoice_on_timesheets'] = template.invoice_on_timesheets
|
res['value']['invoice_on_timesheets'] = template.invoice_on_timesheets
|
||||||
res['value']['hours_qtt_est'] = template.hours_qtt_est
|
res['value']['hours_qtt_est'] = template.hours_qtt_est
|
||||||
|
|
||||||
|
@ -560,7 +561,7 @@ class account_analytic_account(osv.osv):
|
||||||
res['value']['to_invoice'] = template.to_invoice.id
|
res['value']['to_invoice'] = template.to_invoice.id
|
||||||
if template.pricelist_id.id:
|
if template.pricelist_id.id:
|
||||||
res['value']['pricelist_id'] = template.pricelist_id.id
|
res['value']['pricelist_id'] = template.pricelist_id.id
|
||||||
if not ids:
|
if not recurring_invoices:
|
||||||
invoice_line_ids = []
|
invoice_line_ids = []
|
||||||
for x in template.recurring_invoice_line_ids:
|
for x in template.recurring_invoice_line_ids:
|
||||||
invoice_line_ids.append((0, 0, {
|
invoice_line_ids.append((0, 0, {
|
||||||
|
|
|
@ -38,6 +38,9 @@
|
||||||
<field name="partner_id" position="attributes">
|
<field name="partner_id" position="attributes">
|
||||||
<attribute name="attrs">{'required': [('type','=','contract'),'|','|',('fix_price_invoices','=',True), ('invoice_on_timesheets', '=', True), ('recurring_invoices', '=', True)]}</attribute>
|
<attribute name="attrs">{'required': [('type','=','contract'),'|','|',('fix_price_invoices','=',True), ('invoice_on_timesheets', '=', True), ('recurring_invoices', '=', True)]}</attribute>
|
||||||
</field>
|
</field>
|
||||||
|
<field name="template_id" position="attributes">
|
||||||
|
<attribute name="on_change">on_change_template(template_id, date_start, fix_price_invoices, invoice_on_timesheets, recurring_invoices)</attribute>
|
||||||
|
</field>
|
||||||
<xpath expr='//group[@name="invoice_on_timesheets"]' position="replace">
|
<xpath expr='//group[@name="invoice_on_timesheets"]' position="replace">
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr='//separator[@name="description"]' position='before'>
|
<xpath expr='//separator[@name="description"]' position='before'>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<field name="subject">Your registration at ${object.event_id.name}</field>
|
<field name="subject">Your registration at ${object.event_id.name}</field>
|
||||||
<field name="body_html"><![CDATA[
|
<field name="body_html"><![CDATA[
|
||||||
<p>Hello ${object.name},</p>
|
<p>Hello ${object.name},</p>
|
||||||
<p>The event ${object.event_id.name} that you registered for is confirmed and will be held from ${object.event_id.date_begin_located.strftime('%Y-%m-%d %H:%M:%S (%Z)')} to ${object.event_id.date_end_located.strftime('%Y-%m-%d %H:%M:%S (%Z)')}.
|
<p>The event ${object.event_id.name} that you registered for is confirmed and will be held from ${object.event_id.date_begin} to ${object.event_id.date_end}.
|
||||||
For any further information please contact our event department.</p>
|
For any further information please contact our event department.</p>
|
||||||
<p>Thank you for your participation!</p>
|
<p>Thank you for your participation!</p>
|
||||||
<p>Best regards</p>]]></field>
|
<p>Best regards</p>]]></field>
|
||||||
|
|
|
@ -18,8 +18,7 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
import pytz
|
|
||||||
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
|
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from openerp.osv import fields, osv
|
from openerp.osv import fields, osv
|
||||||
from openerp.tools.translate import _
|
from openerp.tools.translate import _
|
||||||
|
@ -157,22 +156,6 @@ class event_event(osv.osv):
|
||||||
for event in self.browse(cr, uid, ids, context=context)
|
for event in self.browse(cr, uid, ids, context=context)
|
||||||
}
|
}
|
||||||
|
|
||||||
def _compute_date_tz(self, cr, uid, ids, fld, arg, context=None):
|
|
||||||
if context is None:
|
|
||||||
context = {}
|
|
||||||
res = {}
|
|
||||||
for event in self.browse(cr, uid, ids, context=context):
|
|
||||||
ctx = dict(context, tz=(event.date_tz or 'UTC'))
|
|
||||||
if fld == 'date_begin_located':
|
|
||||||
date_to_convert = event.date_begin
|
|
||||||
elif fld == 'date_end_located':
|
|
||||||
date_to_convert = event.date_end
|
|
||||||
res[event.id] = fields.datetime.context_timestamp(cr, uid, datetime.strptime(date_to_convert, DEFAULT_SERVER_DATETIME_FORMAT), context=ctx)
|
|
||||||
return res
|
|
||||||
|
|
||||||
def _tz_get(self, cr, uid, context=None):
|
|
||||||
return [(x, x) for x in pytz.all_timezones]
|
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.char('Event Name', size=64, required=True, translate=True, readonly=False, states={'done': [('readonly', True)]}),
|
'name': fields.char('Event Name', size=64, required=True, translate=True, readonly=False, states={'done': [('readonly', True)]}),
|
||||||
'user_id': fields.many2one('res.users', 'Responsible User', readonly=False, states={'done': [('readonly', True)]}),
|
'user_id': fields.many2one('res.users', 'Responsible User', readonly=False, states={'done': [('readonly', True)]}),
|
||||||
|
@ -192,11 +175,8 @@ class event_event(osv.osv):
|
||||||
store={'event.registration': (_get_events_from_registrations, ['state'], 10),
|
store={'event.registration': (_get_events_from_registrations, ['state'], 10),
|
||||||
'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max', 'registration_ids'], 20)}),
|
'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max', 'registration_ids'], 20)}),
|
||||||
'registration_ids': fields.one2many('event.registration', 'event_id', 'Registrations', readonly=False, states={'done': [('readonly', True)]}),
|
'registration_ids': fields.one2many('event.registration', 'event_id', 'Registrations', readonly=False, states={'done': [('readonly', True)]}),
|
||||||
'date_tz': fields.selection(_tz_get, string='Timezone'),
|
|
||||||
'date_begin': fields.datetime('Start Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
|
'date_begin': fields.datetime('Start Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
|
||||||
'date_end': fields.datetime('End Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
|
'date_end': fields.datetime('End Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
|
||||||
'date_begin_located': fields.function(_compute_date_tz, string='Start Date Located', type="datetime"),
|
|
||||||
'date_end_located': fields.function(_compute_date_tz, string='End Date Located', type="datetime"),
|
|
||||||
'state': fields.selection([
|
'state': fields.selection([
|
||||||
('draft', 'Unconfirmed'),
|
('draft', 'Unconfirmed'),
|
||||||
('cancel', 'Cancelled'),
|
('cancel', 'Cancelled'),
|
||||||
|
@ -224,8 +204,7 @@ class event_event(osv.osv):
|
||||||
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'event.event', context=c),
|
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'event.event', context=c),
|
||||||
'user_id': lambda obj, cr, uid, context: uid,
|
'user_id': lambda obj, cr, uid, context: uid,
|
||||||
'organizer_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, context=c).company_id.partner_id.id,
|
'organizer_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, context=c).company_id.partner_id.id,
|
||||||
'address_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, context=c).company_id.partner_id.id,
|
'address_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, context=c).company_id.partner_id.id
|
||||||
'date_tz': lambda self, cr, uid, ctx: ctx.get('tz', "UTC"),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def _check_seats_limit(self, cr, uid, ids, context=None):
|
def _check_seats_limit(self, cr, uid, ids, context=None):
|
||||||
|
|
|
@ -89,7 +89,6 @@
|
||||||
<field name="type" on_change="onchange_event_type(type,context)" />
|
<field name="type" on_change="onchange_event_type(type,context)" />
|
||||||
<field name="date_begin" on_change="onchange_start_date(date_begin,date_end)"/>
|
<field name="date_begin" on_change="onchange_start_date(date_begin,date_end)"/>
|
||||||
<field name="date_end"/>
|
<field name="date_end"/>
|
||||||
<field name="date_tz" />
|
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<notebook>
|
<notebook>
|
||||||
|
|
|
@ -48,8 +48,6 @@ professional emails and reuse templates in a few clicks.
|
||||||
'views/res_config.xml',
|
'views/res_config.xml',
|
||||||
'views/res_partner.xml',
|
'views/res_partner.xml',
|
||||||
'views/email_template.xml',
|
'views/email_template.xml',
|
||||||
'views/website_mass_mailing.xml',
|
|
||||||
'views/snippets.xml',
|
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'views/mass_mailing.xml',
|
'views/mass_mailing.xml',
|
||||||
],
|
],
|
||||||
|
|
|
@ -33,10 +33,5 @@
|
||||||
<field name="sequence">30</field>
|
<field name="sequence">30</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- Create mailing lists -->
|
|
||||||
<record id="mass_mail_list_1" model="mail.mass_mailing.list">
|
|
||||||
<field name="name">Newsletter</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
|
@ -9,7 +9,7 @@
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- Create mailing lists -->
|
<!-- Create mailing lists -->
|
||||||
<record id="mass_mail_list_2" model="mail.mass_mailing.list">
|
<record id="mass_mail_list_1" model="mail.mass_mailing.list">
|
||||||
<field name="name">Imported Contacts</field>
|
<field name="name">Imported Contacts</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@ -17,17 +17,17 @@
|
||||||
<record id="mass_mail_contact_1" model="mail.mass_mailing.contact">
|
<record id="mass_mail_contact_1" model="mail.mass_mailing.contact">
|
||||||
<field name="name">Aristide Antario</field>
|
<field name="name">Aristide Antario</field>
|
||||||
<field name="email">aa@example.com</field>
|
<field name="email">aa@example.com</field>
|
||||||
<field name="list_id" ref="mass_mailing.mass_mail_list_2"/>
|
<field name="list_id" ref="mass_mailing.mass_mail_list_1"/>
|
||||||
</record>
|
</record>
|
||||||
<record id="mass_mail_contact_2" model="mail.mass_mailing.contact">
|
<record id="mass_mail_contact_2" model="mail.mass_mailing.contact">
|
||||||
<field name="name">Beverly Bridge</field>
|
<field name="name">Beverly Bridge</field>
|
||||||
<field name="email">bb@example.com</field>
|
<field name="email">bb@example.com</field>
|
||||||
<field name="list_id" ref="mass_mailing.mass_mail_list_2"/>
|
<field name="list_id" ref="mass_mailing.mass_mail_list_1"/>
|
||||||
</record>
|
</record>
|
||||||
<record id="mass_mail_contact_3" model="mail.mass_mailing.contact">
|
<record id="mass_mail_contact_3" model="mail.mass_mailing.contact">
|
||||||
<field name="name">Carol Cartridge</field>
|
<field name="name">Carol Cartridge</field>
|
||||||
<field name="email">cc@example.com</field>
|
<field name="email">cc@example.com</field>
|
||||||
<field name="list_id" ref="mass_mailing.mass_mail_list_2"/>
|
<field name="list_id" ref="mass_mailing.mass_mail_list_1"/>
|
||||||
<field name="opt_out" eval="True"/>
|
<field name="opt_out" eval="True"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.1 KiB |
|
@ -1,40 +0,0 @@
|
||||||
(function () {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var website = openerp.website;
|
|
||||||
var _t = openerp._t;
|
|
||||||
|
|
||||||
website.snippet.options.mailing_list_subscribe = website.snippet.Option.extend({
|
|
||||||
on_prompt: function () {
|
|
||||||
var self = this;
|
|
||||||
return website.prompt({
|
|
||||||
id: "editor_new_mailing_list_subscribe_button",
|
|
||||||
window_title: _t("Add a Newsletter Subscribe Button"),
|
|
||||||
select: _t("Newsletter"),
|
|
||||||
init: function (field) {
|
|
||||||
return website.session.model('mail.mass_mailing.list')
|
|
||||||
.call('name_search', ['', []], { context: website.get_context() });
|
|
||||||
},
|
|
||||||
}).then(function (mailing_list_id) {
|
|
||||||
self.$target.attr("data-list-id", mailing_list_id);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
drop_and_build_snippet: function() {
|
|
||||||
var self = this;
|
|
||||||
this._super();
|
|
||||||
this.on_prompt().fail(function () {
|
|
||||||
self.editor.on_remove();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
start : function () {
|
|
||||||
var self = this;
|
|
||||||
this.$el.find(".js_mailing_list").on("click", _.bind(this.on_prompt, this));
|
|
||||||
this._super();
|
|
||||||
},
|
|
||||||
clean_for_save: function () {
|
|
||||||
this.$target.addClass("hidden");
|
|
||||||
},
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
|
|
||||||
|
|
|
@ -1,57 +0,0 @@
|
||||||
(function () {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var website = openerp.website;
|
|
||||||
|
|
||||||
website.snippet.animationRegistry.subscribe = website.snippet.Animation.extend({
|
|
||||||
selector: ".js_subscribe",
|
|
||||||
start: function (editable_mode) {
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
// set value and display button
|
|
||||||
self.$target.find("input").removeClass("hidden");
|
|
||||||
openerp.jsonRpc('/website_mass_mailing/is_subscriber', 'call', {
|
|
||||||
list_id: this.$target.data('list-id'),
|
|
||||||
}).always(function (data) {
|
|
||||||
self.$target.find('input.js_subscribe_email')
|
|
||||||
.val(data.email ? data.email : "")
|
|
||||||
.attr("disabled", data.is_subscriber && data.email.length ? "disabled" : false);
|
|
||||||
self.$target.attr("data-subscribe", data.is_subscriber ? 'on' : 'off');
|
|
||||||
self.$target.find('a.js_subscribe_btn')
|
|
||||||
.val(data.email ? data.email : "")
|
|
||||||
.attr("disabled", data.is_subscriber && data.email.length ? "disabled" : false);
|
|
||||||
self.$target.removeClass("hidden");
|
|
||||||
});
|
|
||||||
|
|
||||||
// not if editable mode to allow designer to edit alert field
|
|
||||||
if (!editable_mode) {
|
|
||||||
$('.js_subscribe > .alert').addClass("hidden");
|
|
||||||
$('.js_subscribe > .input-group-btn.hidden').removeClass("hidden");
|
|
||||||
this.$target.find('.js_subscribe_btn').on('click', function (event) {
|
|
||||||
event.preventDefault();
|
|
||||||
self.on_click();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
on_click: function () {
|
|
||||||
var self = this;
|
|
||||||
var $email = this.$target.find(".js_subscribe_email:visible");
|
|
||||||
|
|
||||||
if ($email.length && !$email.val().match(/.+@.+/)) {
|
|
||||||
this.$target.addClass('has-error');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
this.$target.removeClass('has-error');
|
|
||||||
|
|
||||||
openerp.jsonRpc('/website_mass_mailing/subscribe', 'call', {
|
|
||||||
'list_id': this.$target.data('list-id'),
|
|
||||||
'email': $email.length ? $email.val() : false,
|
|
||||||
}).then(function (subscribe) {
|
|
||||||
self.$target.find(".js_subscribe_email, .input-group-btn").addClass("hidden");
|
|
||||||
self.$target.find(".alert").removeClass("hidden");
|
|
||||||
self.$target.find('input.js_subscribe_email').attr("disabled", subscribe ? "disabled" : false);
|
|
||||||
self.$target.attr("data-subscribe", subscribe ? 'on' : 'off');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
})();
|
|
|
@ -1,44 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<openerp>
|
|
||||||
<data>
|
|
||||||
|
|
||||||
<template id="mailing_list_subscribe" inherit_id="website.snippets" name="Subscribe to Newsletter">
|
|
||||||
|
|
||||||
<xpath expr="//div[@id='snippet_content']" position="inside">
|
|
||||||
<div>
|
|
||||||
<div class="oe_snippet_thumbnail">
|
|
||||||
<img class="oe_snippet_thumbnail_img" src="/mass_mailing/static/src/img/blocks/button_newsletter.png"/>
|
|
||||||
<span class="oe_snippet_thumbnail_title">Newsletter</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="oe_snippet_body input-group js_subscribe"
|
|
||||||
data-list-id="0">
|
|
||||||
<input
|
|
||||||
type="email"
|
|
||||||
name="email"
|
|
||||||
class="js_subscribe_email form-control"
|
|
||||||
placeholder="your email..."/>
|
|
||||||
<span class="input-group-btn">
|
|
||||||
<a href="#" class="btn btn-primary js_subscribe_btn">Subscribe</a>
|
|
||||||
</span>
|
|
||||||
<div class="alert alert-success hidden">Thanks for your subscription!</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</xpath>
|
|
||||||
|
|
||||||
<xpath expr="//div[@id='snippet_options']" position="inside">
|
|
||||||
<div data-snippet-option-id='mailing_list_subscribe'
|
|
||||||
data-selector=".js_subscribe"
|
|
||||||
data-selector-siblings="p, h1, h2, h3, blockquote, .well, .panel"
|
|
||||||
>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="button js_mailing_list">Change Newsletter</a>
|
|
||||||
</li>
|
|
||||||
</div>
|
|
||||||
</xpath>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</data>
|
|
||||||
</openerp>
|
|
|
@ -1,14 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<openerp>
|
|
||||||
<data>
|
|
||||||
|
|
||||||
<template id="head" inherit_id="website.layout" name="Mail customization">
|
|
||||||
<xpath expr="//head" position="inside">
|
|
||||||
<script type="text/javascript" src="/mass_mailing/static/src/js/website_mass_mailing.editor.js" groups="base.group_website_publisher"></script>
|
|
||||||
<script type="text/javascript" src="/mass_mailing/static/src/js/website_mass_mailing.js"></script>
|
|
||||||
<link rel='stylesheet' href='/website_mail/static/src/css/website_mail.css'/>
|
|
||||||
</xpath>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</data>
|
|
||||||
</openerp>
|
|
|
@ -6,7 +6,6 @@ import werkzeug
|
||||||
|
|
||||||
from lxml import etree, html
|
from lxml import etree, html
|
||||||
|
|
||||||
from openerp import SUPERUSER_ID
|
|
||||||
from openerp.addons.website.models import website
|
from openerp.addons.website.models import website
|
||||||
from openerp.http import request
|
from openerp.http import request
|
||||||
from openerp.osv import osv, fields
|
from openerp.osv import osv, fields
|
||||||
|
@ -198,7 +197,3 @@ class view(osv.osv):
|
||||||
self.write(cr, uid, res_id, {
|
self.write(cr, uid, res_id, {
|
||||||
'arch': self._pretty_arch(arch)
|
'arch': self._pretty_arch(arch)
|
||||||
}, context=context)
|
}, context=context)
|
||||||
|
|
||||||
view = self.browse(cr, SUPERUSER_ID, res_id, context=context)
|
|
||||||
if view.model_data_id:
|
|
||||||
view.model_data_id.write({'noupdate': True})
|
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
<field name="domain" eval="[('model', '=', 'forum.post'), ('subtype_id', 'in', [ref('website_forum.mt_answer_edit'), ref('website_forum.mt_question_edit')])]"/>
|
<field name="domain" eval="[('model', '=', 'forum.post'), ('subtype_id', 'in', [ref('website_forum.mt_answer_edit'), ref('website_forum.mt_question_edit')])]"/>
|
||||||
<field name="batch_mode">True</field>
|
<field name="batch_mode">True</field>
|
||||||
<field name="batch_distinctive_field" eval="ref('mail.field_mail_message_author_id')" />
|
<field name="batch_distinctive_field" eval="ref('mail.field_mail_message_author_id')" />
|
||||||
<field name="batch_user_expression">user.partner_id.id</field>
|
<field name="batch_user_expression">user.id</field>
|
||||||
</record>
|
</record>
|
||||||
<record model="gamification.challenge" id="challenge_editor">
|
<record model="gamification.challenge" id="challenge_editor">
|
||||||
<field name="name">Editor</field>
|
<field name="name">Editor</field>
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
<data noupdate="1">
|
<data noupdate="1">
|
||||||
|
|
||||||
<record model="mail.group" id="group_all_employees">
|
<record model="mail.group" id="group_all_employees">
|
||||||
<field name="name">Discussion Group</field>
|
<field name="name">Newsletter</field>
|
||||||
<field name="public">public</field>
|
<field name="public">public</field>
|
||||||
<field name="description">Public Discussion Group</field>
|
<field name="description">Public Newsletter.</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.7 KiB |
|
@ -10,7 +10,7 @@
|
||||||
return website.prompt({
|
return website.prompt({
|
||||||
id: "editor_new_subscribe_button",
|
id: "editor_new_subscribe_button",
|
||||||
window_title: _t("Add a Subscribe Button"),
|
window_title: _t("Add a Subscribe Button"),
|
||||||
select: _t("Discussion List"),
|
select: _t("Mailing List"),
|
||||||
init: function (field) {
|
init: function (field) {
|
||||||
return website.session.model('mail.group')
|
return website.session.model('mail.group')
|
||||||
.call('name_search', ['', [['public','=','public']]], { context: website.get_context() });
|
.call('name_search', ['', [['public','=','public']]], { context: website.get_context() });
|
||||||
|
|
|
@ -499,8 +499,8 @@
|
||||||
<xpath expr="//div[@id='snippet_content']" position="inside">
|
<xpath expr="//div[@id='snippet_content']" position="inside">
|
||||||
<div>
|
<div>
|
||||||
<div class="oe_snippet_thumbnail">
|
<div class="oe_snippet_thumbnail">
|
||||||
<img class="oe_snippet_thumbnail_img" src="/website_mail/static/src/img/blocks/button_group_subscribe.png"/>
|
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_button.png"/>
|
||||||
<span class="oe_snippet_thumbnail_title">Discussion Group</span>
|
<span class="oe_snippet_thumbnail_title">Subscribe Button</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="oe_snippet_body input-group js_follow"
|
<div class="oe_snippet_body input-group js_follow"
|
||||||
|
@ -516,7 +516,7 @@
|
||||||
<a href="#" class="btn btn-default js_unfollow_btn">Unsubscribe</a>
|
<a href="#" class="btn btn-default js_unfollow_btn">Unsubscribe</a>
|
||||||
<a href="#" class="btn btn-primary js_follow_btn">Subscribe</a>
|
<a href="#" class="btn btn-primary js_follow_btn">Subscribe</a>
|
||||||
</span>
|
</span>
|
||||||
<div class="alert alert-success hidden">Thanks for your subscription!</div>
|
<div class="alert alert-success hidden">thanks for your subscription!</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -529,7 +529,7 @@
|
||||||
data-selector-siblings="p, h1, h2, h3, blockquote, .well, .panel"
|
data-selector-siblings="p, h1, h2, h3, blockquote, .well, .panel"
|
||||||
>
|
>
|
||||||
<li>
|
<li>
|
||||||
<a href="#" class="button js_mailing_list">Change Discussion List</a>
|
<a href="#" class="button js_mailing_list">Change mailing list</a>
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
|
@ -384,7 +384,7 @@ class ir_model_fields(osv.osv):
|
||||||
|
|
||||||
# static table of properties
|
# static table of properties
|
||||||
model_props = [ # (our-name, fields.prop, set_fn)
|
model_props = [ # (our-name, fields.prop, set_fn)
|
||||||
('field_description', 'string', str),
|
('field_description', 'string', tools.ustr),
|
||||||
('required', 'required', bool),
|
('required', 'required', bool),
|
||||||
('readonly', 'readonly', bool),
|
('readonly', 'readonly', bool),
|
||||||
('domain', '_domain', eval),
|
('domain', '_domain', eval),
|
||||||
|
|
|
@ -218,13 +218,6 @@ class view(osv.osv):
|
||||||
|
|
||||||
self.read_template.clear_cache(self)
|
self.read_template.clear_cache(self)
|
||||||
ret = super(view, self).write(cr, uid, ids, vals, context)
|
ret = super(view, self).write(cr, uid, ids, vals, context)
|
||||||
|
|
||||||
# if arch is modified views become noupdatable
|
|
||||||
if 'arch' in vals and not context.get('install_mode', False):
|
|
||||||
# TODO: should be doable in a read and a write
|
|
||||||
for view_ in self.browse(cr, uid, ids, context=context):
|
|
||||||
if view_.model_data_id:
|
|
||||||
self.pool.get('ir.model.data').write(cr, openerp.SUPERUSER_ID, view_.model_data_id.id, {'noupdate': True})
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def copy(self, cr, uid, id, default=None, context=None):
|
def copy(self, cr, uid, id, default=None, context=None):
|
||||||
|
|
|
@ -156,10 +156,12 @@
|
||||||
|
|
||||||
<label for="street" string="Address"/>
|
<label for="street" string="Address"/>
|
||||||
<div>
|
<div>
|
||||||
<field name="use_parent_address" class="oe_edit_only oe_inline"
|
<div class="oe_edit_only">
|
||||||
on_change="onchange_address(use_parent_address, parent_id)"
|
<field name="use_parent_address" class="oe_inline"
|
||||||
attrs="{'invisible': ['|', ('is_company', '=', True),('parent_id', '=', False)]}"/>
|
on_change="onchange_address(use_parent_address, parent_id)"
|
||||||
<label for="use_parent_address" class="oe_edit_only" attrs="{'invisible': ['|', ('is_company', '=', True), ('parent_id', '=', False)]}"/>
|
attrs="{'invisible': [('parent_id','=', False),('use_parent_address','=',False)]}"/>
|
||||||
|
<label for="use_parent_address" attrs="{'invisible': [('parent_id','=', False),('use_parent_address','=',False)]}"/>
|
||||||
|
</div>
|
||||||
<button name="open_parent" type="object" string="(edit company address)" class="oe_link oe_edit_only"
|
<button name="open_parent" type="object" string="(edit company address)" class="oe_link oe_edit_only"
|
||||||
attrs="{'invisible': ['|',('parent_id','=', False),('use_parent_address','=',False)]}"/>
|
attrs="{'invisible': ['|',('parent_id','=', False),('use_parent_address','=',False)]}"/>
|
||||||
<field name="street" placeholder="Street..." attrs="{'readonly': [('use_parent_address','=',True)]}"/>
|
<field name="street" placeholder="Street..." attrs="{'readonly': [('use_parent_address','=',True)]}"/>
|
||||||
|
|
|
@ -99,7 +99,7 @@ class res_groups(osv.osv):
|
||||||
}
|
}
|
||||||
|
|
||||||
_sql_constraints = [
|
_sql_constraints = [
|
||||||
('name_uniq', 'unique (category_id, name)', 'The name of the group must be unique !')
|
('name_uniq', 'unique (category_id, name)', 'The name of the group must be unique within an application!')
|
||||||
]
|
]
|
||||||
|
|
||||||
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
|
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
<!-- Set accesses to menu -->
|
<!-- Set accesses to menu -->
|
||||||
<record model="ir.ui.menu" id="base.menu_administration">
|
<record model="ir.ui.menu" id="base.menu_administration">
|
||||||
<field name="name">Administration</field>
|
<field name="name">Settings</field>
|
||||||
<field name="groups_id" eval="[(6,0, [ref('group_system'), ref('group_erp_manager')])]"/>
|
<field name="groups_id" eval="[(6,0, [ref('group_system'), ref('group_erp_manager')])]"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
|
@ -177,7 +177,7 @@ def load_information_from_description_file(module, mod_path=None):
|
||||||
|
|
||||||
if not mod_path:
|
if not mod_path:
|
||||||
mod_path = get_module_path(module)
|
mod_path = get_module_path(module)
|
||||||
terp_file = opj(mod_path, '__openerp__.py')
|
terp_file = mod_path and opj(mod_path, '__openerp__.py') or False
|
||||||
if terp_file:
|
if terp_file:
|
||||||
info = {}
|
info = {}
|
||||||
if os.path.isfile(terp_file):
|
if os.path.isfile(terp_file):
|
||||||
|
|
|
@ -305,12 +305,17 @@ form: module.record_id""" % (xml_id,)
|
||||||
|
|
||||||
if d_search:
|
if d_search:
|
||||||
idref = _get_idref(self, cr, self.uid, d_model, context={}, idref={})
|
idref = _get_idref(self, cr, self.uid, d_model, context={}, idref={})
|
||||||
ids = self.pool[d_model].search(cr, self.uid, unsafe_eval(d_search, idref))
|
try:
|
||||||
|
ids = self.pool[d_model].search(cr, self.uid, unsafe_eval(d_search, idref))
|
||||||
|
except ValueError:
|
||||||
|
_logger.warning('Skipping deletion for failed search `%r`', d_search, exc_info=True)
|
||||||
|
pass
|
||||||
if d_id:
|
if d_id:
|
||||||
try:
|
try:
|
||||||
ids.append(self.id_get(cr, d_id))
|
ids.append(self.id_get(cr, d_id))
|
||||||
except:
|
except ValueError:
|
||||||
# d_id cannot be found. doesn't matter in this case
|
# d_id cannot be found. doesn't matter in this case
|
||||||
|
_logger.warning('Skipping deletion for missing XML ID `%r`', d_id, exc_info=True)
|
||||||
pass
|
pass
|
||||||
if ids:
|
if ids:
|
||||||
self.pool[d_model].unlink(cr, self.uid, ids)
|
self.pool[d_model].unlink(cr, self.uid, ids)
|
||||||
|
|
|
@ -71,7 +71,8 @@ _SAFE_OPCODES = _EXPR_OPCODES.union(set(opmap[x] for x in [
|
||||||
'CONTINUE_LOOP', 'RAISE_VARARGS',
|
'CONTINUE_LOOP', 'RAISE_VARARGS',
|
||||||
# New in Python 2.7 - http://bugs.python.org/issue4715 :
|
# New in Python 2.7 - http://bugs.python.org/issue4715 :
|
||||||
'JUMP_IF_FALSE_OR_POP', 'JUMP_IF_TRUE_OR_POP', 'POP_JUMP_IF_FALSE',
|
'JUMP_IF_FALSE_OR_POP', 'JUMP_IF_TRUE_OR_POP', 'POP_JUMP_IF_FALSE',
|
||||||
'POP_JUMP_IF_TRUE', 'SETUP_EXCEPT', 'END_FINALLY', 'LOAD_FAST',
|
'POP_JUMP_IF_TRUE', 'SETUP_EXCEPT', 'END_FINALLY',
|
||||||
|
'LOAD_FAST', 'STORE_FAST', 'DELETE_FAST',
|
||||||
'LOAD_GLOBAL', # Only allows access to restricted globals
|
'LOAD_GLOBAL', # Only allows access to restricted globals
|
||||||
] if x in opmap))
|
] if x in opmap))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue