[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
This commit is contained in:
Mustufa Rangwala 2010-09-21 12:06:31 +05:30
parent dc822ca892
commit 4f2b28dcb8
2 changed files with 6 additions and 5 deletions

View File

@ -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])+'"')

View File

@ -942,8 +942,8 @@
<field name="credit" sum="Total credit"/>
<field name="account_tax_id" groups="base.group_extended"/>
<field name="analytic_account_id" groups="base.group_extended" domain="[('parent_id','!=',False)]"/>
<field name="amount_currency" groups="base.group_extended"/>
<field name="currency_id" groups="base.group_extended"/>
<field name="amount_currency" groups="base.group_extended" attrs="{'readonly':[('state','=','valid')]}"/>
<field name="currency_id" groups="base.group_extended" attrs="{'readonly':[('state','=','valid')]}"/>
<field name="reconcile_partial_id" groups="base.group_extended"/>
<field name="reconcile_id"/>
<field name="state"/>
@ -998,7 +998,7 @@
<field name="account_tax_id" domain="[('parent_id','=',False)]"/>
</group>
<group col="2" colspan="2">
<group col="2" colspan="2" attrs="{'readonly':[('state','=','valid')]}" >
<separator colspan="2" string="Currency"/>
<field name="currency_id"/>
<field name="amount_currency"/>