title: odoo V.9 How to make server action to execute sql query
body: <p>I want try to execute query from server action in sales order module and add the action in the &quot;more&quot; menu but there is found error when click the action
  and I try query alone on the database and execute well
  python code in server action:</p>
  <pre><code>if context.get('active_model') == 'sales.order' and context.get('active_ids'):
      self.Invoiced(cr, uid, context['active_ids'], context=context)
  
  def Invoiced(self):
      for item in self:
          self.env.cr.execute('update sale_order_line as l set qty_invoiced = l.product_uom_qty FROM sale_order s where l.order_id = s.id and s.state = &quot;done&quot;')
      self.deadline = self.env.cr.fetchone()
  </code></pre>
  <h3>Error:</h3>
  <blockquote>
  <p>Odoo Server Error</p>
  <p><strong>SyntaxError</strong>: EOL while scanning string literal</p>
  </blockquote>