[IMP] Minor improvements in portal views, such as contact and employees. Improved menus and string on empty views. Send the password when a partner is invited to portal via sidebar menu.
bzr revid: vta@openerp.com-20121116075305-4d0olu5zlvwsxeq8
This commit is contained in:
@@ -8,18 +8,18 @@
|
||||
groups="base.group_no_one,portal.group_portal"
|
||||
sequence="20"/>
|
||||
|
||||
<menuitem name="Our company" id="portal_company" parent="portal_menu" sequence="10"/>
|
||||
<menuitem name="News" id="portal_company_news" parent="portal_company" sequence="10" action="action_news"/>
|
||||
<menuitem name="Jobs" id="portal_jobs" parent="portal_company" sequence="20" action="action_jobs"/>
|
||||
<menuitem name="Messaging" id="portal_messages" parent="portal_menu" sequence="10"/>
|
||||
<menuitem name="About Us" id="portal_company" parent="portal_menu" sequence="20"/>
|
||||
<menuitem name="News" id="portal_company_news" parent="portal_company" sequence="10" action="action_news"/>
|
||||
<menuitem name="Jobs" id="portal_jobs" parent="portal_company" sequence="20" action="action_jobs"/>
|
||||
|
||||
<!--
|
||||
Create menu items that we'll leave empty for now - they'll be
|
||||
filled up by other portal modules.
|
||||
-->
|
||||
<menuitem name="Orders" id="portal_orders" parent="portal_menu" sequence="20"/>
|
||||
<menuitem name="Invoices and Payments" id="portal_invoices_payements" parent="portal_menu" sequence="30"/>
|
||||
<menuitem name="Projects" id="portal_projects" parent="portal_menu" sequence="40"/>
|
||||
<menuitem name="After Sale Services" id="portal_after_sales" parent="portal_menu" sequence="50"/>
|
||||
<!--
|
||||
Create menu items that we'll leave empty for now - they'll be
|
||||
filled up by other portal modules.
|
||||
-->
|
||||
<menuitem name="Quotations and Sales Orders" id="portal_orders" parent="portal_menu" sequence="30"/>
|
||||
<menuitem name="After Sale Services" id="portal_after_sales" parent="portal_menu" sequence="40"/>
|
||||
<menuitem name="Projects" id="portal_projects" parent="portal_menu" sequence="50"/>
|
||||
|
||||
<!-- extend res.groups search view -->
|
||||
<record id="group_search_view" model="ir.ui.view">
|
||||
@@ -47,5 +47,12 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Inbox" id="portal_inbox" parent="portal_messages"
|
||||
action="mail.action_mail_inbox_feeds" sequence="10"/>
|
||||
<menuitem name="Archives" id="portal_tome" parent="portal_messages"
|
||||
action="mail.action_mail_archives_feeds" sequence="20"/>
|
||||
<menuitem name="Sent" id="portal_sent" parent="portal_messages"
|
||||
action="mail.action_mail_sent_feeds" sequence="30"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -39,6 +39,7 @@ You have been given access to %(portal)s.
|
||||
Your login account data is:
|
||||
Database: %(db)s
|
||||
Username: %(login)s
|
||||
Password: %(password)s
|
||||
|
||||
In order to complete the signin process, click on the following url:
|
||||
%(url)s
|
||||
@@ -210,6 +211,7 @@ class wizard_user(osv.osv_memory):
|
||||
'name': user.name,
|
||||
'login': user.login,
|
||||
'url': user.signup_url,
|
||||
'password': user.password,
|
||||
}
|
||||
mail_mail = self.pool.get('mail.mail')
|
||||
mail_values = {
|
||||
@@ -219,6 +221,7 @@ class wizard_user(osv.osv_memory):
|
||||
'body_html': '<pre>%s</pre>' % (_(WELCOME_EMAIL_BODY) % data),
|
||||
'state': 'outgoing',
|
||||
}
|
||||
return mail_mail.create(cr, uid, mail_values, context=this_context)
|
||||
mail_id = mail_mail.create(cr, uid, mail_values, context=this_context)
|
||||
return mail_mail.send(cr, uid, [mail_id], context=this_context)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -28,6 +28,8 @@ class crm_contact_us(osv.TransientModel):
|
||||
_description = 'Contact form for the portal'
|
||||
_inherit = 'crm.lead'
|
||||
_columns = {
|
||||
'subject' : fields.char('Subject', required=True),
|
||||
'body' : fields.text('Content', required=True),
|
||||
'company_ids' : fields.many2many('res.company', string='Companies', readonly=True),
|
||||
}
|
||||
|
||||
@@ -95,7 +97,10 @@ class crm_contact_us(osv.TransientModel):
|
||||
it is quite complicated to set proper rights for this object.
|
||||
Therefore, user SUPERUSER_ID will perform the creation.
|
||||
"""
|
||||
values['contact_name'] = values['name']
|
||||
print values
|
||||
values['name'] = values['subject']
|
||||
values['contact_name'] = values['partner_name']
|
||||
values['description'] = values['body']
|
||||
crm_lead.create(cr, SUPERUSER_ID, dict(values,user_id=False), context)
|
||||
|
||||
"""
|
||||
@@ -114,7 +119,7 @@ class crm_contact_us(osv.TransientModel):
|
||||
'res_model': self._name,
|
||||
'res_id': ids[0],
|
||||
'view_id': self.pool.get('ir.model.data').get_object_reference(cr, uid, 'portal_crm', 'wizard_contact_form_view_thanks')[1],
|
||||
'target': 'inline',
|
||||
'target': 'new',
|
||||
}
|
||||
|
||||
def _needaction_domain_get(self, cr, uid, context=None):
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- wizard form view -->
|
||||
<record id="wizard_contact_form_view" model="ir.ui.view">
|
||||
<record id="contact_form_view" model="ir.ui.view">
|
||||
<field name="name">Wizard form view</field>
|
||||
<field name="model">portal_crm.crm_contact_us</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Contact wizard view" version="7.0">
|
||||
<div class="oe_portal_crm_contact">
|
||||
<sheet>
|
||||
<h1>Contact us</h1>
|
||||
<table>
|
||||
<tr>
|
||||
<td width="70%%">
|
||||
<div class="oe_portal_crm_contact_form">
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="partner_name"/>
|
||||
<field name="email_from"/>
|
||||
<field name="phone"/>
|
||||
<field name="description"/>
|
||||
<group class="oe_portal_crm_contact">
|
||||
<group col="6">
|
||||
<group class="oe_portal_crm_contact_form" colspan="4">
|
||||
<field name="partner_name" invisible="1"/>
|
||||
<field name="email_from" invisible="1"/>
|
||||
<field name="phone" nolabel="1" placeholder="Your phone number..."/>
|
||||
<field name="subject" nolabel="1" placeholder="Subject..." colspan="6"/>
|
||||
<field name="body" nolabel="1" placeholder="Content..." colspan="6"/>
|
||||
<button string="Submit" name="submit" type="object"/>
|
||||
</group>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="oe_portal_crm_office">
|
||||
<field name="company_ids" widget="many2many_kanban">
|
||||
</group>
|
||||
<group class="oe_portal_crm_office">
|
||||
<field name="company_ids" nolabel="1" widget="many2many_kanban">
|
||||
<kanban>
|
||||
<field name="name"/>
|
||||
<field name="email"/>
|
||||
@@ -59,18 +53,13 @@
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="oe_portal_crm_team">
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<!-- <group>
|
||||
<div class="oe_portal_crm_team"></div>
|
||||
</group> -->
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -88,15 +77,14 @@
|
||||
otherwise the orm will try to select all the model's
|
||||
records and this will result in a permission denied error
|
||||
-->
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="partner_name" invisible="1"/>
|
||||
<label string="Thank you for your interest, we'll respond to your request shortly."/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- wizard action -->
|
||||
<record id="action_wizard_contact_us" model="ir.actions.act_window">
|
||||
<field name="name">Contact</field>
|
||||
<record id="action_contact_us" model="ir.actions.act_window">
|
||||
<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>
|
||||
@@ -104,7 +92,7 @@
|
||||
|
||||
<!-- attach it to the portal menu -->
|
||||
<menuitem name="Contact" id="portal_company_contact"
|
||||
parent="portal.portal_company" action="action_wizard_contact_us" sequence="30"/>
|
||||
parent="portal.portal_company" action="action_contact_us" sequence="40"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
<field name="name">Events</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">event.event</field>
|
||||
<field name="view_mode">kanban,calendar,tree,form,graph</field>
|
||||
<field name="view_mode">kanban,calendar,tree,form</field>
|
||||
<field name="context">{"search_default_upcoming":1}</field>
|
||||
<field name="search_view_id" ref="event.view_event_search"/>
|
||||
<field name="help">There are no public events.</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Events" id="portal_company_events" parent="portal.portal_company"
|
||||
action="action_event_view" sequence="40"/>
|
||||
action="action_event_view" sequence="30"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data>
|
||||
|
||||
<!-- add visibility field to the employee form view -->
|
||||
<record id="view_employee_form" model="ir.ui.view">
|
||||
@@ -15,42 +15,51 @@
|
||||
</record>
|
||||
|
||||
<!-- a kanban view of the employees to the portal's contact page -->
|
||||
<record id="wizard_contact_form_view_employees_list" model="ir.ui.view">
|
||||
<field name="name">portal_hr_employees.employees_list</field>
|
||||
<record id="portal_hr_employees_view" model="ir.ui.view">
|
||||
<field name="name">portal_hr_employees_view</field>
|
||||
<field name="model">portal_crm.crm_contact_us</field>
|
||||
<field name="inherit_id" ref="portal_crm.wizard_contact_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@class='oe_portal_crm_team']" position="inside">
|
||||
<h1>Meet the team</h1>
|
||||
<form string="Our Team" version="7.0">
|
||||
<field name="employee_ids" widget="many2many_kanban">
|
||||
<kanban>
|
||||
<field name="visibility"/>
|
||||
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_employee_vignette">
|
||||
<div class="oe_employee_image">
|
||||
<img t-att-src="kanban_image('hr.employee', 'photo', record.id.value)" class="oe_employee_picture"/>
|
||||
</div>
|
||||
<div class="oe_employee_details">
|
||||
<h4>
|
||||
<a type="open"><field name="name"/><t t-if="record.login.raw_value"> (<field name="login"/>)</t></a>
|
||||
</h4>
|
||||
<ul>
|
||||
<li t-if="record.job_id.raw_value"><field name="job_id"/></li>
|
||||
<li t-if="record.work_phone.raw_value">Tel: <field name="work_phone"/></li>
|
||||
<li t-if="record.mobile_phone.raw_value">Mobile: <field name="mobile_phone"/></li>
|
||||
<li t-if="record.work_email.raw_value"><a t-attf-href="mailto:#{record.work_email.value}"><field name="work_email"/></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<kanban>
|
||||
<field name="visibility"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_employee_vignette">
|
||||
<div class="oe_employee_image">
|
||||
<img t-att-src="kanban_image('hr.employee', 'image_small', record.id.value)" class="oe_employee_picture"/>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
<div class="oe_employee_details">
|
||||
<h4>
|
||||
<a type="open"><field name="name"/><t t-if="record.login.raw_value"> (<field name="login"/>)</t></a>
|
||||
</h4>
|
||||
<ul>
|
||||
<li t-if="record.job_id.raw_value"><field name="job_id"/></li>
|
||||
<li t-if="record.work_phone.raw_value">Tel: <field name="work_phone"/></li>
|
||||
<li t-if="record.mobile_phone.raw_value">Mobile: <field name="mobile_phone"/></li>
|
||||
<li t-if="record.work_email.raw_value"><a t-attf-href="mailto:#{record.work_email.value}"><field name="work_email"/></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</xpath>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_team" model="ir.actions.act_window">
|
||||
<field name="name">Meet the team</field>
|
||||
<field name="res_model">portal_crm.crm_contact_us</field>
|
||||
<field name="view_id" ref="portal_hr_employees_view"/>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="help">Here you can see our employees' public profile, if any</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Meet the team" id="portal_company_team"
|
||||
parent="portal.portal_company" action="action_team" sequence="50"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -75,8 +75,8 @@
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create an issue.
|
||||
</p><p>
|
||||
OpenERP's kanban view will help you track easily your current
|
||||
pipeline of issues to fix.
|
||||
You can track your claims from this menu and the action we
|
||||
will take.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<field name="view_mode">tree,form,calendar,graph</field>
|
||||
<field name="context">{"search_default_draft":1}</field>
|
||||
<field name="search_view_id" ref="sale.view_sales_order_filter"/>
|
||||
<field name="help">You don't have any quotation.</field>
|
||||
<field name="help">We haven't sent you any quotation.</field>
|
||||
</record>
|
||||
|
||||
<record id="action_order_form" model="ir.actions.act_window">
|
||||
@@ -23,7 +23,7 @@
|
||||
<field name="view_mode">tree,form,calendar,graph</field>
|
||||
<field name="search_view_id" ref="sale.view_sales_order_filter"/>
|
||||
<field name="context">{"search_default_sales":1}</field>
|
||||
<field name="help">You don't have any sale order.</field>
|
||||
<field name="help">We haven't sent you any sale order.</field>
|
||||
</record>
|
||||
|
||||
<record id="action_picking_tree" model="ir.actions.act_window">
|
||||
@@ -34,18 +34,7 @@
|
||||
<field name="domain">[('type','=','out')]</field>
|
||||
<field name="context">{'default_type': 'out', 'contact_display': 'partner_address'}</field>
|
||||
<field name="search_view_id" ref="stock.view_picking_out_search"/>
|
||||
<field name="help">You don't have any delivery order.</field>
|
||||
</record>
|
||||
|
||||
<record id="product_normal_action" model="ir.actions.act_window">
|
||||
<field name="name">Products</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">product.product</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="view_id" ref="product.product_kanban_view"/>
|
||||
<field name="search_view_id" ref="product.product_search_form_view"/>
|
||||
<field name="help">There are no public products.</field>
|
||||
<field name="help">We haven't sent you any delivery order.</field>
|
||||
</record>
|
||||
|
||||
<record id="action_invoice_tree1" model="ir.actions.act_window">
|
||||
@@ -55,7 +44,7 @@
|
||||
<field name="domain">[('type','=','out_invoice')]</field>
|
||||
<field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field>
|
||||
<field name="search_view_id" ref="account.view_account_invoice_filter"/>
|
||||
<field name="help">You don't have any invoice.</field>
|
||||
<field name="help">We haven't sent you any invoice.</field>
|
||||
</record>
|
||||
|
||||
<record id="action_vendor_receipt" model="ir.actions.act_window">
|
||||
@@ -65,7 +54,7 @@
|
||||
<field name="context">{'type':'receipt'}</field>
|
||||
<field name="search_view_id" ref="account_voucher.view_voucher_filter_customer_pay"/>
|
||||
<field name="target">current</field>
|
||||
<field name="help">You don't have any refunds or payments.</field>
|
||||
<field name="help">We haven't sent you any credit note.</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Quotations" id="portal_quotations" parent="portal.portal_orders"
|
||||
@@ -74,13 +63,11 @@
|
||||
action="action_order_form" sequence="20"/>
|
||||
<menuitem name="Delivery Orders" id="portal_delivery" parent="portal.portal_orders"
|
||||
action="action_picking_tree" sequence="30"/>
|
||||
<menuitem name="Products" id="portal_products" parent="portal.portal_orders"
|
||||
action="product_normal_action" sequence="40"/>
|
||||
|
||||
<menuitem name="Invoice" id="portal_invoices" parent="portal.portal_invoices_payements"
|
||||
action="action_invoice_tree1" sequence="10"/>
|
||||
<menuitem name="Refund/Payments" id="portal_payments" parent="portal.portal_invoices_payements"
|
||||
action="action_vendor_receipt" sequence="20"/>
|
||||
<menuitem name="Invoices" id="portal_invoices" parent="portal.portal_orders"
|
||||
action="action_invoice_tree1" sequence="40"/>
|
||||
<menuitem name="Credit Notes" id="portal_payments" parent="portal.portal_orders"
|
||||
action="action_vendor_receipt" sequence="50"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user