[IMP] give a try to the sheet layout
also fix a problem in the contact form by assigning a proper value to the field 'name' bzr revid: abo@openerp.com-20120702172748-j6bqm501gnlmrobj
This commit is contained in:
parent
504c544d1c
commit
376af6f33f
|
@ -4,9 +4,7 @@
|
||||||
|
|
||||||
/* Root container */
|
/* Root container */
|
||||||
.openerp .oe_portal_crm_contact {
|
.openerp .oe_portal_crm_contact {
|
||||||
width: 800px;
|
width: 100%;
|
||||||
margin: 0 auto;
|
|
||||||
padding: 20px 0 0 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sections containers */
|
/* Sections containers */
|
||||||
|
@ -50,7 +48,7 @@
|
||||||
/* background is defined directly in the view itself */
|
/* background is defined directly in the view itself */
|
||||||
}
|
}
|
||||||
.openerp .oe_portal_crm_contact .oe_portal_crm_callout .oe_portal_crm_background_wrapper {
|
.openerp .oe_portal_crm_contact .oe_portal_crm_callout .oe_portal_crm_background_wrapper {
|
||||||
height: 180px;
|
height: 120px;
|
||||||
border-bottom: 1px solid #4C4C4C;
|
border-bottom: 1px solid #4C4C4C;
|
||||||
border-top: 1px solid #4C4C4C;
|
border-top: 1px solid #4C4C4C;
|
||||||
padding: 5px 0;
|
padding: 5px 0;
|
||||||
|
@ -78,9 +76,5 @@
|
||||||
|
|
||||||
/* Employees list section */
|
/* Employees list section */
|
||||||
.openerp .oe_portal_crm_contact .oe_portal_crm_team .oe_fold_column.oe_kanban_record {
|
.openerp .oe_portal_crm_contact .oe_portal_crm_team .oe_fold_column.oe_kanban_record {
|
||||||
width: 250px;
|
|
||||||
border: 1px solid #D8D8D8;
|
}
|
||||||
border-bottom-color: #B9B9B9;
|
|
||||||
margin: 0 5px 5px 0;
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
|
@ -24,27 +24,32 @@ class crm_contact_us(osv.TransientModel):
|
||||||
}
|
}
|
||||||
|
|
||||||
def create(self, cr, uid, values, context=None):
|
def create(self, cr, uid, values, context=None):
|
||||||
"""
|
"""
|
||||||
Since they potentially sensitive, we don't want any user to be able to
|
Since they potentially sensitive, we don't want any user to be able to
|
||||||
read datas generated through this module. That's why we'll write those
|
read datas generated through this module. That's why we'll write those
|
||||||
information in the crm.lead table and leave blank entries in the
|
information in the crm.lead table and leave blank entries in the
|
||||||
portal_crm.crm_contact_us table. This is why the create() method is
|
portal_crm.crm_contact_us table. This is why the create() method is
|
||||||
overridden.
|
overridden.
|
||||||
"""
|
"""
|
||||||
crm_lead = self.pool.get('crm.lead')
|
crm_lead = self.pool.get('crm.lead')
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Because of the complex inheritance of the crm.lead model and the other
|
Because of the complex inheritance of the crm.lead model and the other
|
||||||
models implied (like mail.thread, among others, that performs a read
|
models implied (like mail.thread, among others, that performs a read
|
||||||
when its create() method is called (in method message_get_subscribers()),
|
when its create() method is called (in method message_get_subscribers()),
|
||||||
it is quite complicated to set proper rights for this object.
|
it is quite complicated to set proper rights for this object.
|
||||||
Therefore, user #1 will perform the creation until a better workaround
|
Therefore, user #1 will perform the creation until a better workaround
|
||||||
is figured out.
|
is figured out.
|
||||||
"""
|
"""
|
||||||
|
values['name'] = values['contact_name']
|
||||||
|
print values
|
||||||
crm_lead.create(cr, 1, dict(values,user_id=False), context)
|
crm_lead.create(cr, 1, dict(values,user_id=False), context)
|
||||||
|
|
||||||
""" Create an empty record in the portal_crm.crm_contact_us table """
|
"""
|
||||||
return super(crm_contact_us, self).create(cr, uid, {})
|
Create an empty record in the portal_crm.crm_contact_us table.
|
||||||
|
Since the 'name' field is mandatory, give an empty string to avoid an integrity error.
|
||||||
|
"""
|
||||||
|
return super(crm_contact_us, self).create(cr, uid, {'name': ' '})
|
||||||
|
|
||||||
def submit(self, cr, uid, ids, context=None):
|
def submit(self, cr, uid, ids, context=None):
|
||||||
""" When the form is submitted, redirect the user to a "Thanks" message """
|
""" When the form is submitted, redirect the user to a "Thanks" message """
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
<field name="type">form</field>
|
<field name="type">form</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Contact wizard view" version="7.0">
|
<form string="Contact wizard view" version="7.0">
|
||||||
|
<sheet>
|
||||||
<div class="oe_portal_crm_contact">
|
<div class="oe_portal_crm_contact">
|
||||||
<div class="oe_portal_crm_callout">
|
<div class="oe_portal_crm_callout">
|
||||||
<h1>Contact OpenERP</h1>
|
<h1>Contact OpenERP</h1>
|
||||||
|
@ -101,6 +102,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</sheet>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
Loading…
Reference in New Issue