From 4f2b28dcb82d25deac85524d0293ff5470f5bb3a Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Tue, 21 Sep 2010 12:06:31 +0530 Subject: [PATCH] [FIX] Account: Account move line => journal items if the state is move user is not allowed to change its currency and amount of foreigh currency bzr revid: mra@mra-laptop-20100921063631-4ndy7xo02o6thg93 --- addons/account/account_move_line.py | 5 +++-- addons/account/account_view.xml | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index bb208e4..322c388 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -160,10 +160,10 @@ class account_move_line(osv.osv): return context def _default_get(self, cr, uid, fields, context={}): - + if not context.get('journal_id', False) and context.get('search_default_journal_id', False): context['journal_id'] = context.get('search_default_journal_id') - + period_obj = self.pool.get('account.period') context = self.convert_to_period(cr, uid, context) @@ -946,6 +946,7 @@ class account_move_line(osv.osv): if field in ('amount_currency', 'currency_id'): attrs.append('on_change="onchange_currency(account_id, amount_currency,currency_id, date, journal_id)"') + attrs.append("attrs='{'readonly':[('state','=','valid')]}'") if field in widths: attrs.append('width="'+str(widths[field])+'"') diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 40f8fd2..dbc70b1 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -942,8 +942,8 @@ - - + + @@ -998,7 +998,7 @@ - + -- 1.7.10.4