I checked using this code and its working here.

[color=green]class pocscs(osv.osv):
   _name = 'res.partner'
   _inherit = 'res.partner'
   _columns = {
        'age': fields.integer('Age'),
        'typeage': fields.char('Type age', 
size=128),
   }
   _defaults = {
   }
   def age_change(self, cr, uid, ids, age):
      logger.notifyChannel('pocscs', netsvc.LOG_ERROR, 
"Setting typeage!!!!!!")
&nbsp; &nbsp; &nbsp; if age < 20&#58;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return 
&#123;'value'&#58;&#123;'typeage'&#58;'Personne jeune'&#125;&#125;
&nbsp; &nbsp; &nbsp; elif 20 < age < 50&#58;
&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp;return&#123;'value'&#58;&#123;'typeage'&#58;'Personne mature'&#125;&#125;
&nbsp; &nbsp; &nbsp; else&#58;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return 
&#123;'value'&#58;&#123;'typeage'&#58;'Personne du troisieme 
age'&#125;&#125;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; return &#123;&#125;
pocscs&#40;&#41; 
&#91;/color&#93;




&#91;color=green&#93;<record id="test_demo_form" model="ir.ui.view">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <field 
name="name">test.demo.form</field>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <field 
name="model">res.partner</field>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <field name="inherit_id" 
ref="base.view_partner_form"/>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <field name="type">form</field>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <field name="arch" type="xml">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<field 
name="name" select="1" position="after">
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp;<field name="age" on_change="age_change&#40;age&#41;" />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <field 
name="typeage"/>&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp;
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</field>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </field>
&nbsp; &nbsp; &nbsp; &nbsp; </record>
&#91;/color&#93;


------------------------
-- 
Regards,
Husen Daudi,
OpenERP=Easier, Adaptable, Affordable, Modular




-------------------- m2f --------------------

--
http://www.openerp.com/forum/viewtopic.php?p=27637#27637

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman/listinfo/tinyerp-users

Reply via email to