title: Odoo. How to save data in database from ajax in controller
body: <p>I have odoo 10</p>
  
  <p>my model</p>
  
  <pre><code>class SomeModel(models.Model):
      _name = 'some.model'
  
      name = fields.Char(string='Name')
      description = fields.Text()
      published = fields.Date()
  </code></pre>
  
  <p>my controller</p>
  
  <pre><code>class MyController(http.Controller):
      @http.route('/api/save', auth='public', methods=['POST'],
                  website=True, csrf=False)
      def save_obj(self, **kw):
          obj = json.loads(kw.get('data'))
          http.request.env['some.model'].write({
              'name': obj.get('title'),
              'description': obj.get('description'),
              'published': obj.get('dates')[0].get('date'),
          })
  </code></pre>
  
  <p>I want to save data from Ajax in database. The method I wrote does not save data. What am I doing wrong?</p>