diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index 785d7cd6db0..6c71f940e8a 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -542,17 +542,18 @@ class account_analytic_account(osv.osv): '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: 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) 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']['amount_max'] = template.amount_max - if not ids: + if not invoice_on_timesheets: res['value']['invoice_on_timesheets'] = template.invoice_on_timesheets 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 if template.pricelist_id.id: res['value']['pricelist_id'] = template.pricelist_id.id - if not ids: + if not recurring_invoices: invoice_line_ids = [] for x in template.recurring_invoice_line_ids: invoice_line_ids.append((0, 0, { diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml index a6fe828926a..97fb15e9290 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml @@ -38,6 +38,9 @@ {'required': [('type','=','contract'),'|','|',('fix_price_invoices','=',True), ('invoice_on_timesheets', '=', True), ('recurring_invoices', '=', True)]} + + on_change_template(template_id, date_start, fix_price_invoices, invoice_on_timesheets, recurring_invoices) + diff --git a/addons/event/email_template.xml b/addons/event/email_template.xml index d4479bcfc87..d99774acd3c 100644 --- a/addons/event/email_template.xml +++ b/addons/event/email_template.xml @@ -9,7 +9,7 @@ Your registration at ${object.event_id.name} Hello ${object.name},

-

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)')}. +

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.

Thank you for your participation!

Best regards

]]>
diff --git a/addons/event/event.py b/addons/event/event.py index a31ec00b8c0..5e5d1204a17 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -18,8 +18,7 @@ # along with this program. If not, see . # ############################################################################## -import pytz -from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT + from datetime import datetime, timedelta from openerp.osv import fields, osv from openerp.tools.translate import _ @@ -157,22 +156,6 @@ class event_event(osv.osv): 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 = { '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)]}), @@ -192,11 +175,8 @@ class event_event(osv.osv): store={'event.registration': (_get_events_from_registrations, ['state'], 10), '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)]}), - 'date_tz': fields.selection(_tz_get, string='Timezone'), '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_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([ ('draft', 'Unconfirmed'), ('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), '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, - '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"), + 'address_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, context=c).company_id.partner_id.id } def _check_seats_limit(self, cr, uid, ids, context=None): diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index baa553babaf..cc6edfbd9bd 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -89,7 +89,6 @@ - diff --git a/addons/mass_mailing/__openerp__.py b/addons/mass_mailing/__openerp__.py index e0a8ab041fe..e96cc910920 100644 --- a/addons/mass_mailing/__openerp__.py +++ b/addons/mass_mailing/__openerp__.py @@ -48,8 +48,6 @@ professional emails and reuse templates in a few clicks. 'views/res_config.xml', 'views/res_partner.xml', 'views/email_template.xml', - 'views/website_mass_mailing.xml', - 'views/snippets.xml', 'security/ir.model.access.csv', 'views/mass_mailing.xml', ], diff --git a/addons/mass_mailing/data/mass_mailing_data.xml b/addons/mass_mailing/data/mass_mailing_data.xml index 7137bfcf29b..6bd1df79a72 100644 --- a/addons/mass_mailing/data/mass_mailing_data.xml +++ b/addons/mass_mailing/data/mass_mailing_data.xml @@ -33,10 +33,5 @@ 30 - - - Newsletter - - \ No newline at end of file diff --git a/addons/mass_mailing/data/mass_mailing_demo.xml b/addons/mass_mailing/data/mass_mailing_demo.xml index d5a84419f93..569feec9c88 100644 --- a/addons/mass_mailing/data/mass_mailing_demo.xml +++ b/addons/mass_mailing/data/mass_mailing_demo.xml @@ -9,7 +9,7 @@ - + Imported Contacts @@ -17,17 +17,17 @@ Aristide Antario aa@example.com - + Beverly Bridge bb@example.com - + Carol Cartridge cc@example.com - + diff --git a/addons/mass_mailing/static/src/img/blocks/button_newsletter.png b/addons/mass_mailing/static/src/img/blocks/button_newsletter.png deleted file mode 100644 index 46a63ef9b00..00000000000 Binary files a/addons/mass_mailing/static/src/img/blocks/button_newsletter.png and /dev/null differ diff --git a/addons/mass_mailing/static/src/js/website_mass_mailing.editor.js b/addons/mass_mailing/static/src/js/website_mass_mailing.editor.js deleted file mode 100644 index 4caba1d29b5..00000000000 --- a/addons/mass_mailing/static/src/js/website_mass_mailing.editor.js +++ /dev/null @@ -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"); - }, - }); -})(); - - diff --git a/addons/mass_mailing/static/src/js/website_mass_mailing.js b/addons/mass_mailing/static/src/js/website_mass_mailing.js deleted file mode 100644 index 5776fadfb3f..00000000000 --- a/addons/mass_mailing/static/src/js/website_mass_mailing.js +++ /dev/null @@ -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'); - }); - }, - }); -})(); diff --git a/addons/mass_mailing/views/snippets.xml b/addons/mass_mailing/views/snippets.xml deleted file mode 100644 index cefe2e7bdfd..00000000000 --- a/addons/mass_mailing/views/snippets.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - diff --git a/addons/mass_mailing/views/website_mass_mailing.xml b/addons/mass_mailing/views/website_mass_mailing.xml deleted file mode 100644 index bc55f61400c..00000000000 --- a/addons/mass_mailing/views/website_mass_mailing.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - diff --git a/addons/website/models/ir_ui_view.py b/addons/website/models/ir_ui_view.py index 3f868e0d208..9d89665c56f 100644 --- a/addons/website/models/ir_ui_view.py +++ b/addons/website/models/ir_ui_view.py @@ -6,7 +6,6 @@ import werkzeug from lxml import etree, html -from openerp import SUPERUSER_ID from openerp.addons.website.models import website from openerp.http import request from openerp.osv import osv, fields @@ -198,7 +197,3 @@ class view(osv.osv): self.write(cr, uid, res_id, { 'arch': self._pretty_arch(arch) }, context=context) - - view = self.browse(cr, SUPERUSER_ID, res_id, context=context) - if view.model_data_id: - view.model_data_id.write({'noupdate': True}) diff --git a/addons/website_forum/data/badges_moderation.xml b/addons/website_forum/data/badges_moderation.xml index 8e3c1b3dda7..41f3eb7fe41 100644 --- a/addons/website_forum/data/badges_moderation.xml +++ b/addons/website_forum/data/badges_moderation.xml @@ -99,7 +99,7 @@ True - user.partner_id.id + user.id Editor diff --git a/addons/website_mail/data/mail_groups.xml b/addons/website_mail/data/mail_groups.xml index b5d037ca866..0bc8d3e81d1 100644 --- a/addons/website_mail/data/mail_groups.xml +++ b/addons/website_mail/data/mail_groups.xml @@ -3,9 +3,9 @@ - Discussion Group + Newsletter public - Public Discussion Group + Public Newsletter. diff --git a/addons/website_mail/static/src/img/blocks/button_group_subscribe.png b/addons/website_mail/static/src/img/blocks/button_group_subscribe.png deleted file mode 100644 index 204239a8e0c..00000000000 Binary files a/addons/website_mail/static/src/img/blocks/button_group_subscribe.png and /dev/null differ diff --git a/addons/website_mail/static/src/js/website_mail.editor.js b/addons/website_mail/static/src/js/website_mail.editor.js index fdfb948121f..7a26920682b 100644 --- a/addons/website_mail/static/src/js/website_mail.editor.js +++ b/addons/website_mail/static/src/js/website_mail.editor.js @@ -10,7 +10,7 @@ return website.prompt({ id: "editor_new_subscribe_button", window_title: _t("Add a Subscribe Button"), - select: _t("Discussion List"), + select: _t("Mailing List"), init: function (field) { return website.session.model('mail.group') .call('name_search', ['', [['public','=','public']]], { context: website.get_context() }); diff --git a/addons/website_mail/views/snippets.xml b/addons/website_mail/views/snippets.xml index c9f76ce4273..98a79393211 100644 --- a/addons/website_mail/views/snippets.xml +++ b/addons/website_mail/views/snippets.xml @@ -499,8 +499,8 @@
- - Discussion Group + + Subscribe Button
Unsubscribe Subscribe - +
@@ -529,7 +529,7 @@ data-selector-siblings="p, h1, h2, h3, blockquote, .well, .panel" >
  • - Change Discussion List + Change mailing list
  • diff --git a/openerp/addons/base/ir/ir_model.py b/openerp/addons/base/ir/ir_model.py index 76166ee92e0..aca8ac466c8 100644 --- a/openerp/addons/base/ir/ir_model.py +++ b/openerp/addons/base/ir/ir_model.py @@ -384,7 +384,7 @@ class ir_model_fields(osv.osv): # static table of properties model_props = [ # (our-name, fields.prop, set_fn) - ('field_description', 'string', str), + ('field_description', 'string', tools.ustr), ('required', 'required', bool), ('readonly', 'readonly', bool), ('domain', '_domain', eval), diff --git a/openerp/addons/base/ir/ir_ui_view.py b/openerp/addons/base/ir/ir_ui_view.py index abe6b323c88..e898492a762 100644 --- a/openerp/addons/base/ir/ir_ui_view.py +++ b/openerp/addons/base/ir/ir_ui_view.py @@ -218,13 +218,6 @@ class view(osv.osv): self.read_template.clear_cache(self) 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 def copy(self, cr, uid, id, default=None, context=None): diff --git a/openerp/addons/base/res/res_partner_view.xml b/openerp/addons/base/res/res_partner_view.xml index b545ec7a458..50045aaf270 100644 --- a/openerp/addons/base/res/res_partner_view.xml +++ b/openerp/addons/base/res/res_partner_view.xml @@ -156,10 +156,12 @@