From f09e11f55b663da8f8bab41c5fc784b8ab694b05 Mon Sep 17 00:00:00 2001 From: Anael Closson Date: Mon, 4 Aug 2014 17:24:56 +0200 Subject: [PATCH 1/5] [FIX] sale: quote character in company name is converted to html entity Avoid to get company names such as "L'abc" to be transformed as "L'abc" opw 607221 --- addons/account/edi/invoice_action_data.xml | 2 +- addons/portal_sale/portal_sale_data.xml | 4 ++-- addons/purchase/edi/purchase_order_action_data.xml | 2 +- addons/sale/edi/sale_order_action_data.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/account/edi/invoice_action_data.xml b/addons/account/edi/invoice_action_data.xml index 013d259e874..2dbeb707009 100644 --- a/addons/account/edi/invoice_action_data.xml +++ b/addons/account/edi/invoice_action_data.xml @@ -23,7 +23,7 @@ Invoice - Send by Email ${(object.user_id.email or object.company_id.email or 'noreply@localhost')|safe} - ${object.company_id.name} Invoice (Ref ${object.number or 'n/a'}) + ${object.company_id.name|safe} Invoice (Ref ${object.number or 'n/a'}) ${object.partner_id.id} diff --git a/addons/portal_sale/portal_sale_data.xml b/addons/portal_sale/portal_sale_data.xml index f313e774fe0..3aed0beb2ae 100644 --- a/addons/portal_sale/portal_sale_data.xml +++ b/addons/portal_sale/portal_sale_data.xml @@ -7,7 +7,7 @@ Sales Order - Send by Email (Portal) ${(object.user_id.email or '')|safe} - ${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' }) + ${object.company_id.name|safe} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' }) ${object.partner_invoice_id.id} @@ -97,7 +97,7 @@ Invoice - Send by Email (Portal) ${(object.user_id.email or object.company_id.email or 'noreply@localhost')|safe} - ${object.company_id.name} Invoice (Ref ${object.number or 'n/a' }) + ${object.company_id.name|safe} Invoice (Ref ${object.number or 'n/a' }) ${object.partner_id.id} diff --git a/addons/purchase/edi/purchase_order_action_data.xml b/addons/purchase/edi/purchase_order_action_data.xml index ab2b652bf4e..c9aae5a9317 100644 --- a/addons/purchase/edi/purchase_order_action_data.xml +++ b/addons/purchase/edi/purchase_order_action_data.xml @@ -20,7 +20,7 @@ Purchase Order - Send by mail ${(object.validator.email or '')|safe} - ${object.company_id.name} Order (Ref ${object.name or 'n/a' }) + ${object.company_id.name|safe} Order (Ref ${object.name or 'n/a' }) ${object.partner_id.id} diff --git a/addons/sale/edi/sale_order_action_data.xml b/addons/sale/edi/sale_order_action_data.xml index 0d388a1896a..4fedfd7da09 100644 --- a/addons/sale/edi/sale_order_action_data.xml +++ b/addons/sale/edi/sale_order_action_data.xml @@ -21,7 +21,7 @@ Sales Order - Send by Email ${(object.user_id.email or '')|safe} - ${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' }) + ${object.company_id.name|safe} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' }) ${object.partner_invoice_id.id} From 70b246c3c7d6c7b197f1d36cf6c86aeed896d077 Mon Sep 17 00:00:00 2001 From: Anael Closson Date: Tue, 5 Aug 2014 17:01:23 +0200 Subject: [PATCH 2/5] [FIX] analytic: name_search on accounts The name_search was hardcoding ilike operator while it could be different. This means that a name_search "name != Agrolait" would return accounts with agrolait. A side effect of this was the impossibility to import account_analytic_account whose parent is a substring of another - opw 607315 --- addons/analytic/analytic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 5a77b86f14f..5c91caad3a5 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -301,7 +301,7 @@ class account_analytic_account(osv.osv): dom = [] for name2 in name.split('/'): name = name2.strip() - account_ids = self.search(cr, uid, dom + [('name', 'ilike', name)] + args, limit=limit, context=context) + account_ids = self.search(cr, uid, dom + [('name', operator, name)] + args, limit=limit, context=context) if not account_ids: break dom = [('parent_id','in',account_ids)] else: From bc4217ced23288f8ab2a67659903b89625584e68 Mon Sep 17 00:00:00 2001 From: Rifakat Husen Date: Tue, 5 Aug 2014 17:15:06 +0200 Subject: [PATCH 3/5] [FIX] stock: onchange method should take the description The onchange_product_id method used to only change the description if the stock.move is not saved yet. That does not make much sense. opw 607347, bug lp:1314700 --- addons/stock/stock.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 64284f7c0c2..e3e7d539771 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1939,14 +1939,13 @@ class stock_move(osv.osv): product = self.pool.get('product.product').browse(cr, uid, [prod_id], context=ctx)[0] uos_id = product.uos_id and product.uos_id.id or False result = { + 'name': product.partner_ref, 'product_uom': product.uom_id.id, 'product_uos': uos_id, 'product_qty': 1.00, 'product_uos_qty' : self.pool.get('stock.move').onchange_quantity(cr, uid, ids, prod_id, 1.00, product.uom_id.id, uos_id)['value']['product_uos_qty'], 'prodlot_id' : False, } - if not ids: - result['name'] = product.partner_ref if loc_id: result['location_id'] = loc_id if loc_dest_id: From 3bb6136055d582c1db53f750bfdaea827acfb6ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulius=20Sladkevi=C4=8Dius?= Date: Mon, 4 Aug 2014 13:37:50 +0300 Subject: [PATCH 4/5] [FIX] point_of_sale: clear tag in pos order sheet layout Without clear tag total amounts breaks sheet layout. --- addons/point_of_sale/point_of_sale_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index b2a2d4ad002..716dd7d4570 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -64,6 +64,7 @@ +
From 095be21ab17f7f731877d61c99b48b51119ff39a Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 6 Aug 2014 12:47:40 +0200 Subject: [PATCH 5/5] [FIX] crm_claim: allow to create claim as portal user It wasn't possible to create claims as a portal user when the portal user had a parent_id --- addons/portal_claim/__init__.py | 1 + addons/portal_claim/portal_claim.py | 39 +++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 addons/portal_claim/portal_claim.py diff --git a/addons/portal_claim/__init__.py b/addons/portal_claim/__init__.py index 26c654db9dd..dbd07a05428 100644 --- a/addons/portal_claim/__init__.py +++ b/addons/portal_claim/__init__.py @@ -19,3 +19,4 @@ # ############################################################################## +import portal_claim \ No newline at end of file diff --git a/addons/portal_claim/portal_claim.py b/addons/portal_claim/portal_claim.py new file mode 100644 index 00000000000..d7c9c1af6ca --- /dev/null +++ b/addons/portal_claim/portal_claim.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-today OpenERP SA () +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp import SUPERUSER_ID +from openerp.addons.base_status.base_stage import base_stage +from openerp.osv import osv + + +class crm_claim(base_stage, osv.osv): + _inherit = "crm.claim" + + def default_get(self, cr, uid, fields, context=None): + res = super(crm_claim, self).default_get(cr, uid, fields, context=context) + if isinstance(res.get('partner_id'), (int, long)): + # Special case for portal users, as they are not allowed to call name_get on res.partner + # We save this call for the web client by returning it in default get + res['partner_id'] = self.pool['res.partner'].name_get( + cr, SUPERUSER_ID, [res['partner_id']], context=context)[0] + return res + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: