title: How to show sales order field in the sales orderline by default using context in odoo 8.0?
body: <p>I have a field named sales_ship under sale.order model and another field named ship_sale in the sale.order.line. Now what I want is to have the selected sales_ship in the sales.order to come by default in the ship_sale in the  sale.order.line by default. How to do it by using context? Here is my full code.</p>
  
  <p><strong>py</strong>.</p>
  
  <pre class="lang-python prettyprint-override"><code>from openerp import models , fields 
  
  
  class ShipInfo (models.Model): 
      _name = "ship.ship"
      imo = fields.Char (string = "IMO" , size = 64 , required = True ) 
      hull_number = fields.Char (string = ' Hull Number ' , size = 64 , required = True ) 
      engine_number = fields.Char ( string = ' Engine Number ' , size = 64 , required = True ) 
      vessel_name = fields.Char ( string = 'Vessel Name' , size = 64 ) 
      build_year = fields.Char ( string = 'Build Year' , size = 64 ) 
  
      ship_yard = fields.Many2one ( 'res.partner' , string = 'Ship Yard') 
      ship_owner = fields.Many2one ( 'res.partner' , string = 'Ship Owner' ) 
      ship_management = fields.Many2one ( 'res.partner' ,string= 'Ship Management' ) 
      engine_builder = fields.Many2one ( 'res.partner' , string = 'Engine Builder' ) 
      _rec_name = 'vessel_name' 
  
  
  class SaleOrderInherited (models.Model): 
      _inherit = 'sale.order'
      sales_ship = fields.Many2one ( 'ship.ship' , string = 'Sales Ship' ) 
  
  class SaleOrderLineInherited (models.Model):
   _inherit = 'sale.order.line'
   ship_sale = fields.Many2one ( 'ship.ship' , string = 'Sales Ship')
  </code></pre>
  
  <p><strong>.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;openerp&gt;
  &lt;data&gt;
      &lt;menuitem id="ship_module" name="ship" parent="base.menu_base_config" action="action_view_ship" sequence="30"/&gt;
      &lt;!--&lt;menuitem id="ship_menu" name="ship information" parent="ship_module"/&gt;--&gt;
      &lt;record model="ir.ui.view" id="ship_form"&gt;
          &lt;field name="name"&gt;ship.ship.form.view&lt;/field&gt;
          &lt;field name="model"&gt;ship.ship&lt;/field&gt;
          &lt;field name="type"&gt;form&lt;/field&gt;
          &lt;field name="arch" type="xml"&gt;
                  &lt;form string="ship info"&gt;
                      &lt;sheet&gt;
                      &lt;group&gt;
                         &lt;group&gt; &lt;field name="imo"/&gt;
                          &lt;field name="hull_number"/&gt;
                          &lt;field name="engine_number"/&gt;
                          &lt;field name="vessel_name" context="{'sales_ship':sales_ship}"/&gt;
                          &lt;field name="build_year"/&gt;
                         &lt;/group&gt;
                          &lt;group&gt;
                          &lt;field name="ship_yard"/&gt;
                          &lt;field name="ship_owner"/&gt;
                          &lt;field name="ship_management"/&gt;
                          &lt;field name="engine_builder"/&gt;
                          &lt;/group&gt;
                      &lt;/group&gt;
                      &lt;/sheet&gt;
                  &lt;/form&gt;
          &lt;/field&gt;
      &lt;/record&gt;
  
       &lt;record model="ir.ui.view" id="ship_tree"&gt;
          &lt;field name="name"&gt;ship.ship.tree&lt;/field&gt;
          &lt;field name="model"&gt;ship.ship&lt;/field&gt;
          &lt;field name="type"&gt;tree&lt;/field&gt;
          &lt;field name="arch" type="xml"&gt;
                  &lt;tree string="ship info"&gt;
                          &lt;field name="imo"/&gt;
                          &lt;field name="hull_number"/&gt;
                          &lt;field name="engine_number"/&gt;
                          &lt;field name="vessel_name" context="{'sales_ship':sales_ship}"/&gt;
                          &lt;field name="build_year"/&gt;
                          &lt;field name="ship_yard"/&gt;
                          &lt;field name="ship_owner"/&gt;
                          &lt;field name="ship_management"/&gt;
                          &lt;field name="engine_builder"/&gt;
                  &lt;/tree&gt;
          &lt;/field&gt;
      &lt;/record&gt;
  
      &lt;record model="ir.actions.act_window" id="action_view_ship"&gt;
          &lt;field name="name"&gt;ship info&lt;/field&gt;
          &lt;field name="res_model"&gt;ship.ship&lt;/field&gt;
          &lt;field name="view_type"&gt;form&lt;/field&gt;
          &lt;field name="view_mode"&gt;tree,form&lt;/field&gt;
          &lt;field name="help" type="html"&gt;
              &lt;p class="oe_view_nocontent_create"&gt;Create new ship
              &lt;/p&gt;
          &lt;/field&gt;
      &lt;/record&gt;
  
  
      &lt;!--Inherit the sale order form view--&gt;
      &lt;record id="view_sale_order_custom" model="ir.ui.view"&gt;
      &lt;field name="name"&gt;sale.order.custom.form.inherited&lt;/field&gt;
      &lt;field name="model"&gt;sale.order&lt;/field&gt;
       &lt;field name="inherit_id" ref="sale.view_order_form"/&gt;
       &lt;field name="arch" type="xml"&gt;
        &lt;xpath expr="//field[@name='partner_id']" position="after"&gt;
             &lt;field name="sales_ship" context="{'sales_ship':sales_ship}"/&gt;
        &lt;/xpath&gt;
           &lt;xpath expr="/form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='name']" position="after"&gt;
                  &lt;field name="ship_sale" context="{'sales_ship':sales_ship}"/&gt;
           &lt;/xpath&gt;
            &lt;group&gt;
               &lt;button string="Add to Order Line"/&gt;
            &lt;/group&gt;
       &lt;/field&gt;
      &lt;/record&gt;
  &lt;/data&gt;
  </code></pre>
  
  <p></p>