[FIX] Account: Account move line => journal items if the state is move user is not...
authorMustufa Rangwala <mra@mra-laptop>
Tue, 21 Sep 2010 06:36:31 +0000 (12:06 +0530)
committerMustufa Rangwala <mra@mra-laptop>
Tue, 21 Sep 2010 06:36:31 +0000 (12:06 +0530)
bzr revid: mra@mra-laptop-20100921063631-4ndy7xo02o6thg93

addons/account/account_move_line.py
addons/account/account_view.xml

index bb208e4..322c388 100644 (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])+'"')
index 40f8fd2..dbc70b1 100644 (file)
                     <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"/>
                                 <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"/>