diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 783dae570ac..bd51c9b30d8 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -39,7 +39,7 @@ class AccountInvoice(models.Model): _order = "date_invoice desc, number desc, id desc" @api.one - @api.depends('invoice_line_ids.price_subtotal', 'tax_line_ids.amount', 'currency_id', 'company_id') + @api.depends('invoice_line_ids.price_subtotal', 'tax_line_ids.amount', 'currency_id', 'company_id', 'date_invoice') def _compute_amount(self): self.amount_untaxed = sum(line.price_subtotal for line in self.invoice_line_ids) self.amount_tax = sum(line.amount for line in self.tax_line_ids) @@ -47,8 +47,9 @@ class AccountInvoice(models.Model): amount_total_company_signed = self.amount_total amount_untaxed_signed = self.amount_untaxed if self.currency_id and self.currency_id != self.company_id.currency_id: - amount_total_company_signed = self.currency_id.compute(self.amount_total, self.company_id.currency_id) - amount_untaxed_signed = self.currency_id.compute(self.amount_untaxed, self.company_id.currency_id) + currency_id = self.currency_id.with_context(date=self.date_invoice) + amount_total_company_signed = currency_id.compute(self.amount_total, self.company_id.currency_id) + amount_untaxed_signed = currency_id.compute(self.amount_untaxed, self.company_id.currency_id) sign = self.type in ['in_refund', 'out_refund'] and -1 or 1 self.amount_total_company_signed = amount_total_company_signed * sign self.amount_total_signed = self.amount_total * sign diff --git a/addons/account/views/report_agedpartnerbalance.xml b/addons/account/views/report_agedpartnerbalance.xml index 8681931febb..8fa10c8df90 100644 --- a/addons/account/views/report_agedpartnerbalance.xml +++ b/addons/account/views/report_agedpartnerbalance.xml @@ -4,7 +4,7 @@
-

Aged Trial Balance

+

Aged Partner Balance

diff --git a/addons/account_asset/account_asset_invoice.py b/addons/account_asset/account_asset_invoice.py index ba2cb3892fc..bb4e2f90d92 100644 --- a/addons/account_asset/account_asset_invoice.py +++ b/addons/account_asset/account_asset_invoice.py @@ -28,8 +28,8 @@ class AccountInvoiceLine(models.Model): _inherit = 'account.invoice.line' asset_category_id = fields.Many2one('account.asset.category', string='Asset Category') - asset_start_date = fields.Date(string='Asset End Date', compute='_get_asset_date', readonly=True, store=True) - asset_end_date = fields.Date(string='Asset Start Date', compute='_get_asset_date', readonly=True, store=True) + asset_start_date = fields.Date(string='Asset Start Date', compute='_get_asset_date', readonly=True, store=True) + asset_end_date = fields.Date(string='Asset End Date', compute='_get_asset_date', readonly=True, store=True) asset_mrr = fields.Float(string='Monthly Recurring Revenue', compute='_get_asset_date', readonly=True, digits=dp.get_precision('Account'), store=True) @api.one diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index 384649109a1..430aaa48244 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -1064,6 +1064,7 @@ class calendar_event(osv.Model): attendees[att.partner_id.id] = True new_attendees = [] new_att_partner_ids = [] + attendees_to_mail = [] for partner in event.partner_ids: if partner.id in attendees: continue @@ -1085,7 +1086,7 @@ class calendar_event(osv.Model): if not current_user.email or current_user.email != partner.email: mail_from = current_user.email or tools.config.get('email_from', False) if not context.get('no_email'): - self.pool['calendar.attendee']._send_mail_to_attendees(cr, uid, att_id, email_from=mail_from, context=context) + attendees_to_mail.append((att_id, mail_from, partner.name)) if new_attendees: self.write(cr, uid, [event.id], {'attendee_ids': [(4, att) for att in new_attendees]}, context=context) @@ -1105,6 +1106,9 @@ class calendar_event(osv.Model): if attendee_ids_to_remove: self.pool['calendar.attendee'].unlink(cr, uid, attendee_ids_to_remove, context) + for att_id, mail_from, partner_name in attendees_to_mail: + self.pool['calendar.attendee']._send_mail_to_attendees(cr, uid, att_id, email_from=mail_from, context=context) + res[event.id] = { 'new_attendee_ids': new_attendees, 'old_attendee_ids': all_attendee_ids, diff --git a/addons/event/models/event_mail.py b/addons/event/models/event_mail.py index ca3414a84f8..634fe6f28e4 100644 --- a/addons/event/models/event_mail.py +++ b/addons/event/models/event_mail.py @@ -71,7 +71,8 @@ class EventMailScheduler(models.Model): if self.interval_type == 'after_sub': # update registration lines lines = [] - for registration in filter(lambda item: item not in [mail_reg.registration_id for mail_reg in self.mail_registration_ids], self.event_id.registration_ids): + reg_ids = [mail_reg.registration_id for mail_reg in self.mail_registration_ids] + for registration in filter(lambda item: item not in reg_ids, self.event_id.registration_ids): lines.append((0, 0, {'registration_id': registration.id})) if lines: self.write({'mail_registration_ids': lines}) diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index 997d44cb6b0..484fffdc84a 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -253,7 +253,7 @@ class HrExpense(models.Model): # Calculate tax lines and adjust base line taxes = expense.tax_ids.compute_all(expense.unit_amount, expense.currency_id, expense.quantity, expense.product_id) account_move[-1]['price'] = taxes['total_excluded'] - account_move[-1]['tax_ids'] = expense.tax_ids.id + account_move[-1]['tax_ids'] = expense.tax_ids.ids for tax in taxes['taxes']: account_move.append({ 'type': 'tax', diff --git a/addons/hr_holidays/models/hr_holidays.py b/addons/hr_holidays/models/hr_holidays.py index 72cbd3e24c1..153f8097ab9 100644 --- a/addons/hr_holidays/models/hr_holidays.py +++ b/addons/hr_holidays/models/hr_holidays.py @@ -296,9 +296,6 @@ class Holidays(models.Model): """ date_from = self.date_from date_to = self.date_to - # date_to has to be greater than date_from - if (date_from and date_to) and (date_from > date_to): - raise UserError(_('The start date must be anterior to the end date.')) # No date_to set so far: automatically compute one 8 hours later if date_from and not date_to: @@ -316,9 +313,6 @@ class Holidays(models.Model): """ Update the number_of_days. """ date_from = self.date_from date_to = self.date_to - # date_to has to be greater than date_from - if (date_from and date_to) and (date_from > date_to): - raise UserError(_('The start date must be anterior to the end date.')) # Compute and update the number of days if (date_to and date_from) and (date_from <= date_to): diff --git a/addons/l10n_de_skr03/account_chart.xml b/addons/l10n_de_skr03/account_chart.xml index 368cd9a5937..d725d573070 100644 --- a/addons/l10n_de_skr03/account_chart.xml +++ b/addons/l10n_de_skr03/account_chart.xml @@ -484,7 +484,7 @@ Postbank 2 1120 - + @@ -708,7 +708,7 @@ Nebenkasse 1 1010 - + @@ -750,14 +750,14 @@ Postbank 3 1130 - + Bank 3 1230 - + @@ -806,7 +806,7 @@ Schecks 1330 - + @@ -925,7 +925,7 @@ Bank 4 1240 - + @@ -1492,7 +1492,7 @@ LZB-Guthaben 1190 - + @@ -2850,7 +2850,7 @@ Bank 2 1220 - + @@ -3116,7 +3116,7 @@ Postbank 1 1110 - + @@ -4019,7 +4019,7 @@ Nebenkasse 2 1020 - + @@ -4796,7 +4796,7 @@ Bank 1 1210 - + @@ -5020,7 +5020,7 @@ Postbank 1100 - + @@ -6161,7 +6161,7 @@ Bank 5 1250 - + @@ -6511,7 +6511,7 @@ Bundesbankguthaben 1195 - + @@ -7218,7 +7218,7 @@ Geldtransit 1360 - + diff --git a/addons/l10n_de_skr04/account_chart.xml b/addons/l10n_de_skr04/account_chart.xml index 81b0d42574f..fb9f9bf758d 100644 --- a/addons/l10n_de_skr04/account_chart.xml +++ b/addons/l10n_de_skr04/account_chart.xml @@ -3463,7 +3463,7 @@ 1460 Geldtransit - + @@ -3615,7 +3615,7 @@ 1610 Nebenkasse 1 - + @@ -3623,7 +3623,7 @@ 1620 Nebenkasse 2 - + @@ -3631,7 +3631,7 @@ 1700 Postbank - + @@ -3639,7 +3639,7 @@ 1710 Postbank 1 - + @@ -3647,7 +3647,7 @@ 1720 Postbank 2 - + @@ -3655,7 +3655,7 @@ 1730 Postbank 3 - + @@ -3679,7 +3679,7 @@ 1810 Bank 1 - + @@ -3687,7 +3687,7 @@ 1820 Bank 2 - + @@ -3695,7 +3695,7 @@ 1830 Bank 3 - + @@ -3703,7 +3703,7 @@ 1840 Bank 4 - + @@ -3711,7 +3711,7 @@ 1850 Bank 5 - + diff --git a/addons/l10n_fr/fr_fiscal_templates.xml b/addons/l10n_fr/fr_fiscal_templates.xml index d9f9975abe2..4166f1cc071 100644 --- a/addons/l10n_fr/fr_fiscal_templates.xml +++ b/addons/l10n_fr/fr_fiscal_templates.xml @@ -39,30 +39,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -128,30 +153,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/l10n_fr/fr_tax.xml b/addons/l10n_fr/fr_tax.xml index 4b88624de95..523c506265a 100644 --- a/addons/l10n_fr/fr_tax.xml +++ b/addons/l10n_fr/fr_tax.xml @@ -33,6 +33,31 @@ taxes + + 20.0-TTC + taxes + + + + 10.0-TTC + taxes + + + + 8.5-TTC + taxes + + + + 5.5-TTC + taxes + + + + 2.1-TTC + taxes + + ACH-8_5 taxes @@ -250,6 +275,77 @@ + + + + TVA collectée (vente) 20,0% TTC + 20.0-TTC + + + percent + + + + sale + + + + + + TVA collectée (vente) 8,5% TTC + 8.5-TTC + + + percent + + + + sale + + + + + + TVA collectée (vente) 10,0% TTC + 10.0-TTC + + + percent + + + + sale + + + + + + TVA collectée (vente) 5,5% TTC + 5.5-TTC + + + percent + + + + sale + + + + + + TVA collectée (vente) 2,1% TTC + 2.1-TTC + + + percent + + + + sale + + + diff --git a/addons/mail/models/mail_template.py b/addons/mail/models/mail_template.py index fa3725dafcb..f21aa93d4ab 100644 --- a/addons/mail/models/mail_template.py +++ b/addons/mail/models/mail_template.py @@ -494,7 +494,7 @@ class MailTemplate(models.Model): ) # Add report in attachments: generate once for all template_res_ids - if template.report_template and not 'report_template_in_attachment' in self.env.context: + if template.report_template: for res_id in template_res_ids: attachments = [] report_name = self.render_template(template.report_name, template.model, res_id) diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index c648f1f9afc..bf42a515220 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -1645,12 +1645,14 @@ class MailThread(models.AbstractModel): m2m_attachment_ids += [(4, id) for id in attachment_ids] # Handle attachments parameter, that is a dictionary of attachments for attachment in attachments: + cid = False if len(attachment) == 2: name, content = attachment elif len(attachment) == 3: name, content, info = attachment if info and info.get('cid'): - cid_mapping[info['cid']] = name + cid = info['cid'] + cid_mapping[cid] = name else: continue if isinstance(content, unicode): @@ -1658,7 +1660,7 @@ class MailThread(models.AbstractModel): data_attach = { 'name': name, 'datas': base64.b64encode(str(content)), - 'datas_fname': name, + 'datas_fname': cid or name, 'description': name, 'res_model': message_data['model'], 'res_id': message_data['res_id'], @@ -1671,8 +1673,11 @@ class MailThread(models.AbstractModel): postprocessed = False for node in root.iter('img'): if node.get('src', '').startswith('cid:'): - fname = cid_mapping.get(node.get('src').split('cid:')[1], node.get('data-filename', '')) - attachment = parameter_attachments.filtered(lambda attachment: attachment.name == fname) + cid = node.get('src').split('cid:')[1] + fname = cid_mapping.get(cid, node.get('data-filename', '')) + attachment = parameter_attachments.filtered(lambda attachment: attachment.datas_fname == cid) + if not attachment: + attachment = parameter_attachments.filtered(lambda attachment: attachment.datas_fname == fname) if attachment: node.set('src', '/web/image/%s' % attachment.ids[0]) postprocessed = True diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index 907bda2e0db..176ea88aec1 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -192,7 +192,7 @@ class MailComposer(models.TransientModel): @api.multi def send_mail_action(self): # TDE/ ??? - return self.with_context(report_template_in_attachment=True).send_mail() + return self.send_mail() @api.multi def send_mail(self, auto_commit=False): @@ -358,20 +358,6 @@ class MailComposer(models.TransientModel): if template.user_signature and 'body_html' in values: signature = self.env.user.signature values['body_html'] = tools.append_content_to_html(values['body_html'], signature, plaintext=False) - if template.report_template: - attachment = self.env['ir.attachment'] - attach = self.generate_attachment_from_report(template_id, res_id) - for attach_fname, attach_datas in attach[res_id].pop('attachments', []): - data_attach = { - 'name': attach_fname, - 'datas': attach_datas, - 'datas_fname': attach_fname, - 'res_model': 'mail.compose.message', - 'res_id': 0, - 'type': 'binary', - } - values.setdefault('attachment_ids', list()).append(attachment.create(data_attach).id) - elif template_id: values = self.generate_email_for_composer(template_id, [res_id])[res_id] # transform attachments into attachment_ids; not attached to the document because this will @@ -402,13 +388,6 @@ class MailComposer(models.TransientModel): return {'value': values} - @api.multi - def generate_attachment_from_report(self, template_id, res_id): - fields = ['attachment_ids'] - result = self.env['mail.template'].with_context(tpl_partners_only=True).browse(template_id).generate_email([res_id], fields=fields) - return result - - @api.multi def save_as_template(self): """ hit save as template button: current form value will be a new diff --git a/addons/purchase_requisition/views/purchase_requisition_views.xml b/addons/purchase_requisition/views/purchase_requisition_views.xml index af9b78532a5..6e3190dab07 100644 --- a/addons/purchase_requisition/views/purchase_requisition_views.xml +++ b/addons/purchase_requisition/views/purchase_requisition_views.xml @@ -131,7 +131,7 @@ - + diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index af1bbd1c0bb..42ff2ae7919 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -234,8 +234,8 @@ class Product(models.Model): dest_loc_domain = dest_loc_domain + [('location_dest_id', operator, [location.id for location in other_locations])] return ( domain + loc_domain, - domain + ['&'] + dest_loc_domain + ['!'] + loc_domain, - domain + ['&'] + loc_domain + ['!'] + dest_loc_domain + domain + dest_loc_domain + ['!'] + loc_domain if loc_domain else domain + dest_loc_domain, + domain + loc_domain + ['!'] + dest_loc_domain if dest_loc_domain else domain + loc_domain ) def _search_virtual_available(self, operator, value): diff --git a/addons/stock/views/stock_pack_operation_views.xml b/addons/stock/views/stock_pack_operation_views.xml index 5f7e46850e6..e982fac90bf 100644 --- a/addons/stock/views/stock_pack_operation_views.xml +++ b/addons/stock/views/stock_pack_operation_views.xml @@ -21,8 +21,8 @@
- - + + diff --git a/addons/web/static/src/js/views/form_relational_widgets.js b/addons/web/static/src/js/views/form_relational_widgets.js index 4ce7ed6dbf3..dd4c4fb0fb6 100644 --- a/addons/web/static/src/js/views/form_relational_widgets.js +++ b/addons/web/static/src/js/views/form_relational_widgets.js @@ -955,7 +955,7 @@ var X2ManyListView = ListView.extend({ field.no_rerender = true; current_values[field.name] = field.get('value'); }); - var cached_records = _.filter(this.dataset.cache, function(item){return !_.isEmpty(item.values);}); + var cached_records = _.filter(this.dataset.cache, function(item){return !_.isEmpty(item.values) && !item.to_delete;}); var valid = _.every(cached_records, function(record){ _.each(fields, function(field){ var value = record.values[field.name]; diff --git a/addons/web/static/src/less/webclient_layout.less b/addons/web/static/src/less/webclient_layout.less index 3355f4f791f..034f00ad3d9 100644 --- a/addons/web/static/src/less/webclient_layout.less +++ b/addons/web/static/src/less/webclient_layout.less @@ -34,6 +34,7 @@ .o-flex(1, 1, auto); .o-flex-display(); min-height: 0; // Allow flex to shrink this element as much as it wants + height: 100%; .o_sub_menu { .o-flex(0, 0, @odoo-submenu-width); diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js index 00d2af0367c..70fc06ba5e9 100644 --- a/addons/website/static/src/js/website.js +++ b/addons/website/static/src/js/website.js @@ -176,9 +176,10 @@ odoo.define('website.website', function (require) { }); /* ----- PUBLISHING STUFF ---- */ - $(document).on('click', '.js_publish_management .js_publish_btn', function () { + $(document).on('click', '.js_publish_management .js_publish_btn', function (e) { + e.preventDefault(); + var $data = $(this).parents(".js_publish_management:first"); - var self=this; ajax.jsonRpc($data.data('controller') || '/website/publish', 'call', {'id': +$data.data('id'), 'object': $data.data('object')}) .then(function (result) { $data.toggleClass("css_unpublished css_published"); diff --git a/addons/website/static/src/js/website.seo.js b/addons/website/static/src/js/website.seo.js index 528c25afa56..9e1c7ead1f5 100644 --- a/addons/website/static/src/js/website.seo.js +++ b/addons/website/static/src/js/website.seo.js @@ -343,8 +343,8 @@ var Configurator = Dialog.extend({ template: 'website.seo_configuration', events: { 'keyup input[name=seo_page_keywords]': 'confirmKeyword', - 'keyup input[name=seo_page_title]': 'titleChanged', - 'keyup textarea[name=seo_page_description]': 'descriptionChanged', + 'blur input[name=seo_page_title]': 'titleChanged', + 'blur textarea[name=seo_page_description]': 'descriptionChanged', 'click button[data-action=add]': 'addKeyword', }, canEditTitle: false, diff --git a/addons/website_blog/static/src/js/website_blog.editor.js b/addons/website_blog/static/src/js/website_blog.editor.js index 5f1704d39ab..f73f42d47b0 100644 --- a/addons/website_blog/static/src/js/website_blog.editor.js +++ b/addons/website_blog/static/src/js/website_blog.editor.js @@ -100,8 +100,12 @@ odoo.define('website_blog.editor', function (require) { editor.on('save', self, function (event, img) { var url = self.$image.attr('src'); self.$cover.css({"background-image": url ? 'url(' + url + ')' : "", 'min-height': $(window).height()-this.$cover.offset().top}); - self.$target.addClass('o_dirty cover cover_full'); + if (!self.$target.hasClass("cover")) { + var $li = self.$el.find("[data-cover_class]").first(); + self.cover_class(type, $li.data("cover_class"), $li); + } self.set_active(); + self.$target.addClass("o_dirty"); }); }, cover_class : function(type, value, $li) { diff --git a/addons/website_blog/views/website_blog_templates.xml b/addons/website_blog/views/website_blog_templates.xml index 2b93c8280af..6cd9b3c4c23 100644 --- a/addons/website_blog/views/website_blog_templates.xml +++ b/addons/website_blog/views/website_blog_templates.xml @@ -126,12 +126,12 @@
-

-

No blog post yet.

-

-

- Click on "Content" on the top menu to write your first blog post. -

+

+

No blog post yet.

+

+

+ Click on "New Page" in the top-right corner to write your first blog post. +

diff --git a/addons/website_sale/static/src/css/website_sale.css b/addons/website_sale/static/src/css/website_sale.css index 4486a957362..a5437c97159 100644 --- a/addons/website_sale/static/src/css/website_sale.css +++ b/addons/website_sale/static/src/css/website_sale.css @@ -358,6 +358,7 @@ min-height: 100px; position: relative; padding-bottom: 5px; + padding-left: 180px; } .oe_product.oe_list .oe_product_image { top: 0; @@ -369,9 +370,10 @@ .oe_product.oe_list section { position: relative; border: 0; - top: 0; + top: auto; bottom: auto; - left: 180px; + left: auto; + right: auto; background: transparent; } } diff --git a/addons/website_sale/static/src/css/website_sale.sass b/addons/website_sale/static/src/css/website_sale.sass index 4c4ce73c45c..d30861b3040 100644 --- a/addons/website_sale/static/src/css/website_sale.sass +++ b/addons/website_sale/static/src/css/website_sale.sass @@ -306,6 +306,7 @@ min-height: 100px position: relative padding-bottom: 5px + padding-left: 180px .oe_product_image top: 0 bottom: 0 @@ -315,9 +316,10 @@ section position: relative border: 0 - top: 0 + top: auto bottom: auto - left: 180px + left: auto + right: auto background: transparent .oe_website_sale .row .row .col-md-12 diff --git a/doc/cla/individual/bfotop.md b/doc/cla/individual/bfotop.md new file mode 100644 index 00000000000..8697a595ec7 --- /dev/null +++ b/doc/cla/individual/bfotop.md @@ -0,0 +1,11 @@ + + +Greece, 2016-09-23 + +I hereby agree to the terms of the Odoo Individual Contributor License Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this declaration. + +Signed, + +Basilis Fotopoulos bfotop@tax-solutions.gr https://github.com/bfotop diff --git a/doc/cla/individual/kaerdsar.md b/doc/cla/individual/kaerdsar.md new file mode 100644 index 00000000000..70e63803522 --- /dev/null +++ b/doc/cla/individual/kaerdsar.md @@ -0,0 +1,11 @@ +Cuba, 08/10/2016 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Cesar Lage kaerdsar@gmail.com https://github.com/kaerdsar diff --git a/doc/cla/individual/mcb30.md b/doc/cla/individual/mcb30.md new file mode 100644 index 00000000000..b3c601a1ff6 --- /dev/null +++ b/doc/cla/individual/mcb30.md @@ -0,0 +1,11 @@ +United Kingdom, 2016-08-09 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Michael Brown mbrown@fensystems.co.uk https://github.com/mcb30 diff --git a/doc/setup/install.rst b/doc/setup/install.rst index 0f1de4f14c0..3e5940d8ba1 100644 --- a/doc/setup/install.rst +++ b/doc/setup/install.rst @@ -61,11 +61,11 @@ refer to :ref:`setup/enterprise` (except for :ref:`setup/install/source`). If you wish to access the Enterprise installers/source code, you can: * Go to the Download_ page and log in with your customer credentials -* Download the source on GitHub using git_ +* Download the source on GitHub using git_(available to partners only) .. note:: If you do not have access to our Enterprise repository, you can request it be e-mailing your sales representative or our online support with - your subscription number and GitHub username. + your subscription number and GitHub username. (available to partners only) .. warning:: Enterprise deb and rpm packages do not have repositories, so automatic update will not work. Reinstalling the latest package version will be needed diff --git a/openerp/addons/base/ir/ir_config_parameter.py b/openerp/addons/base/ir/ir_config_parameter.py index 5634277c06b..744ac82db50 100644 --- a/openerp/addons/base/ir/ir_config_parameter.py +++ b/openerp/addons/base/ir/ir_config_parameter.py @@ -5,9 +5,12 @@ Store database-specific configuration parameters """ import uuid +import logging from odoo import api, fields, models -from odoo.tools import config, ormcache +from odoo.tools import config, ormcache, mute_logger + +_logger = logging.getLogger(__name__) """ A dictionary holding some configuration parameters to be initialized when the database is created. @@ -34,6 +37,7 @@ class IrConfigParameter(models.Model): ] @api.model_cr + @mute_logger('openerp.addons.base.ir.ir_config_parameter') def init(self, force=False): """ Initializes the parameters listed in _default_parameters. @@ -82,6 +86,8 @@ class IrConfigParameter(models.Model): group = self.env.ref(group_xml, raise_if_not_found=False) if group: gids.append((4, group.id)) + else: + _logger.warning('Potential Security Issue: Group [%s] is not found.' % group_xml) vals = {'value': value} if gids: diff --git a/openerp/tools/translate.py b/openerp/tools/translate.py index 13008e2aec0..5612efa003b 100644 --- a/openerp/tools/translate.py +++ b/openerp/tools/translate.py @@ -306,12 +306,16 @@ def html_translate(callback, value): if not value: return value - parser = etree.HTMLParser(encoding='utf-8') - trans = XMLTranslator(callback, 'html', parser) - wrapped = "
%s
" % encode(value) - root = etree.fromstring(wrapped, parser) - trans.process(root[0][0]) # html > body > div - return trans.get_done()[5:-6] # remove tags
and
+ try: + parser = etree.HTMLParser(encoding='utf-8') + trans = XMLTranslator(callback, 'html', parser) + wrapped = "
%s
" % encode(value) + root = etree.fromstring(wrapped, parser) + trans.process(root[0][0]) # html > body > div + value = trans.get_done()[5:-6] # remove tags
and
+ except ValueError: + _logger.exception("Cannot translate malformed HTML, using source value instead") + return value #