title: AttributeError: 'bool' object has no attribute?
body: <p>this is my function:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    @api.multi
      def write(self, vals):
          if vals['Amount'] &gt; 0:
              vals['Amount_date'] = fields.Datetime.now()
              record=super(MedicalLab, self).write(vals)          
              self.env['medical.journal'].create({
                  'patient_id': record.patient_id,
                  'cat': record.cat,
                  'test_type_id': record.test_type_id,
                  'state_money':record.state_money,
                  'Amount_in_date':record.Amount_date,
                  'type_In': "Reste",
                  'Amount_In':record.Amount,
                  'user_id': record.user_id,
                  'type_lev1': "IN",                                
              })   
          return record  </code></pre>
  </div>
  </div>
  </p>
  <p>this is the error:</p>
  <blockquote>
  <p>AttributeError: 'bool' object has no attribute 'patient_id'</p>
  </blockquote>
  <p><strong>EDITS :</strong></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    @api.multi
      def write(self, vals):
          if vals['Amount'] &gt; 0:
              vals['Amount_date'] = fields.Datetime.now()
          
              self.env['medical.journal'].create({
                  'patient_id': vals['patient_id'],
                  'cat': vals['cat'],
                  'test_type_id': vals['test_type_id'],
                  'state_money':vals['state_money'],
                  'Amount_in_date':vals['Amount_date'],
                  'type_In': "Reste",
                  'Amount_In':vals['Amount'],
                  'user_id': vals['user_id'],
                  'type_lev1': "IN",                                
              })   
     
          return super(MedicalLab, self).write(vals)</code></pre>
  </div>
  </div>
  </p>
  <p>the new error is:</p>
  <blockquote>
  <p>'patient_id': vals['patient_id'],</p>
  <p>KeyError: 'patient_id'</p>
  </blockquote>