parameters: (self, values)
return_statement: return res
docstring: Deduce missing required fields from the onchange
docstring_summary: Deduce missing required fields from the onchange
docstring_tokens: Deduce missing required fields from the onchange
function: def _prepare_add_missing_fields(self, values):
          """ Deduce missing required fields from the onchange """
          res = {}
          onchange_fields = ['name', 'price_unit', 'product_qty', 'product_uom', 'taxes_id', 'date_planned']
          if values.get('order_id') and values.get('product_id') and any(f not in values for f in onchange_fields):
              line = self.new(values)
              line.onchange_product_id()
              for field in onchange_fields:
                  if field not in values:
                      res[field] = line._fields[field].convert_to_write(line[field], line)
          return res
function_tokens: def _prepare_add_missing_fields ( self , values ) : res = { } onchange_fields = [ 'name' , 'price_unit' , 'product_qty' , 'product_uom' , 'taxes_id' , 'date_planned' ] if values . get ( 'order_id' ) and values . get ( 'product_id' ) and any ( f not in values for f in onchange_fields ) : line = self . new ( values ) line . onchange_product_id ( ) for field in onchange_fields : if field not in values : res [ field ] = line . _fields [ field ] . convert_to_write ( line [ field ] , line ) return res