title: Odoo 8.0. Creating slave records in code
body: <p>I have 2 tables with the <code>one2many</code> relation. I want to create a set of records in the slave table after changing a name value in master table. But I have an error:</p>
  
  <blockquote>
    <p>File "C:\odoo80\openerp\addons-custom\att\agreement.py", line 18, in
    _onchange_name</p>
    
    <p>self.pool['att.agreement.line'].create({'agreement_id': id , 'name': str(x), 'qty': x * 100} )</p>
    
    <p>File "C:\odoo80\openerp\api.py", line 250, in wrapper
                return old_api(self, *args, **kwargs)</p>
    
    <p>TypeError: create() takes at least 4 arguments (2 given)</p>
  </blockquote>
  
  <p><strong>My classes are:</strong></p>
  
  <pre><code>    class Agreement(models.Model):
      _name = 'att.agreement'
      line_id = fields.One2many('att.agreement.line','agreement_id', 'Lines', copy=True )
      name = fields.Char(string='Name', required=True)
  
      def create(self, cr, uid, values, context=None):
          return super(Agreement, self).create(cr, uid, values, context)
  
      @api.onchange('name')
      def _onchange_name(self):
          if (self.name):
             for x in range(1,5,1):
                 self.pool['att.agreement.line'].create({'agreement_id': id , 'name': str(x), 'qty': x * 100} )
  
      class AgreementLine(models.Model):
      _name = 'att.agreement.line'
      agreement_id = fields.Many2one('att.agreement', ondelete='cascade', select=True ) # required=True ,readonly = True
      name = fields.Char(string='Name', required=True)
      qty  = fields.Integer(string = 'Qty')
  
      def create(self, cr, uid, values, context=None):
          id = super(AgreementLine, self).create(cr, uid, values, context)
          return id
  </code></pre>
  
  <p><strong>My view is:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
       &lt;openerp&gt;
          &lt;data&gt;
              &lt;!-- form AGREEMENT --&gt;
              &lt;record model="ir.ui.view" id="att_agreement_view_form"&gt;
                  &lt;field name="name"&gt;Agreement&lt;/field&gt;
                  &lt;field name="model"&gt;att.agreement&lt;/field&gt;
                  &lt;field name="arch" type="xml"&gt;
                  &lt;form string="Agreement"&gt;
                          &lt;sheet&gt;
                              &lt;group colspan="4"&gt;
                                  &lt;group&gt;
                                      &lt;field name="name"/&gt;
                                  &lt;/group&gt;
                              &lt;/group&gt;
                               &lt;notebook&gt;
                                      &lt;page string="Agreement Lines"&gt;
                                          &lt;tree string="Agreement Lines"  create ='false'&gt;
                                              &lt;field name="line_id" &gt;
                                                      &lt;field name = "id"/&gt;
                                                      &lt;field name="name"/&gt;
                                                      &lt;field name="qty"/&gt;
                                              &lt;/field&gt;
                                          &lt;/tree&gt;
                                      &lt;/page&gt;
                               &lt;/notebook&gt;
                          &lt;/sheet&gt;
                  &lt;/form&gt;
                  &lt;/field&gt;
              &lt;/record&gt;
  
              &lt;record model="ir.ui.view" id="att_agreement_view_tree"&gt;
                  &lt;field name="name"&gt;List of agreement&lt;/field&gt;
                  &lt;field name="model"&gt;att.agreement&lt;/field&gt;
                  &lt;field name="arch" type="xml"&gt;
                      &lt;tree string="List of agreements"&gt;
                          &lt;field name="name"/&gt;
                      &lt;/tree&gt;
                  &lt;/field&gt;
              &lt;/record&gt;
  
              &lt;!-- window action --&gt;
              &lt;record model="ir.actions.act_window" id="att_agreement_list_action"&gt;
                  &lt;field name="name"&gt;Agreement&lt;/field&gt;
                  &lt;field name="res_model"&gt;att.agreement&lt;/field&gt;
                  &lt;field name="view_mode"&gt;tree,form&lt;/field&gt;
              &lt;/record&gt;
  
              &lt;menuitem id="att_agreement_menuitem" name="Соглашения"
                        parent="att_menu_agreement"
                        action="att_agreement_list_action"/&gt;
          &lt;/data&gt;
      &lt;/openerp&gt;
  </code></pre>
  
  <p>Can anybody help me?</p>