Hi good people.
I am creating an addon to add a questionnaire to the partners view. I want this to be done under a "Questionnaire" tab that I have added to the partners view.
I have created the questionnaire model as follows
class customer_questionnaire(osv.osv):
_name = "customer.questionnaire"
_columns = {
#'partner': fields.many2one('res.partner', 'Partner', ondelete='cascade', select=1),
'name': fields.char('Name', size=15, required=True), #several fields
I then extend Partners object as follows to add a questionnaire field:
class Partner(osv.osv):
'''Partner'''
_inherit = 'res.partner'
_columns = {
'questionnaire': fields.one2many('customer.questionnaire', 'partner', 'Confidential Questionnaire', help="Click to view/edit user's confidential questionnaire."),
}
Here is the view that is adding the tab under customers page and a questionnaire field with a tree:
<page string='Questionnaire'>
<separator string="Customer Questionnaire" colspan="4" />
<field name="questionnaire" nolabel="1" colspan="4" readonly="1">
<tree string="Questionnaires">
<field name="work_hours" />
<field name="commute" />
</tree>
<form string="Questionnaires">
<field name="work_hours" />
<field name="commute" />
</form>
</field>
</page>
This still doesnt open the questionnaire view in pop up. I suppose I am missing something. What am I doing wrong? Can someone please outline the steps that I need to follow to open the questionnaire when I click on a row in the tab. Like how the contacts tab under company customers is made.
Thank you