My ticket has many comments and I created a view for my comment and make a One2Many field in ticket model. But it is not displaying my desired view. Here is my model
class Ticket(model.Model):
_name = 'Tickets'
comment_ids = fields.One2many('comments', 'comment_id')
Here my second model
class Comments(models.Model):
_name = 'comments'
comment = fields.Text(string="Comment")
comment_id = fields.Char(string='Comment Id')
Here is my Ticket's View:
<notebook>
<page name="body" string="Body">
<field name="comment_ids" />
</page>
</notebook>
Here is my Comment's Form View:
<form>
<div class="form-group">
<label name="comment">Comment:</label>
<textarea class="form-control" rows="5" />
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
Here is my Comment's Tree View:
<tree>
<field name = 'comment_id'/>
<field name = 'comment'/>
</tree>