我需要将表单的 one2many 字段中的数据发送到向导的 one2many 字段[单击按钮打开]..向导包含相同格式的 one2many 字段..如何实现这一点?
家长班
class wrhouse(models.Model):
wproductlist = fields.One2many(comodel_name="productlist1", inverse_name="ppp", string="Product List")
@api.multi
def Submittopm(self):
result = {
'view_type': 'form',
'view_mode': 'form',
'res_model': 'submitquantwiz',
'name': 'Enter Quantity of Stock Needed',
'type': 'ir.actions.act_window',
'target': 'new',
}
return result
class productlist1(models.Model)
_name = "productlist1"
ppp = fields.Char(String="hai")
_rec_name = "productname"
productname = fields.Char(string="Product Name")
reqquantity = fields.Char(string="Required Quantity")
quantav = fields.Char(string="Product Available", onchange="pro_quantity")
maxdate = fields.Date(string="Deadline Date")
巫师类
class wrhousesub(models.TransientModel):
_name = 'submitquantwiz'
No = fields.One2many(comodel_name="id",inverse_name="quant",string="Products")
class wr(models.Model):
_name = "id"
# p = fields.Char(string="ff")
products = fields.Many2one(comodel_name='productlist1',string="Product")
quant = fields.Char(string="Quntities")