Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 3/9/14, 5:49 PM|
|Seen: 850 times|
|Last updated: 3/16/15, 8:10 AM|