[MERGE]: merging from the development branch 2

bzr revid: mga@tinyerp.com-20100426055024-m2rugjgyspv71ucc
This commit is contained in:
Mantavya Gajjar 2010-04-26 11:20:24 +05:30
commit 18d06cba7e
16 changed files with 774 additions and 54 deletions

View File

@ -40,6 +40,7 @@
'wizard/base_calendar_invite_attendee_view.xml',
'base_calendar_view.xml'
],
"test" : ['test/base_calendar_test.yml'],
"installable" : True,
"active" : False,
}

View File

@ -469,6 +469,7 @@ property or property parameter."),
reply_to=email_from
)
return True
def onchange_user_id(self, cr, uid, ids, user_id, *args, **argv):
"""
Make entry on email and availbility on change of user_id field.
@ -795,7 +796,26 @@ class calendar_event(osv.osv):
def _tz_get(self, cr, uid, context={}):
return [(x.lower(), x) for x in pytz.all_timezones]
def onchange_dates(self, cr, uid, ids, start_date, duration=False, end_date=False, context={}):
def onchange_allday(self, cr, uid, ids, allday, context={}):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of calendar events IDs.
@param allday: Value of allday boolean
@param context: A standard dictionary for contextual values
"""
if not allday or not ids:
return {}
event = self.browse(cr, uid, ids, context=context)[0]
value = {
'date': event.date and event.date[:11] + '00:00:00',
'date_deadline': event.date_deadline and event.date_deadline[:11] + '00:00:00',
'duration': 24
}
return {'value': value}
def onchange_dates(self, cr, uid, ids, start_date, duration=False, end_date=False, allday=False, context={}):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@ -805,14 +825,23 @@ class calendar_event(osv.osv):
@param duration: Get Duration between start date and end date or False
@param end_date: Get Ending Date or False
@param context: A standard dictionary for contextual values
"""
if not start_date:
return {}
value = {}
if not start_date:
return value
if not end_date and not duration:
duration = 8.00
value['duration'] = 8.00
value['duration'] = duration
if allday: # For all day event
start = start_date[:11] + '00:00:00'
value = {
'date': start,
'date_deadline': start,
'duration': 24
}
return {'value': value}
start = datetime.strptime(start_date, "%Y-%m-%d %H:%M:%S")
if end_date and not duration:
end = datetime.strptime(end_date, "%Y-%m-%d %H:%M:%S")
@ -822,6 +851,7 @@ class calendar_event(osv.osv):
elif not end_date:
end = start + timedelta(hours=duration)
value['date_deadline'] = end.strftime("%Y-%m-%d %H:%M:%S")
return {'value': value}
def _set_rrulestring(self, cr, uid, id, name, value, arg, context):
@ -998,8 +1028,12 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
('3', 'Third'), ('4', 'Fourth'), \
('5', 'Fifth'), ('-1', 'Last')], 'By day'),
'month_list': fields.selection(months.items(), 'Month'),
'end_date': fields.date('Repeat Until')
'end_date': fields.date('Repeat Until'),
'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel',\
'event_id', 'attendee_id', 'Attendees'),
'allday': fields.boolean('All Day')
}
_defaults = {
'class': lambda *a: 'public',
'show_as': lambda *a: 'busy',
@ -1007,6 +1041,46 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
'select1': lambda *x: 'date',
'interval': lambda *x: 1,
}
def open_event(self, cr, uid, ids, context=None):
"""
Open Event From for Editing
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of events IDs
@param context: A standard dictionary for contextual values
@return: Dictionary value which open Crm Meeting form.
"""
if not context:
context = {}
data_obj = self.pool.get('ir.model.data')
value = {}
id2 = data_obj._get_id(cr, uid, 'base_calendar', 'event_form_view')
id3 = data_obj._get_id(cr, uid, 'base_calendar', 'event_tree_view')
id4 = data_obj._get_id(cr, uid, 'base_calendar', 'event_calendar_view')
if id2:
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
if id3:
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
if id4:
id4 = data_obj.browse(cr, uid, id4, context=context).res_id
for id in ids:
value = {
'name': _('Event'),
'view_type': 'form',
'view_mode': 'form,tree',
'res_model': 'calendar.event',
'view_id': False,
'views': [(id2, 'form'), (id3, 'tree'), (id4, 'calendar')],
'type': 'ir.actions.act_window',
'res_id': base_calendar_id2real_id(id),
'nodestroy': True
}
return value
def modify_this(self, cr, uid, event_id, defaults, real_date, context=None, *args):
"""
@ -1085,8 +1159,8 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
count = 0
for data in cr.dictfetchall():
start_date = base_start_date and datetime.strptime(base_start_date, "%Y-%m-%d") or False
until_date = base_until_date and datetime.strptime(base_until_date, "%Y-%m-%d") or False
start_date = base_start_date and datetime.strptime(base_start_date[:10], "%Y-%m-%d") or False
until_date = base_until_date and datetime.strptime(base_until_date[:10], "%Y-%m-%d") or False
if count > limit:
break
event_date = datetime.strptime(data['date'], "%Y-%m-%d %H:%M:%S")
@ -1124,7 +1198,6 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
new_rule = '%s=%s' % (name, value)
new_rrule_str.append(new_rule)
new_rrule_str = ';'.join(new_rrule_str)
start_date = datetime.strptime(data['date'], "%Y-%m-%d %H:%M:%S")
rdates = get_recurrent_dates(str(new_rrule_str), exdate, start_date)
for rdate in rdates:
r_date = datetime.strptime(rdate, "%Y-%m-%d %H:%M:%S")
@ -1216,8 +1289,12 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
args_without_date.append(arg)
else:
if arg[1] in ('>', '>='):
if start_date:
continue
start_date = arg[2]
elif arg[1] in ('<', '<='):
if until_date:
continue
until_date = arg[2]
res = super(calendar_event, self).search(cr, uid, args_without_date, \
offset, limit, order, context, count)
@ -1261,7 +1338,6 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
context.update({'alarm_id': vals.get('alarm_id')})
alarm_obj.do_alarm_create(cr, uid, new_ids, self._name, 'date', \
context=context)
return res
def browse(self, cr, uid, ids, context=None, list_class=None, fields_process={}):

View File

@ -1,7 +1,12 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<record model="res.request.link" id="request_link_meeting">
<field name="name">Event</field>
<field name="object">calendar.event</field>
</record>
<record model="res.alarm" id="alarm1">
<field name="name">1 minute before</field>
<field name="active" eval="1" />

View File

@ -71,7 +71,7 @@
<field name="arch" type="xml">
<tree string="Invitation details">
<field name="email" string="Invitation To"/>
<field name="partner_id" string="Partner" />
<field name="user_id" string="Internal User" />
<field name="partner_address_id" string="Contact" />
<field name="role" />
<field name="state" />
@ -100,8 +100,30 @@
</search>
</field>
</record>
<record id="action_view_attendee_form" model="ir.actions.act_window">
<field name="name">Event Invitations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">calendar.attendee</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="base_calendar.base_calendar_attendee_tree_view" />
<field name="context">{'default_sent_by_uid': uid}</field>
</record>
<!-- Calenadar's menu -->
<menuitem id="base.menu_calendar_configuration" name="Calendar"
parent="base.menu_base_config" sequence="10" />
<!-- Invitation menu -->
<menuitem id="menu_attendee_invitations"
name="Event Invitations" parent="base.menu_calendar_configuration"
sequence="10" action="action_view_attendee_form" />
<record id="res_alarm_form_view" model="ir.ui.view">
<!-- ALARM FORM VIEW-->
<record id="res_alarm_form_view" model="ir.ui.view">
<field name="name">res.alarm.form</field>
<field name="model">res.alarm</field>
<field name="type">form</field>
@ -121,36 +143,230 @@
</field>
</record>
<record id="res_alarm_tree_view" model="ir.ui.view">
<field name="name">res.alarm.tree</field>
<field name="model">res.alarm</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Reminder details">
<field name="name" select="1"/>
<field name="trigger_interval" select="1"/>
<field name="trigger_duration" select="1"/>
<field name="trigger_occurs" select="1"/>
<field name="trigger_related" select="1"/>
</tree>
</field>
</record>
<record id="action_res_alarm_view" model="ir.actions.act_window">
<!-- ALARM TREE VIEW-->
<record id="res_alarm_tree_view" model="ir.ui.view">
<field name="name">res.alarm.tree</field>
<field name="model">res.alarm</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Reminder details">
<field name="name" select="1"/>
<field name="trigger_interval" select="1"/>
<field name="trigger_duration" select="1"/>
<field name="trigger_occurs" select="1"/>
<field name="trigger_related" select="1"/>
</tree>
</field>
</record>
<record id="action_res_alarm_view" model="ir.actions.act_window">
<field name="name">Available Alarms</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.alarm</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<!--Available alarms-->
<menuitem id="base.menu_calendar_configuration" name="Calendar"
parent="base.menu_base_config" sequence="10" />
</record>
<menuitem id="menu_crm_meeting_avail_alarm"
groups="base.group_extended"
action="base_calendar.action_res_alarm_view"
parent="base.menu_calendar_configuration" />
</data>
</openerp>
<!-- Event Form View-->
<record model="ir.ui.view" id="event_form_view">
<field name="name">Event Form</field>
<field name="model">calendar.event</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Meetings">
<group col="6" colspan="4">
<field name="name" select="1" string="Summary"
colspan="4" />
<field name="allday" colspan="2" on_change="onchange_allday(allday)" />
<newline/>
<field name="date" string="Start Date" required="1" select="1"
on_change="onchange_dates(date,duration,False,allday)" />
<field name="duration" widget="float_time"
on_change="onchange_dates(date,duration,False,allday)" attrs="{'readonly': [('allday', '=', True)]}"/>
<field name="date_deadline" string="End Date" required="1"
on_change="onchange_dates(date,False,date_deadline)" />
<field name="location" />
<field name="alarm_id" string="Reminder"
widget="selection" />
<group colspan="2" col="4" >
<field name="rrule_type" string="Recurrency"
colspan="1" attrs="{'readonly':[('recurrent_uid','!=',False)]}"/>
<button string="Edit All"
help="Edit all Ourrences of recurrent Meeting"
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"
name="open_event" icon="gtk-edit"
type="object" />
</group>
</group>
<group col="4" colspan="4" name="rrule" attrs="{'invisible': [('rrule_type','!=','custom')]}">
<separator string="Select data for Custom Rule" colspan="8"/>
<group col="8" colspan="4">
<field name="freq" />
<field name="interval" />
<field name="count" />
<field name="end_date" />
</group>
<group col="14" colspan="4" name="Select weekdays"
attrs="{'invisible' : [('freq','!=','weekly')]}">
<field name="mo" colspan="1" />
<field name="tu" colspan="1" />
<field name="we" colspan="1" />
<field name="th" colspan="1" />
<field name="fr" colspan="1" />
<field name="sa" colspan="1" />
<field name="su" colspan="1" />
<newline />
</group>
<group col="10" colspan="4"
attrs="{'invisible' : [('freq','!=','monthly'), ('freq','!=','yearly')]}">
<group col="2" colspan="1">
<field name="select1" />
</group>
<group col="2" colspan="1"
attrs="{'invisible' : [('select1','=','day')]}">
<field name="day"
attrs="{'required' : [('select1','=','date')]}" />
</group>
<group col="3" colspan="1"
attrs="{'invisible' : [('select1','=','date')]}">
<field name="byday" string="The"
attrs="{'required' : [('select1','=','day')]}" />
<field name="week_list" nolabel="1"
attrs="{'required' : [('select1','=','day')]}" />
</group>
<group col="1" colspan="1"
attrs="{'invisible' : [('freq','!=','yearly')]}">
<field name="month_list" string="of"
colspan="1"
attrs="{'required' : [('freq','=','yearly')]}" />
</group>
</group>
</group>
<notebook colspan="4">
<page string="Event">
<group col="6" colspan="4">
<separator colspan="6" string="Visibility"/>
<field name="user_id" string="Responsible User" />
<field name="show_as" string="Show time as"/>
<field name="class" string="Privacy"/>
<field name="rrule" groups="base.group_extended" />
<field name="recurrent_id" invisible="1" />
<field name="recurrent_uid" invisible="1" />
</group>
<separator string="Description" colspan="4" />
<field name="description" nolabel="1" colspan="4" />
<separator colspan="4"/>
</page>
<page string="Invitation Detail">
<button string="Invite People"
name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
icon="terp-partner" type="action"
context="{'model' : 'calendar.event', 'attendee_field':'attendee_ids'}" colspan="2"/>
<field name="attendee_ids" colspan="4"
nolabel="1" widget="one2many" mode="tree,form">
<tree string="Invitation details" editable="top">
<field name="email" />
<field name="role" select="1" />
<field name="state" />
</tree>
<form string="Invitation details">
<notebook colspan="4">
<page string="Details">
<field name="email" />
<field name="rsvp" select="1" />
<field name="cutype" select="1" />
<field name="role" select="1" />
<separator colspan="4" string="" />
<group col="6" colspan="4">
<field name="state" select="2" />
<button name="do_tentative"
states="needs-action,declined,accepted"
string="Uncertain"
type="object"
icon="terp-crm" />
<button name="do_accept"
string="Accept"
states="needs-action,tentative,declined"
type="object"
icon="gtk-apply" />
<button name="do_decline"
string="Decline"
states="needs-action,tentative,accepted"
type="object"
icon="gtk-cancel" />
<button
name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
string="Delegate"
type="action"
icon="gtk-sort-descending"
states="needs-action,tentative,declined,accepted"
context="{'model' : 'calendar.attendee', 'attendee_field' : 'child_ids'}" />
</group>
</page>
</notebook>
</form>
</field>
</page>
</notebook>
</form>
</field>
</record>
<!-- Event Tree View -->
<record model="ir.ui.view" id="event_tree_view">
<field name="name">Event Tree</field>
<field name="model">calendar.event</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Events">
<field name="name" string="Subject" />
<field name="date" string="Meeting Date" />
<field name="location" />
<field name="show_as" />
<field name="class" string="Privacy" />
</tree>
</field>
</record>
<!-- Event Calendar View -->
<record model="ir.ui.view" id="event_calendar_view">
<field name="name">Events Calendar</field>
<field name="model">calendar.event</field>
<field name="type">calendar</field>
<field name="priority" eval="2"/>
<field name="arch" type="xml">
<calendar string="Events" date_start="date" color="show_as" date_delay="duration">
<field name="name"/>
<field name="class"/>
<field name="show_as"/>
</calendar>
</field>
</record>
<!-- Event action -->
<record id="action_view_event" model="ir.actions.act_window">
<field name="name">Events</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">calendar.event</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar</field>
</record>
<!-- Event menu -->
<menuitem id="menu_events"
name="Events" parent="base.menu_calendar_configuration"
sequence="5" action="action_view_event" />
</data>
</openerp>

View File

@ -0,0 +1,77 @@
- |
In Order to test base_calendar, I will first create One Simple Event with real data
-
!record {model: calendar.event, id: calendar_event_technicalpresentation0}:
class: private
date: '2010-04-30 16:00:00'
date_deadline: '2010-04-30 18:30:00'
description: The Technical Presentation will cover following topics:\n* Creating OpenERP
class\n* Views\n* Wizards\n* Workflows
duration: 2.5
location: OpenERP S.A.
name: Technical Presentation
rrule_type: none
- |
Now I will set recurrence for this event to occure monday and friday of week
-
!python {model: calendar.event}: |
self.write(cr, uid, [ref("calendar_event_technicalpresentation0")], {'fr': 1, 'mo': 1, 'interval': 1, 'freq': 'weekly', 'rrule_type': 'custom'})
- |
In order to check that recurrent events are views successfully in calenadar view,
I will open calendar view of events
-
!python {model: calendar.event}: |
self.fields_view_get(cr, uid, False, 'calendar', context)
- |
In order to check that recurrent events are views successfully in calenadar view,
I will search for one of the recurrent event and count the number of events
-
!python {model: calendar.event}: |
ids = self.search(cr, uid, [('date', '>=', '2010-05-01 00:00:00'), ('date', '<=', '2010-05-31 00:00:00')] )
assert len(ids) == 9
- |
Now I will make All day event and test it
-
!record {model: calendar.event, id: calendar_event_alldaytestevent0}:
allday: 1
class: confidential
date: '2010-04-30 00:00:00'
date_deadline: '2010-04-30 00:00:00'
description: 'All day technical test '
location: School
name: All day test event
rrule_type: none
- |
In order to check reminder I will first create reminder
-
!record {model: res.alarm, id: res_alarm_daybeforeeventstarts0}:
name: 1 Day before event starts
trigger_duration: 1
trigger_interval: days
trigger_occurs: before
trigger_related: start
- |
Now I will assign this reminder to all day event
-
!python {model: calendar.event}: |
self.write(cr, uid, [ref("calendar_event_alldaytestevent0")], {'alarm_id': ref("res_alarm_daybeforeeventstarts0")})
- |
In order to assign attendee I will invite Demo user
-
!record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}:
type: internal
partner_id: base.res_partner_9 # Put bcz of problem in read
user_ids:
- base.user_demo
- |
Then I click on Invite Button
-
!python {model: base_calendar.invite.attendee}: |
self.do_invite(cr, uid, [ref("base_calendar_invite_attendee_0")], {'active_id': ref("calendar_event_alldaytestevent0"), 'model' : 'calendar.event', 'attendee_field':'attendee_ids'})
- |
Now I will Accept this invitation
-
!python {model: calendar.attendee}: |
ids = self.search(cr, uid, [('ref', '=', 'calendar.event' + ',' + str(ref("calendar_event_alldaytestevent0")))])
if ids:
self.do_accept(cr, uid, ids, context=context)

View File

@ -432,11 +432,20 @@ class crm_case(osv.osv):
"""
if not context:
context = {}
hist_obj = self.pool.get('crm.case.history')
log_obj = self.pool.get('crm.case.log')
for case in self.browse(cr, uid, ids, context):
if (not case.section_id.allow_unlink) and (case.state <> 'draft'):
raise osv.except_osv(_('Warning !'),
_('You can not delete this case. You should better cancel it.'))
# Also removing history and logs
history_ids = map(lambda x: x.id, case.history_line)
log_ids = map(lambda x: x.id, case.log_ids)
hist_obj.unlink(cr, uid, history_ids, context=context)
log_obj.unlink(cr, uid, log_ids, context=context)
return super(crm_case, self).unlink(cr, uid, ids, context)
def stage_next(self, cr, uid, ids, context=None):

View File

@ -51,7 +51,7 @@ class crm_meeting(osv.osv):
),
'phonecall_id': fields.many2one ('crm.phonecall', 'Phonecall'),
'opportunity_id': fields.many2one ('crm.opportunity', 'Opportunity'),
'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel',\
'attendee_ids': fields.many2many('calendar.attendee', 'meeting_attendee_rel',\
'event_id', 'attendee_id', 'Attendees'),
'date_closed': fields.datetime('Closed', readonly=True),
'date_deadline': fields.datetime('Deadline'),
@ -115,16 +115,13 @@ class calendar_attendee(osv.osv):
_description = 'Calendar Attendee'
def _compute_data(self, cr, uid, ids, name, arg, context):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of compute datas IDs
@param context: A standard dictionary for contextual values
"""
name = name[0]
result = super(calendar_attendee, self)._compute_data(cr, uid, ids, name, arg, context)
@ -132,7 +129,7 @@ class calendar_attendee(osv.osv):
id = attdata.id
result[id] = {}
if name == 'categ_id':
if attdata.ref:
if attdata.ref and 'categ_id' in attdata.ref._columns:
result[id][name] = (attdata.ref.categ_id.id, attdata.ref.categ_id.name,)
else:
result[id][name] = False

View File

@ -46,7 +46,8 @@
"data/olap_security.xml",
'security/ir.model.access.csv'
],
"demo_xml" : ["data/olap_demo.xml"],
"demo_xml" : ["data/olap_demo.xml",
"test/olap_test00.yml"],
"active": False,
"installable": True
}

View File

@ -41,10 +41,7 @@
<field name="loaded"/>
<separator string="Connection url" colspan="4"/>
<field name="connection_url" nolabel="1" colspan="2"/>
<!--
<button name="test_connection" string="Test Connection" type="object" colspan="2"/>
-->
<button name="%(bi_test_connection)d" string="Test Connection" type="action" colspan="2"/>
</page>
<page string="Tables">
<field name="table_ids" colspan="4" nolabel="1"/>
@ -277,7 +274,7 @@
<field name="table_name" select="1" />
<field name="application_id" select="1" />
<field name="is_hidden" select="1" colspan="2" />
</form>
</field>
</record>
@ -325,7 +322,7 @@
<field name="application_id" select="1" />
<newline/>
<field name="is_hidden" select="1" colspan="2"/>
</form>
</field>
</record>
@ -340,9 +337,5 @@
id="menu_view_olap_application_field_form"
parent="menu_bi_conf_known_application"/>
</data>
</openerp>

View File

@ -96,8 +96,8 @@ class olap_fact_database(osv.osv):
raise osv.except_osv('Error (cx_Oracle) : ', e)
except Exception,e:
raise osv.except_osv('BI Error !', e)
raise osv.except_osv('Error !', e)
raise osv.except_osv('Message', 'Connection Successful !')
return True
_columns = {

View File

@ -0,0 +1,111 @@
-
In order to check olap module which is used to configure BI from OpenERP client.I create olap fact database record.
-
!record {model: olap.fact.database, id: olap_fact_database_openerp0}:
connection_type: port
db_host: localhost
db_login: postgres
db_name: tiny
db_password: '123456'
db_port: 5432
name: OpenERP
type: postgres
-
I will check the connection for successful login. >>>>>>(Problem)
# !python {model: olap.fact.database}: |
# self.test_connection(cr, uid,[ref('olap_fact_database_openerp0')], context)
-
In order to test schema,I create a new schema record.
-
!record {model: olap.schema, id: olap_schema_Partners0}:
database_id: olap_fact_database_openerp0
name: Partners
-
I press "Connect to Database" and I see that the Schema State is "Database Connected" now
-
!workflow {model: olap.schema, action: dbconnect, ref: olap_schema_Partners0}
-
Now I will load the structure of the database. by structure we mean tables, columns and the relations. This will help in defining cube easily.
-
!record {model: bi.load.db.wizard, id: bi_load_db_wizard_0}:
db_name: OpenERP
fact_table: Partners
-
I can see two buttons for Configuration one for manually and the other is for Automatically.I press "Configure Automatically".After configuration I can see that the Boolean Configuring Data-structure is True now Schema State is "The Structure is Configured" and there is one button "Mark as Configured"
-
!record {model: bi.auto.configure.wizard, id: bi_auto_configure_wizard_Partners0}:
name: Partners
-
Performing a workflow action load on module olap.schema
-
!workflow {model: olap.schema, action: dbload, ref: olap_schema_Partners0}
-
Performing a workflow action configure on module olap.schema
-
!workflow {model: olap.schema, action: dbconfigure, ref: olap_schema_Partners0}
-
Performing a workflow action dbready on module olap.schema
-
!workflow {model: olap.schema, action: dbready, ref: olap_schema_Partners0}
-
In order to create Cube I first define the fact table.Fact table are the key tables in which measures are stored and we can branch to other tables for other parameters.
-
!record {model: olap.database.tables, id: database_table_res_partner}:
active: True
fact_database_id: fact_database_terp
name: res_partner
table_db_name: res_partner
-
I create cube table and select ID of as Relational Column.Then I select related record in Joined tables.
-
!record {model: olap.cube.table, id: olap_cube_table_partnercubetable0}:
column_link_id: olap.columns_res_partner_id
name: Partner cube table
available_table_ids:
- olap.columns_res_partner_date
- olap.columns_res_partner_id
- olap.columns_res_partner_credit_limit
- olap.columns_res_partner_user_id
-
I can configure Cube from BI Cube Designer.I make sure that OpenERP BI web-client is running.From Configuration I click on "Cube Designer" and It will open Cube Designer in my system browser.I can see that the schema "Partners" is visible through Cube Designer.
-
Creating olap cube
-
!record {model: olap.cube, id: olap_cube_partnercube0}:
name: Partner cube
query_log: true
schema_id: olap_schema_Partners0
table_id: olap_cube_table_partnercubetable0
-
After cube we can decide upon the dimensions to be used for the cube.In order to analyze Partner I create one dimension.
-
!record {model: olap.dimension, id: olap_dimension_products0}:
name: Products
cube_id: olap_cube_partnercube0
-
After adding the dimension I create hierarchy.
-
!record {model: olap.hierarchy, id: olap_hierarchy_allproducts0}:
dimension_id: olap_dimension_products0
name: All Products
sequence: 1
table_id: olap_cube_table_partnercubetable0
-
After adding the hierarchy I create level.I select Product's default_code as Columns Name that is loaded in Fact columns.
-
!record {model: olap.level, id: olap_level_productscode0}:
column_id_name: name
column_name: olap.columns_res_user_name
hierarchy_id: olap_hierarchy_allproducts0
name: Products code
sequence: 1
table_name: res_users
type: normal
-
I will check that columns is loaded in Fact Table.
-
!python {model: olap.load.column}: |
ids = self.search(cr, uid, [])
self.get_table_data(cr, uid, ids, {'active_ids': [ref('olap_cube_table_partnercubetable0')]})

View File

@ -26,7 +26,6 @@ class olap_load_column(osv.osv_memory):
_description = "Olap Load Column"
def get_table_data(self, cr, uid, ids, context={}):
"""
This function load column
@param cr: the current row, from the database cursor,

View File

@ -44,6 +44,9 @@
'wizard/survey_print.xml',
'wizard/survey_send_invitation.xml'],
'demo_xml': ['survey_demo.xml'],
'test': [
'test/survey00.yml',
],
'installable': True,
'active': False,
}

View File

@ -0,0 +1,159 @@
- |
Survey Scenario:
In order to check the survey module in OpenERP.
-
I Create the one survey and give survey title "Partner Feedback" and define the survey pages and survey question.
-
I Create "Partner Feedback" survey.
-
!record {model: 'survey', id: survey_partner_0}:
title: 'Partner Feedback'
max_response_limit: 20
-
I Create "Who are you?" page in "Partner Feedback" survey with title .
-
!record {model: 'survey.page', id: survey_partner_page_0}:
title: 'Who are you?'
survey_id: survey_partner_0
-
I Create "What is your company name?" question in "Who are you" survey page.
-
!record {model: 'survey.question', id: survey_p_question_0}:
question: 'What is your company name?'
type: single_textbox
sequence: 1
page_id: survey_partner_page_0
-
I Create "What is your company size?" question in "Who are you" survey page.
-
!record {model: 'survey.question', id: survey_p_question_1}:
question: 'What is your company size?'
type: multiple_choice_only_one_ans
sequence: 2
is_require_answer: true
page_id: survey_partner_page_0
-
I Create "1-50" answer in question "What is your company size?"
-
!record {model: 'survey.answer', id: survey_p_1_1}:
answer: '1 - 50'
sequence: 1
question_id : survey_p_question_1
-
I Create "51 - 100" answer in question "What is your company size?"
-
!record {model: 'survey.answer', id: survey_p_1_2}:
answer: '51 - 100'
sequence: 2
question_id : survey_p_question_1
-
I Create "100 - 500" answer in question "What is your company size?"
-
!record {model: 'survey.answer', id: survey_p_1_3}:
answer: '100 - 500'
sequence: 3
question_id : survey_p_question_1
-
I Create "500 - 1000" answer in question "What is your company size?"
-
!record {model: 'survey.answer', id: survey_p_1_4}:
answer: '500 - 1000'
sequence: 4
question_id : survey_p_question_1
-
I Create "> 1000" answer in question "What is your company size?"
-
!record {model: 'survey.answer', id: survey_p_1_5}:
answer: '> 1000'
sequence: 5
question_id : survey_p_question_1
-
I Create another "Contract" page in "Partner Feedback" survey.
-
!record {model: 'survey.page', id: survey_partner_page_1}:
title: 'Contract'
survey_id: survey_partner_0
-
I Create "Which maintenance contract do you sell to your customers." question in "Contract" survey page.
-
!record {model: 'survey.question', id: survey_p_question_3}:
question: 'Which maintenance contract do you sell to your customers.'
type: multiple_choice_only_one_ans
sequence: 1
page_id: survey_partner_page_1
-
I Create "OpenERP maintenance contract" answer in question "Which maintenance contract do you sell to your customers."
-
!record {model: 'survey.answer', id: survey_p_3_1}:
answer: 'OpenERP maintenance contract'
sequence: 1
question_id : survey_p_question_3
-
I Create "Your own contract, but you buy an OpenERP one" answer in question "Which maintenance contract do you sell to your customers."
-
!record {model: 'survey.answer', id: survey_p_3_2}:
answer: 'Your own contract, but you buy an OpenERP one'
sequence: 2
question_id : survey_p_question_3
-
I Create "Your own contract without buying an OpenERP one" answer in question "Which maintenance contract do you sell to your customers."
-
!record {model: 'survey.answer', id: survey_p_3_3}:
answer: 'Your own contract without buying an OpenERP one'
sequence: 3
question_id : survey_p_question_3
-
I Create "When do you propose a maintenance contract to your customers?" question in "Contract" survey page.
-
!record {model: 'survey.question', id: survey_p_question_4}:
question: When do you propose a maintenance contract to your customers?
type: multiple_choice_only_one_ans
sequence: 2
comment_field_type: text
comment_label: Why?
is_require_answer: true
is_comment_require: true
page_id: survey_partner_page_1
-
I Create "With each integration" answer in question "When do you propose a maintenance contract to your customers?"
-
!record {model: 'survey.answer', id: survey_p_4_1}:
answer: 'With each integration'
sequence: 1
question_id : survey_p_question_4
-
I Create "Sometimes" answer in question "When do you propose a maintenance contract to your customers?"
-
!record {model: 'survey.answer', id: survey_p_4_2}:
answer: 'Sometimes'
sequence: 2
question_id : survey_p_question_4
-
I Create "Never... " answer in question "When do you propose a maintenance contract to your customers?"
-
!record {model: 'survey.answer', id: survey_p_4_3}:
answer: 'Never... '
sequence: 3
question_id : survey_p_question_4
-
Now Survey set in open state.
-
!python {model: survey}: |
self.survey_open(cr, uid, [ref("survey_partner_0")], context)
-
Give answer of the survey, Run "Answer a Survey" wizard and select the survey and press on start button then run the selected survey.
-
!python {model: survey.name.wiz}: |
ids = self.create(cr, uid, {'survey_id': ref("survey_partner_0")})
self.action_next(cr, uid, [ids], context)
-
Give answer of the first and second page in "Partner Feedback" suvey.
-
!python {model: survey.question.wiz}: |
ids = self.create(cr, uid, {str(ref("survey_p_question_0")) +"_single" :'Tiny' , str(ref("survey_p_question_1")) + "_selection" :int(ref("survey_p_1_1"))}, context)
ids = self.create(cr, uid, {str(ref("survey_p_question_3")) +"_selection" : int(ref("survey_p_3_1")), str(ref("survey_p_question_4")) +"_selection": int(ref("survey_p_4_1"))},context)
-
Set the value in "Total start survey" field.
-
!python {model: survey}: |
ids = self.write(cr, uid, ref("survey_partner_0"), {'tot_start_survey' : 1}, context)

View File

@ -42,7 +42,8 @@
'data/wiki_main.xml',
'security/ir.model.access.csv'
],
'demo_xml': [],
'demo_xml': ['test/wiki_test00.yml'],
# 'demo_xml': [],
'installable': True,
'active': False,
'certificate': '0086363630317',

View File

@ -0,0 +1,72 @@
-
In order to test the wiki in OpenERP, I create a new wiki group on Select Display Method Tree
-
!record {model: wiki.groups, id: wiki_groups_wikigrouptest0}:
method: tree
name: Wiki Group Test
notes: I can Generate New Group for Select Display method = Tree.
-
Now I will create new wikipage and assign Group test to this page
-
!record {model: wiki.wiki, id: wiki_wiki_openerpwikiediting0}:
group_id: wiki.wiki_groups_wikigrouptest0
name: OpenERP Wiki Test
section: '1.1'
text_area: '=The Open ERP wiki=
The Open ERP wiki allows you to manage your enterprise contents using wiki
restructured texts. This module provides a collaborative way to manage internal
FAQs, quality manuals, technical references, etc.
'
-
I Get Help on this current page by clicking on "Basic wiki Editing" wizard
-
!python {model: wiki.wiki}: |
self.open_wiki_page(cr, uid, [ref("wiki_wiki_openerpwikiediting0")], context)
-
I create Index on this current page by clicking on "Create Index" wizard
-
!python {model: wiki.make.index}: |
ids = self.search(cr, uid, [])
self.wiki_do_index(cr, uid, ids , {'active_ids': [ref('wiki_wiki_openerpwikiediting0')]})
-
# Remaining Act window
I check the page history for the current page by clicking on "Page History".After that find difference between history.
-
I create a new wiki group on the Given Home Page
-
!record {model: wiki.groups, id: wiki_groups_wikigroupediting0}:
name: Wiki Group Editing
home: wiki.wiki_wiki_quickstart0
-
I open a wiki page on this given group and page by clicking on Open wiki Page wizard.
-
!python {model: wiki.wiki.page.open}: |
ids = self.search(cr, uid, [])
self.open_wiki_page(cr, uid, ids, {'active_ids': [ref('wiki_groups_wikigroupediting0')]})
-
# Remaining beacuse of Act window (I search the page by clicking on the "search page".)
In order to create a menu I will create wizard data
-
!record {model: wiki.groups, id: wiki.wiki_groups_wikiformatting0}:
home: wiki.wiki_wiki_main
-
I create a Menu by clicking on "create menu" button.
# The folowing is not running properly because of osv memory problem
-
!record {model: wiki.create.menu, id: wiki_create_menu_0}:
menu_name: Wiki Test menu
menu_parent_id: base.menu_base_partner
page: wiki.wiki_wiki_openerpwikiediting0
-
#I will check that menu is generated properly
-
# Remaining because some problem occur
#!python {model: wiki.create.menu}: |
# ids = self.search(cr, uid, [])
# self.wiki_menu_create(cr, uid, ids, context)