title: ValueError Mixing apples and oranges: my.model() < False - Odoo v8
body: <p>I have this wizard button, which saves fields as records on a table:</p>
  
  <pre><code>@api.multi
  def save_data(self, vals):
      vals = {
          self.name : 'name',
          self.date_production : 'date_production',
          self.type_prod : 'type_prod',
          self.product_id : 'product_id',
          self.qty_available : 'qty_available',
          self.print_order2 : 'print_order2',
          self.name_block : 'name_block',
          }
      self.env['bsi.production.order'].create(vals)
  </code></pre>
  
  <p>This is a step by step wizard, these are the original fields on my model:</p>
  
  <pre><code>class bsi_production_order(models.Model):
  _name = 'bsi.production.order'
  _inherit = ['mail.thread','text.paper','book.binding', 'book.block','book.edge','book.edition','book.size','cut.off','end.paper','job.rate','paper.master','printing.code', 'mrp.worksheet.contract', 'work.order.isbn.code', 'product.template'] 
  
  @api.model
  def create(self, vals):
      if vals.get('name', 'New') == 'New':
          vals['name'] = self.env['ir.sequence'].next_by_code('bsi.production.order') or '/'
      return super(bsi_production_order, self).create(vals)
  
      name = fields.Char('Reference', required=True, index=True, copy=False, readonly='True', default='New')
      date_production = fields.Date(string="Production Date")
      type_prod = fields.Selection([
          ('budgeted','Budgeted'),
          ('nonbudgeted','Non Budgeted'),
          ('direct','Direct Order'),
      ], string='Type of Order', index=True,  
      track_visibility='onchange', copy=False,
      help=" ")
      product_id = fields.Many2one('product.template', string="Product")
      qty_available = fields.Float(string="Qty Available", related="product_id.qty_available")
      production_qty = fields.Float(string="Qty to produce")
      print_order2 = fields.Many2one('bsi.print.order', string="Print Order")
      book_block = fields.Many2one('book.block', )
      name_block = fields.Selection(string="Code", related="book_block.name_block", store=True)
  </code></pre>
  
  <p>When I try to save the records from the wizard it says:</p>
  
  <pre><code>    ValueError
  
  Mixing apples and oranges: bsi.print.order() &lt; False
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is definitely something related to <code>Many2one</code> and/or <code>One2many</code> fields, I've got another error like this with another field, which is a <code>Many2one</code> type of field.</p>
  
  <p>There is also something curious that might have something to do with it, and is the fact that when I save a <code>bsi.production.order</code> in the traditional form way, not by wizard, the Many2one <code>related</code> fields are shown, but when I save the new record, they just got empty somehow, it's like it doesn't save them for some reason, I've added the <code>store=True</code> flag to them, but still the same behaviour.</p>
  
  <p><strong>Second Edit</strong></p>
  
  <p>Full stack trace:</p>
  
  <pre><code>2017-08-26 22:42:46,786 1688 ERROR bsi_def openerp.http: Exception during JSON request handling.
  Traceback (most recent call last):
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\http.py", line 546, in _handle_exception
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\http.py", line 583, in dispatch
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\http.py", line 319, in _call_function
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\service\model.py", line 118, in wrapper
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\http.py", line 316, in checked_call
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\http.py", line 812, in __call__
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\http.py", line 412, in response_wrap
  File "C:\Program Files\Odoo 8.0-20170809\server\openerp\addons\web\controllers\main.py", line 948, in call_button
  File "C:\Program Files\Odoo 8.0-20170809\server\openerp\addons\web\controllers\main.py", line 936, in _call_kw
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\api.py", line 268, in wrapper
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\api.py", line 399, in old_api
  File "C:\Program Files\Odoo 8.0-20170809\server\openerp\addons\mrp_worksheet_contract\models\models.py", line 780, in save_data
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\api.py", line 266, in wrapper
  File "C:\Program Files\Odoo 8.0-20170809\server\openerp\addons\mrp_worksheet_contract\models\models.py", line 476, in create
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\api.py", line 266, in wrapper
  File "C:\Program Files\Odoo 8.0-20170809\server\openerp\addons\mrp_worksheet_contract\models\models.py", line 15, in create
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\api.py", line 266, in wrapper
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\api.py", line 508, in new_api
  File "C:\Program Files\Odoo 8.0-20170809\server\openerp\addons\product\product.py", line 742, in create
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\api.py", line 268, in wrapper
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\api.py", line 372, in old_api
  File "C:\Program Files\Odoo 8.0-20170809\server\openerp\addons\mrp_work_order_isbn\models\models.py", line 28, in create
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\api.py", line 266, in wrapper
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\api.py", line 508, in new_api
  File "C:\Program Files\Odoo 8.0-20170809\server\openerp\addons\mail\mail_thread.py", line 381, in create
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\api.py", line 268, in wrapper
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\api.py", line 372, in old_api
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\models.py", line 4101, in create
  File "C:\Program Files\Odoo 8.0-20170809\server\.\openerp\models.py", line 5608, in __lt__
  except_orm: ('ValueError', 'Mixing apples and oranges: bsi.print.order() &lt; False')
  </code></pre>