From 9c0e8f10e0268c26cea1b991b0156f425a3c3e1a Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Mon, 13 Oct 2014 17:07:13 +0200 Subject: [PATCH 01/30] [FIX] sale: translate advance message on advance invoice --- addons/sale/wizard/sale_make_invoice_advance.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index 9c3160cb46a..c4798cc44d4 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -58,6 +58,9 @@ class sale_advance_payment_inv(osv.osv_memory): 'product_id': _get_advance_product, } + def _translate_advance(self, cr, uid, percentage=False, context=None): + return _("Advance of %s %%") if percentage else _("Advance of %s %s") + def onchange_method(self, cr, uid, ids, advance_payment_method, product_id, context=None): if advance_payment_method == 'percentage': return {'value': {'amount':0, 'product_id':False }} @@ -104,16 +107,17 @@ class sale_advance_payment_inv(osv.osv_memory): if wizard.advance_payment_method == 'percentage': inv_amount = sale.amount_total * wizard.amount / 100 if not res.get('name'): - res['name'] = _("Advance of %s %%") % (wizard.amount) + res['name'] = self._translate_advance(cr, uid, percentage=True, context=dict(context, lang=sale.partner_id.lang)) % (wizard.amount) else: inv_amount = wizard.amount if not res.get('name'): #TODO: should find a way to call formatLang() from rml_parse symbol = sale.pricelist_id.currency_id.symbol if sale.pricelist_id.currency_id.position == 'after': - res['name'] = _("Advance of %s %s") % (inv_amount, symbol) + symbol_order = (inv_amount, symbol) else: - res['name'] = _("Advance of %s %s") % (symbol, inv_amount) + symbol_order = (symbol, inv_amount) + res['name'] = self._translate_advance(cr, uid, context=dict(context, lang=sale.partner_id.lang)) % symbol_order # determine taxes if res.get('invoice_line_tax_id'): @@ -159,7 +163,6 @@ class sale_advance_payment_inv(osv.osv_memory): sale_obj.write(cr, uid, sale_id, {'invoice_ids': [(4, inv_id)]}, context=context) return inv_id - def create_invoices(self, cr, uid, ids, context=None): """ create invoices for the active sales orders """ sale_obj = self.pool.get('sale.order') From 1d57a09112e4def7c7ed9cc010f9d683c18ac1ea Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 16 Oct 2014 14:07:38 +0200 Subject: [PATCH 02/30] [FIX] mail: set the parent_id to the first message of type email And fallback of any type if there is none of type email This fix allow the communication between two mail thread from two different Odoo servers having message creation subtypes, like project issue or crm lead --- addons/mail/mail_thread.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index ee039533af6..e82ed94c43b 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -1166,7 +1166,9 @@ class mail_thread(osv.AbstractModel): # _mail_flat_thread: automatically set free messages to the first posted message if self._mail_flat_thread and not parent_id and thread_id: - message_ids = mail_message.search(cr, uid, ['&', ('res_id', '=', thread_id), ('model', '=', model)], context=context, order="id ASC", limit=1) + message_ids = mail_message.search(cr, uid, ['&', ('res_id', '=', thread_id), ('model', '=', model), ('type', '=', 'email')], context=context, order="id ASC", limit=1) + if not message_ids: + message_ids = message_ids = mail_message.search(cr, uid, ['&', ('res_id', '=', thread_id), ('model', '=', model)], context=context, order="id ASC", limit=1) parent_id = message_ids and message_ids[0] or False # we want to set a parent: force to set the parent_id to the oldest ancestor, to avoid having more than 1 level of thread elif parent_id: From 639174bc53ffdb4503d240d3555e6bc5a725f994 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 16 Oct 2014 18:38:20 +0200 Subject: [PATCH 03/30] [FIX] website: prevent editing contact address with qweb contact widget Because, currently, it copy the whole address in the contact name. The address is therefore duplicated --- addons/website/models/ir_qweb.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/website/models/ir_qweb.py b/addons/website/models/ir_qweb.py index c598773c10b..f0a75dc31db 100644 --- a/addons/website/models/ir_qweb.py +++ b/addons/website/models/ir_qweb.py @@ -417,6 +417,9 @@ class Contact(orm.AbstractModel): _name = 'website.qweb.field.contact' _inherit = ['ir.qweb.field.contact', 'website.qweb.field.many2one'] + def from_html(self, cr, uid, model, column, element, context=None): + return None + class QwebView(orm.AbstractModel): _name = 'website.qweb.field.qweb' _inherit = ['ir.qweb.field.qweb'] From bc38c36503339fa2bbac53369f1f3c4d390e3c7e Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Thu, 16 Oct 2014 22:15:35 +0200 Subject: [PATCH 04/30] [FIX] website: fix snippet banner, else when a video is dropped (using a div), the video is moved outside of the span col-md-6 by the editor and so become invisble --- addons/website/views/snippets.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website/views/snippets.xml b/addons/website/views/snippets.xml index cee78689bda..84acc2346b5 100644 --- a/addons/website/views/snippets.xml +++ b/addons/website/views/snippets.xml @@ -34,9 +34,9 @@ Contact us

-