title: Generating a sequence using a field value of other class in the same model file
body: <p>I am trying to create a sequence that would be on the form_serial_no field of a formdownload model at the click of save button. This form_serial_no field will pick the company_short_code field of companyname model in the same models.py file and padded it with seven(7) digit number e.g CHN0000001 where CHN is the value of company_short_code field and 0000001 is the first sequence of the record.
  Below are my code snippets:</p>
  
  <p>models.py code</p>
  
  <pre><code>class CompanyName(models.Model):
  
      _name = 'companyname'
      _rec_name = 'company_name'
  
      company_name = fields.Char(string="Company Name", required=True)
      company_short_code = fields.Char(string="Company short code", required=True)
  
  class FormDownload(models.Model):
  
      _name = 'formdownload'
  
      name = fields.Many2one('companyname', string="Company Name", ondelete='cascade',
                                        required=True)
      form_serial_no = fields.Char(string="Form Serial No", readonly=True)
      status = fields.Boolean(string="Status", default=False)
  
      @api.model
      def create(self, vals):
          vals['form_serial_no'] = vals['name']
          if vals:
              vals['form_serial_no'] = self.env['ir.sequence'].get('formdownload')
  
              return super(FormDownload, self).create(vals)
  </code></pre>
  
  <p>sequences.xml code</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;openerp&gt;
       &lt;data noupdate="1"&gt;
          &lt;!-- Sequence for form download serial number --&gt;
          &lt;record id="ref_code_form_serial_no" model="ir.sequence.type"&gt;
            &lt;field name="name"&gt;Sequence for form download serial number&lt;/field&gt;
            &lt;field name="code"&gt;formdownload.form_serial_no&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record id="seq_form_serial_no" model="ir.sequence"&gt;
            &lt;field name="name"&gt;Sequence for form download serial number&lt;/field&gt;
            &lt;field name="code"&gt;formdownload.form_serial_no&lt;/field&gt;
            &lt;field name="prefix"&gt;company_short_code&lt;/field&gt;
            &lt;field name="padding"&gt;7&lt;/field&gt;
            &lt;field name="company_id" eval="False"/&gt;
           &lt;/record&gt;
       &lt;/data&gt;
    &lt;/openerp&gt;
  </code></pre>
  
  <p>When i check the formdownload table there is no record created for form_serial_no field. Kindly help me look into this.</p>