Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
4468 Weergaven

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
Annuleer
Beste antwoord

You try  (if o is your model object):

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

Avatar
Annuleer
Auteur

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.