title: How can I set the attribute of a field to required=True or required=False based on the value of another field?
body: <p>I have a selection field in the <code>res.partner</code> model which is <code>employmentstatus</code> and the options there are <code>employed</code> 
  or <code>unemployed</code>. I want another field <code>employmenttype</code> have the attribute <code>required=True</code> if the <code>employmentstatus='employed'</code> 
  or <code>required=False</code> if the <code>employmentstatus='unemployed'</code>. The field right now sets required to True  whether Partner is 
  employed or not (See attached image <a href="https://photos.google.com/share/AF1QipMaZK-y77T2GqSg7UFkRSIZvsJQOnZAswvEEeY-bcQTxsFt8ACBd2Elw9vjSJOi6w?key=NVNaSDBXazdaQ0kwSWx3MF8ycDQydUJ6QUdaZm5n" rel="nofollow noreferrer">here</a>).</p>
  
  <p>Here is my code:</p>
  
  <pre><code>from openerp.osv import osv, fields
  from openerp import tools
  class custom_fields_partner(osv.Model):
      _inherit = 'res.partner'
      _columns = {
          'employmentstatus' : fields.selection([
          ('employed','Employed'),
          ('unemployed','Unemployed')
          ],'Employment status', required=True, default='unemployed'),
          'employmenttype' : fields.selection([
          ('0','Public'),
          ('1','Private'),
          ('2','Mission')],'Nature of employment', required="fieldproperty"),
      }
  
      @api.one
      def fieldproperty(self):
          if self.employmentstatus == 'employed':
              return True
          else:
              return False
  </code></pre>