[FIX] minor fixes and improvements

assign the leads to the right uid
remove the target attribute in the form view and render it 'inline' (not in a popup)
add fields to the contact us form view

bzr revid: abo@openerp.com-20120525152738-kf799ejmqi2yclav
This commit is contained in:
Antonin Bourguignon 2012-05-25 17:27:38 +02:00
parent 54de5b4f8a
commit c49ffec86e
2 changed files with 18 additions and 5 deletions

View File

@ -24,7 +24,8 @@ class crm_contact_us(osv.TransientModel):
Therefore, user #1 will perform the creation until a better workaround
is figured out.
"""
crm_lead.create(cr, 1, dict(values,create_uid=uid), context)
#todo: add all the extra values in the 'description' field
crm_lead.create(cr, 1, dict(values,user_id=uid), context)
""" Create an empty record in the portal_crm.crm_contact_us table """
return super(crm_contact_us, self).create(cr, uid, {})

View File

@ -7,9 +7,8 @@
<field name="name">Contact Us</field>
<field name="res_model">portal_crm.crm_contact_us</field>
<field name="view_mode">form</field>
<field name="target">inline</field>
</record>
<!-- attach it to the portal menu -->
<menuitem name="Contact Us" id="portal_company_contact"
parent="portal.portal_company" action="action_wizard_contact_us"/>
@ -22,8 +21,21 @@
<field name="arch" type="xml">
<form string="Contact Us wizard view">
<group col="2">
<field name="name"/>
<field name="contact_name" string="Name"/>
<field name="name" string="Company"/>
<field name="function" string="Job title"/>
<!--
copy the value of the field "name" in "partner_name"
<field name="partner_name"/>
-->
<field name="email_from"/>
<field name="phone"/>
<field name="city"/>
<field name="zip" string="Zip code"/>
<field name="state_id"/>
<field name="country_id"/>
<field name="description" string="Comment"/>
<group colspan="2">
<button string="Submit" icon="gtk-ok" name="submit" type="object"/>
</group>
@ -47,7 +59,7 @@
records and this will result in a permission denied error
-->
<field name="name" invisible="1"/>
<label string="Thank you"/>
<label string="Thank you for your interest, we'll respond to your request shortly."/>
</form>
</field>
</record>