Created
April 22, 2015 01:59
-
-
Save erickgnavar/76b3d121fafbbf94a40b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SaleOrder(models.Model): | |
_inherit = 'sale.order' | |
@api.model | |
def create(self, values): | |
record = super(SaleOrder, self).create(values) | |
import urllib2 | |
import json | |
req = urllib2.Request('http://localhost:3000/send-message/', data=json.dumps({ | |
'message': '{} - {}'.format(record.partner_id.name, record.amount_total) | |
}), headers={ | |
'Content-type': 'application/json' | |
}) | |
urllib2.build_opener().open(req) | |
return record |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment