Skip to Content
मेन्यू
This question has been flagged
1 Reply
4462 Views

I am trying to change the contact us form. I want to put one drop down list based on my custom module. I am trying to show this custom model values in that drop down list (like many2one field.).

I am following this way.

I have written a custom model and inherited contact form.

##################models.py###################

class website_contact_for(osv.Model):
    _name = "website.contact.for"
    _columns = {
        'name' : fields.char('Style Name', required=True),
    }
    def getcontactfor(self):
        return self.search(cr,uid,[])

#####################################################

I have written   <t t-set="websitecontactfor_value_ids" t-value="getcontactfor()"/>  line in my xml file. It is giving ""'NoneType' object is not callable" while evaluating 'getcontactfor()'" error. All my files is there in my custom module itself. Can any one please help me?

 

Avatar
Discard
Best Answer

You try  (if o is your model object):

<t t-set="websitecontactfor_value_ids" t-value="o.getcontactfor()"/>

Avatar
Discard
Author

Thank you Zbik, Where can i create this Object o?

o is an standard model object in report. You do not need to create it.