From 0cb1ed9f96b2f313b649c542540fa9ec269d35a2 Mon Sep 17 00:00:00 2001 From: "Raphael Valyi(Akretion)" <> Date: Tue, 14 Sep 2010 18:27:44 +0530 Subject: [PATCH 1/2] [FIX] Project_long_term : Better ordering on phase lp bug: https://launchpad.net/bugs/629735 fixed bzr revid: jvo@tinyerp.com-20100914125744-78lz9uaby27z4a07 --- addons/project_long_term/project_long_term.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index 04fde75342e..79baff679cc 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -116,7 +116,7 @@ class project_phase(osv.osv): 'sequence': 10, 'product_uom': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('Day'))], context=c)[0] } - _order = "name" + _order = "project_id, date_start, sequence, name" _constraints = [ (_check_recursion,'Loops in phases not allowed',['next_phase_ids', 'previous_phase_ids']), (_check_dates, 'Phase start-date must be lower than phase end-date.', ['date_start', 'date_end']), From d57d18e789c9e160d801e6e134d80dd67a6da3e6 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 14 Sep 2010 15:16:57 +0200 Subject: [PATCH 2/2] [IMP] account: proper check of main vs. secondary currency during move.line creation bzr revid: odo@openerp.com-20100914131657-wxiij1ccr9fed005 --- addons/account/account_move_line.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 463612e2177..7ddd4ad42f0 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1117,7 +1117,6 @@ class account_move_line(osv.osv): context['period_id'] = m.period_id.id self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context) - company_currency = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id move_id = vals.get('move_id', False) journal = self.pool.get('account.journal').browse(cr, uid, context['journal_id']) is_new_move = False @@ -1156,7 +1155,10 @@ class account_move_line(osv.osv): if a.id == vals['account_id']: ok = True break - if (account.currency_id) and 'amount_currency' not in vals and account.currency_id.id <> company_currency: + + # Automatically convert in the account's secondary currency if there is one and + # the provided values were not already multi-currency + if account.currency_id and 'amount_currency' not in vals and account.currency_id.id != account.company_id.currency_id.id: vals['currency_id'] = account.currency_id.id cur_obj = self.pool.get('res.currency') ctx = {}