I am trying to fire an action when an incoming shipment gets the state 'Received'. For a reason I don't understand, my basic function just doesn't start. I am working in the Warehouse section - Incoming Shipments. When a shipment gets the state 'Received', I want to do a number of actions. Here's my XML code:
<?xml version="1.0" encoding="utf-8"?> <openerp> <data> <record id="stock_picking_in_inherit_test" model="ir.ui.view"> <field name="name">Incoming Picking Inherited</field> <field name="model">stock.picking.in</field> <field name="inherit_id" ref="stock.view_picking_form"/> <field name="arch" type="xml"> <xpath expr="//field[@name='state']" position="attributes"> <attribute name="on_change">on_change_state(purchase_id, context)</attribute> </xpath> </field> </record> </data> </openerp>
and here's the Python code:
class stock_picking_in(osv.osv): _inherit = "stock.picking.in" def on_change_state(self, cr, uid, ids, purchase_id, context=None): print 'purchase_id ', purchase_id print 'ids', ids stock_picking_in()
I've done similar things a few times before, but in this case I don't see anything printed. I've put a breakpoint at the last print command, but the function 'on_change_state' just doesn't start.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 3/9/14, 5:58 PM|
|Seen: 411 times|
|Last updated: 3/16/15, 8:10 AM|