Hi Gowraw
hasOne creates a new field of class Field_Relation. It’s method destruct() will remove the feehead field also, to avoid any field referencing the feedead_id field.
You should rather hide the field and there are several ways to do that:
1) ->visible(false) - will hide field from the grid and from the select
2) ->system(true) - will hide the field from the grid, but would have it in the query regardless.
3) $grid->setModel(‘Fee’, array(’name’,’amount’,’isOptional’)); - explicitly sets which fields to display. All of the named fields must be present and be visible. This also affects the order in which columns appear.
4) you can manually add columns. $grid->setModel(‘Fee’, false); will only initialize controller. You can subsequently call $grid->controller->importField(’name’); which will initialize column.
romans