From 418e06e88f0cc1a0cd7054af9263bb0529cf8870 Mon Sep 17 00:00:00 2001 From: dhr-odoo Date: Fri, 18 Jul 2014 16:14:28 +0530 Subject: [PATCH 1/5] [FIX] project_timesheet: test used fields added not in dependencies The fields procure_method and supply_method are not present if we just install project_timesheet which makes the tests fail (opw 610590). --- .../test/worktask_entry_to_timesheetline_entry.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml index 3efd133ffb6..8cfc8803021 100644 --- a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml +++ b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml @@ -16,9 +16,7 @@ cost_method: standard mes_type: fixed name: HR Manger - procure_method: make_to_stock standard_price: 1.0 - supply_method: buy type: service uom_id: product.product_uom_hour uom_po_id: product.product_uom_hour From e9e376a6de83abc18d21711b1f85572703be1e46 Mon Sep 17 00:00:00 2001 From: Hardik Ansodariya Date: Tue, 15 Jul 2014 11:33:49 +0530 Subject: [PATCH 2/5] [FIX] account_analytic_plan: correctly check context The id of the journal is passed in the context. Avoid trying to browse on jounral_id=False Fixes #821 --- addons/account_analytic_plans/account_analytic_plans.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index 2948ac1c19c..0db70291ea5 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -213,7 +213,7 @@ class account_analytic_plan_instance(osv.osv): ana_plan_instance_obj = self.pool.get('account.analytic.plan.instance') acct_anal_acct = self.pool.get('account.analytic.account') acct_anal_plan_line_obj = self.pool.get('account.analytic.plan.line') - if context and 'journal_id' in context: + if context and context.get('journal_id'): journal = journal_obj.browse(cr, uid, context['journal_id'], context=context) pids = ana_plan_instance_obj.search(cr, uid, [('name','=',vals['name']), ('code','=',vals['code']), ('plan_id','<>',False)], context=context) From d31faceb67fd87acaca00365dcfc28925b08a37f Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 8 Aug 2014 11:40:30 +0200 Subject: [PATCH 3/5] [FIX] yaml tests: extra key in on_change result isn't that bad. In the return result of an on_change, having keys which are not ine the view is not that bad, it is not an actual problem. Display warning instead of asserting all the keys are in the views. --- openerp/tools/yaml_import.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openerp/tools/yaml_import.py b/openerp/tools/yaml_import.py index 3172caac1f4..8f98573c413 100644 --- a/openerp/tools/yaml_import.py +++ b/openerp/tools/yaml_import.py @@ -449,10 +449,13 @@ class YamlInterpreter(object): args = map(lambda x: eval(x, ctx), match.group(2).split(',')) result = getattr(model, match.group(1))(self.cr, SUPERUSER_ID, [], *args) for key, val in (result or {}).get('value', {}).items(): - assert key in fg, "The returning field '%s' from your on_change call '%s' does not exist either on the object '%s', either in the view '%s' used for the creation" % (key, match.group(1), model._name, view_info['name']) - record_dict[key] = process_val(key, val) - #if (key in fields) and record_dict[key] == process_val(key, val): - # print '*** You can remove these lines:', key, val + if key in fg: + record_dict[key] = process_val(key, val) + else: + _logger.warning("The returning field '%s' from your on_change call '%s'" + " does not exist either on the object '%s', either in" + " the view '%s'", + key, match.group(1), model._name, view_info['name']) else: nodes = list(el) + nodes else: From 1d826a6051e86796949c3ea725cee1d914e9d741 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 8 Aug 2014 12:29:47 +0200 Subject: [PATCH 4/5] [FIX] account_anglo_savon: round prices according to account precision to avoid getting unbalanced move The standard move_line_get from account.invoice returns prices rounded (price_subtotal field as account precision) while the anglo-saxon module could return dict with non-rounded prices. With amounts with bigger precision, we could get a difference of a few cents when comparing the debit/credits and then not be able to balance the invoice (opw 597208). --- addons/account_anglo_saxon/invoice.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/account_anglo_saxon/invoice.py b/addons/account_anglo_saxon/invoice.py index b486ff71ad9..0530abf1386 100644 --- a/addons/account_anglo_saxon/invoice.py +++ b/addons/account_anglo_saxon/invoice.py @@ -22,6 +22,7 @@ ############################################################################## from openerp.osv import osv +from openerp.tools.float_utils import float_round as round class account_invoice_line(osv.osv): _inherit = "account.invoice.line" @@ -32,11 +33,12 @@ class account_invoice_line(osv.osv): company_currency = inv.company_id.currency_id.id def get_price(cr, uid, inv, company_currency,i_line): cur_obj = self.pool.get('res.currency') + decimal_precision = self.pool.get('decimal.precision') if inv.currency_id.id != company_currency: price = cur_obj.compute(cr, uid, company_currency, inv.currency_id.id, i_line.product_id.standard_price * i_line.quantity, context={'date': inv.date_invoice}) else: price = i_line.product_id.standard_price * i_line.quantity - return price + return round(price, decimal_precision.precision_get(cr, uid, 'Account')) if inv.type in ('out_invoice','out_refund'): for i_line in inv.invoice_line: @@ -113,6 +115,8 @@ class account_invoice_line(osv.osv): fpos = i_line.invoice_id.fiscal_position or False a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa) diff_res = [] + decimal_precision = self.pool.get('decimal.precision') + account_prec = decimal_precision.precision_get(cr, uid, 'Account') # calculate and write down the possible price difference between invoice price and product price for line in res: if a == line['account_id'] and i_line.product_id.id == line['product_id']: @@ -121,14 +125,14 @@ class account_invoice_line(osv.osv): if inv.currency_id.id != company_currency: standard_price = self.pool.get('res.currency').compute(cr, uid, company_currency, inv.currency_id.id, standard_price, context={'date': inv.date_invoice}) if standard_price != i_line.price_unit and line['price_unit'] == i_line.price_unit and acc: - price_diff = i_line.price_unit - standard_price - line.update({'price':standard_price * line['quantity']}) + price_diff = round(i_line.price_unit - standard_price, account_prec) + line.update({'price': round(standard_price * line['quantity'], account_prec)}) diff_res.append({ 'type':'src', 'name': i_line.name[:64], 'price_unit':price_diff, 'quantity':line['quantity'], - 'price': price_diff * line['quantity'], + 'price': round(price_diff * line['quantity'], account_prec), 'account_id':acc, 'product_id':line['product_id'], 'uos_id':line['uos_id'], From 5f696ba86c5acdde11199ff4e7a41b9d7ace815f Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 8 Aug 2014 16:05:32 +0200 Subject: [PATCH 5/5] [FIX] pos: display cashier name on receipt, not the user --- addons/point_of_sale/static/src/xml/pos.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 9fcf20819cb..c4501253828 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -561,7 +561,7 @@

Phone:
- User:
+ User:
Shop: