Hello,
I need to auto create a sales order (no quotation) when a sales order or a quotation is save. Therefore I created a short module, which looks like follows:
class sale_order(osv.osv):
_inherit = 'sale.order'
def create(self, cr, uid, vals, context=None):
result = super(sale_order, self).create(cr, uid, vals, context=context)
if not vals.get('order_line', '/') == '/':
wf_service = netsvc.LocalService('workflow')
wf_service.trg_validate(uid, 'sale.order', result, 'order_confirm', cr)
return result
This works but I have one problem. My module is called when the "save" and the "update" button is used. This isn't good and I'll run this coding only if button "save" is used. So I would like to now how can I check in coding, which button is pressed? Can anybody tell me or give me an example, how can I check which button is used?
Thanks a lot!
Leo