[ADD] : demo data

bzr revid: aja@tinyerp.com-20140311085626-phkz5012uvwagc94
This commit is contained in:
ajay javiya (OpenERP) 2014-03-11 14:26:26 +05:30
parent 3f25397dfa
commit 22d1989d6c
3 changed files with 156 additions and 37 deletions

View File

@ -58,7 +58,7 @@ class MailGroup(http.Controller):
cr, uid, context = request.cr, request.uid, request.context
group_obj = request.registry.get('mail.group')
thread_obj = request.registry.get('mail.message')
thread_ids = thread_obj.search(cr, uid, [('type','=','email'), ('model','=','mail.group'), ('res_id','=',group.id), ('parent_message','=',False)])
thread_ids = thread_obj.search(cr, uid, [('type','=','email'), ('model','=','mail.group'), ('res_id','=',group.id), ('parent_id','=',False)])
group_ids = group_obj.search(cr, uid, [])
pager = request.website.pager(
url='/groups/%s/' % group.id,
@ -83,7 +83,7 @@ class MailGroup(http.Controller):
def get_thread(self, group, message, **post):
cr, uid, context = request.cr, request.uid, request.context
thread_obj = request.registry.get('mail.message')
child_ids = thread_obj.search(cr, uid, [('parent_id','=',message.id)])
child_ids = thread_obj.search(cr, uid, [('parent_id','=',message.id)], order='date')
values = {
'main_thread': message,
'child_thread': thread_obj.browse(cr, uid, child_ids, context),

View File

@ -1,5 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="mail.group" id="group_community">
<field name="name">Community</field>
<field name="description">Community team</field>
</record>
<record model="mail.group" id="group_community">
<field name="message_follower_ids" eval="[(6, 0, [ref('base.partner_demo')])]"/>
</record>
<record id="msg_group_community_1" model="mail.message">
<field name="model">mail.group</field>
<field name="res_id" ref="group_community"/>
<field name="subject">Discover OpenERP V8</field>
<field name="body"><![CDATA[<p>Dear community,</p>
<p>We are organizing a serie of events to showcase the new features of OpenERP v8.
The events are visible on http://openerp.com/events
</p>
<p>The America Tour:</p>
<p>3/11: New York: </p>
<p>3/13: Montreal: <a href="http://www.eventbrite.com/event/10577717237">http://www.eventbrite.com/event/10577717237</a></p>
<p>3/18: Los Angeles: <a href="http://www.eventbrite.com/event/10577185647">http://www.eventbrite.com/event/10577185647</a></p>
<p>3/20: San Francisco: <a href="http://www.eventbrite.com/event/10577185647">http://www.eventbrite.com/event/10577185647</a></p>
<p>4/10: Chicago: <a href="http://www.eventbrite.com/event/10577414331">http://www.eventbrite.com/event/10577414331</a></p>
<p>4/17: Miami: <a href="http://www.eventbrite.com/event/10577616937">http://www.eventbrite.com/event/10577616937</a></p>
<p>The European Tour:</p>
<p>2/20: Gosselies - Belgium: <a href="http://www.eventbrite.com/e/inscription-avant-premiere-openerp-presentation-du-cms-ecommerce-gosselies-be-10408392783>http://www.eventbrite.com/e/inscription-avant-premiere-openerp-presentation-du-cms-ecommerce-gosselies-be-10408392783</a></p>
<p>2/21: Brussels - Belgium: <a href="http://www.eventbrite.com/e/presentation-of-the-website-builder-ecommerce-brussels-belgium-tickets-10313228143">http://www.eventbrite.com/e/presentation-of-the-website-builder-ecommerce-brussels-belgium-tickets-10313228143</a></p>
<p>3/10: Germany: <a href="http://www.eventbrite.com/e/exhibition-en-cebit-hannover-germany-registration-10615107071">http://www.eventbrite.com/e/exhibition-en-cebit-hannover-germany-registration-10615107071</a></p>
<p>3/18: Lisbon, Portugal: <a href="https://www.eventbrite.com/e/openerp-tour-discover-openerp-with-cms-ecommerce-lisbon-portugal-registration-10552736519">https://www.eventbrite.com/e/openerp-tour-discover-openerp-with-cms-ecommerce-lisbon-portugal-registration-10552736519</a></p>
<p>Please spread the news and lets meet there.</p>
<p>Thanks,</p>
]]></field>
<field name="type">email</field>
<field name="author_id" ref="base.partner_root"/>
<field name="date" eval="(DateTime.today() - timedelta(days=4)).strftime('%Y-%m-%d %H:%M')"/>
</record>
<record id="msg_group_community_2" model="mail.message">
<field name="model">mail.group</field>
<field name="res_id" ref="group_community"/>
<field name="subject">Re: Discover OpenERP V8</field>
<field name="body"><![CDATA[<p>Hi,<p>
<p>is there any event scheduled for Africa in near future?</p>
<p>Regards</p>
]]></field>
<field name="type">email</field>
<field name="parent_id" ref="msg_group_community_1"></field>
<field name="author_id" ref="base.partner_demo"/>
<field name="date" eval="(DateTime.today() - timedelta(days=4)).strftime('%Y-%m-%d %H:%M')"/>
</record>
<record id="msg_group_community_3" model="mail.message">
<field name="model">mail.group</field>
<field name="res_id" ref="group_community"/>
<field name="subject">Re: Discover OpenERP V8</field>
<field name="body"><![CDATA[<p>Yes,<p>
<p>in Moroco. You can contact Yves-Pascal (ypm@xxxxxxxxxxx) for morinformation.</p>
]]></field>
<field name="type">email</field>
<field name="parent_id" ref="msg_group_community_1"></field>
<field name="author_id" ref="base.partner_root"/>
<field name="date" eval="(DateTime.today() - timedelta(days=3)).strftime('%Y-%m-%d %H:%M')"/>
</record>
<record id="msg_group_community_4" model="mail.message">
<field name="model">mail.group</field>
<field name="res_id" ref="group_community"/>
<field name="subject">OpenERP Marketing</field>
<field name="body"><![CDATA[<p>Dear community,</p>
<p>
Over the past years, we did not invest a lot in marketing. We put most
our efforts in R&D and Sales departements (starting from 2010) and
services (started in 2012).
</p><p>
Things are changing and we are now ready to invest a lot in marketing
activities. I just wrote a "very draft" internal document to discuss the
brand positioning of OpenERP:
<a href="http://pad.openerp.com/p/r.Zzg7LhlqI7elyigb">http://pad.openerp.com/p/r.Zzg7LhlqI7elyigb</a>
</p><p>
I would like to have your point of view on these marketing thoughts for
OpenERP.
</p><p>
Thanks,
</p>
]]></field>
<field name="type">email</field>
<field name="author_id" ref="base.partner_root"/>
<field name="date" eval="(DateTime.today() - timedelta(days=4)).strftime('%Y-%m-%d %H:%M')"/>
</record>
<record id="msg_group_community_5" model="mail.message">
<field name="model">mail.group</field>
<field name="res_id" ref="group_community"/>
<field name="subject">Re: OpenERP Marketing</field>
<field name="body"><![CDATA[<p>I just posted my feedback request about the OpenERP brand positioning on
HN, you can react there: <a href="https://news.ycombinator.com/item?id=7243726">
https://news.ycombinator.com/item?id=7243726</a>
]]></field>
<field name="type">email</field>
<field name="author_id" ref="base.partner_demo"/>
<field name="parent_id" ref="msg_group_community_4"></field>
<field name="date" eval="(DateTime.today() - timedelta(days=4)).strftime('%Y-%m-%d %H:%M')"/>
</record>
<record id="msg_group_community_6" model="mail.message">
<field name="model">mail.group</field>
<field name="res_id" ref="group_community"/>
<field name="subject">Re: report_webkit future</field>
<field name="body"><![CDATA[<p>Hello,</p>
<p>I don't think there can be only one positioning for OpenERP.</p>
<p>Depending on the customer in front of me, I will present OpenERP as :</p>
<ol>
<li>an Apps-consuming platform (like a cell phone)</li>
<li>an ERP (in its traditional meaning)</li>
<li>a business apps development framework</li>
</ol>
<p>
OpenERP answers a wide range of needs, so you need to differentiate
the positioning based on the 3 axis above. In each of those axis,
the competition is different and arguments toward OpenERP will be
different as well.
</p>
]]></field>
<field name="type">email</field>
<field name="author_id" ref="base.partner_demo"/>
<field name="parent_id" ref="msg_group_community_4"></field>
<field name="date" eval="(DateTime.today() - timedelta(days=3)).strftime('%Y-%m-%d %H:%M')"/>
</record>
</data>
</openerp>

View File

@ -19,21 +19,19 @@
<t t-call="website_mail_group.navigation_menu"/>
</div>
<div class="col-md-8">
<t t-foreach="groups" t-as="group">
<div class="col-md-6" style="min-height: 150px">
<div class="col-md-3 col-md-pull-1">
<img t-att-src="'/website/image?model=mail.group&amp;field=image_small&amp;id='+str(group['id'])"/>
</div>
<div class="col-md-8">
<a t-attf-href="/groups/#{group.id}" t-esc="group.name"/>
<br/>
<small t-esc="group.description"/>
<br/>
<a t-attf-class="btn btn-default js_group #{group.message_is_follower and 'hidden' or 'visible'} follow_#{group.id}" t-attf-href="/groups/subscription/#{ group.id }/?action=follow" t-attf-id="#{group.id}">Join Group</a>
<a t-attf-class="btn btn-primary js_group #{group.message_is_follower and 'visible' or 'hidden'} unfollow_#{group.id}" t-attf-href="/groups/subscription/#{ group.id }/?action=unfollow" t-attf-id="#{group.id}">UnFollow</a>
</div>
<div class="col-md-6" style="min-height: 150px" t-foreach="groups" t-as="group">
<div class="col-md-3 col-md-pull-1">
<img t-att-src="'/website/image?model=mail.group&amp;field=image_small&amp;id='+str(group['id'])"/>
</div>
</t>
<div class="col-md-8">
<a t-attf-href="/groups/#{group.id}" t-esc="group.name"/>
<br/>
<small t-esc="group.description"/>
<br/>
<a t-attf-class="btn btn-default js_group #{group.message_is_follower and 'hidden' or 'visible'} follow_#{group.id}" t-attf-href="/groups/subscription/#{ group.id }/?action=follow" t-attf-id="#{group.id}">Join Group</a>
<a t-attf-class="btn btn-primary js_group #{group.message_is_follower and 'visible' or 'hidden'} unfollow_#{group.id}" t-attf-href="/groups/subscription/#{ group.id }/?action=unfollow" t-attf-id="#{group.id}">UnFollow</a>
</div>
</div>
</div>
</div>
</div>
@ -65,15 +63,13 @@
<div class="panel-heading" t-esc="active_group.name"/>
<table class="table table-bordered">
<tbody>
<t t-foreach="thread_list" t-as="thread">
<tr>
<td>
<a t-attf-href="/groups/#{active_group.id}/message/#{thread.id}" t-esc="thread.subject"></a>
<img class="img-rounded pull-right mt0" t-att-src="'/website/image?model=mail.message&amp;field=author_avatar&amp;id='+str(thread.id)" style="width : 30px"/>
<p><small>by <t t-esc="thread.author_id.name and thread.author_id.name or thread.email_from"/> on <t t-esc="thread.date"/></small></p>
</td>
</tr>
</t>
<tr t-foreach="thread_list" t-as="thread">
<td>
<a t-attf-href="/groups/#{active_group.id}/message/#{thread.id}" t-esc="thread.subject"></a>
<img class="img-rounded pull-right mt0" t-att-src="'/website/image?model=mail.message&amp;field=author_avatar&amp;id='+str(thread.id)" style="width : 30px"/>
<p><small>by <t t-esc="thread.author_id.name and thread.author_id.name or thread.email_from"/> on <t t-esc="thread.date"/></small></p>
</td>
</tr>
</tbody>
</table>
</div>
@ -89,25 +85,25 @@
</t>
<div class="row mt32">
<div class="container">
<div class="col-md-1 mt0">
<img class="img-rounded pull-right mt0" t-att-src="'/website/image?model=mail.message&amp;field=author_avatar&amp;id='+str(main_thread.id)" style="width : 30px"/>
</div>
<div class="col-md-11">
<div class="panel panel-default">
<div class="panel-heading" t-esc="main_thread.subject"/>
<div class="panel-body">
<t t-raw="main_thread.body"/>
<div class="row">
<div class="col-md-1">
<img class="img-rounded pull-right" t-att-src="'/website/image?model=mail.message&amp;field=author_avatar&amp;id='+str(main_thread.id)" style="width : 30px"/>
</div>
<div class="col-md-11">
<div class="panel panel-default">
<div class="panel-heading" t-esc="main_thread.subject"/>
<div class="panel-body" t-raw="main_thread.body"/>
</div>
</div>
</div>
<div class="row" t-foreach="child_thread" t-as="message">
<div class="col-md-1 mt0">
<img class="img-rounded pull-right mt0" t-att-src="'/website/image?model=mail.message&amp;field=author_avatar&amp;id='+str(message.id)" style="width : 30px"/>
<div class="col-md-1">
<img class="img-rounded pull-right" t-att-src="'/website/image?model=mail.message&amp;field=author_avatar&amp;id='+str(message.id)" style="width : 30px"/>
</div>
<div class="col-md-11">
<div class="panel panel-default">
<div class="panel-heading panel-line" t-esc="message.subject"/>
<t t-raw="message.body"/>
<div class="panel-heading" t-esc="message.subject"/>
<div class="panel-body" t-raw="message.body"/>
</div>
</div>
</div>