From 737728a7a05cf849ced6e53d6d776e10b67dc804 Mon Sep 17 00:00:00 2001 From: Christophe Combelles Date: Sat, 24 Jan 2015 21:43:36 +0200 Subject: [PATCH 1/2] [FIX] base: import po file with comments only Do not crash when importing a po file with only comments lines (e.g. autogenerated files) Fixes #4887 --- openerp/tools/translate.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openerp/tools/translate.py b/openerp/tools/translate.py index 4e9ffecb3aa..1c53b47beff 100644 --- a/openerp/tools/translate.py +++ b/openerp/tools/translate.py @@ -329,6 +329,8 @@ class TinyPoFile(object): elif line.startswith('#,') and (line[2:].strip() == 'fuzzy'): fuzzy = True line = self.lines.pop(0).strip() + if not self.lines: + raise StopIteration() while not line: # allow empty lines between comments and msgid line = self.lines.pop(0).strip() From d246e36c824931613229a6467e21d65d392a2fa3 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 13 Apr 2015 15:38:17 +0200 Subject: [PATCH 2/2] Revert commit "[FIX] sale_margin: purchase price calculated using the currency of the price type" Reasons: - the currency conversion is done assuming that the cost price currency is the company currency - we support only one price type per field. Defining several price types on the same field using different price types is not supported. --- addons/sale_margin/sale_margin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py index ebe00221c83..96031db1f3c 100644 --- a/addons/sale_margin/sale_margin.py +++ b/addons/sale_margin/sale_margin.py @@ -37,7 +37,7 @@ class sale_order_line(osv.osv): to_cur = self.pool.get('product.pricelist').browse(cr, uid, [pricelist])[0].currency_id.id if product: product = self.pool['product.product'].browse(cr, uid, product, context=context) - purchase_price = product.price_get(ptype='standard_price', context=dict(context, currency_id=to_cur))[product.id] + purchase_price = product.standard_price to_uom = res.get('product_uom', uom) if to_uom != product.uom_id.id: purchase_price = self.pool['product.uom']._compute_price(cr, uid, product.uom_id.id, purchase_price, to_uom)