Hello, I added an "on_change" event to a view, with a basic function to test, but nothing append when the field change, here is my code :
In sale order view I added tree fields <field name="height" on_change="dimensions_change()"/> <field name="width" on_change="dimensions_change()"/> <field name="m2_total" /> I created a sale_order_line class : class sale_order_line(osv.osv): _name = 'sale.order.line' _inherit = 'sale.order.line' def _getM2Total (self, cr, uid, ids, field_name, arg, context) : """ M2 + m2 recharges """ res = {} for id in ids: res[id] = 11 return res _columns = { 'width': fields.integer('Width'), 'height': fields.integer('Height'), 'm2_total': fields.function(_getM2Total, method=True, type="integer", string='M2 Total'), } def dimensions_change(self, cr, uid, ids): v = {} v['m2_total'] = 36 return {'value': v} sale_order_line() _______________________________________________ Tinyerp-users mailing list http://tiny.be/mailman/listinfo/tinyerp-users
