[IMP] start the portal's contact page new layout

bzr revid: abo@openerp.com-20120629125209-03wbu806i8mi2ab7
This commit is contained in:
Antonin Bourguignon 2012-06-29 14:52:09 +02:00
parent 335f198eed
commit e0e7597aa0
2 changed files with 63 additions and 10 deletions

View File

@ -5,6 +5,23 @@ class crm_contact_us(osv.TransientModel):
_name = 'portal_crm.crm_contact_us'
_description = 'Contact form for the portal'
_inherit = 'crm.lead'
_columns = {
'company_ids' : fields.many2many('res.company', string='Companies', readonly=True),
'employee_ids' : fields.many2many('hr.employee', string='Employees', readonly=True),
}
def _get_employee(self, cr, uid, context=None):
r = self.pool.get('hr.employee').search(cr, uid, [], context=context)
return r
def _get_companies(self, cr, uid, context=None):
r = self.pool.get('res.company').search(cr, uid, [], context=context)
return r
_defaults = {
'employee_ids' : _get_employee,
'company_ids' : _get_companies
}
def create(self, cr, uid, values, context=None):
"""

View File

@ -8,16 +8,52 @@
<field name="model">portal_crm.crm_contact_us</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Contact Us wizard view">
<group col="2">
<field name="contact_name" string="Name"/>
<field name="name" string="Company"/>
<field name="email_from"/>
<field name="phone"/>
<field name="description" string="Your question"/>
<label string=""/>
<button string="Submit" name="submit" type="object"/>
</group>
<form string="Contact Us wizard view" version="7.0">
<div style="width: 960px; margin: 0 auto;">
<table>
<tr>
<td width="80%%">
<group>
<field name="contact_name" string="Name"/>
<field name="name" string="Company"/>
<field name="email_from"/>
<field name="phone"/>
<field name="description" string="Your question"/>
<label string=""/>
<button string="Submit" name="submit" type="object"/>
</group>
<field name="employee_ids"/>
</td>
<td>
<field name="company_ids" widget="many2many_kanban">
<kanban>
<field name="name"/>
<field name="email"/>
<field name="phone"/>
<field name="street"/>
<field name="street2"/>
<field name="zip"/>
<field name="city"/>
<field name="country_id"/>
<field name="state_id"/>
<templates>
<t t-name="kanban-box">
<div style="position: relative">
<!-- <img t-att-src="kanban_image('res.partner', 'photo', record.id.value)" class="oe_avatar oe_kanban_avatar_toto"/> -->
<h4><field name="name"/></h4>
<a t-if="record.email.raw_value" title="Mail" t-att-href="'mailto:'+record.email.value" style="text-decoration: none;" >
<field name="email"/>
</a>
</div>
</t>
</templates>
</kanban>
</field>
</td>
</tr>
</table>
</div>
</form>
</field>
</record>