bzr revid: sbh@tinyerp.com-20100121044850-32p4bahw9i5dr59u
This commit is contained in:
sbh (Open ERP)
2010-01-21 10:18:50 +05:30
251 changed files with 33822 additions and 1580 deletions
+4 -4
View File
@@ -7,19 +7,19 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-02-03 06:24+0000\n"
"Last-Translator: <>\n"
"PO-Revision-Date: 2010-01-20 14:02+0000\n"
"Last-Translator: Paulius Sladkevičius <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-12-16 05:17+0000\n"
"X-Launchpad-Export-Date: 2010-01-21 04:34+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_date_check
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
msgstr "Netinkamas XML peržiūros struktūrai!"
#. module: account_date_check
#: field:account.journal,allow_date:0
+12 -12
View File
@@ -2,7 +2,7 @@
<openerp>
<data>
<menuitem name="Auction Management" id="auction_menu_root" icon="terp-purchase"/>
<menuitem name="Configuration" parent="auction_menu_root" id="auction_config_menu" sequence="1"/>
<menuitem name="Configuration" parent="auction_menu_root" id="auction_config_menu" sequence="7"/>
=======================================================
Auction Management/Configuration/artist
@@ -127,7 +127,7 @@
<field name="view_id" eval="False"/>
</record>
<menuitem name="Auction Dates" parent="auction_menu_root" id="auction_date_menu"/>
<menuitem name="Auction Dates" parent="auction_menu_root" id="auction_date_menu" sequence="1"/>
<menuitem name="Next Auction Dates" parent="auction_date_menu" id="menu_auction_dates_next1" action="action_auction_dates_next"/>
=======================================================
Auction Management/Auction Dates/Old Auction Dates
@@ -361,10 +361,10 @@
<field name="res_model">auction.lots</field>
<field name="view_type">form</field>
<field name="domain">[('state','=','sold')]</field>
<field name="filter" eval="True"/>
<field name="filter" eval="True"/>
</record>
<menuitem name="Objects" parent="auction_menu_root" id="auction_objects_menu"/>
<menuitem name="Objects" parent="auction_menu_root" id="auction_objects_menu" sequence="2"/>
<menuitem name="All objects" action="action_all_objects" parent="auction_objects_menu" id="auction_all_objects_menu"/>
<record model="ir.actions.act_window" id="action_all_objects_to_sell">
@@ -373,7 +373,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','&lt;&gt;','sold')]</field>
<field name="filter" eval="True"/>
<field name="filter" eval="True"/>
</record>
<record model="ir.actions.act_window" id="action_all_objects_unplanned">
@@ -382,7 +382,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('auction_id','=', False),('state','=','draft')]</field>
<field name="filter" eval="True"/>
<field name="filter" eval="True"/>
</record>
<!-- for the sold object start-->
@@ -392,7 +392,7 @@
<field name="res_model">auction.lots</field>
<field name="view_type">form</field>
<field name="domain">[('state','=','unsold')]</field>
<field name="filter" eval="True"/>
<field name="filter" eval="True"/>
</record>
<!-- form3: simplified form meant for during the sale (action button in dates) -->
@@ -439,7 +439,7 @@
<button name="button_not_bought" string="Not sold" states="draft" type="object" icon="gtk-undo"/>
<button name="button_draft" string="Set to draft" states="sold,unsold" type="object" icon="gtk-convert"/>
<button name="button_taken_away" string="Taken away" states="sold" type="object" icon="gtk-goto-last"/>
</group>
</group>
</page>
<page string="Statements">
<field name="statement_id" domain="[('state','=','draft')]" colspan="4" nolabel="1"
@@ -465,7 +465,7 @@
<field name="res_model">report.unclassified.objects</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="filter" eval="True"/>
<field name="filter" eval="True"/>
</record>
<record model="ir.ui.view" id="v12">
@@ -583,7 +583,7 @@
<field name="view_id" ref="view_deposit_border_tree2"/>
</record>
<menuitem name="Sellers" id="auction_seller_menu" parent="auction_menu_root"/>
<menuitem name="Sellers" id="auction_seller_menu" parent="auction_menu_root" sequence="3"/>
<menuitem name="Deposit border" parent="auction_seller_menu" action="action_deposit_border" id="menu_auction_deposit_border"/>
=======================================================
@@ -679,7 +679,7 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Buyers" id="auction_buyers_menu" parent="auction_menu_root"/>
<menuitem name="Buyers" id="auction_buyers_menu" parent="auction_menu_root" sequence="4"/>
<menuitem name="Bids" parent="auction_buyers_menu" action="action_bid_open" id="menu_action_bid_open"/>
@@ -728,7 +728,7 @@
</field>
</record>
<menuitem name="Reporting" id="auction_report_menu" parent="auction_menu_root"/>
<menuitem name="Reporting" id="auction_report_menu" parent="auction_menu_root" sequence="6"/>
<record model="ir.actions.act_window" id="action_auction_report_allmonth_view1">
+9 -9
View File
@@ -35,20 +35,20 @@
name="auction.pay.buy"
id="wizard_pay"/>
<wizard
string="Gestion emporte"
model="auction.dates"
<wizard
string="Gestion emporte"
model="auction.dates"
name="auction.taken"
multi="1"
id="wizard_emporte"/>
<menuitem name="Tools Bar Codes"
<menuitem name="Tools Bar Codes"
id="auction_outils_menu"
parent="auction_menu_root"
parent="auction_menu_root" sequence="6"
/>
<menuitem name="Deliveries Management"
action="wizard_emporte"
<menuitem name="Deliveries Management"
action="wizard_emporte"
type="wizard"
id="menu_wizard_emporte"
parent="auction_outils_menu"
+1 -1
View File
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-01-20 04:36+0000\n"
"X-Launchpad-Export-Date: 2010-01-21 04:34+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: audittrail
+24
View File
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import base_calendar
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+50
View File
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"name" : "Basic Calendar Functionality",
"version" : "1.0",
"depends" : [
"base",
],
'description': """
Contains basic functionality for caldav system like:
- Maintenance of basic objects needed for caldav calendar
* Event(Meeting)
* Todo(Task)
* Reminder
* Attendee
- Availabilities of synchronisation using WebDAV
""",
"author" : "Tiny",
'category': 'Generic Modules/Others',
'website': 'http://www.openerp.com',
"init_xml" : [],
"demo_xml" : [],
"update_xml" : [
'security/ir.model.access.csv',
],
"installable" : True,
"active" : False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -23,7 +23,7 @@ from datetime import datetime, timedelta
from dateutil import parser
from dateutil.rrule import *
from osv import osv
import common
import pooler
import re
import vobject
@@ -32,6 +32,33 @@ import vobject
# R-1 Required and can come only once
# R-n Required and can come more than once
def uid2openobjectid(cr, uidval, oomodel, rdate):
__rege = re.compile(r'OpenObject-([\w|\.]+)_([0-9]+)@(\w+)$')
wematch = __rege.match(uidval.encode('utf8'))
if not wematch:
return (False, None)
else:
model, id, dbname = wematch.groups()
model_obj = pooler.get_pool(cr.dbname).get(model)
if (not model == oomodel) or (not dbname == cr.dbname):
return (False, None)
qry = 'select distinct(id) from %s' % model_obj._table
if rdate:
qry += " where recurrent_id='%s'" % (rdate)
cr.execute(qry)
r_id = cr.fetchone()
if r_id:
return (id, r_id[0])
cr.execute(qry)
ids = map(lambda x: str(x[0]), cr.fetchall())
if id in ids:
return (id, None)
return False
def openobjectid2uid(cr, uidval, oomodel):
value = 'OpenObject-%s_%s@%s' % (oomodel, uidval, cr.dbname)
return value
def map_data(cr, uid, obj):
vals = {}
for map_dict in obj.__attribute__:
@@ -126,9 +153,10 @@ class CalDAV(object):
model = context.get('model', None)
if not model:
continue
uidval = common.openobjectid2uid(cr, data[map_field], model)
uidval = openobjectid2uid(cr, data[map_field], model)
model_obj = self.pool.get(model)
cr.execute('select id from %s where recurrent_uid=%s'
% (model.replace('.', '_'), data[map_field]))
% (model_obj._table, data[map_field]))
r_ids = map(lambda x: x[0], cr.fetchall())
if r_ids:
rdata = self.pool.get(model).read(cr, uid, r_ids)
@@ -136,14 +164,18 @@ class CalDAV(object):
for revents in rcal.contents['vevent']:
ical.contents['vevent'].append(revents)
if data.get('recurrent_uid', None):
uidval = common.openobjectid2uid(cr, data['recurrent_uid'], model)
uidval = openobjectid2uid(cr, data['recurrent_uid'], model)
vevent.add('uid').value = uidval
elif field == 'attendee' and data[map_field]:
model = self.__attribute__[field].get('object', False)
attendee_obj = self.pool.get('basic.calendar.attendee')
vevent = attendee_obj.export_ical(cr, uid, data[map_field], vevent, context=context)
vevent = attendee_obj.export_ical(cr, uid, model, \
data[map_field], vevent, context=context)
elif field == 'valarm' and data[map_field]:
model = self.__attribute__[field].get('object', False)
alarm_obj = self.pool.get('basic.calendar.alarm')
vevent = alarm_obj.export_ical(cr, uid, data[map_field][0], vevent, context=context)
vevent = alarm_obj.export_ical(cr, uid, model, \
data[map_field][0], vevent, context=context)
elif data[map_field]:
if map_type == "text":
vevent.add(field).value = str(data[map_field])
@@ -341,9 +373,9 @@ class Alarm(CalDAV, osv.osv_memory):
'x-prop': None,
}
def export_ical(self, cr, uid, alarm_id, vevent, context={}):
def export_ical(self, cr, uid, model, alarm_id, vevent, context={}):
valarm = vevent.add('valarm')
alarm_object = self.pool.get('calendar.alarm')
alarm_object = self.pool.get(model)
alarm_data = alarm_object.read(cr, uid, alarm_id, [])
# Compute trigger data
@@ -427,9 +459,9 @@ class Attendee(CalDAV, osv.osv_memory):
vals = map_data(cr, uid, self)
return vals
def export_ical(self, cr, uid, attendee_id, vevent, context={}):
attendee_object = self.pool.get('calendar.attendee')
for attendee in attendee_object.read(cr, uid, attendee_id, []):
def export_ical(self, cr, uid, model, attendee_ids, vevent, context={}):
attendee_object = self.pool.get(model)
for attendee in attendee_object.read(cr, uid, attendee_ids, []):
attendee_add = vevent.add('attendee')
for a_key, a_val in attendee_object.__attribute__.items():
if attendee[a_val['field']] and a_val['field'] != 'cn':
@@ -0,0 +1,6 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_basic_calendar_all","basic.calendar","model_basic_calendar",,1,1,1,1
"access_basic_calendar_event_all","basic.calendar.event","model_basic_calendar_event",,1,1,1,1
"access_basic_calendar_attendee_all","basic.calendar.attendee","model_basic_calendar_attendee",,1,1,1,1
"access_calendar_todo_all","basic.calendar.todo","model_basic_calendar_todo",,1,1,1,1
"access_basic_calendar_alarm_all","basic.calendar.alarm","model_basic_calendar_alarm",,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_basic_calendar_all basic.calendar model_basic_calendar 1 1 1 1
3 access_basic_calendar_event_all basic.calendar.event model_basic_calendar_event 1 1 1 1
4 access_basic_calendar_attendee_all basic.calendar.attendee model_basic_calendar_attendee 1 1 1 1
5 access_calendar_todo_all basic.calendar.todo model_basic_calendar_todo 1 1 1 1
6 access_basic_calendar_alarm_all basic.calendar.alarm model_basic_calendar_alarm 1 1 1 1
@@ -105,10 +105,10 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem
name="Custom Reports" id="menu_custom_reports"
action="base_report_creator_action" parent="board.dashboard_menu" sequence="1"/>
name="Custom Reports" id="base.menu_custom_reports"
action="base_report_creator_action" parent="base.reporting_menu" sequence="1"/>
<menuitem
name="Custom Reports" parent="board.next_id_50"
name="Custom Reports" parent="base.next_id_50"
id="menu_base_report_creator_action_config"
action="base_report_creator_action"/>
@@ -127,7 +127,7 @@
<field name="view_type">tree</field>
</record>
<menuitem
name="Custom Reports" parent="menu_custom_reports"
name="Custom Reports" parent="base.menu_custom_reports"
id="menu_base_report_creator_action"
action="base_report_creator_action_tree"/>
@@ -8,12 +8,20 @@
name="base_report_designer.modify"
id="wizard_report_designer_modify"/>
<menuitem icon="terp-graph" id="base.reporting_menu" name="Reporting"/>
<menuitem
id="base.next_id_50"
name="Configuration"
parent="base.reporting_menu"
groups="base.group_system"
sequence="3"/>
<menuitem
parent="base.menu_custom"
parent="base.next_id_50"
name="Report Designer"
action="wizard_report_designer_modify"
type="wizard"
id="menu_wizard_report_designer_modify"/>
id="menu_wizard_report_designer_modify"
sequence="70"/>
+8 -8
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem icon="terp-graph" id="dashboard_menu" name="Reporting"/>
<menuitem icon="terp-graph" id="dashboard" name="Dashboards" sequence="2" parent="dashboard_menu"/>
<menuitem icon="terp-graph" id="base.reporting_menu" name="Reporting"/>
<!-- <menuitem icon="terp-graph" id="dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>-->
<record id="view_board_note_tree" model="ir.ui.view">
<field name="name">board.note.tree</field>
<field name="model">board.note</field>
@@ -34,7 +34,7 @@
<field name="view_mode">form,tree</field>
</record>
<wizard id="wizard_board_create_menu" model="board.board" multi="True" name="board.board.menu.create" string="Create Board Menu"/>
<wizard id="wizard_board_create_menu" model="board.board" multi="True" name="board.board.menu.create" string="Create Board Menu" />
<record id="view_board_tree" model="ir.ui.view">
<field name="name">board.board.tree</field>
@@ -81,17 +81,17 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem
id="next_id_50"
id="base.next_id_50"
name="Configuration"
parent="board.dashboard_menu"
parent="base.reporting_menu"
groups="base.group_system"
sequence="3"/>
<menuitem
action="action_view_board_list_form"
id="menu_view_board_form"
parent="next_id_50"/>
<menuitem action="action_view_board_note_form" id="menu_view_board_note_form" parent="next_id_50"
sequence="100"
parent="base.next_id_50" sequence="1"/>
<menuitem action="action_view_board_note_form" id="menu_view_board_note_form" parent="base.next_id_50"
sequence="3"
groups="base.group_system" />
<act_window context="{'view': active_id}" id="dashboard_open" multi="True" name="Open Dashboard" res_model="board.board" src_model="board.board"/>
+2 -2
View File
@@ -71,8 +71,8 @@
<field name="usage">menu</field>
<field name="view_id" ref="board_account_form"/>
</record>
<menuitem id="next_id_68" name="Accounting" parent="board.dashboard"
<menuitem icon="terp-graph" id="base.dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>
<menuitem id="next_id_68" name="Accounting" parent="base.dashboard"
groups="account.group_account_manager"/>
<menuitem action="open_board_account" icon="terp-graph" id="menu_board_account" parent="next_id_68" sequence="1"/>
</data>
@@ -53,8 +53,8 @@
<field name="view_mode">form</field>
<field name="view_id" ref="board_associations_manager_form"/>
</record>
<menuitem id="board_associations" name="Associations" parent="board.dashboard" />
<menuitem icon="terp-graph" id="base.dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>
<menuitem id="board_associations" name="Associations" parent="base.dashboard" />
<menuitem
name="Associations" parent="board_associations"
action="open_board_associations_manager"
@@ -69,8 +69,8 @@
<field name="usage">menu</field>
<field name="view_id" ref="board_auction_manager_form1"/>
</record>
<menuitem name="Auction Manager" id="board_menu_auction_manager" parent="board.dashboard" />
<menuitem icon="terp-graph" id="base.dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>
<menuitem name="Auction Manager" id="board_menu_auction_manager" parent="base.dashboard" />
<menuitem
name="Auction Manager"
action="open_board_auction_manager"
+2 -2
View File
@@ -58,8 +58,8 @@
<field name="usage">menu</field>
<field name="view_id" ref="board_auction_manager_form"/>
</record>
<menuitem name="Auction Member" id="board_menu_auction_member" parent="board.dashboard" />
<menuitem icon="terp-graph" id="base.dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>
<menuitem name="Auction Member" id="board_menu_auction_member" parent="base.dashboard" />
<menuitem
name="Auction Member"
action="open_board_auction"
@@ -98,8 +98,9 @@
<field name="view_id" ref="board_crm_statistical_form"/>
</record>
<menuitem icon="terp-graph" id="base.dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>
<menuitem
name="CRM Configuration" parent="board.dashboard"
name="CRM Configuration" parent="base.dashboard"
id="menu_board_crm_config"
groups="crm.group_crm_manager"/>
<menuitem
@@ -50,10 +50,11 @@
<field name="view_id" ref="board_document_manager_form"/>
</record>
<menuitem icon="terp-graph" id="base.dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>
<menuitem
name="Document"
id="menu_board_document"
parent="board.dashboard"
parent="base.dashboard"
groups="document.group_document_manager"/>
@@ -36,10 +36,12 @@
<field name="view_mode">form</field>
<field name="view_id" ref="board_mrp_manager_form"/>
</record>
<menuitem icon="terp-graph" id="base.dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>
<menuitem
id="next_id_87"
name="Production"
parent="board.dashboard"
parent="base.dashboard"
groups="mrp.group_mrp_manager"/>
<menuitem
action="open_board_manufacturing"
+2 -2
View File
@@ -76,11 +76,11 @@
<field name="usage">menu</field>
<field name="view_id" ref="board_project_form"/>
</record>
<menuitem icon="terp-graph" id="base.dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>
<menuitem
id="next_id_86"
name="Project"
parent="board.dashboard"/>
parent="base.dashboard"/>
<menuitem
action="open_board_project"
icon="terp-graph"
+2 -1
View File
@@ -35,7 +35,8 @@
<field name="view_id" ref="board_sales_manager_form"/>
</record>
<menuitem id="next_id_88" name="Sales" parent="board.dashboard"/><menuitem action="open_board_sales_manager" icon="terp-graph" id="menu_board_sales_manager" parent="next_id_88" sequence="1"/>
<menuitem icon="terp-graph" id="base.dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>
<menuitem id="next_id_88" name="Sales" parent="base.dashboard"/><menuitem action="open_board_sales_manager" icon="terp-graph" id="menu_board_sales_manager" parent="next_id_88" sequence="1"/>
</data>
</openerp>
+1 -2
View File
@@ -19,8 +19,7 @@
#
##############################################################################
import calendar
import common
import caldav
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+3 -5
View File
@@ -24,16 +24,14 @@
"name" : "CalDAV",
"version" : "1.0",
"depends" : [
"base",
"base_calendar",
],
'description': """
To develop a full featured caldav system that support:
- access through webdav (based on xrg code)
Full featured caldav system that support:
- alerts (create requests)
- recurring events (*)
- invitations to others people (exactly like sunbird)
- availabilities of users/calendars
- full day events""",
""",
"author" : "Tiny",
'category': 'Generic Modules/Others',
'website': 'http://www.openerp.com',
@@ -19,14 +19,15 @@
#
##############################################################################
from datetime import datetime, timedelta
from datetime import datetime, timedelta
from dateutil import parser
from osv import fields, osv
from base_calendar import base_calendar
from service import web_services
from tools.translate import _
import base64
import pooler
import re
import time
@@ -43,7 +44,9 @@ def caldav_id2real_id(caldav_id=None, with_date=False):
if with_date:
real_date = time.strftime("%Y-%m-%d %H:%M:%S", \
time.strptime(res[1], "%Y%m%d%H%M%S"))
return (int(real_id), real_date)
start = datetime.strptime(real_date, "%Y-%m-%d %H:%M:%S")
end = start + timedelta(hours=with_date)
return (int(real_id), real_date, end.strftime("%Y-%m-%d %H:%M:%S"))
return int(real_id)
return caldav_id and int(caldav_id) or caldav_id
@@ -54,31 +57,6 @@ def real_id2caldav_id(real_id, recurrent_date):
return '%d-%s' % (real_id, recurrent_date)
return real_id
def uid2openobjectid(cr, uidval, oomodel, rdate):
__rege = re.compile(r'OpenObject-([\w|\.]+)_([0-9]+)@(\w+)$')
wematch = __rege.match(uidval.encode('utf8'))
if not wematch:
return (False, None)
else:
model, id, dbname = wematch.groups()
if (not model == oomodel) or (not dbname == cr.dbname):
return (False, None)
qry = 'select distinct(id) from %s' % model.replace('.', '_')
if rdate:
qry += " where recurrent_id='%s'" % (rdate)
cr.execute(qry)
r_id = cr.fetchone()
if r_id:
return (id, r_id[0])
cr.execute(qry)
ids = map(lambda x: str(x[0]), cr.fetchall())
if id in ids:
return (id, None)
return False
def openobjectid2uid(cr, uidval, oomodel):
value = 'OpenObject-%s_%s@%s' % (oomodel, uidval, cr.dbname)
return value
def _links_get(self, cr, uid, context={}):
obj = self.pool.get('res.request.link')
@@ -280,8 +258,8 @@ are both optional, but if one occurs, so MUST the other"""),
def do_alarm_create(self, cr, uid, ids, model, date, context={}):
alarm_obj = self.pool.get('calendar.alarm')
model_obj = self.pool.get('ir.model')
model_id = model_obj.search(cr, uid, [('model', '=', model)])[0]
ir_obj = self.pool.get('ir.model')
model_id = ir_obj.search(cr, uid, [('model', '=', model)])[0]
model_obj = self.pool.get(model)
for data in model_obj.browse(cr, uid, ids):
@@ -307,8 +285,8 @@ are both optional, but if one occurs, so MUST the other"""),
}
alarm_id = alarm_obj.create(cr, uid, vals)
cr.execute('Update %s set caldav_alarm_id=%s, alarm_id=%s \
where id=%s' % (model.replace('.', '_'), \
alarm_id, basic_alarm.id, data.id))
where id=%s' % (model_obj._table, \
alarm_id, basic_alarm.id, data.id))
cr.commit()
return True
@@ -321,8 +299,8 @@ are both optional, but if one occurs, so MUST the other"""),
alarm_ids = alarm_obj.search(cr, uid, [('model_id', '=', model_id), ('res_id', '=', datas.id)])
if alarm_ids and len(alarm_ids):
alarm_obj.unlink(cr, uid, alarm_ids)
cr.execute('Update %s set caldav_alarm_id=NULL, \
alarm_id=NULL where id=%s' % (self._table, datas.id))
cr.execute('Update %s set caldav_alarm_id=NULL, alarm_id=NULL\
where id=%s' % (model_obj._table, datas.id))
cr.commit()
return True
@@ -477,7 +455,7 @@ class calendar_event(osv.osv):
'url': {'field': 'caldav_url', 'type': 'text'},
'recurrence-id': {'field': 'recurrent_id', 'type': 'datetime'},
'attendee': {'field': 'attendee_ids', 'type': 'many2many', 'object': 'calendar.attendee'},
'categories': {'field': 'categ_id', 'type': 'many2one', 'object': 'crm.meeting.categ'},
# 'categories': {'field': 'categ_id', 'type': 'many2one', 'object': 'crm.meeting.categ'},
'comment': None,
'contact': None,
'exdate': {'field': 'exdate', 'type': 'datetime'},
@@ -583,7 +561,7 @@ rule or repeating pattern for anexception to a recurrence set"),
vals = event_obj.import_ical(cr, uid, file_content)
ids = []
for val in vals:
exists, r_id = uid2openobjectid(cr, val['id'], self._name, \
exists, r_id = base_calendar.uid2openobjectid(cr, val['id'], self._name, \
val.get('recurrent_id'))
if val.has_key('create_date'): val.pop('create_date')
val['caldav_url'] = context.get('url') or ''
@@ -621,8 +599,9 @@ rule or repeating pattern for anexception to a recurrence set"),
ids = select
result = []
if ids and (base_start_date or base_until_date):
cr.execute("select m.id, m.rrule, m.date, m.exdate \
from " + self._table + " m where m.id in ("\
cr.execute("select m.id, m.rrule, m.date, m.date_deadline, \
m.exdate from " + self._table + \
" m where m.id in ("\
+ ','.join(map(lambda x: str(x), ids))+")")
count = 0
@@ -635,9 +614,9 @@ rule or repeating pattern for anexception to a recurrence set"),
if start_date and start_date <= event_date:
start_date = event_date
if not data['rrule']:
if start_date and event_date < start_date:
if start_date and (event_date < start_date):
continue
if until_date and event_date > until_date:
if until_date and (event_date > until_date):
continue
idval = real_id2caldav_id(data['id'], data['date'])
result.append(idval)
@@ -713,7 +692,7 @@ rule or repeating pattern for anexception to a recurrence set"),
if not id in new_ids:
new_ids.append(id)
res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context)
if vals.get('alarm_id'):
if vals.has_key('alarm_id'):
alarm_obj = self.pool.get('res.alarm')
alarm_obj.do_alarm_create(cr, uid, new_ids, self._name, 'date')
return res
@@ -741,9 +720,10 @@ rule or repeating pattern for anexception to a recurrence set"),
for caldav_id, real_id in select:
res = super(calendar_event, self).read(cr, uid, real_id, fields=fields, context=context, \
load=load)
ls = caldav_id2real_id(caldav_id, with_date=True)
ls = caldav_id2real_id(caldav_id, with_date=res.get('duration', 0))
if not isinstance(ls, (str, int, long)) and len(ls) >= 2:
res['date'] = ls[1]
res['date_deadline'] = ls[2]
res['id'] = caldav_id
result.append(res)
@@ -881,7 +861,7 @@ class calendar_todo(osv.osv):
hours = (val['planned_hours'].seconds / float(3600)) + \
(val['planned_hours'].days * 24)
val['planned_hours'] = hours
exists, r_id = uid2openobjectid(cr, val['id'], self._name, val.get('recurrent_id'))
exists, r_id = base_calendar.uid2openobjectid(cr, val['id'], self._name, val.get('recurrent_id'))
val.pop('id')
if exists:
self.write(cr, uid, [exists], val)
@@ -1,9 +1,4 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_basic_calendar_all","basic.calendar","model_basic_calendar",,1,1,1,1
"access_basic_calendar_event_all","basic.calendar.event","model_basic_calendar_event",,1,1,1,1
"access_basic_calendar_attendee_all","basic.calendar.attendee","model_basic_calendar_attendee",,1,1,1,1
"access_calendar_todo_all","basic.calendar.todo","model_basic_calendar_todo",,1,1,1,1
"access_calendar_todo_all","basic.calendar.todo","model_basic_calendar_todo",,1,1,1,1
"access_calendar_attendee","calendar.attendee","model_calendar_attendee",,1,1,1,1
"access_calendar_alarm","calendar.alarm","model_calendar_alarm",,1,1,1,1
"access_res_alarm","res.alarm","model_res_alarm",,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
access_basic_calendar_all basic.calendar model_basic_calendar 1 1 1 1
access_basic_calendar_event_all basic.calendar.event model_basic_calendar_event 1 1 1 1
access_basic_calendar_attendee_all basic.calendar.attendee model_basic_calendar_attendee 1 1 1 1
access_calendar_todo_all basic.calendar.todo model_basic_calendar_todo 1 1 1 1
access_calendar_todo_all basic.calendar.todo model_basic_calendar_todo 1 1 1 1
2 access_calendar_attendee calendar.attendee model_calendar_attendee 1 1 1 1
3 access_calendar_alarm calendar.alarm model_calendar_alarm 1 1 1 1
4 access_res_alarm res.alarm model_res_alarm 1 1 1 1
@@ -45,17 +45,20 @@ class event_edit_this(wizard.interface):
'alarm_id': {'string': 'Reminder', 'type': 'many2one', 'relation': 'res.alarm'},
}
def _default_values(self, cr, uid, data, context):
def _default_values(self, cr, uid, data, context=None):
model = data.get('model')
model_obj = pooler.get_pool(cr.dbname).get(model)
event = model_obj.read(cr, uid, data['id'], ['name', 'location', 'date',\
'date_deadline', 'alarm_id'])
event = model_obj.read(cr, uid, data['id'], ['name', 'location', 'alarm_id'])
event.update({
'date': context.get('date'),
'date_deadline': context.get('date_deadline')
})
return event
def _modify_this(self, cr, uid, datas, *args):
def _modify_this(self, cr, uid, datas, context=None):
model = datas.get('model')
model_obj = pooler.get_pool(cr.dbname).get(model)
new_id = model_obj.modify_this(cr, uid, [datas['id']], datas['form'])
new_id = model_obj.modify_this(cr, uid, [datas['id']], datas['form'], context)
value = {
'name': 'New event',
'view_type': 'form',
+2 -7
View File
@@ -20,7 +20,7 @@
##############################################################################
from osv import fields, osv
import crm
class crm_meeting(osv.osv):
_name = 'crm.meeting'
@@ -29,12 +29,7 @@ class crm_meeting(osv.osv):
_inherit = ["crm.case", "calendar.event"]
_columns = {
'priority': fields.selection([('5','Lowest'),
('4','Low'),
('3','Normal'),
('2','High'),
('1','Highest')
], 'Priority'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'categ_id': fields.many2one('crm.case.categ', 'Category', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.meeting')]", \
+3 -2
View File
@@ -85,8 +85,9 @@
</field>
</page>
<page string="Other Information">
<field name="alarm_id" string="Reminder" widget="selection" />
<field name="priority"/>
<field name="show_as"/>
<field name="alarm_id" string="Reminder" widget="selection" />
<field name="class"/>
<field name="user_id"/>
<field name="recurrent_id" invisible="1" />
@@ -98,7 +99,7 @@
<label string="" />
<button string="Modify this Occurrence"
name="%(caldav.wizard_edit_this_event)d" icon="gtk-save"
type="action" context="{'model' : 'crm.meeting'}" />
type="action" context="{'model' : 'crm.meeting', 'date': date, 'date_deadline': date_deadline}" />
</group>
</form>
</field>
-1
View File
@@ -19,7 +19,6 @@
#
##############################################################################
from caldav import common
from dateutil.rrule import *
from osv import fields, osv
import datetime
+49 -46
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2010-01-05 05:59+0000\n"
"PO-Revision-Date: 2010-01-20 01:33+0000\n"
"PO-Revision-Date: 2010-01-21 00:53+0000\n"
"Last-Translator: pedrobom <pedrobomlimeira@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-01-20 04:36+0000\n"
"X-Launchpad-Export-Date: 2010-01-21 04:34+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm
@@ -308,17 +308,17 @@ msgstr "Data da última ação"
#. module: crm
#: view:crm.job:0
msgid "Appreciation"
msgstr ""
msgstr "Apreciação"
#. module: crm
#: model:crm.case.stage,name:crm.stage_job3
msgid "Second Interview"
msgstr ""
msgstr "Segunda entrevista"
#. module: crm
#: model:ir.actions.wizard,name:crm.wizard_crm_cal_subscribe
msgid "Subscribe to a Remote calendar"
msgstr ""
msgstr "Inscrever-se num calendário Remoto"
#. module: crm
#: model:ir.actions.act_window,name:crm.crm_case_categ-act
@@ -330,7 +330,7 @@ msgstr "Categorias"
#: code:addons/crm/wizard/wizard_crm_new_send_email.py:0
#, python-format
msgid "Warning!"
msgstr ""
msgstr "Atenção!"
#. module: crm
#: view:crm.case:0
@@ -356,18 +356,18 @@ msgstr ""
#: view:crm.fundraising:0
#: view:crm.opportunity:0
msgid "Description Information"
msgstr ""
msgstr "Informação da descrição"
#. module: crm
#: view:crm.lead:0
msgid "Contact Name"
msgstr ""
msgstr "Nome do Contato"
#. module: crm
#: selection:crm.lead.opportunity_set,create_partner,action:0
#: selection:crm.phonecall.opportunity_set,create_partner,action:0
msgid "Link to an existing partner"
msgstr ""
msgstr "Link para um parceiro existente"
#. module: crm
#: field:crm.case.rule,trg_date_range_type:0
@@ -387,7 +387,7 @@ msgstr ""
#. module: crm
#: view:crm.job:0
msgid "Next Interview"
msgstr ""
msgstr "Próxima entrevista"
#. module: crm
#: field:crm.case.rule,regex_history:0
@@ -402,7 +402,7 @@ msgstr ""
#. module: crm
#: model:process.transition,name:crm.process_transition_opportunitymeeting0
msgid "Opportunity Meeting"
msgstr ""
msgstr "Reunindo oportunidades"
#. module: crm
#: help:crm.case,canal_id:0
@@ -411,11 +411,14 @@ msgid ""
"customer. With each commercial opportunity, you can indicate the canall "
"which is this opportunity source."
msgstr ""
"Os canais representam os diferentes modos de comunicação disponíveis com o "
"cliente. A cada oportunidade comercial, você pode indicar o canal que é essa "
"fonte de oportunidade."
#. module: crm
#: view:crm.meeting:0
msgid "Exception Rules"
msgstr ""
msgstr "Regras de exceção"
#. module: crm
#: field:crm.menu.config_wizard,opportunity:0
@@ -426,7 +429,7 @@ msgstr "Oportunidades de negócios"
#. module: crm
#: model:crm.case.stage,name:crm.stage_claim1
msgid "Accepted as Claim"
msgstr ""
msgstr "Aceito como reivindicação"
#. module: crm
#: view:crm.case.rule:0
@@ -455,13 +458,13 @@ msgstr ""
#. module: crm
#: view:crm.meeting:0
msgid "Confirm Meeting"
msgstr ""
msgstr "Confirmar reunião"
#. module: crm
#: model:crm.case.categ,name:crm.categ_lead1
#: model:crm.case.categ,name:crm.categ_oppor1
msgid "Existing Customer"
msgstr ""
msgstr "Cliente existente"
#. module: crm
#: model:crm.case.category2,name:crm.category_meet2
@@ -485,7 +488,7 @@ msgstr "Categoria"
#: model:ir.ui.menu,name:crm.menu_crm_case_section_categ_stage_tree
#: view:report.crm.case.section.categ.stage:0
msgid "Cases by Section, Category and Stage"
msgstr ""
msgstr "Casos por seção, categoria e estágio"
#. module: crm
#: help:crm.case.rule,act_mail_to_watchers:0
@@ -497,7 +500,7 @@ msgstr ""
#. module: crm
#: field:crm.meeting,class:0
msgid "Privacy"
msgstr ""
msgstr "Privacidade"
#. module: crm
#: view:crm.case.rule:0
@@ -565,12 +568,12 @@ msgstr ""
#: selection:report.crm.case.section.categ2,month:0
#: selection:report.crm.case.section.stage,month:0
msgid "August"
msgstr ""
msgstr "Agosto"
#. module: crm
#: view:crm.meeting:0
msgid "Meetings Tree"
msgstr ""
msgstr "Árvore de reuniões"
#. module: crm
#: code:addons/crm/crm.py:0
@@ -587,7 +590,7 @@ msgstr "Escalada"
#. module: crm
#: model:ir.ui.menu,name:crm.menu_crm_case_categ_meet
msgid "All Meetings"
msgstr ""
msgstr "Todas as reuniões"
#. module: crm
#: model:ir.module.module,shortdesc:crm.module_meta_information
@@ -606,7 +609,7 @@ msgstr ""
#: selection:report.crm.case.section.categ2,month:0
#: selection:report.crm.case.section.stage,month:0
msgid "June"
msgstr ""
msgstr "Junho"
#. module: crm
#: field:crm.segmentation,som_interval_default:0
@@ -616,7 +619,7 @@ msgstr "Padrão (0=Nada)"
#. module: crm
#: model:crm.case.stage,name:crm.stage_job7
msgid "Refused by Company"
msgstr ""
msgstr "Recusado pela Empresa"
#. module: crm
#: field:crm.case,planned_revenue:0
@@ -634,12 +637,12 @@ msgstr "Permite exclusão"
#: selection:report.crm.case.section.categ2,month:0
#: selection:report.crm.case.section.stage,month:0
msgid "October"
msgstr ""
msgstr "Outubro"
#. module: crm
#: model:crm.case.stage,name:crm.stage_oppor3
msgid "Value Proposition"
msgstr ""
msgstr "Proposta de valor"
#. module: crm
#: view:crm.case.rule:0
@@ -654,12 +657,12 @@ msgstr ""
#. module: crm
#: help:crm.case,email_from:0
msgid "These people will receive email."
msgstr ""
msgstr "Essas pessoas receberão e-mail."
#. module: crm
#: help:crm.case.section,calendar:0
msgid "Allows to show calendar"
msgstr ""
msgstr "Permite mostrar calendário"
#. module: crm
#: view:crm.job:0
@@ -667,13 +670,13 @@ msgstr ""
#: view:crm.opportunity:0
#: view:crm.phonecall:0
msgid " Today "
msgstr ""
msgstr " Hoje "
#. module: crm
#: wizard_view:crm.job.reschedule_phone_call,init:0
#: wizard_view:crm.opportunity.reschedule_phone_call,init:0
msgid "Phone Call Description"
msgstr ""
msgstr "Descrição da chamada telefônica"
#. module: crm
#: view:crm.case.categ:0
@@ -709,7 +712,7 @@ msgstr ""
#. module: crm
#: view:crm.phonecall:0
msgid "Assigned to"
msgstr ""
msgstr "Atribuído a"
#. module: crm
#: view:res.partner.events:0
@@ -719,7 +722,7 @@ msgstr "Eventos dos parceiros"
#. module: crm
#: model:crm.case.stage,name:crm.stage_job4
msgid "Contract Proposed"
msgstr ""
msgstr "Contrato proposto"
#. module: crm
#: model:ir.ui.menu,name:crm.menu_crm_case_job_req_main
@@ -732,7 +735,7 @@ msgstr ""
#: view:crm.lead:0
#: view:crm.opportunity:0
msgid "Related Cases"
msgstr ""
msgstr "Casos relacionados"
#. module: crm
#: selection:report.crm.case.section.categ.categ2,month:0
@@ -740,7 +743,7 @@ msgstr ""
#: selection:report.crm.case.section.categ2,month:0
#: selection:report.crm.case.section.stage,month:0
msgid "September"
msgstr ""
msgstr "Setembro"
#. module: crm
#: view:crm.case:0
@@ -755,33 +758,33 @@ msgstr "Histórico"
#. module: crm
#: view:crm.claim:0
msgid "New Claims"
msgstr ""
msgstr "Pedidos Novos"
#. module: crm
#: view:crm.meeting:0
msgid "Meetings Form"
msgstr ""
msgstr "Formulario de reuniões"
#. module: crm
#: model:crm.case.stage,name:crm.stage_oppor5
msgid "Negotiation/Review"
msgstr ""
msgstr "Negociação/Revisão"
#. module: crm
#: code:addons/crm/wizard/crm_phonecall_wizard.py:0
#, python-format
msgid "A partner is already defined on this phonecall."
msgstr ""
msgstr "Um parceiro já está definido sobre esta chamada."
#. module: crm
#: model:ir.ui.menu,name:crm.menu_action_report_crm_case_oppor_stage
msgid "Cases by Opportunities and Stage"
msgstr ""
msgstr "Casos por oportunidades e estágios"
#. module: crm
#: view:crm.claim:0
msgid "Date of Claim"
msgstr ""
msgstr "Data da reivindicação"
#. module: crm
#: view:crm.segmentation.line:0
@@ -796,7 +799,7 @@ msgstr ""
#. module: crm
#: view:crm.lead:0
msgid "Leads Form"
msgstr ""
msgstr "Formulário de ligações"
#. module: crm
#: view:crm.segmentation:0
@@ -807,7 +810,7 @@ msgstr "Segmentação de parceiros"
#. module: crm
#: model:crm.case.stage,name:crm.stage_job5
msgid "Contract Signed"
msgstr ""
msgstr "Contrato assinado"
#. module: crm
#: wizard_view:caldav.crm.subscribe,init:0
@@ -817,7 +820,7 @@ msgstr ""
#. module: crm
#: model:crm.case.category2,name:crm.category_oppor1
msgid "Existing Business"
msgstr ""
msgstr "Negócios existentes"
#. module: crm
#: field:crm.case,probability:0
@@ -855,7 +858,7 @@ msgstr "Regra do caso"
#: model:ir.ui.menu,name:crm.menu_action_report_crm_case_oppor
#, python-format
msgid "Opportunity"
msgstr ""
msgstr "Oportunidade"
#. module: crm
#: view:crm.case:0
@@ -870,7 +873,7 @@ msgstr ""
#. module: crm
#: model:crm.case.category2,name:crm.category_lead7
msgid "Television"
msgstr ""
msgstr "Televisão"
#. module: crm
#: view:crm.segmentation:0
@@ -906,13 +909,13 @@ msgstr "Valor"
#. module: crm
#: help:caldav.crm.export,init,name:0
msgid "Save in .ics format"
msgstr ""
msgstr "Salve em formato .ics"
#. module: crm
#: wizard_field:crm.new.send.mail,init,text:0
#: wizard_field:crm.send.mail,init,text:0
msgid "Message"
msgstr ""
msgstr "Mensagem"
#. module: crm
#: help:crm.segmentation,exclusif:0
@@ -946,7 +949,7 @@ msgstr "Definir estado para"
#: code:addons/crm/crm.py:0
#, python-format
msgid "Email!"
msgstr ""
msgstr "Email!"
#. module: crm
#: model:crm.case.category2,name:crm.category_lead6
+3 -1
View File
@@ -139,7 +139,9 @@ class opportunity2meeting(wizard.interface):
new_meeting_id = meeting_case_obj.create(cr, uid, {
'name': opportunity.name,
'date': opportunity.date,
'section_id' : opportunity.section_id and opportunity.section_id.id or False,
'date_deadline': opportunity.date_deadline,
'description':opportunity.description,
})
new_meeting = meeting_case_obj.browse(cr, uid, new_meeting_id)
vals = {}
@@ -164,7 +166,7 @@ class opportunity2meeting(wizard.interface):
'view_mode': 'calendar,form,tree',
'res_model': 'crm.meeting',
'view_id': False,
'views': [(id1,'calendar'),(id2,'form'),(id3,'tree'),(False,'graph')],
'views': [(id1,'calendar'),(id2,'form'),(id3,'tree')],
'type': 'ir.actions.act_window',
'search_view_id': id['res_id']
}
+4 -3
View File
@@ -102,8 +102,7 @@ class phonecall2opportunity(wizard.interface):
'name': data['form']['name'],
'planned_revenue': data['form']['planned_revenue'],
'probability': data['form']['probability'],
'partner_id': data['form']['partner_id'],
'phonecall_id':phonecall.id,
'partner_id': data['form']['partner_id'],
'section_id':phonecall.section_id.id,
'description':phonecall.description,
})
@@ -200,7 +199,9 @@ class phonecall2meeting(wizard.interface):
new_meeting_id = meeting_case_obj.create(cr, uid, {
'name': phonecall.name,
'date': phonecall.date,
'section_id' : phonecall.section_id and phonecall.section_id.id or False,
'duration': phonecall.duration,
'description':phonecall.description,
})
new_meeting = meeting_case_obj.browse(cr, uid, new_meeting_id)
vals = {}
@@ -225,7 +226,7 @@ class phonecall2meeting(wizard.interface):
'view_mode': 'calendar,form,tree',
'res_model': 'crm.meeting',
'view_id': False,
'views': [(id1,'calendar'),(id2,'form'),(id3,'tree'),(False,'graph')],
'views': [(id1,'calendar'),(id2,'form'),(id3,'tree')],
'type': 'ir.actions.act_window',
'search_view_id': id['res_id']
}
+2 -2
View File
@@ -3,11 +3,11 @@
<data>
<menuitem icon="terp-hr" id="menu_hr_root" name="Human Resources"/>
<menuitem id="menu_hr_human_resources" sequence="1" name="Human Resources" parent="menu_hr_root"/>
<menuitem
<!-- <menuitem
id="menu_hr_reporting"
name="Reporting"
parent="hr.menu_hr_root"
sequence="40" />
sequence="40" /> -->
<menuitem
id="menu_hr_configuration"
name="Configuration"
+26
View File
@@ -0,0 +1,26 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import hr_evaluation
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+40
View File
@@ -0,0 +1,40 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"name" : "Human Resources Evaluation",
"version" : "0.1",
"author" : "Tiny",
"category" : "Generic Modules/Human Resources",
"website" : "http://www.openerp.com",
"depends" : ["hr","survey"],
"description": "Ability to create employees evaluation.",
"init_xml" : [],
"demo_xml" : ["hr_evaluation_demo.xml"],
"update_xml" : [
# "security/ir.model.access.csv",
"hr_evaluation_view.xml",
"hr_evaluation_data.xml"],
"active": False,
"installable": True
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+142
View File
@@ -0,0 +1,142 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import fields, osv
class hr_evaluation_plan(osv.osv):
_name = "hr_evaluation.plan"
_description = "Evaluation Plan"
_columns = {
'name': fields.char("Evaluation Plan", size=64, required=True),
'company_id': fields.many2one('res.company', 'Company', required=True),
'phase_ids' : fields.one2many('hr_evaluation.plan.phase', 'plan_id', 'Evaluation Phases'),
'month_first': fields.integer('First Evaluation After'),
'month_next': fields.integer('Next Evaluation After'),
'active': fields.boolean('Active')
}
_defaults = {
'active' : lambda *a: True,
}
hr_evaluation_plan()
class hr_evaluation_plan_phase(osv.osv):
_name = "hr_evaluation.plan.phase"
_description = "Evaluation Plan Phase"
_order = "sequence"
_columns = {
'name': fields.char("Phase", size=64, required=True),
'sequence': fields.integer("Sequence"),
'company_id': fields.related('plan_id','company_id',type='many2one',relation='res.company',string='Company',store=True),
'plan_id': fields.many2one('hr_evaluation.plan','Evaluation Plan', required=True, ondelete='cascade'),
'action': fields.selection([
('top-down','Top-Down Appraisal Requests'),
('bottom-up','Bottom-Up Appraisal Requests'),
('self','Self Appraisal Requests'),
('final','Final Interview')], 'Action', required=True),
'survey_id': fields.many2one('survey','Appraisal Form'),
'send_answer_manager': fields.boolean('All Answers',
help="Send all answers to the manager"),
'send_answer_employee': fields.boolean('All Answers',
help="Send all answers to the employee"),
'send_anonymous_manager': fields.boolean('Anonymous Summary',
help="Send an anonymous summary to the manager"),
'send_anonymous_employee': fields.boolean('Anonymous Summary',
help="Send an anonymous summary to the employee"),
'wait': fields.boolean('Wait Previous Phases',
help="Check this box if you want to wait that all preceeding phases " +
"are finished before launching this phase.")
}
_defaults = {
'sequence' : lambda *a: 1,
}
hr_evaluation_plan_phase()
class hr_employee(osv.osv):
_inherit="hr.employee"
_columns = {
'evaluation_plan_id': fields.many2one('hr_evaluation.plan', 'Evaluation Plan'),
'evaluation_date': fields.date('Next Evaluation', help="Date of the next evaluation"),
}
def onchange_evaluation_plan_id(self, *args):
# return the right evaluation date
pass
hr_employee()
class hr_evaluation(osv.osv):
_name = "hr_evaluation.evaluation"
_description = "Employee Evaluation"
_rec_name = 'employee_id'
_columns = {
'date': fields.date("Evaluation Deadline", required=True),
'employee_id': fields.many2one('hr.employee', "Employee", required=True),
'manager_id': fields.many2one('res.users', "Manager", required=True),
'note_summary': fields.text('Evaluation Summary'),
'note_action': fields.text('Action Plan',
help="If the evaluation does not meet the expectations, you can propose"+
"an action plan"),
'rating': fields.selection([
('0','Significantly bellow expectations'),
('1','Did not meet expectations'),
('2','Meet expectations'),
('3','Exceeds expectations'),
('4','Significantly exceeds expectations'),
], "Overall Rating", help="This is the overall rating on that summarize the evaluation"),
'survey_request_ids': fields.many2many('survey.request',
'hr_evaluation_evaluation_requests',
'evaluation_id',
'survey_id',
'Appraisal Forms'),
'plan_id': fields.many2one('hr_evaluation.plan', 'Plan'),
'phase_id': fields.many2one('hr_evaluation.plan.phase', 'Phase'),
'state': fields.selection([
('draft','Draft'),
('wait','Plan In Progress'),
('progress','Final Validation'),
('done','Done'),
('cancel','Cancelled'),
], 'State', required=True,readonly=True)
}
_defaults = {
'date' : lambda *a: time.strftime('%Y-%m-%d'),
'state' : lambda *a: 'draft',
}
def button_plan_in_progress(self,cr, uid, ids, context):
self.write(cr,uid,ids,{'state':'wait'})
return True
def button_final_validation(self,cr, uid, ids, context):
self.write(cr,uid,ids,{'state':'progress'})
return True
def button_done(self,cr, uid, ids, context):
self.write(cr,uid,ids,{'state':'done'})
return True
def button_cancel(self,cr, uid, ids, context):
self.write(cr,uid,ids,{'state':'cancel'})
return True
hr_evaluation()
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,6 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
</data>
</openerp>
+185
View File
@@ -0,0 +1,185 @@
<?xml version="1.0" ?>
<openerp>
<data>
<record model="ir.ui.view" id="view_hr_evaluation_plan_form">
<field name="name">hr_evaluation.plan.form</field>
<field name="model">hr_evaluation.plan</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Evaluation Plan">
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="company_id" select="1" widget="selection"/>
<field name="active"/>
<field name="month_first"/>
<field name="month_next"/>
<label string="(months)" align="0.0"/>
</group>
<notebook colspan="4">
<page string="Evaluation Phases">
<field name="phase_ids" nolabel="1" colspan="4"/>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_hr_evaluation_plan_tree">
<field name="name">hr_evaluation.plan.form</field>
<field name="model">hr_evaluation.plan</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Evaluation Plan">
<field name="name"/>
<field name="month_first"/>
<field name="month_next"/>
<field name="company_id"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="open_view_hr_evaluation_plan_tree">
<field name="res_model">hr_evaluation.plan</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Evaluations" parent="hr.menu_hr_root" id="menu_eval_hr" sequence="3"/>
<!--menuitem name="HR Responsible" parent="menu_eval_hr" id="menu_resp_hr"/-->
<menuitem
name="Evaluation Plan" parent="menu_eval_hr"
id="menu_open_view_hr_evaluation_plan_tree"
action="open_view_hr_evaluation_plan_tree"/>
<record model="ir.ui.view" id="view_hr_evaluation_plan_phase_form">
<field name="name">hr_evaluation.plan.phase.form</field>
<field name="model">hr_evaluation.plan.phase</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Evaluation Plan Phase">
<group col="6" colspan="4">
<field name="name"/>
<field name="wait"/>
<field name="sequence"/>
</group>
<group col="4" colspan="4">
<separator string="Action to Perform" colspan="4"/>
<field name="action"/>
<field name="survey_id" widget="selection"/>
</group>
<group col="4" colspan="4">
<group col="4" colspan="2">
<separator string="Send to Managers" colspan="2"/>
<newline/>
<field name="send_answer_manager"/>
<newline/>
<field name="send_anonymous_manager"/>
</group>
<group col="4" colspan="2">
<separator string="Send to Employees" colspan="2"/>
<newline/>
<field name="send_answer_employee"/>
<newline/>
<field name="send_anonymous_employee"/>
</group>
</group>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_hr_evaluation_plan_phase_tree">
<field name="name">hr_evaluation.plan.phase.form</field>
<field name="model">hr_evaluation.plan.phase</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Evaluation Plan Phase" editable="bottom" >
<field name="sequence"/>
<field name="name"/>
<field name="action"/>
<field name="survey_id" widget="selection"/>
<field name="wait"/>
</tree>
</field>
</record>
<record id="hr_hr_employee_view_form" model="ir.ui.view">
<field name="name">hr.hr.employee.view.form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Evaluation">
<field name="evaluation_plan_id"/>
<field name="evaluation_date"/>
</page>
</notebook>
</field>
</record>
<record model="ir.ui.view" id="view_hr_evaluation_form">
<field name="name">hr_evaluation.evaluation.form</field>
<field name="model">hr_evaluation.evaluation</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Evaluation">
<group col="4" colspan="4">
<field name="date" select="1"/>
<field name="rating"/>
<field name="employee_id" select="1"/>
<field name="manager_id" select="1"/>
<field name="plan_id"/>
<field name="phase_id"/>
</group>
<notebook colspan="4">
<page string="Appraisal">
<field name="survey_request_ids" nolabel="1" colspan="4"/>
</page>
<page string="Action Plan">
<field name="note_action" colspan="4" nolabel="1"/>
</page>
<page string="Summary">
<field name="note_summary" colspan="4" nolabel="1"/>
</page>
</notebook>
<newline/>
<group col="6" colspan="4">
<field name="state"/>
<button name="button_plan_in_progress"
string="Plan In Progress"
states="draft"
type="object"/>
<button name="button_final_validation"
string="Final Validation"
states="wait"
type="object"/>
<button name="button_done"
string="Done"
states="progress"
type="object"/>
<button name="button_cancel"
string="Cancel"
states="draft,wait,progress"
type="object"/>
</group>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_hr_evaluation_tree">
<field name="name">hr_evaluation.evaluation.form</field>
<field name="model">hr_evaluation.evaluation</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Evaluation">
<field name="date"/>
<field name="employee_id"/>
<field name="manager_id"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="open_view_hr_evaluation_tree">
<field name="res_model">hr_evaluation.evaluation</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem
name="Evaluation" parent="menu_eval_hr"
id="menu_open_view_hr_evaluation_tree"
action="open_view_hr_evaluation_tree"/>
</data>
</openerp>
+275
View File
@@ -0,0 +1,275 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * hr_evaluation
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.6\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-11-25 12:18:06+0000\n"
"PO-Revision-Date: 2009-11-25 12:18:06+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: hr_evaluation
#: view:hr_evaluation.type:0
#: field:hr_evaluation.type,info:0
msgid "Information"
msgstr ""
#. module: hr_evaluation
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
msgid "Schedule next evaluation"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
#: field:hr_evaluation.evaluation,info_bad:0
msgid "Bad Points"
msgstr ""
#. module: hr_evaluation
#: model:ir.actions.act_window,name:hr_evaluation.open_view_employee_evaluation_next_my_list
msgid "My Next Evaluation"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.type,value_ids:0
msgid "Values"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
#: field:hr_evaluation.evaluation,info_good:0
msgid "Good Points"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.evaluation,state:0
msgid "State"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.evaluation,score:0
#: field:hr_evaluation.quote,score:0
#: field:hr_evaluation.type,score:0
#: field:hr_evaluation.type.value,score:0
msgid "Score"
msgstr ""
#. module: hr_evaluation
#: selection:hr_evaluation.evaluation,state:0
msgid "Draft"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
msgid "Informal Data"
msgstr ""
#. module: hr_evaluation
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.evaluation,employee_id:0
msgid "Employee"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
#: field:hr_evaluation.evaluation,info_improve:0
msgid "To Improve"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.quote,evaluation_id:0
msgid "Evaluation"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.type.value,type_id:0
msgid "Evaluation Type"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
msgid "Status"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.type:0
msgid "Apply to categories"
msgstr ""
#. module: hr_evaluation
#: model:ir.module.module,description:hr_evaluation.module_meta_information
msgid "Ability to create employees evaluation."
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.quote,name:0
msgid "Quote"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.type,category_ids:0
msgid "Appliable Role"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.evaluation,user_id:0
msgid "Evaluation User"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.type:0
msgid "Choices Results"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.evaluation,date:0
msgid "Date"
msgstr ""
#. module: hr_evaluation
#: model:ir.ui.menu,name:hr_evaluation.menu_eval_hr
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_form
msgid "Evaluations"
msgstr ""
#. module: hr_evaluation
#: model:ir.ui.menu,name:hr_evaluation.menu_eval_config
msgid "Configuration"
msgstr ""
#. module: hr_evaluation
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_next_list
msgid "Next Evaluations"
msgstr ""
#. module: hr_evaluation
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: hr_evaluation
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_evaluation_type_form
msgid "Evaluation Criterions"
msgstr ""
#. module: hr_evaluation
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_my_old_evaluation_list
msgid "My Preceeding Evaluations"
msgstr ""
#. module: hr_evaluation
#: model:ir.ui.menu,name:hr_evaluation.menu_resp_hr
msgid "HR Responsible"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.quote,value_id:0
#: field:hr_evaluation.type.value,name:0
msgid "Value"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.evaluation,name:0
msgid "Summary"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.type,active:0
msgid "Active"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.type:0
msgid "Notes"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
#: model:ir.model,name:hr_evaluation.model_hr_evaluation_evaluation
msgid "Employee Evaluation"
msgstr ""
#. module: hr_evaluation
#: model:ir.model,name:hr_evaluation.model_hr_evaluation_type
msgid "Employee Evaluation Type"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
msgid "Quotations"
msgstr ""
#. module: hr_evaluation
#: model:ir.actions.act_window,name:hr_evaluation.open_view_employee_evaluation_next_list
msgid "Next Employee Evaluation"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.quote,type_id:0
msgid "Type"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.type:0
#: field:hr_evaluation.type,name:0
msgid "Evaluation Criterion"
msgstr ""
#. module: hr_evaluation
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_next_my_list
msgid "My Next Evaluations"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.quote:0
msgid "Evalution Quote"
msgstr ""
#. module: hr_evaluation
#: model:ir.module.module,shortdesc:hr_evaluation.module_meta_information
msgid "Human Resources Evaluation"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.evaluation,quote_ids:0
msgid "Quotes"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
#: selection:hr_evaluation.evaluation,state:0
msgid "Done"
msgstr ""
#. module: hr_evaluation
#: model:ir.model,name:hr_evaluation.model_hr_evaluation_quote
msgid "Employee Evaluation Quote"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
#: field:hr_evaluation.evaluation,info_employee:0
msgid "Employee Response"
msgstr ""
#. module: hr_evaluation
#: model:ir.model,name:hr_evaluation.model_hr_evaluation_type_value
msgid "Evaluation Type Value"
msgstr ""
+275
View File
@@ -0,0 +1,275 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * hr_evaluation
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.6\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-11-25 12:18:06+0000\n"
"PO-Revision-Date: 2009-11-25 12:18:06+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: hr_evaluation
#: view:hr_evaluation.type:0
#: field:hr_evaluation.type,info:0
msgid "Information"
msgstr ""
#. module: hr_evaluation
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
msgid "Schedule next evaluation"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
#: field:hr_evaluation.evaluation,info_bad:0
msgid "Bad Points"
msgstr ""
#. module: hr_evaluation
#: model:ir.actions.act_window,name:hr_evaluation.open_view_employee_evaluation_next_my_list
msgid "My Next Evaluation"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.type,value_ids:0
msgid "Values"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
#: field:hr_evaluation.evaluation,info_good:0
msgid "Good Points"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.evaluation,state:0
msgid "State"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.evaluation,score:0
#: field:hr_evaluation.quote,score:0
#: field:hr_evaluation.type,score:0
#: field:hr_evaluation.type.value,score:0
msgid "Score"
msgstr ""
#. module: hr_evaluation
#: selection:hr_evaluation.evaluation,state:0
msgid "Draft"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
msgid "Informal Data"
msgstr ""
#. module: hr_evaluation
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.evaluation,employee_id:0
msgid "Employee"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
#: field:hr_evaluation.evaluation,info_improve:0
msgid "To Improve"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.quote,evaluation_id:0
msgid "Evaluation"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.type.value,type_id:0
msgid "Evaluation Type"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
msgid "Status"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.type:0
msgid "Apply to categories"
msgstr ""
#. module: hr_evaluation
#: model:ir.module.module,description:hr_evaluation.module_meta_information
msgid "Ability to create employees evaluation."
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.quote,name:0
msgid "Quote"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.type,category_ids:0
msgid "Appliable Role"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.evaluation,user_id:0
msgid "Evaluation User"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.type:0
msgid "Choices Results"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.evaluation,date:0
msgid "Date"
msgstr ""
#. module: hr_evaluation
#: model:ir.ui.menu,name:hr_evaluation.menu_eval_hr
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_form
msgid "Evaluations"
msgstr ""
#. module: hr_evaluation
#: model:ir.ui.menu,name:hr_evaluation.menu_eval_config
msgid "Configuration"
msgstr ""
#. module: hr_evaluation
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_next_list
msgid "Next Evaluations"
msgstr ""
#. module: hr_evaluation
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: hr_evaluation
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_evaluation_type_form
msgid "Evaluation Criterions"
msgstr ""
#. module: hr_evaluation
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_my_old_evaluation_list
msgid "My Preceeding Evaluations"
msgstr ""
#. module: hr_evaluation
#: model:ir.ui.menu,name:hr_evaluation.menu_resp_hr
msgid "HR Responsible"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.quote,value_id:0
#: field:hr_evaluation.type.value,name:0
msgid "Value"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.evaluation,name:0
msgid "Summary"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.type,active:0
msgid "Active"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.type:0
msgid "Notes"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
#: model:ir.model,name:hr_evaluation.model_hr_evaluation_evaluation
msgid "Employee Evaluation"
msgstr ""
#. module: hr_evaluation
#: model:ir.model,name:hr_evaluation.model_hr_evaluation_type
msgid "Employee Evaluation Type"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
msgid "Quotations"
msgstr ""
#. module: hr_evaluation
#: model:ir.actions.act_window,name:hr_evaluation.open_view_employee_evaluation_next_list
msgid "Next Employee Evaluation"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.quote,type_id:0
msgid "Type"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.type:0
#: field:hr_evaluation.type,name:0
msgid "Evaluation Criterion"
msgstr ""
#. module: hr_evaluation
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_next_my_list
msgid "My Next Evaluations"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.quote:0
msgid "Evalution Quote"
msgstr ""
#. module: hr_evaluation
#: model:ir.module.module,shortdesc:hr_evaluation.module_meta_information
msgid "Human Resources Evaluation"
msgstr ""
#. module: hr_evaluation
#: field:hr_evaluation.evaluation,quote_ids:0
msgid "Quotes"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
#: selection:hr_evaluation.evaluation,state:0
msgid "Done"
msgstr ""
#. module: hr_evaluation
#: model:ir.model,name:hr_evaluation.model_hr_evaluation_quote
msgid "Employee Evaluation Quote"
msgstr ""
#. module: hr_evaluation
#: view:hr_evaluation.evaluation:0
#: field:hr_evaluation.evaluation,info_employee:0
msgid "Employee Response"
msgstr ""
#. module: hr_evaluation
#: model:ir.model,name:hr_evaluation.model_hr_evaluation_type_value
msgid "Evaluation Type Value"
msgstr ""
@@ -0,0 +1,9 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_evaluation_evaluation","hr_evaluation.evaluation","model_hr_evaluation_evaluation",hr.group_hr_user,1,0,0,0
"access_hr_evaluation_type","hr_evaluation.type","model_hr_evaluation_type",hr.group_hr_user,1,0,0,0
"access_hr_evaluation_type_value","hr_evaluation.type.value","model_hr_evaluation_type_value",hr.group_hr_user,1,0,0,0
"access_hr_evaluation_quote","hr_evaluation.quote","model_hr_evaluation_quote",hr.group_hr_user,1,0,0,0
"access_hr_evaluation_evaluation_manager","hr_evaluation.evaluation","model_hr_evaluation_evaluation",hr.group_hr_manager,1,1,1,1
"access_hr_evaluation_type_manager","hr_evaluation.type","model_hr_evaluation_type",hr.group_hr_manager,1,1,1,1
"access_hr_evaluation_type_value_manager","hr_evaluation.type.value","model_hr_evaluation_type_value",hr.group_hr_manager,1,1,1,1
"access_hr_evaluation_quote_manager","hr_evaluation.quote","model_hr_evaluation_quote",hr.group_hr_manager,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_evaluation_evaluation hr_evaluation.evaluation model_hr_evaluation_evaluation hr.group_hr_user 1 0 0 0
3 access_hr_evaluation_type hr_evaluation.type model_hr_evaluation_type hr.group_hr_user 1 0 0 0
4 access_hr_evaluation_type_value hr_evaluation.type.value model_hr_evaluation_type_value hr.group_hr_user 1 0 0 0
5 access_hr_evaluation_quote hr_evaluation.quote model_hr_evaluation_quote hr.group_hr_user 1 0 0 0
6 access_hr_evaluation_evaluation_manager hr_evaluation.evaluation model_hr_evaluation_evaluation hr.group_hr_manager 1 1 1 1
7 access_hr_evaluation_type_manager hr_evaluation.type model_hr_evaluation_type hr.group_hr_manager 1 1 1 1
8 access_hr_evaluation_type_value_manager hr_evaluation.type.value model_hr_evaluation_type_value hr.group_hr_manager 1 1 1 1
9 access_hr_evaluation_quote_manager hr_evaluation.quote model_hr_evaluation_quote hr.group_hr_manager 1 1 1 1
Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

+1 -1
View File
@@ -47,7 +47,7 @@
""",
'author': 'Tiny & Axelor',
'website': 'http://www.openerp.com',
'depends': ['hr', 'crm', 'process'],
'depends': ['hr', 'crm', 'process','hr_attendance'],
'init_xml': [],
'update_xml': [
'security/ir.model.access.csv',
@@ -1,6 +1,11 @@
<?xml version="1.0" ?>
<openerp>
<data>
<menuitem
id="hr.menu_hr_reporting"
name="Reporting"
parent="hr.menu_hr_root"
sequence="40" />
<wizard string="Print Summary of Holidays"
name="hr.holidays.summary"
id="holidays_summary"/>
+2 -2
View File
@@ -1,11 +1,11 @@
<?xml version="1.0" ?>
<openerp>
<data>
<menuitem
<!--<menuitem
id="menu_hr_reporting"
name="Reporting"
parent="hr.menu_hr_root"
sequence="40" />
sequence="40" />-->
<!-- Menu Items -->
<record id="view_hr_holidays_filter" model="ir.ui.view">
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem
id="hr.menu_hr_reporting"
name="Reporting"
parent="hr.menu_hr_root"
sequence="40" />
<report auto="False" id="report_user_timesheet" menu="False" model="hr.employee" name="hr.analytical.timesheet" string="Employee timesheet" xsl="hr_timesheet/report/user_timesheet.xsl"/>
<wizard id="wizard_hr_timesheet" menu="False" model="hr.employee" name="hr.analytical.timesheet" string="Employee Timesheet"/>
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem
id="hr.menu_hr_reporting"
name="Reporting"
parent="hr.menu_hr_root"
sequence="40" />
<report auto="False" id="account_analytic_account_cost_ledger" menu="False" model="account.analytic.account" name="hr.timesheet.invoice.account.analytic.account.cost_ledger" rml="account/project/report/cost_ledger.rml" string="Cost Ledger"/>
<wizard id="account_analytic_account_cost_ledger_report" keyword="client_print_multi" model="account.analytic.account" name="hr.timesheet.invoice.account.analytic.account.cost_ledger.report" string="Cost Ledger"/>
@@ -23,8 +27,8 @@
string="Timesheet Profit"
groups="account.group_account_manager"/>
<menuitem action="account_analytic_profit"
id="print_account_analytic_profit"
<menuitem action="account_analytic_profit"
id="print_account_analytic_profit"
parent="hr.menu_hr_reporting"
type="wizard"
groups="hr.group_hr_manager"/>
+26
View File
@@ -0,0 +1,26 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import lunch
import wizard
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+40
View File
@@ -0,0 +1,40 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"name": "Lunch Module",
"author": "Tiny",
"version": "0.1",
"depends": ["base"],
"category" : "Generic Modules/Others",
"init_xml": [],
"update_xml": [
'security/ir.model.access.csv',
'lunch_wizard.xml',
'lunch_view.xml',
'lunch_report.xml',
#'process/lunch_process.xml'
],
"demo_xml": ['lunch_demo.xml'],
"installable": True,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+347
View File
@@ -0,0 +1,347 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * lunch
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.6\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-11-26 04:56:11+0000\n"
"PO-Revision-Date: 2009-11-26 04:56:11+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: lunch
#: model:ir.model,name:lunch.model_lunch_category
#: view:lunch.category:0
#: field:lunch.product,category_id:0
msgid "Category"
msgstr ""
#. module: lunch
#: wizard_view:lunch.cashbox.clean,init:0
msgid "Reset cashbox"
msgstr ""
#. module: lunch
#: selection:lunch.order,state:0
msgid "Confirmed"
msgstr ""
#. module: lunch
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: lunch
#: model:ir.model,name:lunch.model_lunch_cashmove
msgid "lunch.cashmove"
msgstr ""
#. module: lunch
#: wizard_view:lunch.order.cancel,init:0
msgid "Are you sure you want to cancel this order ?"
msgstr ""
#. module: lunch
#: model:ir.module.module,shortdesc:lunch.module_meta_information
msgid "Lunch Module"
msgstr ""
#. module: lunch
#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form
msgid "Cash Moves"
msgstr ""
#. module: lunch
#: rml:lunch.order:0
msgid "Printed at :"
msgstr ""
#. module: lunch
#: model:ir.model,name:lunch.model_lunch_product
msgid "lunch.product"
msgstr ""
#. module: lunch
#: wizard_view:lunch.cashbox.clean,init:0
msgid "Are you sure you want to reset this cashbox ?"
msgstr ""
#. module: lunch
#: field:lunch.order,state:0
msgid "State"
msgstr ""
#. module: lunch
#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form
#: view:lunch.cashbox:0
msgid "CashBox"
msgstr ""
#. module: lunch
#: selection:lunch.order,state:0
msgid "Draft"
msgstr ""
#. module: lunch
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
#. module: lunch
#: field:lunch.cashmove,user_cashmove:0
#: field:lunch.order,user_id:0
#: field:report.lunch.amount,user_id:0
msgid "User Name"
msgstr ""
#. module: lunch
#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree
#: view:report.lunch.amount:0
msgid "Box Amount by User"
msgstr ""
#. module: lunch
#: view:report.lunch.amount:0
msgid "Total box"
msgstr ""
#. module: lunch
#: model:ir.actions.act_window,name:lunch.action_lunch_product_form
#: field:lunch.order,product:0
msgid "Product"
msgstr ""
#. module: lunch
#: rml:lunch.order:0
#: field:lunch.product,description:0
msgid "Description"
msgstr ""
#. module: lunch
#: field:lunch.order,price:0
#: field:lunch.product,price:0
msgid "Price"
msgstr ""
#. module: lunch
#: wizard_button:lunch.order.cancel,init,end:0
msgid "No"
msgstr ""
#. module: lunch
#: view:lunch.category:0
#: rml:lunch.order:0
#: view:lunch.order:0
msgid "Order"
msgstr ""
#. module: lunch
#: field:lunch.cashmove,create_date:0
msgid "Created date"
msgstr ""
#. module: lunch
#: model:ir.ui.menu,name:lunch.menu_lunch
msgid "Lunch"
msgstr ""
#. module: lunch
#: field:lunch.order,descript:0
msgid "Description Order"
msgstr ""
#. module: lunch
#: model:ir.actions.wizard,name:lunch.lunch_order_confirm
#: wizard_button:lunch.order.confirm,init,go:0
msgid "Confirm Order"
msgstr ""
#. module: lunch
#: wizard_view:lunch.order.confirm,init:0
msgid "Orders Confirmation"
msgstr ""
#. module: lunch
#: field:lunch.cashmove,active:0
#: field:lunch.product,active:0
msgid "Active"
msgstr ""
#. module: lunch
#: model:ir.actions.act_window,name:lunch.action_lunch_order_day_form
msgid " Order of the day"
msgstr ""
#. module: lunch
#: model:ir.ui.menu,name:lunch.menu_lunch_category_root
msgid "Configuration"
msgstr ""
#. module: lunch
#: model:ir.actions.wizard,name:lunch.wizard_id_cancel
#: wizard_view:lunch.order.cancel,init:0
msgid "Cancel Order"
msgstr ""
#. module: lunch
#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form
msgid " CashBox "
msgstr ""
#. module: lunch
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: lunch
#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree
msgid "Lunch amount"
msgstr ""
#. module: lunch
#: field:lunch.cashbox,name:0
#: field:lunch.cashmove,name:0
#: field:lunch.category,name:0
#: rml:lunch.order:0
#: field:lunch.product,name:0
msgid "Name"
msgstr ""
#. module: lunch
#: model:ir.actions.act_window,name:lunch.action_lunch_category_form
msgid " Category of product "
msgstr ""
#. module: lunch
#: view:lunch.cashmove:0
msgid "Total amount"
msgstr ""
#. module: lunch
#: model:ir.model,name:lunch.model_lunch_cashbox
msgid "lunch.cashbox"
msgstr ""
#. module: lunch
#: field:lunch.order,date:0
msgid "Date"
msgstr ""
#. module: lunch
#: field:lunch.cashmove,amount:0
#: field:report.lunch.amount,amount:0
msgid "Amount"
msgstr ""
#. module: lunch
#: model:ir.ui.menu,name:lunch.menu_lunch_product_form
#: view:lunch.product:0
msgid "Products"
msgstr ""
#. module: lunch
#: model:ir.ui.menu,name:lunch.menu_lunch_category_form
msgid "Category of product"
msgstr ""
#. module: lunch
#: model:ir.actions.report.xml,name:lunch.report_lunch_order
msgid "Print Order"
msgstr ""
#. module: lunch
#: model:ir.ui.menu,name:lunch.menu_lunch_order_day_form
msgid "Order of the day"
msgstr ""
#. module: lunch
#: model:ir.model,name:lunch.model_report_lunch_amount
msgid "Amount available by user and box"
msgstr ""
#. module: lunch
#: view:lunch.category:0
msgid "Category related to Products"
msgstr ""
#. module: lunch
#: model:ir.model,name:lunch.model_lunch_order
msgid "lunch.order"
msgstr ""
#. module: lunch
#: field:lunch.cashbox,sum_remain:0
msgid "Remained Total"
msgstr ""
#. module: lunch
#: model:ir.actions.act_window,name:lunch.action_lunch_order_form
#: model:ir.ui.menu,name:lunch.menu_lunch_order_form
msgid "Make order"
msgstr ""
#. module: lunch
#: model:ir.actions.wizard,name:lunch.wizard_clean_cashbox
msgid "Set CashBox to Zero"
msgstr ""
#. module: lunch
#: field:lunch.cashmove,box:0
#: field:report.lunch.amount,box:0
msgid "Box Name"
msgstr ""
#. module: lunch
#: field:lunch.cashbox,manager:0
msgid "Manager"
msgstr ""
#. module: lunch
#: rml:lunch.order:0
msgid "Unit Price"
msgstr ""
#. module: lunch
#: wizard_field:lunch.order.confirm,init,confirm_cashbox:0
msgid "Name of box"
msgstr ""
#. module: lunch
#: view:lunch.order:0
msgid "Total price"
msgstr ""
#. module: lunch
#: wizard_button:lunch.cashbox.clean,init,end:0
#: wizard_button:lunch.order.confirm,init,end:0
msgid "Cancel"
msgstr ""
#. module: lunch
#: wizard_button:lunch.cashbox.clean,init,zero:0
msgid "Set to Zero"
msgstr ""
#. module: lunch
#: wizard_button:lunch.order.cancel,init,cancel:0
msgid "Yes"
msgstr ""
#. module: lunch
#: model:ir.ui.menu,name:lunch.menu_tools
msgid "Tools"
msgstr ""
#. module: lunch
#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form
#: view:lunch.cashmove:0
#: field:lunch.order,cashmove:0
msgid "CashMove"
msgstr ""
+191
View File
@@ -0,0 +1,191 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
import time
class lunch_category(osv.osv):
_name = 'lunch.category'
_description = "Category"
_columns = {
'name': fields.char('Name', required=True, size=50),
}
_order = 'name'
lunch_category()
class lunch_product(osv.osv):
_name = 'lunch.product'
def _category_name_get(self, cr, uid, context={}):
obj = self.pool.get('lunch.category')
cat_ids= obj.search(cr,uid,[])
res = obj.read(cr,uid,cat_ids,['name', 'category'])
return [(str(r['id']), r['name']) for r in res]+ [('0','')]
_columns = {
'name': fields.char('Name', size=50, required=True),
'category_id': fields.selection(_category_name_get, 'Category', size=32),
'description': fields.char('Description', size=128, required=False),
'price': fields.float('Price', digits=(16,2)),
'active': fields.boolean('Active'),
}
_defaults = {
'active': lambda *a : True,
}
lunch_product()
class lunch_cashbox(osv.osv):
_name='lunch.cashbox'
def amount_available(self, cr, uid, ids, field_name, arg, context):
cr.execute("SELECT box,sum(amount) from lunch_cashmove where active = 't' group by box")
r = dict(cr.fetchall())
for i in ids :
r.setdefault(i,0)
return r
_columns={
'manager':fields.many2one('res.users','Manager'),
'name':fields.char('Name',size=30,required=True, unique = True),
'sum_remain': fields.function(amount_available, method=True, string='Remained Total'),
}
lunch_cashbox()
class lunch_cashmove(osv.osv):
_name= 'lunch.cashmove'
_columns={
'name': fields.char('Name',size=128),
'user_cashmove': fields.many2one('res.users','User Name', required=True),
'amount': fields.float('Amount', digits=(16,2)),
'box':fields.many2one('lunch.cashbox','Box Name',size=30,required=True),
'active':fields.boolean('Active'),
'create_date': fields.datetime('Created date', readonly=True),
}
_defaults={
'active': lambda *a: True,
}
lunch_cashmove()
class lunch_order(osv.osv):
_name='lunch.order'
_rec_name= "user_id"
def _price_get(self, cr, uid, ids, name, args, context=None):
res = {}
for o in self.browse(cr, uid, ids):
res[o.id] = o.product.price
return res
_columns={
'user_id': fields.many2one('res.users','User Name', required=True,
readonly=True, states={'draft':[('readonly',False)]}),
'product':fields.many2one('lunch.product','Product', required=True,
readonly=True, states={'draft':[('readonly',False)]}, change_default=True),
'date': fields.date('Date',readonly=True,states={'draft':[('readonly',False)]}),
'cashmove':fields.many2one('lunch.cashmove', 'CashMove' , readonly=True ),
'descript':fields.char('Description Order', readonly=True, size=50,
states={'draft':[('readonly',False)]}),
'state': fields.selection([('draft','Draft'), ('confirmed','Confirmed'),],
'State', readonly=True, select=True),
'price': fields.function(_price_get, method=True, string="Price"),
}
_defaults={
'user_id': lambda self,cr,uid,context: uid,
'date': lambda self,cr,uid,context: time.strftime('%Y-%m-%d'),
'state': lambda self,cr,uid,context: 'draft',
}
def confirm(self,cr,uid,ids,box,context):
cashmove_ref= self.pool.get('lunch.cashmove')
for order in self.browse(cr,uid,ids):
if order.state == 'confirmed':
continue
new_id= cashmove_ref.create(cr,uid,{'name': order.product.name+' order',
'amount':-order.product.price,
'user_cashmove':order.user_id.id,
'box':box,
'active':True,
})
self.write(cr,uid,[order.id],{'cashmove':new_id, 'state':'confirmed'})
return {}
def lunch_order_cancel(self,cr,uid,ids,context):
orders= self.browse(cr,uid,ids)
for order in orders:
if not order.cashmove:
continue
self.pool.get('lunch.cashmove').unlink(cr, uid, [order.cashmove.id])
self.write(cr,uid,ids,{'state':'draft'})
return {}
def onchange_product(self, cr, uid, ids, product):
if not product:
return {'value': {'price': 0.0}}
price = self.pool.get('lunch.product').read(cr, uid, product, ['price'])['price']
return {'value': {'price': price}}
lunch_order()
class report_lunch_amount(osv.osv):
_name='report.lunch.amount'
_description = "Amount available by user and box"
_auto = False
_rec_name= "user"
_columns = {
'user_id': fields.many2one('res.users','User Name',readonly=True),
'amount': fields.float('Amount', readonly=True, digits=(16,2)),
'box':fields.many2one('lunch.cashbox','Box Name',size=30,readonly=True),
}
def init(self, cr):
cr.execute("""
create or replace view report_lunch_amount as (
select
min(lc.id) as id,
lc.user_cashmove as user_id,
sum(amount) as amount,
lc.box as box
from
lunch_cashmove lc
where
active = 't'
group by lc.user_cashmove, lc.box
)""")
report_lunch_amount()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+20
View File
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<record model="lunch.category" id="categ_sandwich">
<field name="name">Sandwich</field>
</record>
<record model="lunch.product" id="product_club">
<field name="name">Club</field>
<field name="category_id" eval="str(ref('categ_sandwich'))"/>
<field name="price">2.75</field>
</record>
<record model="lunch.cashbox" id="cashbox_cashbox">
<field name="name">Cashbox</field>
<field name="manager" ref="base.user_admin"/>
</record>
</data>
</openerp>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<openerp>
<data>
<report
id="report_lunch_order"
string="Print Order"
model="lunch.order"
name="lunch.order"
rml="lunch/report/order.rml"
auto="False"
/>
</data>
</openerp>
+243
View File
@@ -0,0 +1,243 @@
<?xml version="1.0"?>
<openerp>
<data>
<menuitem icon="STOCK_PREFERENCES" id="base.menu_tools" name="Tools"/>
<!--<menuitem name="Tools" id="menu_tools" icon="STOCK_PREFERENCES"/>
<menuitem name="Lunch Order" parent="menu_tools" id="menu_lunch" sequence="1"/>
<menuitem name="Reporting" parent="menu_tools" id="menu_lunch_reporting" sequence="4"/>
<menuitem name="Lunch Orders" parent="menu_lunch_reporting" id="menu_lunch_reporting_order" sequence="1"/>
<menuitem name="Configuration" parent="menu_tools" id="menu_lunch_category_root" sequence="5"/>-->
<menuitem name="Tools" id="menu_tools" icon="STOCK_PREFERENCES"/>-->
<menuitem name="Lunch Order" parent="base.menu_tools" id="menu_lunch" sequence="1"/>
<menuitem name="Reporting" parent="base.menu_tools" id="menu_lunch_reporting" sequence="4"/>
<menuitem name="Lunch Orders" parent="menu_lunch_reporting" id="menu_lunch_reporting_order" sequence="1"/>
<menuitem name="Configuration" parent="base.menu_tools" id="base.menu_lunch_survey_root" sequence="5"/>
<menuitem name="Lunch" parent="base.menu_lunch_survey_root" id="menu_lunch_category_root_configuration" sequence="5"/>
<record model="ir.ui.view" id="view_lunch_order_form">
<field name="name">Order</field>
<field name="model">lunch.order</field>
<field name="arch" type="xml">
<form string="Order">
<group colspan="2" col="4">
<field name="user_id" select="1"/>
<field name="date" select="1"/>
<field name="product" select="1" on_change="onchange_product(product)"/>
<field name="price"/>
<field name="descript"/>
<field name="cashmove"/>
<field name="state" select="2"/>
</group>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_lunch_order_tree">
<field name="name">Order</field>
<field name="model">lunch.order</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Order">
<field name="user_id"/>
<field name="product"/>
<field name="date"/>
<field name="cashmove"/>
<field name="state"/>
<field name="descript"/>
<field name="price" sum="Total price"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_lunch_order_form">
<field name="name">Orders</field>
<field name="res_model">lunch.order</field>
<field name="view_mode">form,tree</field>
</record>
<menuitem name="Order" parent="menu_lunch" id="menu_lunch_order_form" action="action_lunch_order_form"/>
<!-- <record model="ir.actions.act_window" id="action_lunch_order_day_form">-->
<!-- <field name="name"> Order of the day</field>-->
<!-- <field name="res_model">lunch.order</field>-->
<!-- <field name="domain">[('date','=',time.strftime('%Y-%m-%d'))]</field>-->
<!---->
<!-- </record>-->
<!-- <menuitem name="Order of the day" parent="menu_lunch_order_form" id="menu_lunch_order_day_form" action="action_lunch_order_day_form"/>-->
<record model="ir.ui.view" id="view_lunch_cashbox_form">
<field name="name">CashBox</field>
<field name="model">lunch.cashbox</field>
<field name="arch" type="xml">
<form string="CashBox">
<field name="name" select="1"/>
<field name="manager" select="1"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_lunch_cashbox_tree">
<field name="name">CashBox</field>
<field name="model">lunch.cashbox</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="CashBox" colors="red:sum_remain&lt;=0">
<field name="name" select="1"/>
<field name="manager" select="1"/>
<field name="sum_remain" select="1"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_lunch_cashbox_form">
<field name="name"> CashBox </field>
<field name="res_model">lunch.cashbox</field>
</record>
<menuitem name="CashBox" parent="menu_lunch_category_root_configuration" id="menu_lunch_cashbox_form" action="action_lunch_cashbox_form"/>
<record model="ir.ui.view" id="view_lunch_cashmove_form">
<field name="name">CashMove</field>
<field name="model">lunch.cashmove</field>
<field name="arch" type="xml">
<form string="CashMove">
<field name="name" select="1"/>
<field name="user_cashmove" select="1"/>
<field name="amount" select="2"/>
<field name="box" select="1"/>
<field name="create_date" select="1"/>
<field name="active" select="1"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_lunch_cashmove_tree">
<field name="name">CashMove</field>
<field name="model">lunch.cashmove</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="CashMove" editable="top">
<field name="name" select="1" required="1"/>
<field name="user_cashmove" select="1"/>
<field name="amount" select="1" sum="Total amount"/>
<field name="box" select="1"/>
<field name="create_date"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_lunch_cashmove_form">
<field name="name">CashMove</field>
<field name="res_model">lunch.cashmove</field>
</record>
<menuitem name="Cash Moves" parent="menu_lunch" id="menu_lunch_cashmove_form" action="action_lunch_cashmove_form"/>
<record model="ir.ui.view" id="view_lunch_category_form">
<field name="name"> Category of product </field>
<field name="model">lunch.category</field>
<field name="arch" type="xml">
<form string="Category">
<separator string="Category related to Products" colspan="4"/>
<field name="name" select="1"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_lunch_category_tree">
<field name="name">Category</field>
<field name="model">lunch.category</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Order">
<field name="name" select="1"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_lunch_category_form">
<field name="name"> Category of product </field>
<field name="res_model">lunch.category</field>
</record>
<record model="ir.ui.view" id="view_lunch_product_form">
<field name="name">Products</field>
<field name="type">form</field>
<field name="model">lunch.product</field>
<field name="arch" type="xml">
<form string="Products">
<field name="name" select="1"/>
<field name="category_id" select="1"/>
<field name="description" select="1"/>
<field name="price" select="1"/>
<field name="active" select="1"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_lunch_product_tree">
<field name="name">Products</field>
<field name="model">lunch.product</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Products">
<field name="name" select="1"/>
<field name="category_id" select="1"/>
<field name="description" select="1"/>
<field name="price" select="1"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_lunch_product_form">
<field name="name">Product</field>
<field name="res_model">lunch.product</field>
</record>
<menuitem name="Tools/Lunch/Configuration/Products" id="menu_lunch_product_form" action="action_lunch_product_form" sequence="1"/>
<menuitem name="Products" parent="menu_lunch_category_root_configuration" id="menu_lunch_product_form" action="action_lunch_product_form" sequence="2"/>
<menuitem name="Category of product" parent="menu_lunch_category_root_configuration" id="menu_lunch_category_form" action="action_lunch_category_form" sequence="1"/>
<record model="ir.ui.view" id="view_report_lunch_amount_tree">
<field name="name">Lunch amount</field>
<field name="model">report.lunch.amount</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Box Amount by User">
<field name="box" select="1"/>
<field name="user_id" select="1"/>
<field name="amount" select="1" sum="Total box" />
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_report_lunch_amount_form">
<field name="name">Lunch amount</field>
<field name="model">report.lunch.amount</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Box Amount by User">
<field name="user_id" select="1"/>
<field name="box" select="1"/>
<field name="amount" select="1"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_report_lunch_amount_tree">
<field name="name">Lunch amount</field>
<field name="res_model">report.lunch.amount</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Cash Position by User" parent="menu_lunch_reporting_order" action="action_report_lunch_amount_tree" id="menu_lunch_report_amount_tree"/>
</data>
</openerp>
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" ?>
<openerp>
<data>
<wizard
string="Confirm Order"
model="lunch.order"
name="lunch.order.confirm"
keyword="client_action_multi"
id="lunch_order_confirm"/>
<wizard
string="Cancel Order"
model="lunch.order"
name="lunch.order.cancel"
keyword="client_action_multi"
id="wizard_id_cancel"/>
<wizard
string="Set CashBox to Zero"
model="lunch.cashbox"
name="lunch.cashbox.clean"
keyword="client_action_multi"
id="wizard_clean_cashbox"/>
</data>
</openerp>
+24
View File
@@ -0,0 +1,24 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import order
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+46
View File
@@ -0,0 +1,46 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from report import report_sxw
from osv import osv
class order(report_sxw.rml_parse):
def sum_price(self, orders):
res = 0.0
for o in orders:
res += o.price
return res
def __init__(self, cr, uid, name, context):
super(order, self).__init__(cr, uid, name, context)
self.localcontext.update({
'time': time,
'sum_price': self.sum_price,
})
report_sxw.report_sxw('report.lunch.order', 'lunch.order',
'addons/lunch/report/order.rml',parser=order, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+132
View File
@@ -0,0 +1,132 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="34.0" y1="42.0" width="527" height="758"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tableau2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="GRID" colorName="black"/>
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
<blockBackground colorName="#e6e6e6" start="3,0" stop="3,0"/>
</blockTableStyle>
<blockTableStyle id="Tableau1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="GRID" colorName="black"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Times-Roman" fontSize="15.0" leading="19"/>
<paraStyle name="P2" fontName="Times-Roman" fontSize="16.0" leading="20"/>
<paraStyle name="P3" fontName="Times-Roman"/>
<paraStyle name="P4" fontName="Times-Bold" fontSize="8.0" leading="10" alignment="CENTER"/>
<paraStyle name="P5" fontName="Times-BoldItalic" fontSize="9.0" leading="11" alignment="LEFT"/>
<paraStyle name="P6" fontName="Times-BoldItalic" fontSize="9.0" leading="11"/>
<paraStyle name="P7" fontName="Times-Italic" fontSize="9.0" leading="11" alignment="LEFT"/>
<paraStyle name="P8" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT"/>
<paraStyle name="P9" fontName="Times-Roman" fontSize="9.0" leading="11"/>
<paraStyle name="P10" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT"/>
<paraStyle name="P11" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT"/>
<paraStyle name="P12" fontName="Times-BoldItalic" fontSize="6.0" leading="8"/>
<paraStyle name="P13" fontName="Times-Italic" fontSize="9.0" leading="11" alignment="LEFT"/>
<paraStyle name="P14" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT"/>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Header" fontName="Times-Roman"/>
<paraStyle name="Footer" fontName="Times-Roman"/>
<paraStyle name="Table Contents" fontName="Times-Roman"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
<paraStyle name="Caption" fontName="Times-Roman" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Footnote" rightIndent="0.0" leftIndent="14.0" fontName="Times-Roman" fontSize="10.0" leading="13"/>
<paraStyle name="Index" fontName="Times-Roman"/>
</stylesheet>
<story>
<para style="P1">
<font face="Times-Roman">Printed at : [[time.strftime("%Hh%M")]]</font>
</para>
<para style="P2">
<font color="white"> </font>
</para>
<para style="P3">
<font color="white"> </font>
</para>
<blockTable colWidths="149.0,135.0,103.0,140.0" repeatRows="1" style="Tableau2">
<tr>
<td>
<para style="P4">Name</para>
</td>
<td>
<para style="P4">Order</para>
</td>
<td>
<para style="P4">Description</para>
</td>
<td>
<para style="P4">Unit Price</para>
</td>
</tr>
</blockTable>
<section>
<para style="P5">
<font color="white"> </font>
</para>
</section>
<blockTable colWidths="148.0,135.0,103.0,140.0" style="Tableau1">
<tr>
<td>
<para style="P7">[[repeatIn(objects, 'o') ]]</para>
<para style="P7">[[ o.user_id.name ]]</para>
</td>
<td>
<para style="P8">[[o.product.name ]]</para>
</td>
<td>
<para style="P9">[[ o.descript ]]</para>
<para style="P10">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P14">[['%.2f' % o.price ]]</para>
</td>
</tr>
<tr>
<td>
<para style="P9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P12">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P11">[[ '%.2f' % sum_price(objects) ]]</para>
</td>
</tr>
</blockTable>
<para style="P6">
<font color="white"> </font>
</para>
</story>
</document>
@@ -0,0 +1,7 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_lunch_category","lunch.category","model_lunch_category",base.group_user,1,1,1,1
"access_lunch_product","lunch.product","model_lunch_product",base.group_user,1,1,1,1
"access_lunch_cashbox","lunch.cashbox","model_lunch_cashbox",base.group_user,1,1,1,1
"access_lunch_cashmove","lunch.cashmove","model_lunch_cashmove",base.group_user,1,1,1,1
"access_lunch_order","lunch.order","model_lunch_order",base.group_user,1,1,1,1
"access_report_lunch_amount","report.lunch.amount","model_report_lunch_amount",base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_lunch_category lunch.category model_lunch_category base.group_user 1 1 1 1
3 access_lunch_product lunch.product model_lunch_product base.group_user 1 1 1 1
4 access_lunch_cashbox lunch.cashbox model_lunch_cashbox base.group_user 1 1 1 1
5 access_lunch_cashmove lunch.cashmove model_lunch_cashmove base.group_user 1 1 1 1
6 access_lunch_order lunch.order model_lunch_order base.group_user 1 1 1 1
7 access_report_lunch_amount report.lunch.amount model_report_lunch_amount base.group_user 1 1 1 1
+26
View File
@@ -0,0 +1,26 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import confirm
import cancel
import reset_box
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+53
View File
@@ -0,0 +1,53 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import netsvc
import ir
import pooler
cancel_form = """<?xml version="1.0"?>
<form string="Cancel Order">
<label string="Are you sure you want to cancel this order ?"/>
</form>"""
cancel_fields = {
}
def _cancel(self,cr,uid,data,context):
return pooler.get_pool(cr.dbname).get('lunch.order').lunch_order_cancel(cr,uid,data['ids'],context)
class order_cancel(wizard.interface):
states = {
'init': {
'actions': [],
'result': {'type':'form', 'arch':cancel_form, 'fields':cancel_fields, 'state':[('end','No'),('cancel','Yes')]}
},
'cancel': {
'actions': [_cancel],
'result': {'type':'state', 'state':'end'}
}
}
order_cancel('lunch.order.cancel')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+60
View File
@@ -0,0 +1,60 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import netsvc
import ir
import pooler
confirm_order_form = """<?xml version="1.0"?>
<form title="Confirm">
<separator string="Orders Confirmation" colspan="4"/>
<field name="confirm_cashbox"/>
<newline/>
</form>
"""
confirm_order_fields = {
'confirm_cashbox': {'string':'Name of box', 'type':'many2one', 'required':True, 'relation':'lunch.cashbox' },
}
def _confirm(self,cr,uid,data,context):
pool= pooler.get_pool(cr.dbname)
order_ref = pool.get('lunch.order')
order_ref.confirm(cr,uid,data['ids'],data['form']['confirm_cashbox'],context)
return {}
class order_confirm(wizard.interface):
states = {
'init': {
'action':[],
'result':{'type' : 'form', 'arch' : confirm_order_form, 'fields' : confirm_order_fields, 'state' : [('end', 'Cancel'),('go', 'Confirm Order') ]},
},
'go' : {
'actions' : [_confirm],
'result' : {'type' : 'state', 'state' : 'end'}
},
}
order_confirm('lunch.order.confirm')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+76
View File
@@ -0,0 +1,76 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import netsvc
import ir
import pooler
set_to_zero_form = """<?xml version="1.0"?>
<form string="Reset cashbox">
<label string="Are you sure you want to reset this cashbox ?"/>
</form>"""
confirm_setting_zero_fields = {}
def _set_to_zero(self,cr,uid,data,context):
pool= pooler.get_pool(cr.dbname)
cashmove_ref = pool.get('lunch.cashmove')
cr.execute("select user_cashmove, box,sum(amount) from lunch_cashmove where active= 't' and box in (%s) group by user_cashmove, box"%','.join(map(str,data['ids'])))
res= cr.fetchall()
cr.execute("update lunch_cashmove set active = 'f' where active= 't' and box in (%s)"%','.join(map(str,data['ids'])))
## to_unactive= {}.fromkeys([r[0] for r in cr.fetchall]).keys()
## print to_unactive
## cashmove_ref.write(cr,uid,to_unactive,{'active':False})
##
for (user_id,box_id,amount) in res:
cashmove_ref.create(cr,uid,{'name': 'Summary for user'+ str(user_id),
'amount': amount,
'user_cashmove': user_id,
'box': box_id,
'active': True,
})
return {}
class cashbox_set_to_zero(wizard.interface):
states = {
'init': {
'action':[],
'result':{'type' : 'form',
'arch' : set_to_zero_form,
'fields' : confirm_setting_zero_fields,
'state' : [('end', 'Cancel'),('zero', 'Set to Zero') ]},
},
'zero' : {
'actions' : [_set_to_zero],
'result' : {'type' : 'state', 'state' : 'end'}
},
}
cashbox_set_to_zero('lunch.cashbox.clean')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+7 -4
View File
@@ -82,9 +82,12 @@
</record>
<menuitem name="Membership" id="menu_membership" icon="terp-crm"/>
<menuitem name="Members" parent="menu_membership"
id="menu_member"
sequence="1"/>
<menuitem name="Configuration" parent="menu_membership"
id="menu_conf"
sequence="1"/>
sequence="3"/>
<menuitem name="Membership products" parent="menu_conf"
id="menu_membership_products"
action="action_membership_products"/>
@@ -144,8 +147,8 @@
<field name="view_mode">form</field>
<field name="act_window_id" ref="action_membership_members"/>
</record>
<menuitem name="Current members" parent="menu_membership"
<menuitem name="Current members" parent="menu_member"
id="menu_members"
sequence="2"
action="action_membership_members"/>
@@ -207,7 +210,7 @@
<!-- MEMBERSHIP/REPORTING -->
<menuitem name="Reporting" parent="menu_membership"
sequence="5"
sequence="2"
id="menu_reporting"/>
<!-- REPORTING/MEMBERSHIP BY YEAR -->
+4 -4
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-01-09 14:51+0000\n"
"Last-Translator: Carlo <Unknown>\n"
"PO-Revision-Date: 2010-01-20 13:06+0000\n"
"Last-Translator: Milo Casagrande <milo@casagrande.name>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-01-10 07:17+0000\n"
"X-Launchpad-Export-Date: 2010-01-21 04:34+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp_repair
@@ -479,7 +479,7 @@ msgstr ""
#: selection:mrp.repair,state:0
#: wizard_button:mrp.repair.make_invoice,init,end:0
msgid "Cancel"
msgstr "Cancella"
msgstr "Annulla"
#. module: mrp_repair
#: field:mrp.repair.line,location_dest_id:0
+1 -1
View File
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-01-20 04:36+0000\n"
"X-Launchpad-Export-Date: 2010-01-21 04:34+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: multi_company
+30
View File
@@ -0,0 +1,30 @@
##############################################################################
#
# Copyright (c) 2004 TINY SPRL. (http://tiny.be) All Rights Reserved.
# Fabien Pinckaers <fp@tiny.Be>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import olap
import wizard
+23
View File
@@ -0,0 +1,23 @@
{
"name" : "Olap Schemes Management",
"version" : "0.1",
"author" : "Tiny",
"website" : "http://www.openerp.com",
"depends" : ["base"],
"category" : "Generic Modules/Olap",
"description": """
Base module to manage Olap schemas. Cube designer.
""",
"init_xml" : ["data/olap_data.xml"],
"update_xml" : [
"data/olap_view.xml",
"data/olap_wizard.xml",
"data/olap_cube_view.xml",
"data/olap_fact_view.xml",
"data/olap_cube_workflow.xml",
"data/olap_security.xml"
],
"demo_xml" : ["data/olap_demo.xml"],
"active": False,
"installable": True
}
+69
View File
@@ -0,0 +1,69 @@
DATABASE = 'bi'
all: simple sale date where sublevels calc_meas cross page complex test
simple:
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "tinyerp" -c "select {[User].[all]} on rows, {[measures].[Credit Limit],[measures].[Count]} on columns from Partner"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "tinyerp" -c "select {[measures].[Credit Limit],[measures].[Count]} on rows, {[User].[all],[User].children} on columns from Partner"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "tinyerp" -c "select {[User].children} on rows from Partner"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "tinyerp" -c "select {[User].[all],[User].children} on rows, {[measures].[Credit Limit],[measures].[Count]} on columns from Partner"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "tinyerp" -c "select {[User].children} on rows, {[User].children} on columns from Partner where ([measures].[Count])"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "tinyerp" -c "select {[User].children} on rows, {[measures].[Count]} on columns from Partner where ([User].[3])"
# ./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "tinyerp" -c "select {[Date].[2008]} on rows, {[measures].[Credit Limit],[measures].[Count]} on columns from Partner"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "tinyerp" -c "select {[Date].[all],[Date].children} on rows, {[measures].[Credit Limit],[measures].[Count]} on columns from Partner"
sale:
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[Partner Country].children} on rows from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[City].children} on rows from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[City].children,[City].[Paris].children,[Partner Country].children} on rows, {[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[Order Date].[all],[Order Date].children,[Users].children} on rows, {[measures].[Average Sales],[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[Order Date].children, [Order Date].[all]} on rows, {[measures].[Average Sales],[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[Partner Country].children} on rows, {[measures].[Average Sales],[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[Partner Country].[China]} on rows, {[measures].[Average Sales],[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[Partner Country].[Belgium]} on rows, {[measures].[Average Sales],[measures].[Total Sales]} on columns from Sales"
date:
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[Order Date].children} on rows, {[measures].[Average Sales],[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[Order Date].[2007]} on rows, {[measures].[Average Sales],[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[Order Date].[2008]} on rows, {[measures].[Average Sales],[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[Order Date].children,[Order Date].[2008].children,[Order Date].[2008].[Q2].children} on rows, {[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[Order Date].children,[Order Date].[2008].children,[Order Date].[2008].[Q2].children} on rows, {[measures].[Total Sales]} on columns from Sales where ([Order Date].[2008].[Q2])"
where:
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c " select crossjoin (crossjoin ({[Order Date].[all],[Users].[all]} , {[Users].children} ) , {[Partner Country].[all]}) on rows, {[measures].[Units Sold]} on columns from Sales"
sublevels:
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[City].[all],[City].children} on rows, {[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[City].[all],[City].children} on rows, {[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[City].[all],[City].children,[City].[Liege].children} on rows, {[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[Products Category].[all],[Products Category].children} on rows, {[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[Products Category].[all],[Products Category].children,[Products Category].[PC].children} on rows, {[measures].[Total Sales]} on columns from Sales"
calc_meas:
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[City].[all]} on rows, {[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[City].[all],[City].children} on rows, {[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[City].[all],[City].children} on rows, {[measures].[Units Sold],[measures].[Total Sales]} on columns from Sales"
cross:
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select crossjoin ({[Order Date].[all],[Order Date].children} , {[All Products].[all]}) on rows from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select crossjoin({[City].[all]},{[Users].[all]}) on rows, {[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select crossjoin({[City].[all],[Users].[all]},{[Order Date].[all]}) on rows, {[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select crossjoin({[City].[all],[City].children},{[Order Date].children}) on rows, {[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select crossjoin(crossjoin({[City].[all],[City].children},{[Users].children}),{[Order Date].children}) on rows, {[measures].[Total Sales]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select crossjoin(crossjoin({[City].[all],[City].children},{[Users].children}),{[Order Date].children}) on rows, {[measures].[Total Sales],[measures].[Units Sold]} on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select crossjoin(crossjoin({[City].[all],[Users].[all]},{[Order Date].[all]}),{[Order Date].children}) on rows, crossjoin({[All Products].[all],[Products Category].[all]},{[Partner Country].children}) on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select crossjoin({[City].[all]},{[Users].[all]}) on rows, crossjoin({[measures].[Total Sales]},{[Order Date].children}) on columns from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select crossjoin({[City].[all]},{[Users].[all]}) on rows, crossjoin(crossjoin({[measures].[Total Sales]},{[Order Date].children}),{[Users].children}) on columns from Sales"
page:
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[City].[all],[City].children} on rows, {[measures].[Units Sold],[measures].[Total Sales]} on columns, {[Order Date].children} on pages from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select {[measures].[Units Sold],[measures].[Total Sales]} on rows, {[City].[all],[City].children} on columns, {[Order Date].children} on pages from Sales"
complex:
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select crossjoin({[City].[all],[City].children},{[Order Date].[all]}) on rows, {[measures].[Units Sold],[measures].[Total Sales]} on columns, {[Order Date].children} on pages from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select crossjoin(crossjoin({[City].[all],[City].children},{[Order Date].children}),{[Users].children}) on rows, {[measures].[Units Sold],[measures].[Total Sales]} on columns, {[Order Date].children} on pages from Sales"
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "OpenERPSales" -c "select crossjoin(crossjoin({[City].[all],[City].children},{[Order Date].children}),{[Users].children}) on rows, crossjoin({[measures].[Units Sold],[measures].[Total Sales]},{[City].children}) on columns, {[Order Date].children} on pages from Sales"
test:
./tinybi.py -d ${DATABASE} -H localhost -U admin -W admin -p 8069 -s "tinyerp" -c " select crossjoin (crossjoin ({[Order Date].[all],[Users].[all]} , {[Users].children} ) , {[Partner Country].[all]}) on rows, {[measures].[Units Sold]} on columns from Sales"
+86
View File
@@ -0,0 +1,86 @@
#!/usr/bin/python
##############################################################################
#
# Copyright (c) 2004 TINY SPRL. (http://tiny.be) All Rights Reserved.
# Fabien Pinckaers <fp@tiny.Be>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
#
# This module test all RPC methods
#
import optparse
import xmlrpclib
import time
__version__ = '1.0'
parser = optparse.OptionParser(version=__version__)
group = optparse.OptionGroup(parser, "General options")
group.add_option("-c", "--command", dest="command", help="The query to execute")
group.add_option("-s", "--schema", dest="schema", help="The schema to use for the query")
parser.add_option_group(group)
group = optparse.OptionGroup(parser, "Connection options")
group.add_option("-d", "--database", dest="database", help="Database name")
group.add_option("-H", "--hostname", dest="hostname", default='localhost', help="Server hostname")
group.add_option("-U", "--username", dest="username", default='admin', help="Username")
group.add_option("-W", "--password", dest="password", default='admin', help="Password")
group.add_option("-p", "--port", dest="port", default=8069, help="Server port")
parser.add_option_group(group)
(opt, args) = parser.parse_args()
sock = xmlrpclib.ServerProxy('http://'+opt.hostname+':'+str(opt.port)+'/xmlrpc/object')
uid = 1
axis,data = sock.execute(opt.database, uid, opt.password, 'olap.schema', 'request', opt.schema, opt.command)
COLSPAN = 18
ROWSPAN = 18
print
if len(axis)>1:
for i in range(8):
ok = False
for x in axis[1]:
if len(x[0])==i:
ok = True
if not ok:
continue
print ' '*COLSPAN,
print (('%-'+str(ROWSPAN)+'s ' ) * len(axis[1])) % tuple(map(lambda x: str(len(x[0])==i and x[1] or ''),axis[1]))
for col in data:
print ('%-'+str(COLSPAN)+'s')% (' '*(len(axis[0][0][0])-1)*2 + str(axis[0].pop(0)[1]),),
for row in col:
if row==[False]:
print ('%-'+str(ROWSPAN)+'s')%('',),
else:
print ('%-'+str(ROWSPAN)+'s')%(row,),
print
print
+3
View File
@@ -0,0 +1,3 @@
from mdx_parser import mdx_parser
from mdx_output import mdx_output
from warehouse import warehouse
+9
View File
@@ -0,0 +1,9 @@
import sqlalchemy
agregator = {}
agregator['sum'] = sqlalchemy.func.sum
agregator['count'] = sqlalchemy.func.count
agregator['avg'] = sqlalchemy.func.avg
agregator['min'] = sqlalchemy.func.min
agregator['max'] = sqlalchemy.func.max
+43
View File
@@ -0,0 +1,43 @@
import sqlalchemy
import common
class axis(object):
def __init__(self, axis, name=None):
self.axis = axis
self.name = name
def validate(self, cube):
self.object = cube
self.axis.validate(cube)
def name_set(self, name):
self.name = name
def __repr__(self):
res = '\t<olap.axis ['+str(self.name)+']\n'
res += str(self.axis)
res += '\t>'
return res
#
# Output:
# a list of grouped values that can be computed at once
# a group is defined by elements having the same query
#
# [
# {
# 'level': ["Time","2008","Q1"],
# 'value': '1er Trim 2008',
# 'query': SQLAlchemy query object
# }
# ]
#
def run(self, metadata):
result = self.axis.run(metadata)
return result
# vim: ts=4 sts=4 sw=4 si et
+109
View File
@@ -0,0 +1,109 @@
#
# Interface for all mapping objects to map values into the right
# position in the cube, according to cube definition
#
class mapping(object):
def query_init(self):
pass
def position_get(self):
return 0
class column_static(mapping):
def __init__(self, value=False, position=0):
self.value = value
def cube_set(self, cube, value, delta=0):
return cube[ delta]
def value_set(self, value=False):
value.pop(0)
return self.value
class column_static_dummy(mapping):
def __init__(self, value=False, position=0):
self.value = value
def cube_set(self, cube, value, delta=0):
return cube[ delta]
def value_set(self, value=False):
value.pop(0)
return self.value
class column_fixed(mapping):
def __init__(self, pos=0, position=0):
self.pos = pos
def cube_set(self, cube, value, delta=0):
return cube[ self.pos +delta]
def value_set(self, value):
return value.pop(0)
class column_mapping_value(mapping):
def __init__(self, value, position=0):
self.axis_value = {}
for v in range(len(value)):
self.axis_value[value[v][0]] = v
def cube_set(self, cube, value, delta=0):
pos = value.pop(0)
return cube[ self.axis_value[pos]+delta ]
def value_set(self, value):
return False
class column_mapping(mapping):
def __init__(self, value, position=0):
self.axis_value = {}
for v in range(len(value)):
self.axis_value[value[v][0]] = v
def cube_set(self, cube, value, delta=0):
pos = value.pop(0)
return cube[ self.axis_value[pos]+delta ]
def value_set(self, value):
return False
def position_get(self):
return 1
class column_mapping_axis(mapping):
def __init__(self, mapping, axis, position=0):
keys = {}
i = 0
for a in axis:
keys[tuple(list(a)[0][1:])] = i
i+=1
self.axis_value = {}
for m in mapping:
k = tuple(list(m)[:-1])
a = keys[k]
self.axis_value[tuple(m)[-1]] = a
def cube_set(self, cube, value, delta=0):
pos = value.pop(0)
return cube[ self.axis_value[pos]+delta ]
def value_set(self, value):
return False
def position_get(self):
return 1
class column_mapping_join(mapping):
def __init__(self, mappings, position=0):
self.mappings = mappings
def cube_set(self, cube, value, delta=0):
for m in self.mappings:
cube = m.cube_set(cube, value, delta)
return cube
def value_set(self, value):
for m in self.mappings:
value = m.value_set(value)
return value
# vim: ts=4 sts=4 sw=4 si et
+109
View File
@@ -0,0 +1,109 @@
import sqlalchemy
from sqlalchemy import *
import common
def measure_sql_exp_col(metadata,col):
temp = col.split(".")
table_name = filter(lambda x: x.name==temp[0],metadata.table_iterator(reverse=False))
if table_name:
if not col in table_name[0].c:
col = sqlalchemy.Column(temp[1], sqlalchemy.Float)
table_name[0].append_column(col)
return col
else:
for k in table_name[0].c:
if temp[1] == k.name:
return k
else:
print "The table %s do not exist or match to cube fact table"%(temp[0])
# To be Improved
# I am sure it exist something better in SA
def col_get(table, col_obj):
# table = sqlalchemy table object
# level = level object
# Check for the columns
datatypes = {
'timestamp': sqlalchemy.DateTime,
'timestampz': sqlalchemy.DateTime,
'numeric': sqlalchemy.Numeric,
'int': sqlalchemy.Integer,
'float8': sqlalchemy.Float,
'varchar': sqlalchemy.String,
'bool': sqlalchemy.Boolean,
'bytea':'Byte A', # Not Clear
'int2':sqlalchemy.SmallInteger,
'int4':sqlalchemy.Integer,
'int8':sqlalchemy.Integer,
'text':sqlalchemy.String,
'date':sqlalchemy.Date,
'time': sqlalchemy.Time,
'number':sqlalchemy.Numeric,
}
if not ('.').join([col_obj.table_id.table_db_name,col_obj.column_db_name]) in table.c:
col = sqlalchemy.Column(col_obj.column_db_name, datatypes[col_obj.type])
table.append_column(col)
return col
else:
for k in table.c:
if col_obj.column_db_name == k.name:
return k
def get_primary_key(table):
for cols in table.columns:
if cols.primary_key == True:
return cols
# It gets the olap_cube_table browse object
def table_get(metadata, table):
result = False
table1 = False
table2 = False
if table.line_ids:
temp = 0
for i in range(len(table.line_ids)):
table1 = sqlalchemy.Table(table.line_ids[i].table_id.table_db_name,metadata)
pk = get_primary_key(table.line_ids[i].table_id)
if result:
result = join(result,table1, onclause=col_get(table1,pk)==col_get(table2,table.line_ids[i-1].field_id))
elif table2:
result = join(table1, table2, onclause=col_get(table1,pk)==col_get(table2,table.line_ids[i-1].field_id))
else:
table2=table1
temp=i
if not result:
result = table1
pk = get_primary_key(table.line_ids[temp].table_id)
tab = sqlalchemy.Table(table.line_ids[temp].field_id.related_to.table_db_name,metadata)
result = join(result, tab,onclause=col_get(tab,pk)
==col_get(sqlalchemy.Table(table.line_ids[temp].table_id.table_db_name,metadata),table.line_ids[temp].field_id))
else:
if table.column_link_id.related_to:
result = sqlalchemy.Table(table.column_link_id.related_to.table_db_name,metadata)
else:
result = sqlalchemy.Table(table.column_link_id.table_id.table_db_name,metadata)
return result
def xcombine(*seqin):
"""
Cartesian product of the list of list that produce all distinct
subsets of my query.
"""
def rloop(seqin,comb):
'''recursive looping function'''
if seqin:
for item in seqin[0]:
newcomb=comb+[item]
for item in rloop(seqin[1:],newcomb):
yield item
else:
yield comb
return rloop(seqin, [])
# vim: ts=4 sts=4 sw=4 si et
+32
View File
@@ -0,0 +1,32 @@
import sqlalchemy
import common
import level
class cross(object):
def __init__(self, cross):
self.cross = cross
self.name = False
self.object = False
def validate(self, cube):
for obj in self.cross:
self.object = obj.validate(cube)
return self.object
def name_set(self, name):
self.name = name
def __repr__(self):
res = '\t<olap.cross\n'
res += str(self.cross)
res += '\t>'
return res
def run(self, metadata):
print '*'*40
for obj in self.cross:
result = obj.run(metadata)
return result
# vim: ts=4 sts=4 sw=4 si et
+24
View File
@@ -0,0 +1,24 @@
import sqlalchemy
import common
class cube(object):
def __init__(self, name=None):
super(cube, self).__init__()
self.object = False
self.name = name
def run(self, metadata):
table = common.table_get(metadata, self.object.table_id)
return sqlalchemy.select(from_obj = [table], columns=[]),table
def validate(self, schema):
for cube in schema.cube_ids:
if self.name == cube.name:
self.object = cube
break
return self.object
def __repr__(self):
return self.name
# vim: ts=4 sts=4 sw=4 si et
+8
View File
@@ -0,0 +1,8 @@
class datatype_class(object):
def __init__(self):
self.datatype = {}
def subscribe(self, name, data):
self.datatype[name] = data
datatype = datatype_class()
# vim: ts=4 sts=4 sw=4 si et
+8
View File
@@ -0,0 +1,8 @@
class formatstring_class(object):
def __init__(self):
self.formatstrings = {}
def subscribe(self, name, data):
self.formatstrings[name] = data
formatstring = formatstring_class()
# vim: ts=4 sts=4 sw=4 si et
+322
View File
@@ -0,0 +1,322 @@
import sqlalchemy
import common
import axis_map
import pooler,tools
class level(object):
def __init__(self, level, sublevels=[]):
self.level = level
self.sublevels = sublevels
self.object = False
def validate(self, cube):
for dimension in cube.dimension_ids:
if self.object:
break
for hierarchy in dimension.hierarchy_ids:
if hierarchy.name==self.level:
self.object = hierarchy
break
#
# TODO: implement access to unique levels for not fully qualified names
#
if not self.object:
raise 'This dimension (%s) does not exist !' % (self.level,)
obj = hierarchy
pos = 0
for level in self.sublevels:
res = level.validate(hierarchy.level_ids[pos])
if res:
pos += 1
return self.object
def _to_unicode(self,s):
try:
return s.encode('ascii')
except UnicodeError:
try:
return s.decode('utf-8')
except UnicodeError:
try:
return s.decode('latin')
except UnicodeError:
return s
def _to_decode(self,s):
try:
return s.encode('utf-8')
except UnicodeError:
try:
return s.encode('latin')
except UnicodeError:
try:
return s.decode('ascii')
except UnicodeError:
return s
def run(self, metadata):
'''
RETURN: {
'value': [(ID, NAME)], # ID = ['user', 3]
'query': {
'whereclause': [col.in_(*primary_keys)],
'column': [col],
'group_by': [col]
},
'axis_mapping': axis_map.column_mapping(result),
'delta':0
}
'''
if self.sublevels[0].name=='all':
return [{
'value': [([str(self.level)], str(self.level), False)],
'query': {
'column': [sqlalchemy.literal('all')],
},
'axis_mapping': axis_map.column_static(False),
'delta':0,
}]
# Make these 2 commands working in all cases:
# return self._run_transform(metadata)
# return self._run_star(metadata)
if self.object.table_id<>self.object.dimension_id.cube_id.table_id: # Add a condition on the object
result = self._run_transform(metadata)
else:
result = self._run_star(metadata)
return result
def _compute_axis(self, metadata, primarykey=False):
"""
Compute axis values, and transform the main query in the same way
to add this branch of the star for this subset. The mappers
reassign to values.
"""
#
# Build a query on all tables of the hierarchy
# It passes the hierarchy table_id browse object (olap_cube_table )
#
table = common.table_get(metadata, self.object.table_id)
#
# Implement the query for all sublevels
# Return:
# [ (ID1, ID2, ID3, NAME, [PRIMARYKEY]) ]
#
result_axis = {}
for slevel in self.sublevels:
res = slevel.run(metadata, table)
for key in res.keys():
result_axis.setdefault(key, [])
result_axis[key] += res[key]
cols = []
axis_select = sqlalchemy.select(from_obj=[table], columns=[], distinct=True)
for where in result_axis.get('where_clause', []):
axis_select.append_whereclause(where)
for col in result_axis.get('column', []):
axis_select.append_column(col)
for group in result_axis.get('group_by', []):
axis_select.append_group_by(group)
# TODO: find a way to do: axis_select2 = axis_select.copy()
axis_select2 = sqlalchemy.select(from_obj=[table], columns=[], distinct=True)
for where in result_axis.get('where_clause', []):
axis_select2.append_whereclause(where)
for col in result_axis.get('column', []):
axis_select2.append_column(col)
for group in result_axis.get('group_by', []):
axis_select2.append_group_by(group)
# TODO: end
#metadata.bind.echo = True
axis_select2.append_column(result_axis['column_name'][-1].label('axis_name'))
query = axis_select2.execute()
result = query.fetchall()
def _tuple_define(x):
y=list(x)
if y[-1] == None:
y[-1] = '/'
elif isinstance(y[-1],float):
y[-1] = str (int(y[-1]))
else:
y[-1] = self._to_unicode(y[-1])
y[-1] = tools.ustr(y[-1])
return ([self.level]+y[:-1]),y[-1]
axis = map(_tuple_define, result)
# Gives the mapping
primary_key = ''
if primarykey:
if self.object.table_id.column_link_id.related_to:
primary_key = self.object.table_id.column_link_id.related_to
else:
primary_key = self.object.table_id.column_link_id.table_id
tableprim = sqlalchemy.Table(primary_key.table_db_name, metadata)
pk = common.get_primary_key(primary_key)
col = common.col_get(tableprim,pk)
axis_select.append_column(col.label('axis_primarykey'))
query = axis_select.execute()
result = query.fetchall()
else:
# To find the primary key that suits best as per the given criteria
raise 'Primary key table not made in the hierarchy'
maps = []
position =0
for mapping in result_axis['axis_mapping']:
mapinst = mapping(result, position)
maps.append(mapinst)
position += mapinst.position_get()
result_axis['axis_mapping'] = maps
#
# #
# # Apply the filters on the main query object due to this block
# #
#
# maps = []
# position =0
# for mapping in result_axis['axis_mapping']:
# mapinst = mapping(result, position)
# maps.append(mapinst)
# position += mapinst.position_get()
# result_axis['axis_mapping'] = maps
# print '*'*50
# print table, result, result_axis
return table, axis, result ,result_axis
def _run_star(self, metadata):
"""
Compute axis values, and transform the main query in the same way
to add this branch of the star for this subset. The mappers
reassign to values.
"""
print '*** Start ***'
table, result,result_mapping, result_axis = self._compute_axis(metadata, True)
result_axis.setdefault('where_clause', [])
#
# The result to be applied to the main query object
#
result = {
'value': result,
'query': {
# 'whereclause': result_axis.get('where_clause',[]),
'column': result_axis.get('column', []),
'group_by': result_axis.get('column', [])
},
##
## How to use group of axis_mapping ?
##
'axis_mapping': axis_map.column_static(False),
'delta':0,
}
return [result]
def _run_transform(self, metadata):
"""
Compute axis values, and transform the main query according to axis
values for this subset. The main query slicer is transformed to a
single condition like: foreign_key in (...) and reapplied to axis
values.
"""
table, axis, mapping, result_axis = self._compute_axis(metadata, True)
table2 = common.table_get(metadata, self.object.dimension_id.cube_id.table_id)
sql_table = sqlalchemy.Table(self.object.table_id.column_link_id.table_id.table_db_name,metadata)
col = common.col_get(sql_table, self.object.table_id.column_link_id)
#
# The result to be applied to the main query object
#
result = []
for a in axis:
k = tuple(list(a)[0][1:])
mapping_axis = filter(lambda m: tuple(list(m)[:-1])==k, mapping)
primary_keys = map(lambda x:list(x)[-1], mapping_axis)
# To convert everything in to the string so that no conversion needed at later stage
# This is for the elements to be displayed in the rows and columns
for i in range(len(a[0])):
if a[0][i]:
if isinstance(a[0][i],int):
a[0][i] = str(a[0][i])
elif isinstance(a[0][i],float):
a[0][i] = str(int(a[0][i]))
else:
a[0][i] = '/'
a = list(a)
if isinstance(a[-1],int):
a[-1] = str(a[-1])
elif isinstance(a[-1],float):
a[-1] = str(int(a[-1]))
a = tuple(a)
primary_keys = map(lambda x: str(x),primary_keys)
result.append( {
'value': [a],
'query': {
'whereclause': [col.in_(primary_keys)],#.extend(result_axis['where_clause']),
'column': [sqlalchemy.literal('transform')],
},
'axis_mapping': axis_map.column_static(False),
'delta':0,
})
return result
def __repr__(self):
res= '\t\t<olap.level \n'
res+= '\t\t\t'+str(self.level)+'\n'
for l in self.sublevels:
res+= '\t\t\t'+str(l)+'\n'
res += '\t\t>'
return res
class level_filter(object):
def __init__(self, name):
self.name=name
self.object=None
def validate(self, level):
self.object = level
return 1
#
# Modify for the query select to return tuples:
# (id, name)
# where:
# id: ["Time","2008","Q1"]
# name: Quarter 1
# Return a description of what have been added
#
def run(self, metadata, table):
return self.object._types[self.object.type].run( self, metadata, table)
def __repr__(self):
return '<olap.level_filter '+self.name+'>'
class level_function(object):
def __init__(self, name):
self.type='function'
self.name = name
self.object = None
# [{
# 'level': ["Time","2008","Q1"],
# 'value': '1er Trim 2008',
# 'query': SQLAlchemy query object
# }]
def run(self, metadata, table):
return self.object._types[self.object.type].children( self, metadata, table)
def validate(self, level):
self.object = level
return 0
def __repr__(self):
return '<olap.level_function '+self.name+'>'
# vim: ts=4 sts=4 sw=4 si et
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+3
View File
@@ -0,0 +1,3 @@
import level_interface
from level_normal import level_normal
from level_date import *
+109
View File
@@ -0,0 +1,109 @@
import sqlalchemy
from level_interface import level_interface
from olap.cube import common
from olap.cube import axis_map
#
# To Be Fixed:
# Mapping of QX and Month
#
class level_date_month(level_interface):
def run(self, level, metadata, table):
col = common.col_get(sqlalchemy.Table(level.object.table_name,metadata), level.object.column_name)
col_id = common.col_get(sqlalchemy.Table(level.object.table_name,metadata), level.object.column_name)
result = {
'column': [sqlalchemy.func.date_part('month',col_id)],
'column_name': [sqlalchemy.func.date_part('month', col)],
'axis_mapping': [axis_map.column_mapping],
'where_clause': [sqlalchemy.func.date_part('month',col_id) == level.name]
}
return result
def children(self, level, metadata, table):
col = common.col_get(sqlalchemy.Table(level.object.table_name,metadata), level.object.column_name)
col_id = common.col_get(sqlalchemy.Table(level.object.table_name,metadata), level.object.column_name)
qexpr = sqlalchemy.literal('Q')+ sqlalchemy.sql.cast(sqlalchemy.func.date_part('QUARTER',col_id), sqlalchemy.types.String) + sqlalchemy.sql.cast(sqlalchemy.func.date_part('month',col_id),sqlalchemy.types.String)
return {
'column': [sqlalchemy.func.date_part('month',col)],
'column_name':[sqlalchemy.func.date_part('month',col)],
'axis_mapping': [axis_map.column_mapping]
}
def validate(self, level, name):
return 1
class level_date_year(level_interface):
def run(self, level, metadata, table):
col = common.col_get(sqlalchemy.Table(level.object.table_name,metadata),level.object.column_name)
col_id = common.col_get(sqlalchemy.Table(level.object.table_name,metadata), level.object.column_name)
result = {
'column': [sqlalchemy.func.date_part('year',col_id)],
'column_name': [sqlalchemy.func.date_part('year', col)],
'axis_mapping': [axis_map.column_mapping],
'where_clause': [sqlalchemy.func.date_part('year',col_id) == level.name]
}
return result
def children(self, level, metadata, table):
col = common.col_get(sqlalchemy.Table(level.object.table_name,metadata), level.object.column_name)
col_id = common.col_get(sqlalchemy.Table(level.object.table_name,metadata), level.object.column_name)
return {
'column': [sqlalchemy.func.date_part('year',col_id)],
'column_name':[sqlalchemy.func.date_part('year',col)],
'axis_mapping': [axis_map.column_mapping],
'where_clause':[]
}
def validate(self, level, name):
return 1
#
# To Do: Create your own axis mapping
#
class level_date_quarter(level_interface):
def run(self, level, metadata, table):
quarters = {
'Q1': [1,2,3],
'Q2': [4,5,6],
'Q3': [7,8,9],
'Q4': [10,11,12]
}
col = common.col_get(sqlalchemy.Table(level.object.table_name,metadata), level.object.column_name)
col_id = common.col_get(sqlalchemy.Table(level.object.table_name,metadata), level.object.column_name)
qexpr = sqlalchemy.literal('Q')+ sqlalchemy.sql.cast(sqlalchemy.func.date_part('QUARTER',col_id), sqlalchemy.types.String)
if not level.name in quarters:
raise 'Quarter should be in Q1,Q2,Q3,Q4 !'
result = {
'column': [qexpr],
'column_name': [qexpr],
'axis_mapping': [axis_map.column_static],
'where_clause': [
(sqlalchemy.func.date_part('month',col_id)==quarters[level.name][0]) |
(sqlalchemy.func.date_part('month',col_id)==quarters[level.name][1]) |
(sqlalchemy.func.date_part('month',col_id)==quarters[level.name][2])
]
}
return result
def children(self, level, metadata, table):
table = sqlalchemy.Table(level.object.table_name, metadata)
col =common.col_get(table, level.object.column_name)
col_id = common.col_get(table,level.object.column_name)
qexpr = sqlalchemy.literal('Q')+ sqlalchemy.sql.cast(sqlalchemy.func.date_part('QUARTER',col_id), sqlalchemy.types.String)
return {
'column': [qexpr],
'column_name': [qexpr],
'axis_mapping': [axis_map.column_mapping_value]
}
def validate(self, level, name):
return 1
# vim: ts=4 sts=4 sw=4 si et
+14
View File
@@ -0,0 +1,14 @@
class level_interface(object):
#
# Return the number of position consummed by this level
# 1 means this goes to the next level object (.[20])
# 0 means that the next argument is still on the same level object (.children)
#
def validate(self, level, name):
return 1
def run(self, level, metadata, table):
col = None
return {}
# vim: ts=4 sts=4 sw=4 si et
+32
View File
@@ -0,0 +1,32 @@
import sqlalchemy
from olap.cube import common
from olap.cube import axis_map
from level_interface import level_interface
class level_normal(level_interface):
def run(self, level, metadata, table):
col = common.col_get(sqlalchemy.Table(level.object.table_name,metadata), level.object.column_name)
col_id = common.col_get(sqlalchemy.Table(level.object.table_name,metadata), level.object.column_name)
result = {
'column': [col_id],
'column_name': [col],
'axis_mapping': [axis_map.column_mapping],
'where_clause': [col_id == level.name ]
}
return result
def children(self, level, metadata, table):
col = common.col_get(sqlalchemy.Table(level.object.table_name,metadata), level.object.column_name)
col_id = common.col_get(sqlalchemy.Table(level.object.table_name,metadata), level.object.column_name)
result = {
'column': [col_id],
'column_name': [col],
'axis_mapping': [axis_map.column_mapping],
'where_clause': []
}
return result
def validate(self, level, name):
return 1
# vim: ts=4 sts=4 sw=4 si et
+1
View File
@@ -0,0 +1 @@
from mdx_input import mdx_input
+5
View File
@@ -0,0 +1,5 @@
class mdx_input(object):
def parse(self, mdx):
return mdx
+35
View File
@@ -0,0 +1,35 @@
import common
#
# Class constructed by {..., ...}
#
class mdx_set(object):
def __init__(self, list):
self.list = list
def run(self, metadata):
"""
Should use xcombine, I think it's currently False
common.xcombine(*result)
"""
result = []
for l in self.list:
result += l.run(metadata)
position = 0
for r in result:
r['delta'] = position
position += len(r['value'])
return result
def validate(self, object):
for l in self.list:
l.validate(object)
return True
def __repr__(self):
res = '\tSet: ['
for l in self.list:
res += str(l)+',\n'
res += '\t]'
return res
# vim: ts=4 sts=4 sw=4 si et
+1
View File
@@ -0,0 +1 @@
from mdx_output import *
+56
View File
@@ -0,0 +1,56 @@
#
# Modify the final result (axis, data), for instance, reordering of axes
#
import copy
def decimal_to_float(cube):
# Note FP: I think the decimal > float conversion should be done more
# in upstream
if type(cube)==type([]) and len(cube):
if type(cube[0])==type([]):
for b in cube:
decimal_to_float(b)
else:
for l in range(len(cube)):
cube[l] = str(float(cube[l]))
def sort_apply(cube, axis_pos):
cube2 = copy.copy(cube)
for i in range(len(axis_pos)):
cube[i] = cube2[axis_pos[i]]
return cube
def sort_axis(data):
for axis_id in range(len(data[0])):
axis_pos = []
for i in range(len(data[0][axis_id])):
axis_pos.append((data[0][axis_id][i], i))
axis_pos.sort()
data[0][axis_id] = map(lambda x: x[0], axis_pos)
axis_pos2 = map(lambda x: x[1], axis_pos)
cubes = [ data[1] ]
for i in range(axis_id):
cubes2 = []
for cube in cubes:
cubes2 += cube
cubes = cubes2
for cube in cubes:
sort_apply(cube, axis_pos2)
def mdx_output(data):
print 'DATA', data
# decimal_to_float(data[1])
# sort_axis(data)
return data
if __name__=='__main__':
print 'Testing Code'
data = ([[(['user'], 'All user')], [(['measures', 'credit_limit'], 'credit_limit'), (['measures', 'count'], 'count')]], [[[66700.0], [22L]]])
data = ([[([u'Products'], u'All Products'), ([u'Order Date'], u'All Order Date')]], [[False], [False]])
data = ([[([u'Order Date'], u'All Order Date'), ([u'Order Date', 2007.0], 2007.0), ([u'Order Date', 2008.0], 2008.0), ([u'Order Date', 2007.0, 'Q1'], 'Q1'), ([u'Order Date', 2007.0, 'Q2'], 'Q2'), ([u'Order Date', 2007.0, 'Q3'], 'Q3'), ([u'Order Date', 2007.0, 'Q4'], 'Q4'), ([u'Users'], u'All Users'), ([u'Users', 'Administrator'], 'Administrator'), ([u'Users', 'Demo User'], 'Demo User'), ([u'Users', 'Root'], 'Root'), ([u'Partner Country'], u'All Partner Country'), ([u'Partner Country', 'Belgium'], 'Belgium'), ([u'Partner Country', 'China'], 'China'), ([u'Partner Country', 'France'], 'France'), ([u'Partner Country', 'Taiwan'], 'Taiwan')]], [[False], [False], [False], [False], [False], [False], [False], [False], [False], [False], [False], [False], [False], [False], [False], [False]])
data = ([[([u'Order Date'], u'All Order Date'), ([u'Order Date', 2007.0], 2007.0), ([u'Order Date', 2008.0], 2008.0), ([u'Order Date', 2007.0, 'Q1'], 'Q1'), ([u'Order Date', 2007.0, 'Q2'], 'Q2'), ([u'Order Date', 2007.0, 'Q3'], 'Q3'), ([u'Order Date', 2007.0, 'Q4'], 'Q4'), ([u'Users'], u'All Users'), ([u'Users', 'Administrator'], 'Administrator'), ([u'Users', 'Demo User'], 'Demo User'), ([u'Users', 'Root'], 'Root'), ([u'Partner Country'], u'All Partner Country'), ([u'Partner Country', 'Belgium'], 'Belgium'), ([u'Partner Country', 'China'], 'China'), ([u'Partner Country', 'France'], 'France'), ([u'Partner Country', 'Taiwan'], 'Taiwan')], [(['measures', u'Items Sold'], u'Items Sold')]], [[[Decimal("258.00")]], [[Decimal("34.00")]], [[Decimal("224.00")]], [[Decimal("12.00")]], [[Decimal("9.00")]], [[Decimal("6.00")]], [[Decimal("7.00")]], [[Decimal("258.00")]], [[Decimal("204.00")]], [[Decimal("16.00")]], [[Decimal("38.00")]], [[Decimal("258.00")]], [[Decimal("17.00")]], [[Decimal("78.00")]], [[Decimal("139.00")]], [[Decimal("2.00")]]])
print 'Old', data
sort_axis(data)
print 'New', data
# vim: ts=4 sts=4 sw=4 si et
+201
View File
@@ -0,0 +1,201 @@
"""
Tiny BI
Copyright (C)2007 Fabien Pinckaers
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation version 2.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
from pyparsing import *
import cube, axis, measure, level, query, slicer, cross
import mdx_operator
#
# Predicate: the construction of the object's query does not depend
# on the schema architecture. I think we can go on for this, this will
# simplify the extension/module architecture.
#
# Rethink about that in one month.
#
class mdx_parser(object):
def mdx_level(self):
"""
Return a parser that parse the level part of the MDX query and
return a level object
Examples:
[prod].[all prod].children
[prod].[all prod].join(...)
"""
leftSqBr = Literal("[").suppress()
rightSqBr = Literal("]").suppress()
dotToken = Literal(".").suppress()
measuresToken = Literal("measures").suppress()
scalar = Word(alphanums+alphas8bit.encode("utf-8") +"_"+" "+"-" )
level_filter = leftSqBr + scalar + rightSqBr
level_function = Keyword("children", caseless=True)
level_filter.setParseAction(lambda s,a,toks: level.level_filter(toks[0]))
level_function.setParseAction(lambda s,a,toks: level.level_function(toks[0]))
level_item = level_filter | level_function
level_parse = leftSqBr + scalar + rightSqBr + Optional(dotToken + delimitedList(level_item, ".", combine=False))
level_parse.setParseAction(lambda s,a,toks: level.level(toks[0], toks[1:]))
measure_parse = leftSqBr + measuresToken + rightSqBr + dotToken + leftSqBr + scalar + rightSqBr
measure_parse.setParseAction(lambda s,a,toks: measure.measure(toks[0]))
lev = measure_parse | level_parse
return lev
def mdx_axis(self):
"""
Return a parser that parse the axis part of the MDX query and
return an axis object
Examples:
{[prod].[all prod].children, [a]}
OR
crossjoin({[Order Date].[all]},{[prod].[all prod].children, [a]})
This is to be made recursive for the cross join
crossjoin(crossjoin({[City].[all],[City].children},{[User].[all]}),{[User].[Administrator]})
"""
leftCurlBr = Literal("{").suppress()
rightCurlBr = Literal("}").suppress()
comma = Literal(",").suppress()
level_parse = self.mdx_level()
axis_parser = delimitedList(level_parse, ",", combine=False)
axis_parser.setParseAction(lambda s,a,toks:axis.axis(mdx_operator.mdx_set(toks)))
mdx = leftCurlBr + axis_parser + rightCurlBr
return mdx
def cross_axis(self):
leftCurlBr = Literal("{").suppress()
rightCurlBr = Literal("}").suppress()
cross_parser = self.mdx_level()
cross_parser.setParseAction(lambda s,a,toks:cross.cross(toks))
cross_parse = leftCurlBr + cross_parser + rightCurlBr
return cross_parse
def mdx_cross_axis(self):
leftRoundBr = Literal("(").suppress()
rightRoundBr = Literal(")").suppress()
comma = Literal(",").suppress()
crossjoinToken = Keyword("crossjoin", caseless=True).suppress()
crossx = Forward()
cross_mdx = crossx | self.mdx_axis()
crossx << (crossjoinToken + leftRoundBr + cross_mdx + comma + self.cross_axis() + rightRoundBr)
# crossx.setParseAction(lambda s,a,toks:axis.axis(toks)
simple_mdx = self.mdx_axis()
mdx = simple_mdx | crossx
return mdx
def mdx_axis_list(self):
#
# TODO: accept notation line AXIS(0) = rows, AXIS(1)=columns, ...
#
row_names = ["rows","columns","pages"]
onToken = Keyword("on", caseless=True).suppress()
page_name = oneOf(' '.join(row_names))
axis_parser = self.mdx_cross_axis() + Optional(onToken + page_name)
def _assign_name(s,a,toks):
if len(toks)>=3:
toks[0].name_set(toks[-1])
for x in range(1,len(toks)-1):
toks[x].name_set('cross')
elif len(toks)==2:
toks[0].name_set(toks[1])
elif len(toks)==1:
toks[0].name_set(row_names.pop(0))
else:
raise 'invalid size'
return toks[:-1]
axis_parser.setParseAction(_assign_name)
axis_lst = delimitedList(axis_parser, ",")
axis_lst.setParseAction(lambda s,a,toks: [toks])
return axis_lst
def mdx_slice(self):
""" Return a MDX parser of the where clause of a MDX query """
leftBr = Literal("(").suppress()
rightBr = Literal(")").suppress()
levels = delimitedList(self.mdx_level(), ',', combine=False)
levels.setParseAction(lambda s,a,toks: toks)
slicer_lst = delimitedList(leftBr + levels + rightBr, ",", combine=False)
slicer_lst.setParseAction(lambda s,a,toks:slicer.slicer(list(toks)))
return slicer_lst
def mdx_cube(self):
""" Return a MDX parser of the from clause of a MDX query """
mdx = Word(alphas+'_')
mdx.setParseAction(lambda s,a,toks: cube.cube(toks[0]))
return mdx
def mdx_query(self):
""" Return a MDX parser of the from clause of a MDX query """
selectToken = Keyword("select", caseless=True).suppress()
fromToken = Keyword("from", caseless=True).suppress()
whereToken = Keyword("where", caseless=True).suppress()
semicolon = Literal(";").suppress()
mdx = selectToken + self.mdx_axis_list() + fromToken + self.mdx_cube() + Optional(whereToken + self.mdx_slice()) + Optional(semicolon)
mdx.setParseAction(lambda s,a,toks: query.query(*toks))
return mdx
def parse(self, query):
""" Parse a string and get a MDX object """
return self.mdx_query().parseString(query)[0]
if __name__ == "__main__":
mdx = mdx_parser()
level_parse = mdx.mdx_level()
for test in ['[sales].children','[prod].[all prod]']:
print 'Testing level', test
print level_parse.parseString(test)
print
axis_parser = mdx.mdx_axis()
for test in ['{[a]}','{[prod].[all prod],[time].[Q3].[Sep]}']:
print 'Testing axis', test
print axis_parser.parseString(test)
axis_parser = mdx.mdx_axis_list()
for test in ['{[a]} on rows, {[prod].[all prod],[time].[Q3].[Sep]} on columns',
'{[region].[all region].children} on rows, {[prod].[all prod].children} on columns'
]:
print 'Testing axis', test
print axis_parser.parseString(test)
cube_parser = mdx.mdx_cube()
for test in ['sales']:
print 'Testing axis', test
print cube_parser.parseString(test)
for query_parser in [
"Select {[region].[all region].children} on rows, {[product]} on columns from cubulus where ([time].[all time].[time_2005])",
"Select {[region].[all region].children} on rows, {[prod].[all prod].children} on columns from cubulus where ([time].[all time].[time_2005])",
#"Select {[time].[all time].children} on rows, crossjoin([region].[all region].children, [region].[all region].children) on columns from cubulus"
]:
print 'Testing ', query_parser
print mdx.parse(query_parser)
print mdx.parse('''select
{[date].[2007].[Q2].children} on rows,
{[country_id].children,[country_id].[1].children} on columns
from res_partner where ([measure].[credit_limit])''')
# vim: ts=4 sts=4 sw=4 si et
+84
View File
@@ -0,0 +1,84 @@
import sqlalchemy
import common
import copy
import pyparsing
import operator
from operator import add,sub
from pyparsing import *
from agregator import agregator
import axis_map
class measure(object):
def __init__(self, name):
self.name = name
self.object = False
def validate(self, cube):
for measure in cube.measure_ids:
if measure.name==self.name:
self.object = measure
if not self.object:
raise 'This measure does not exist !'
return True
def run(self, metadata):
table = common.table_get(metadata, self.object.cube_id.table_id)
if self.object.measure_type == 'fact_column':
col = common.col_get(sqlalchemy.Table(self.object.table_name,metadata), self.object.value_column)
col_agregated = agregator[self.object.agregator](col)
else:
scalar = Word(alphanums+"_"+" "+".")
sql_func = ["sum","max","min","count","avg"]
arith_operator = ["-","*","/","+"]
sql_function = oneOf(' '.join(sql_func))
leftRdBr = Literal("(").suppress()
rightRdBr = Literal(")").suppress()
operator_arith = oneOf(' '.join(arith_operator))
sqlexpression = sql_function.setResultsName('sql_func') + leftRdBr + delimitedList(scalar,",",combine=False) + rightRdBr | sql_function + leftRdBr + scalar + ZeroOrMore(operator_arith.setResultsName('arithmetic') + scalar) + rightRdBr
res = sqlexpression.parseString(self.object.value_sql)
operators = []
cols = []
function = None
for item in res:
if str(item) == res.sql_func:
function = str(item)
elif str(item) == res.arithmetic or str(item) in ["+","-","/","*"]:
operators.append(str(item))
else:
cols.append(common.measure_sql_exp_col(metadata,str(item)))
operations = {
'+':operator.add,
'-':operator.sub,
'/':operator.div,
'%':operator.mod,
'*':operator.mul,
}
operators = [operations[name] for name in operators]
ops_cols = zip(operators, cols[1:])
col = reduce(lambda expr, op_col: op_col[0](expr, op_col[1]), ops_cols,cols[0])
if function:
col_agregated = agregator[function](col)
else:
col_agregated = col
return [ {
'value': [(['measures',self.name], self.name, False)],
'query': {
'column': [col_agregated]
},
'axis_mapping': axis_map.column_fixed(0),
'delta': 0,
'format':self.object.formatstring
} ]
def children(self, level, metadata):
raise 'Not yet implemented !'
def __repr__(self):
res= '\t\t<olap.measure %s>\n' % (self.name,)
return res
# vim: ts=4 sts=4 sw=4 si et
+236
View File
@@ -0,0 +1,236 @@
import locale
import mdx_input
import sqlalchemy
import common
import slicer
import datetime
import pooler
import copy
class mapper(object):
def __init__(self, size):
self.size = size
class query(object):
def __init__(self, axis, cube, slicer_obj=None, *args):
super(query, self).__init__()
self.object = False
self.cube = cube
self.axis = axis
if not slicer_obj:
slicer_obj = slicer.slicer([])
self.slicer = slicer_obj
#
# Generate the cube with 'False' values
# This function could be improved
#
def _cube_create(self, cube_size):
cube_data = [False]
while cube_size:
newcube = []
for i in range(cube_size.pop()):
newcube.append(copy.deepcopy(cube_data))
cube_data = newcube
return cube_data
def run(self,currency):
db = sqlalchemy.create_engine(self.object.schema_id.database_id.connection_url,encoding='utf-8')
metadata = sqlalchemy.MetaData(db)
print 'Connected to database...', self.object.schema_id.database_id.connection_url
#
# Compute axis
#
axis = []
axis_result = []
cube_size = []
cross = False
cross_all = []
for ax in self.axis:
if ax.name == 'cross':
cross = True
cross = ax.run(metadata)
cube_size[-1] = cube_size[-1] * len(cross)
temp = axis_result[0][:]
cross_all.append(cross)
final_axis = []
for cr in cross:
for el in axis_result[-1]:
t = copy.deepcopy(el)
t = list(t)
t[0].append(cr['value'][0][0])
t.append(cr['value'][0][1])
final_axis.append(tuple(t))
axis_result[-1]=final_axis[:]
final_axis=[]
len_axis = len(axis[-1])
len_cross = len(cross)
delta_count = 0
d=0
for data in common.xcombine(axis[-1],cross):
flag = False
make_where = []
temp_where = []
temp_column = []
if 'whereclause' in data[0]['query'].keys():
flag = True
temp_where = data[0]['query']['whereclause'][0]
data[0]['query']['whereclause']=str(data[0]['query']['whereclause'][0])
if isinstance(type(data[0]['query']['column'][0]),type(sqlalchemy.sql.expression._BindParamClause)):
temp_column = data[0]['query']['column'][0]
data[0]['query']['column'][0] = str(data[0]['query']['column'][0])
data_temp = copy.deepcopy(data[0])
if 'whereclause' in data[1]['query'].keys():
if 'whereclause' in data_temp['query'].keys():
make_where.append(data[1]['query']['whereclause'][0])
else:
make_where.append(data[1]['query']['whereclause'][0])
delta_count = delta_count + 1
if delta_count >= len_cross and len_cross!=1:
delta_count = 0
data_temp['delta'] = d
d = d + 1
else:
data_temp['delta'] = d
d = d + 1
if flag:
data[0]['query']['whereclause']=[temp_where]
data_temp['query']['whereclause'] = [temp_where]
if make_where:
if 'whereclause' in data_temp['query'].keys():
data_temp['query']['whereclause'].append(make_where[0])
else:
data_temp['query']['whereclause'] = make_where
if temp_column:
data[0]['query']['column'] = [temp_column]
data_temp['query']['column'] = [temp_column]
final_axis.append(data_temp)
axis[-1] = []
axis[-1] = final_axis
else:
cross = False
result = ax.run(metadata)
length = 0
axis_result2 = []
for r in result:
length += len(r['value'])
axis_result2 += map(lambda x: (map(lambda y: y or False,x[0]),x[1] or False), r['value'])
axis_result.append(axis_result2)
axis.append(result)
cube_size.append(length)
cube_data = self._cube_create(cube_size)
cr = []
slice = self.slicer.run(metadata)
position = 0
ax = []
for subset in common.xcombine(*axis):
select,table_fact = self.cube.run(metadata)
for s in subset+slice:
for key,val in s['query'].items():
for v in val:
if key=='column':
v = v.label('p_%d' % (position,))
position += 1
select.append_column(v)
elif key=='whereclause':
select.append_whereclause(v)
elif key=='group_by':
select.append_group_by(v)
else:
raise 'Error, %s not implemented !'% (key,)
# metadata.bind.echo = True
query = select.execute()
result = query.fetchall()
for record in result:
cube = cube_data
r = list(record)
value = False
for s in subset:
if s.has_key('format'):
# To make use of the format string if specified for the measure
# Its set to static for a testing
if not currency:
currency = "EUR"
if isinstance(r[0],float) or isinstance(r[0],int) or isinstance(r[0],long):
a = {'data':r[0]}
r[0] = str(r[0])
else:
r[0] = '0.0'
a = {'data':0.0}
if s['format'] == 'cr_prefix':
r[0] = currency + " " + "%.2f"%a['data']
elif s['format'] == 'cr_postfix':
r[0] = "%.2f"%a['data'] + " " + currency
elif s['format'] == 'comma_sep':
r[0] = locale.format("%(data).2f", a, 1)
elif s['format'] == 'cr_prefix_comma':
r[0] = locale.format("%(data).2f", a, 1)
r[0] = currency + " " + str(r[0])
elif s['format'] == 'cr_postfix_comma':
a['currency'] = currency
r[0] = locale.format("%(data).2f %(currency)s", a, 1)
cube = s['axis_mapping'].cube_set(cube, r, s['delta'])
value = s['axis_mapping'].value_set(r) or value
for s in slice:
value = s['axis_mapping'].value_set(r) or value
if value:
assert not cube[0], 'Already a value in cube, this is a bug !'
cube[0] = value
i=0
for a in cube_data:
i=i+1;
return (axis_result, cube_data)
def preprocess(self):
wrapper = mdx_input.mdx_input()
wrapper.parse(self)
def validate(self, schema):
""" This function takes a query object and validate and assign
fact data to it. Browse object from Tiny ERP"""
cube = self.cube.validate(schema)
self.object = cube
if not self.object:
raise "Cube '%s' not found in the schema '%s' !"%(cube.name, schema.name)
self.slicer.validate(cube)
for axis in self.axis:
axis.validate(cube)
for dimension in cube.dimension_ids:
pass
return True,cube
def __repr__(self):
res = '<olap.query ['+str(self.cube)+']\n'
for l in self.axis:
res+= '\tAxis: '+str(l)+'\n'
res+= '\tSlicer:\n'+str(self.slicer)+'\n'
res += '>'
return res
def log(self,cr,uid,cube,query,context={}):
if not context==False:
log_ids = pooler.get_pool(cr.dbname).get('olap.query.logs').search( cr, uid, [('query','=', query), ('user_id','=', uid)])
if log_ids:
count = pooler.get_pool(cr.dbname).get('olap.query.logs').browse(cr, uid, log_ids, context)[0]
pooler.get_pool(cr.dbname).get('olap.query.logs').write(cr, uid, log_ids, {'count':count.count+1})
else:
logentry={}
logentry['user_id']=uid
logentry['cube_id']=cube.id
logentry['query']=query
logentry['time']= str(datetime.datetime.now())
logentry['result_size']=0
logentry['count']=1
logentry['schema_id'] = cube.schema_id.id
log_id = pooler.get_pool(cr.dbname).get('olap.query.logs').create(cr,uid,logentry)
# count = pooler.get_pool(cr.dbname).get('olap.query.logs').browse(cr, uid, log_id, context)
# pooler.get_pool(cr.dbname).get('olap.query.logs').write(cr, uid, log_id, {'count':count.count+1})
return log_id
return -1
# vim: ts=4 sts=4 sw=4 si et
+42
View File
@@ -0,0 +1,42 @@
import sqlalchemy
import common
class slicer(object):
def __init__(self, slicer):
self.slicer = slicer
def validate(self, cube):
self.object = cube
for slicer in self.slicer:
slicer.validate(cube)
def __repr__(self):
res = '\t<olap.slicer\n'
res += str(self.slicer)
res += '\t>'
return res
#
# Output:
# a list of grouped values that can be computed at once
# a group is defined by elements having the same query
#
# [
# {
# 'level': ["Time","2008","Q1"],
# 'value': '1er Trim 2008',
# 'query': SQLAlchemy query object
# }
# ]
#
def run(self, metadata):
print '*'*40
print self.slicer
result = []
for slicer_line in self.slicer:
res = slicer_line.run(metadata)
result += slicer_line.run(metadata)
return result
# vim: ts=4 sts=4 sw=4 si et
+270
View File
@@ -0,0 +1,270 @@
##############################################################################
#
# Copyright (c) 2004-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import locale
import mdx_input
import sqlalchemy
from sqlalchemy import *
import common
import slicer
import datetime
import pooler
import copy
import pyparsing
from pyparsing import *
class warehouse(object):
def create_table(self, connection, table_name, data):
measures = data[0].keys()
measures.pop(measures.index('name'))
engine = create_engine(connection, echo=False)
metadata = MetaData()
tab = Table(str(table_name), metadata,
Column('name', String(100)),
Column('parent_id', String(100)),
Column('id', String(100))
)
for msr in measures:
colmn = Column(msr, String(100))
tab.append_column(colmn)
metadata.create_all(engine)
result = engine.execute(tab.insert(), data)
return {}
def log(self,cr,uid,cube,query,data,connection,context={}):
if not context==False:
log_ids = pooler.get_pool(cr.dbname).get('olap.query.logs').search( cr, uid, [('query','=', query), ('user_id','=', uid)])
if log_ids:
count = pooler.get_pool(cr.dbname).get('olap.query.logs').browse(cr, uid, log_ids, context)[0]
counter = count.count + 1
table_name = ''
if counter>=3:
if len(data[0]) == 2:
rows = data[0][0]
columns = data[0][1]
datas = data[1]
result = []
parent_list = [ rw[0] for rw in rows]
for element in range(len(rows)):
res = {}
check_element = rows[element][0][:rows[element][0].index(rows[element][1])]
if check_element:
res['parent_id'] = str(parent_list.index(check_element))
res['id'] = str(element)
else:
res['parent_id'] = str(None)
res['id'] = str(element)
res['name'] = str(rows[element][1])
for col in range(len(columns)):
col_elem = columns[col][0][:columns[col][0].index(columns[col][1])+1]
c_element = '.'.join(map(lambda x: str(x), col_elem))
res[c_element] = str(datas[element][col][0])
result.append(res)
table_name = cube.name+'_'+str(count.id)+'_'+str(counter)
self.create_table(connection,table_name, result)
elif len(data[0]) == 3:
print "Its for Pages:>>>>>>>>>"
pooler.get_pool(cr.dbname).get('olap.query.logs').write(cr, uid, log_ids, {'count':counter, 'table_name': table_name})
return True
else:
logentry={}
logentry['user_id']=uid
logentry['cube_id']=cube.id
logentry['query']=query
logentry['time']= str(datetime.datetime.now())
logentry['result_size']=0
logentry['count']=1
logentry['schema_id'] = cube.schema_id.id
log_id = pooler.get_pool(cr.dbname).get('olap.query.logs').create(cr,uid,logentry)
return log_id
return -1
def run(self, currency, qry_obj):
schema = qry_obj.schema_id
table_name = str(qry_obj.table_name)
connection = schema.database_id.connection_url
engine = create_engine(connection, echo=False)
metadata = MetaData(engine)
metadata.create_all(engine)
tab = Table(table_name, metadata, autoload=True, autoload_with=engine)
total_columns = [c.name for c in tab.columns]
columns = []
cols = []
for c in tab.columns:
if not c.name.__contains__('name') and not c.name.__contains__('id') and not c.name.__contains__('parent_id'):
columns.append(c.name)
cols.append((c.name.split('.'), str(c.name.split('.')[1])))
result = tab.select().execute()
res = result.fetchall()
rows = []
# dt = [[[]] * len(columns)] * len(res)
for r in range(len(res)):
if res[r][1] == str(None):
rows.append(([str(res[r][0])], str(res[r][0])))
else:
rows.append(([str(res[int(res[r][1])][0]),str(res[r][0])], str(res[r][0])))
data = []
for r in range(len(res)):
data.append(res[r][3:])
datas = []
for dd in range(len(data)):
datas.append([])
for d in range(len(data[dd])):
datas[dd].append([str(data[dd][d])])
final_result = ([rows, cols], datas)
return final_result
def match_table(self, cr, uid,request, context):
qry_obj = pooler.get_pool(cr.dbname).get('olap.query.logs')
result = self.parse_query(request)
qry = result[1][0]
qry_axis = result[0]
qry_id = qry_obj.search(cr, uid, [('query','=',str(qry))])
result = ()
if qry_id:
qry = qry_obj.browse(cr, uid, qry_id)[0]
schema = qry.schema_id
if qry.table_name !='':
total_rows = []
total_cols = []
data = []
table_name = str(qry.table_name)
connection = schema.database_id.connection_url
engine = create_engine(connection, echo=False)
metadata = MetaData(engine)
metadata.create_all(engine)
tab = Table(table_name, metadata, autoload=True, autoload_with=engine)
total_columns = [c.name for c in tab.columns]
res = tab.select().execute().fetchall()
for val in range(len(res)):
for row in range(len(res[val])):
if total_columns[row]!='parent_id' and total_columns[row]!='id':
if total_columns[row] == 'name':
total_rows.append((str(res[val][row]).split("."), str(res[val][row]).split(".")[-1]))
else:
total_cols.append((str(total_columns[row]).split("."), str(total_columns[row]).split(".")[-1]))
data.append([[str(res[val][row])]])
res_1 = []
res_1.append(total_rows)
res_1.append(total_cols)
result = (res_1, data)
return result
def parse_query(self, query):
result = []
lrbrack, rrbrack = map( Suppress, "()" )
comma = Suppress( "," )
leftCurlBr, rightCurlBr = map( Suppress, "{}" )
dot = Suppress( "." )
crossToken = Literal( "crossjoin" ).suppress()
selectToken = Keyword( "select", caseless = True ).suppress()
fromToken = Keyword( "from", caseless = True ).suppress()
whereToken = Keyword( "where", caseless = True ).suppress()
scalar = Word( alphanums + "_" + " " + "-" + "+")
cube = Word( alphas + '_' )
level_scalar = Word( alphanums + "_" + " " )
level_filter = Suppress( "[" ) + level_scalar + Suppress( "]" )
level_function = Keyword( "children", caseless = True )
level_item = level_filter | level_function
levels = Group( level_item + Optional( dot + delimitedList( level_item, ".", combine = False ) ) )
axis_parser = delimitedList( levels, ",", combine = False )
where_parse = lrbrack + Group( delimitedList( levels , ",", combine = False ) ) + rrbrack
cross_parser = leftCurlBr + levels + rightCurlBr
crossx = Forward()
cross_mdx = crossx | leftCurlBr + axis_parser + rightCurlBr
crossx << ( crossToken + lrbrack + cross_mdx + comma + Group( cross_parser.setResultsName( "cross" ) ) + rrbrack )
rowsmdx = leftCurlBr + axis_parser + rightCurlBr
colsmdx = leftCurlBr + axis_parser + rightCurlBr
pagemdx = leftCurlBr + axis_parser + rightCurlBr
row_mdx_axis = rowsmdx | crossx
col_mdx_axis = colsmdx | crossx
row_names = ["rows", "columns", "pages"]
onToken = Keyword( "on", caseless = True ).suppress()
page_name = oneOf( ' '.join( row_names ) ).suppress()
query_parser = selectToken + Group( row_mdx_axis ) + onToken + page_name + Optional( comma + Group( col_mdx_axis ) + onToken + page_name ) \
+ Optional( comma + Group( pagemdx ) + onToken + page_name )\
+ fromToken + cube.suppress() + Optional( whereToken + Group(where_parse ))
qr = query_parser.parseString(query)
axes = [[],[], []]
crossjoins=[[],[],[]]
ax = 0
for items in qr:
for i in items:
# if ax == 2:
# if len( items ) > 1:
# for t in i:
# conditions.append( list(t) )
# else:
# conditions.append( list(i))
if i.cross:
if i[0][-1] == 'children':
crossjoins[ax].append( '.'.join(map(lambda x: "[" + x +"]",i[0][:-1]))+".children")
else:
crossjoins[ax].append( '.'.join(map(lambda x: "[" + x +"]",i[0])))
else:
if i[-1] == 'children':
axes[ax].append( '.'.join(map(lambda x: "[" + x +"]",i[:-1]))+".children")
else:
axes[ax].append( '.'.join(map(lambda x: "[" + x +"]",i)))
ax = ax + 1
result.append(axes)
result.append(crossjoins)
qry_list = [[], []]
t_qry = []
new_query = ''
for x in range(len(axes)):
qry_select = 'select {'
if x == 0:
rs = axes[x][:-1]
if rs:
t_qry.append(rs)
rs_axis = ','.join(rs)
new_query = qry_select + rs_axis + '} on rows,'
elif x == 1:
cs_axis = ','.join(axes[x])
if cs_axis:
t_qry.append(cs_axis)
new_query = new_query + ' {' + cs_axis + '} on columns from Sales'
qry_list[0].append(t_qry)
qry_list[1].append(new_query)
# else:
# print "pages"
return qry_list
+701
View File
@@ -0,0 +1,701 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
Wizard view for the load data
-->
<record id="bi_load_db_form" model="ir.ui.view">
<field name="name">bi.load.db.form</field>
<field name="model">bi.load.db.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Load Database Tables">
<label align="0.0" string="We will load the complete structure of the database by introspection, so that you will be able to work on it, and specify a better structure according to your reporting needs." colspan="4" />
<newline/>
<label align="0.0" string="After having loaded the structure, you will be able to hide/show or rename tables and columns to simplify end-users interface. The following database will be loaded:" colspan="4"/>
<newline/>
<field name="fact_table" />
<field name="db_name" />
<newline/>
<button name="action_cancel" string="Cancel" type="object" colspan="2"/>
<button name="action_load" string="Load Data Structure" type="object" colspan="2"/>
</form>
</field>
</record>
<record id="act_bi_load_db_wizard" model="ir.actions.act_window">
<field name="name">Load database Structure</field>
<field name="res_model">bi.load.db.wizard</field>
<field name="src_model">olap.schema</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="auto_refresh" eval="1"/>
<field name="target">new</field>
</record>
<!--
Wizard For Olap Warehouse
-->
<record id="view_warehouse_bi" model="ir.ui.view">
<field name="name">Olap Warehouse</field>
<field name="model">olap.warehouse.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Warehouse">
<group colspan="16">
<separator string="Query" colspan="16"/>
<field name="query" nolabel="1" colspan="16"/>
<button string="Ok" name="action_ok" colspan="16" type="object" icon='gtk-ok'/>
</group>
</form>
</field>
</record>
<record id="action_olap_warehouse" model="ir.actions.act_window">
<field name="name">Olap Warehouse</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">olap.warehouse.wizard</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<menuitem
name="Olap Warehouse"
action="action_olap_warehouse"
id="menu_bi_warehouse"
sequence="51"
parent="base.next_id_50"
/>
<!--
Wizard View for the parameters wizard
-->
<record id="view_config_bi" model="ir.ui.view">
<field name="name">Parameters Configuration</field>
<field name="model">olap.parameters.config.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Parameters Configure">
<separator string="BI Web Client." colspan="4"/>
<label string="This wizard will automatically configure the web client for BI." align="0.0" colspan="4"/>
<field name="host_name" colspan="4"/>
<field name="host_port" colspan="4"/>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="4" colspan="2">
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
<button name="action_config" string="Configure" icon='gtk-ok' type="object"/>
</group>
</form>
</field>
</record>
<record id="action_config_bi_parameters" model="ir.actions.act_window">
<field name="name">Parameters Configuration</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">olap.parameters.config.wizard</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<menuitem
name="Server Parameters"
action="action_config_bi_parameters"
id="menu_bi_server_parameters"
sequence="50"
parent="base.next_id_50"
/>
<record model="ir.actions.todo" id="config_auto_directory">
<field name="name">Server Parameters Configuration</field>
<field name="note">This wizard will configure the URL of the web client</field>
<field name="action_id" ref="action_config_bi_parameters"/>
</record>
<!--
Wizard view for the Auto Configuring the data
-->
<record id="bi_auto_configure_form" model="ir.ui.view">
<field name="name">bi.auto.configure.form</field>
<field name="model">bi.auto.configure.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Auto Congifuring Tables">
<label align="0.0" string="This will Auto Configure Application. This will help to increase the readability of the tables and columns by giving it meaningful and easy to comprehend name. You can hides particular data and columns by reconfiguring the structure option." colspan="4" />
<field name="name" select="1" colspan="4"/>
<newline/>
<button name="action_cancel" string="Cancel" type="object" colspan="2"/>
<button name="action_load" string="Auto Configure Structure" type="object" colspan="2"/>
</form>
</field>
</record>
<record id="act_bi_auto_configure" model="ir.actions.act_window">
<field name="name">Auto Configuration</field>
<field name="res_model">bi.auto.configure.wizard</field>
<field name="src_model">olap.schema</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="auto_refresh" eval="1"/>
<field name="target">new</field>
</record>
# ------------------------------------------------------------------
# Olap Schema
# ------------------------------------------------------------------
<record model="ir.ui.view" id="view_olap_schema_tree">
<field name="name">olap.schema.tree</field>
<field name="model">olap.schema</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Olap Schema">
<field name="name"/>
<field name="database_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_schema_form">
<field name="name">olap.schema.form</field>
<field name="model">olap.schema</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Olap Schema">
<field name="name" select="1" colspan="4"/>
<field name="database_id" select="2" colspan="4"/>
<field name="loaded" colspan="3"/>
<button name="%(act_bi_load_db_wizard)d" string="Reload Structure" type="action" states="done"/>
<field name="configure" colspan="3"/>
<button name="%(bi_load_configuration_table)d" string="ReConfigure Structure" type="action" states="done"/>
<!-- <button string="Configure Manually" name="dbconfigure" states="dbload" target="new"/>-->
<field name="ready" select="2" colspan="3"/>
<field name="note" colspan="4"/>
<field name="state" select="2" colspan="2" />
<group colspan="2">
<button string="Connect to Database" name="dbconnect" states="none"/>
<button string="Load Database Structure" name="%(act_bi_load_db_wizard)d" type="action" states="dbconnect" target="new" />
<button string="Configure Manually" name="dbconfigure" states="dbload"/>
<button string="Mark as Configured" name="dbready" states="dbconfigure"/>
</group>
<separator string="Auto Application Configuration" colspan="4"/>
<field name="app_detect" nolabel="1" colspan="3"/>
<button string="Configure Automatically " name="%(act_bi_auto_configure)d" type="action" states="dbload" target="new"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_olap_schema_form">
<field name="name">Olap Schemas</field>
<field name="res_model">olap.schema</field>
<field name="view_type">form</field>
</record>
<menuitem
name="Olap Schema"
action="action_olap_schema_form"
id="menu_action_olap_schema_form"
parent="menu_bi_conf_cubes"/>
# ------------------------------------------------------------------
# Olap Cubes Table
# ------------------------------------------------------------------
<record model="ir.ui.view" id="view_olap_cube_table_form">
<field name="name">olap.cube.table.form</field>
<field name="model">olap.cube.table</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Olap cube_table" >
<field name="name" select="2"/>
<field name="column_link_id" context="{'fk':True,'dim_x':context.get('d_id',False)}"/>
<newline/>
<separator colspan="2" string="Joined Tables"/>
<field invisible="True" name="line_ids" nolabel="1">
<form string="Database Tables">
<field name="table_id"/>
<field name="field_id"/>
</form>
<tree string="Database Tables">
<field name="table_id"/>
<field name="field_id"/>
</tree>
</field>
<field name="available_table_ids" colspan="4" nolabel="1" readonly="0" domain="[('available_table_ids','in',available_table_ids)]" context="{'flag':True,'master_dim':context.get('d_id',False),'master_schema':context.get('parent_schema_id',False),'link_col':column_link_id}">
<tree string="Database Tables">
<field name="related_to" string="Joined Table"/>
<field name="name"/>
<field name="table_id" />
<field name="primary_key" />
</tree>
</field>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_olap_cube_table_form">
<field name="name">Olap Cube Tables</field>
<field name="res_model">olap.cube.table</field>
<field name="view_type">form</field>
</record>
<menuitem
name="Olap Cubes Table"
parent = "menu_bi_conf_cubes"
action="action_olap_cube_table_form"
id="menu_action_olap_cube_table_form"/>
# ------------------------------------------------------------------
# Olap Cubes
# ------------------------------------------------------------------
<record model="ir.ui.view" id="view_olap_cube_tree">
<field name="name">olap.cube.tree</field>
<field name="model">olap.cube</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Olap cube">
<field name="name"/>
<field name="table_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_cube_form">
<field name="name">olap.cube.form</field>
<field name="model">olap.cube</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Olap cube">
<field name="name" select="1" colspan="4"/>
<field name="schema_id" select="1" attrs="{'readonly':[('schema_id','!=','')]}"/>
<field name="query_log" select="2"/>
<field name="table_id" colspan="4" context="{'parent_schema_id':schema_id}"/>
<!--<separator colspan="4" string="Dimensions"/>
<field name="dimension_ids" colspan="4" nolabel="1"/>
<separator colspan="4" string="Measures"/>
<field name="measure_ids" colspan="4" nolabel="1"/>-->
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_olap_cube_form">
<field name="name">Olap Cubes</field>
<field name="res_model">olap.cube</field>
<field name="view_type">form</field>
</record>
<menuitem
name="Olap Cubes"
parent ="menu_bi_conf_cubes"
action="action_olap_cube_form"
id="menu_action_olap_cube_form"/>
# ------------------------------------------------------------------
# Olap Dimensions
# ------------------------------------------------------------------
<record model="ir.ui.view" id="view_olap_dimension_tree">
<field name="name">olap.dimension.tree</field>
<field name="model">olap.dimension</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Olap dimension">
<field name="name"/>
<field name="cube_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_dimension_form">
<field name="name">olap.dimension.form</field>
<field name="model">olap.dimension</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Olap dimension">
<field name="name" select="1"/>
<field name="cube_id" select="1" attrs="{'readonly':[('cube_id','!=','')]}"/>
<!-- <field name="cube_id" on_change="onchange_cube_id(cube_id)" select="1" attrs="{'readonly':[('cube_id','!=','')]}"/>
<field name="foreign_key_table" select="2"/>
<field name="foreign_key" select="2"/>
<separator colspan="4" string="Select In These Tables For Foreign Keys"/>
<field name="available_foreign_table_ids" nolabel="1" colspan="4" readonly="0">
<tree string="Database Tables">
<button string="Mark as Foreign Table" name="mark_foreign" context="{'parent_id':parent.id,'parent_name':parent.name,'parent_cube':parent.cube_id,'reload':1}" type="object"/>
<field name="table_id" />
<field name="name" string="Link Column"/>
</tree>
</field>
<separator colspan="4" string="Hierarchies"/>
<field name="hierarchy_ids" colspan="4" nolabel="1"/>-->
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_olap_dimension_form">
<field name="name">Olap Dimensions</field>
<field name="res_model">olap.dimension</field>
<field name="view_type">form</field>
</record>
<menuitem
name="Olap Dimension"
parent = "menu_bi_conf_cubes"
action="action_olap_dimension_form"
id="menu_action_olap_dimension_form"/>
# ------------------------------------------------------------------
# Olap Hierarchies
# ------------------------------------------------------------------
<record model="ir.ui.view" id="view_olap_hierarchy_tree">
<field name="name">olap.hierarchy.tree</field>
<field name="model">olap.hierarchy</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Olap hierarchy">
<field name="name"/>
<field name="dimension_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_hierarchy_form">
<field name="name">olap.hierarchy.form</field>
<field name="model">olap.hierarchy</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Olap hierarchy">
<field name="name" select="1" colspan="4"/>
<field name="dimension_id" select="1" attrs="{'readonly':[('dimension_id','!=','')]}"/>
<!-- <field name="field_name" select="2"/>-->
<field name="sequence"/>
<field name="table_id" select="2" colspan="4" context="{'d_id':dimension_id}"/>
<!-- <separator string="Levels" colspan="4"/>
<field name="level_ids" colspan="4" nolabel="1"/>-->
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_olap_hierarchy_form">
<field name="name">Olap Hierarchies</field>
<field name="res_model">olap.hierarchy</field>
<field name="view_type">form</field>
</record>
<menuitem
name="Olap Hierarchy"
parent = "menu_bi_conf_cubes"
action="action_olap_hierarchy_form"
id="menu_action_olap_hierarchy_form"/>
# ------------------------------------------------------------------
# Olap Levels
# ------------------------------------------------------------------
<record model="ir.ui.view" id="view_olap_level_tree">
<field name="name">olap.level.tree</field>
<field name="model">olap.level</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Olap Level">
<field name="name"/>
<field name="column_name"/>
<field name="column_id_name" invisible="True"/>
<field name="type"/>
<field name="table_name" invisible="True"/>
<field name="sequence"/>
<field name="hierarchy_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_level_form">
<field name="name">olap.level.form</field>
<field name="model">olap.level</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Olap level">
<field name="name" select="1" colspan="4"/>
<field name="column_name" select="1" on_change="onchange_column_name(column_name)" context="{'filter_cols_hier':hierarchy_id}"/>
<field name="column_id_name" select="1"/>
<field name="type" select="1"/>
<field name="table_name" select="1"/>
<field name="sequence"/>
<!-- <field name="hierarchy_id" select="1"/>-->
<field name="hierarchy_id" select="1" attrs="{'readonly':[('hierarchy_id','!=','')]}"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_olap_level_form">
<field name="name">Olap Level</field>
<field name="res_model">olap.level</field>
<field name="view_type">form</field>
</record>
<menuitem
name="Olap Level"
parent = "menu_bi_conf_cubes"
action="action_olap_level_form"
id="menu_action_olap_level_form"/>
# ------------------------------------------------------------------
# Olap Measure
# ------------------------------------------------------------------
<record model="ir.ui.view" id="view_olap_measure_tree">
<field name="name">olap.measure.tree</field>
<field name="model">olap.measure</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Olap measure">
<field name="name"/>
<field name="cube_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_measure_form">
<field name="name">olap.measure.form</field>
<field name="model">olap.measure</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Olap measure">
<field name="name" select="1"/>
<field name="cube_id" select="1" attrs="{'readonly':[('cube_id','!=','')]}"/>
<field name="value_column_id_name" invisible="True"/>
<field name="table_name" invisible="True"/>
<field name="measure_type"/>
<!-- <notebook colspan="4">
<page string="Fact Table Column" >
<newline/>
<field name="value_column" select="1" on_change="onchange_measure_name(value_column)" context="{'filter_cols_cube':cube_id}"/>
<field name="agregator" select="2"/>
<field name="formatstring" select="2"/>
</page>
<page string="SQL Expression" attrs="{'invisible':[('measure_type','!=','sql_expr')]}">
<field name="value_sql" colspan="4" select="2"/>
<field name="datatype" select="2"/>
</page>
</notebook>
-->
<group colspan="4" attrs="{'invisible':[('measure_type','!=','fact_column')]}">
<newline/>
<field name="value_column" select="1" attrs="{'required':[('measure_type','=','fact_column')]}" on_change="onchange_measure_name(value_column)" context="{'filter_cols_cube':cube_id}"/>
<field name="agregator" select="2"/>
<field name="formatstring" select="2"/>
</group>
<group colspan="4" attrs="{'invisible':[('measure_type','!=','sql_expr')]}">
<newline/>
<field name="value_sql" colspan="4" select="2" attrs="{'required':[('measure_type','=','sql_expr')]}"/>
<field name="datatype" select="2"/>
</group>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_olap_measure_form">
<field name="name">Olap Measures</field>
<field name="res_model">olap.measure</field>
<field name="view_type">form</field>
</record>
<menuitem
name="Olap Measures"
parent = "menu_bi_conf_cubes"
action="action_olap_measure_form"
id="menu_action_olap_measure_form"/>
# ------------------------------------------------------------------
# Olap Saved Query
# ------------------------------------------------------------------
<record model="ir.ui.view" id="view_olap_saved_query_form_tree">
<field name="name">olap.saved.query.tree</field>
<field name="model">olap.saved.query</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Olap Saved Query">
<field name="name"/>
<field name="cube_id"/>
<field name="mdx_id"/>
<field name="user_id"/>
<field name="query"/>
<field name="time"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_saved_query_form_mdx">
<field name="name">olap.saved.query.mdx</field>
<field name="model">olap.saved.query</field>
<field name="type">mdx</field>
<field name="arch" type="xml">
<tree string="Olap Saved Query">
<field name="name"/>
<field name="user_id"/>
<field name="query"/>
<field name="cube_id"/>
<field name="mdx_id"/>
<field name="axis_keys" readonly="True"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_saved_query_form">
<field name="name">olap.saved.query.form</field>
<field name="model">olap.saved.query</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Olap Saved Query">
<field name="name" select="1" readonly="True"/>
<field name="query" select="1" colspan="4" readonly="True"/>
<field name="user_id" readonly="True"/>
<field name="cube_id" select="2" readonly="True"/>
<field name="mdx_id" select="2" readonly="True"/>
<field name="schema_id" select="2" readonly="True"/>
<field name="axis_keys" readonly="True"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_olap_saved_query_form">
<field name="name">Olap Saved Query</field>
<field name="res_model">olap.saved.query</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,mdx</field>
</record>
<menuitem
name="Olap Saved Query"
parent = "menu_bi_conf_tools"
action="action_olap_saved_query_form"
id="menu_action_olap_saved_query_form"/>
<!--
All Logs
-->
<record model="ir.ui.view" id="view_olap_query_logs_tree">
<field name="name">olap.query.logs</field>
<field name="model">olap.query.logs</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="All Logs">
<field name="user_id"/>
<field name="query"/>
<field name="cube_id"/>
<field name="schema_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_query_logs_form">
<field name="name">olap.query.logs.form</field>
<field name="model">olap.query.logs</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="All Logs">
<field name="query" colspan="4" select="1" readonly="True"/>
<field name="time" select="2" readonly="True"/>
<field name="result_size" select="2" readonly="True"/>
<field name="cube_id" select="2" readonly="True"/>
<field name="count" readonly="True"/>
<field name="schema_id" readonly="True"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_olap_query_logs_form">
<field name="name">All Logs</field>
<field name="res_model">olap.query.logs</field>
<field name="view_type">form</field>
</record>
<menuitem
name="All Logs"
action="action_olap_query_logs_form"
id="menu_action_olap_query_logs_form"
parent="menu_bi_conf_tools"/>
<!--
All Logs / My logs
-->
<record model="ir.ui.view" id="view_olap_query_logs_my_tree">
<field name="name">olap.query.logs</field>
<field name="model">olap.query.logs</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="My Logs">
<field name="user_id"/>
<field name="query"/>
<field name="cube_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_query_logs_my_tree">
<field name="name">olap.query.logs</field>
<field name="model">olap.query.logs</field>
<field name="type">mdx</field>
<field name="arch" type="xml">
<tree string="My Logs">
<field name="user_id"/>
<field name="query"/>
<field name="cube_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_query_logs_my_form">
<field name="name">olap.query.logs.form</field>
<field name="model">olap.query.logs</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="My Logs">
<field name="user_id" select="1" readonly="True"/>
<!-- domain="[('uid','=',uid)]"
/> -->
<field name="query" select="1" readonly="True"/>
<field name="time" select="2" readonly="True"/>
<field name="result_size" select="2" readonly="True"/>
<field name="cube_id" select="2" readonly="True"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_olap_query_logs_my_form">
<field name="name">My Logs</field>
<field name="res_model">olap.query.logs</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,mdx</field>
<field name="domain">[('user_id','=',uid)]</field>
</record>
<menuitem
name="My Logs"
action="action_olap_query_logs_my_form"
id="menu_action_olap_query_logs_my_form"
parent="menu_action_olap_query_logs_form"/>
<!--
Clear All Logs
-->
<!--
Clear My logs
-->
</data>
</openerp>
+87
View File
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="workflow" id="wkf_schema">
<field name="name">olap.schema</field>
<field name="osv">olap.schema</field>
<field name="on_create">True</field>
</record>
<record model="workflow.activity" id="act_none">
<field name="wkf_id" ref="wkf_schema"/>
<field name="flow_start">True</field>
<field name="name">none</field>
</record>
<record model="workflow.activity" id="act_dbconnect">
<field name="wkf_id" ref="wkf_schema"/>
<field name="name">dbconnect</field>
<field name="kind">function</field>
<field name="action">action_dbconnect()</field>
</record>
<record model="workflow.activity" id="act_dbload">
<field name="wkf_id" ref="wkf_schema"/>
<field name="name">dbload</field>
<field name="kind">function</field>
<field name="action">action_dbload()</field>
</record>
<record model="workflow.activity" id="act_dbconfigure">
<field name="wkf_id" ref="wkf_schema"/>
<field name="name">dbconfigure</field>
<field name="kind">function</field>
<field name="action">action_dbconfigure()</field>
</record>
<record model="workflow.activity" id="act_dbready">
<field name="wkf_id" ref="wkf_schema"/>
<field name="flow_stop">True</field>
<field name="name">dbready</field>
<field name="kind">function</field>
<field name="action">action_dbready()</field>
</record>
<!--
<record model="workflow.activity" id="act_dbdone">
<field name="wkf_id" ref="wkf_schema"/>
<field name="flow_stop">True</field>
<field name="name">db_done</field>
<field name="kind">function</field>
<field name="action">action_done()</field>
</record>
-->
<record model="workflow.transition" id="trans_none_dbconnect">
<field name="act_from" ref="act_none"/>
<field name="act_to" ref="act_dbconnect"/>
<field name="signal">dbconnect</field>
</record>
<record model="workflow.transition" id="trans_dbconnect_dbload">
<field name="act_from" ref="act_dbconnect"/>
<field name="act_to" ref="act_dbload"/>
<field name="signal">dbload</field>
</record>
<record model="workflow.transition" id="trans_dbload_dbconfigure">
<field name="act_from" ref="act_dbload"/>
<field name="act_to" ref="act_dbconfigure"/>
<field name="signal">dbconfigure</field>
</record>
<record model="workflow.transition" id="trans_dbconfigure_dbready">
<field name="act_from" ref="act_dbconfigure"/>
<field name="act_to" ref="act_dbready"/>
<field name="signal">dbready</field>
</record>
<!--
<record model="workflow.transition" id="trans_dbready_done">
<field name="act_from" ref="act_dbready"/>
<field name="act_to" ref="act_dbdone"/>
<field name="signal">dbdone</field>
</record>
-->
</data>
</openerp>
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
</data>
</openerp>
+171
View File
@@ -0,0 +1,171 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="True">
<record model="olap.fact.database" id="fact_database_terp">
<field name="name">Tiny ERP database</field>
<field name="db_name">terp</field>
<field name="db_login">postgres</field>
<field name="db_password">postgres</field>
</record>
<record model="olap.database.tables" id="database_table_res_partner">
<field name="name">res_partner</field>
<field name="table_db_name">res_partner</field>
<field name="fact_database_id" ref="fact_database_terp"/>
<field name="active">True</field>
</record>
<record model="olap.database.tables" id="database_table_res_user">
<field name="name">res_users</field>
<field name="table_db_name">res_users</field>
<field name="fact_database_id" ref="fact_database_terp"/>
<field name="active">True</field>
</record>
<record model="olap.database.columns" id="columns_res_partner_date">
<field name="name">date</field>
<field name="column_db_name">date</field>
<field name="type">date</field>
<field name="table_id" ref="database_table_res_partner"/>
<field name="active">True</field>
</record>
<record model="olap.database.columns" id="columns_res_user_create_uid">
<field name="name">create_uid</field>
<field name="column_db_name">create_uid</field>
<field name="type">int4</field>
<field name="table_id" ref="database_table_res_user"/>
<field name="active">True</field>
</record>
<record model="olap.database.columns" id="columns_res_user_id">
<field name="name">id</field>
<field name="column_db_name">id</field>
<field name="type">int4</field>
<field name="table_id" ref="database_table_res_user"/>
<field name="primary_key">True</field>
<field name="active">True</field>
</record>
<record model="olap.database.columns" id="columns_res_partner_id">
<field name="name">id</field>
<field name="column_db_name">id</field>
<field name="type">int4</field>
<field name="table_id" ref="database_table_res_partner"/>
<field name="primary_key">True</field>
<field name="active">True</field>
</record>
<record model="olap.database.columns" id="columns_res_user_name">
<field name="name">name</field>
<field name="column_db_name">name</field>
<field name="type">varchar</field>
<field name="table_id" ref="database_table_res_user"/>
<field name="active">True</field>
</record>
<record model="olap.database.columns" id="columns_res_partner_credit_limit">
<field name="name">credit_limit</field>
<field name="column_db_name">credit_limit</field>
<field name="type">int4</field>
<field name="table_id" ref="database_table_res_partner"/>
<field name="active">True</field>
</record>
<record model="olap.database.columns" id="columns_res_partner_user_id">
<field name="name">user_id</field>
<field name="column_db_name">user_id</field>
<field name="type">int4</field>
<field name="table_id" ref="database_table_res_partner"/>
<field name="related_to" ref="database_table_res_user"></field>
<field name="active">True</field>
</record>
<record model="olap.schema" id="schema_main">
<field name="name">tinyerp</field>
<field name="state">none</field>
<field name="database_id" ref="fact_database_terp"/>
</record>
<record model="olap.cube.table" id="table_res_partner">
<field name="name">Partner</field>
<field name="schema_id" ref="schema_main"/>
<field name="column_link_id" ref="columns_res_partner_id"/>
</record>
<record model="olap.cube.table" id="table_res_user">
<field name="name">Partner(User)</field>
<field name="schema_id" ref="schema_main"/>
<field name="column_link_id" ref="columns_res_partner_user_id"/>
</record>
<record model="olap.cube" id="cube_partner">
<field name="name">Partner</field>
<field name="table_id" ref="table_res_partner"/>
<field name="schema_id" ref="schema_main"/>
</record>
<record model="olap.dimension" id="dimension_date">
<field name="name">Date</field>
<field name="cube_id" ref="cube_partner"/>
</record>
<record model="olap.hierarchy" id="hierarchy_date">
<field name="name">Date</field>
<field name="dimension_id" ref="dimension_date"/>
<field name="primary_key_table">res_partner</field>
<field name="table_id" ref="table_res_partner"/>
</record>
<record model="olap.level" id="hierarchy_level_date">
<field name="name">Date</field>
<field name="column_name" ref="columns_res_partner_date"></field>
<field name="column_id_name">date</field>
<field name="type">date_year</field>
<field name="table_name">res_partner</field>
<field name="hierarchy_id" ref="hierarchy_date"/>
</record>
<record model="olap.dimension" id="dimension_user">
<field name="name">User</field>
<field name="cube_id" ref="cube_partner"/>
</record>
<record model="olap.hierarchy" id="hierarchy_user">
<field name="name">User</field>
<field name="dimension_id" ref="dimension_user"/>
<field name="primary_key_table">res_users</field>
<field name="table_id" ref="table_res_user"/>
</record>
<record model="olap.level" id="hierarchy_user_level">
<field name="name">Name</field>
<field name="column_id_name">name</field>
<field name="column_name" ref="columns_res_user_name"></field>
<field name="table_name">res_users</field>
<field name="hierarchy_id" ref="hierarchy_user"/>
</record>
<record model="olap.measure" id="measure_credit_limit">
<field name="name">Credit Limit</field>
<field name="cube_id" ref="cube_partner"/>
<field name="value_column" ref="columns_res_partner_credit_limit"></field>
<field name="value_column_id_name">credit_limit</field>
<field name="table_name">res_partner</field>
</record>
<record model="olap.measure" id="measure_count">
<field name="name">Count</field>
<field name="cube_id" ref="cube_partner"/>
<field name="value_column" ref="columns_res_partner_id"></field>
<field name="value_column_id_name">id</field>
<field name="table_name">res_partner</field>
<field name="agregator">count</field>
</record>
<record model="olap.application" id="application_openerp">
<field name="name">OpenERP</field>
<field name="query">select * from res_users</field>
</record>
</data>
</openerp>
+345
View File
@@ -0,0 +1,345 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
# --------------------------------------------------------------------
# Fact databases
# --------------------------------------------------------------------
<record model="ir.ui.view" id="view_olap_fact_database_tree">
<field name="name">olap.fact.database.tree</field>
<field name="model">olap.fact.database</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Olap fact database">
<field name="name"/>
<field name="db_name"/>
<field name="type"/>
<field name="loaded"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_fact_database_form">
<field name="name">olap.fact.database.form</field>
<field name="model">olap.fact.database</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Fact database">
<notebook>
<page string="Information">
<separator string="General information" colspan="4"/>
<field name="name" select="1" colspan="4"/>
<field name="db_name" select="2"/>
<field name="type" select="2"/>
<separator string="Connection parameters" colspan="4"/>
<field name="connection_type"/>
<newline/>
<field name="db_host"/>
<field name="db_port"/>
<field name="db_login"/>
<field name="db_password" password="True"/>
<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"/>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_view_olap_fact_database_form">
<field name="name">Fact Databases</field>
<field name="res_model">olap.fact.database</field>
<field name="view_type">form</field>
</record>
<menuitem
name="Databases"
action="action_view_olap_fact_database_form"
id="menu_view_olap_fact_database_form"
parent="menu_bi_conf_fact"/>
# --------------------------------------------------------------------
# Fact Database Tables
# --------------------------------------------------------------------
<record model="ir.ui.view" id="view_olap_database_tables_tree">
<field name="name">olap.database.tables.tree</field>
<field name="model">olap.database.tables</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Olap database tables">
<field name="name"/>
<field name="table_db_name"/>
<field name="fact_database_id" select="2"/>
<field name="active"/>
<field name="hide"/>
<!-- <button name="show_col_view" string="Columns" type="object"/>-->
<!--<button string="Columns_wiz" name="%(bi_load_column)d" type="action"/>-->
<button name="hide_col" string="Hide" type="object"/>
<button name="show_col" string="Show" type="object"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_database_tables_form">
<field name="name">olap.database.tables.form</field>
<field name="model">olap.database.tables</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Database tables">
<field name="name" select="1" colspan="2"/>
<field name="table_db_name"/>
<field name="columns" colspan="4" mode="tree" nolabel="1">
<tree string="Olap database columns">
<field name="name"/>
<field name="column_db_name"/>
<field name="type"/>
<field name="table_id"/>
<field name="primary_key"/>
<field name="related_to"/>
<field name="active"/>
<field name="hide"/>
<button name="hide_col" string="Hide" type="object"/>
<button name="show_col" string="Show" type="object"/>
</tree>
</field>
<field name="fact_database_id" select="1" colspan="2"/>
<field name="active"/>
<field name="hide"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_view_olap_database_tables_form">
<field name="name">Database Tables</field>
<field name="res_model">olap.database.tables</field>
<field name="view_type">form</field>
</record>
<menuitem
name="Tables"
action="action_view_olap_database_tables_form"
id="menu_view_olap_database_tables_form"
parent="menu_bi_conf_fact"/>
# --------------------------------------------------------------------
# Fact Database Columns
# --------------------------------------------------------------------
<record model="ir.ui.view" id="view_olap_database_columns_tree">
<field name="name">olap.database.columns.tree</field>
<field name="model">olap.database.columns</field>
<field name="type">tree</field>
<field name="priority">2</field>
<field name="arch" type="xml">
<tree string="Olap database columns">
<field name="name"/>
<field name="column_db_name"/>
<field name="type"/>
<field name="table_id"/>
<field name="primary_key"/>
<field name="related_to"/>
<field name="active"/>
<field name="hide"/>
<button name="hide_col" string="Hide" type="object"/>
<button name="show_col" string="Show" type="object"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_database_columns_tree_m20">
<field name="name">olap.database.columns.tree.m20</field>
<field name="model">olap.database.columns</field>
<field name="type">tree</field>
<field name="priority">1</field>
<field name="arch" type="xml">
<tree string="Olap database columns">
<field name="name"/>
<field name="column_db_name"/>
<field name="table_id"/>
<field name="related_to"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_database_columns_form">
<field name="name">olap.database.columns.form</field>
<field name="model">olap.database.columns</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Database columns">
<field name="name" select="1" colspan="2"/>
<field name="column_db_name"/>
<field name="type"/>
<field name="table_id" select="1" colspan="2"/>
<field name="primary_key"/>
<field name="related_to"/>
<field name="active"/>
<field name="hide"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_view_olap_database_columns_form">
<field name="name">Database Columns</field>
<field name="res_model">olap.database.columns</field>
<field name="view_type">form</field>
</record>
<record model="ir.actions.act_window" id="action_view_olap_database_columns_form">
<field name="name">Database Columns</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="res_model">olap.database.columns</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_olap_database_columns_tree"></field>
</record>
<menuitem
name="Columns"
action="action_view_olap_database_columns_form"
id="menu_view_olap_database_columns_form"
parent="menu_bi_conf_fact"/>
# --------------------------------------------------------------------
# Olap Application
# --------------------------------------------------------------------
<record model="ir.ui.view" id="view_olap_application_tree">
<field name="name">olap.application.tree</field>
<field name="model">olap.application</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Olap Application">
<field name="name"/>
<field name="query"/>
<field name="table_ids"/>
<field name="field_ids"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_application_form">
<field name="name">olap.application.form</field>
<field name="model">olap.application</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Olap Application">
<newline/>
<field name="name" select="1" colspan="2"/>
<field name="query" select="1" colspan="2"/>
<field name="table_ids" select="1" colspan="4" nolabel="1"/>
<field name="field_ids" select="1" colspan="4" nolabel="1" rowspan="1"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_view_olap_application_form">
<field name="name">Olap Applicatiion</field>
<field name="res_model">olap.application</field>
<field name="view_type">form</field>
</record>
<menuitem
name="Application"
action="action_view_olap_application_form"
id="menu_view_olap_application_form"
parent="menu_bi_conf_known_application"/>
# --------------------------------------------------------------------
# Olap Application table
# --------------------------------------------------------------------
<record model="ir.ui.view" id="view_olap_application_table_tree">
<field name="name">olap.application.table.tree</field>
<field name="model">olap.application.table</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Olap Application Table">
<field name="name"/>
<field name="table_name"/>
<field name="is_hidden"/>
<field name="application_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_application_table_form">
<field name="name">olap.application.table.form</field>
<field name="model">olap.application.table</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Olap Application Table">
<newline/>
<field name="name" select="1" colspan="2"/>
<field name="table_name" select="1" />
<field name="is_hidden" select="1" colspan="2" />
<field name="application_id" select="1" />
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_view_olap_application_table_form">
<field name="name">Olap Applicatiion Table</field>
<field name="res_model">olap.application.table</field>
<field name="view_type">form</field>
</record>
<menuitem
name="Application Table"
action="action_view_olap_application_table_form"
id="menu_view_olap_application_table_form"
parent="menu_bi_conf_known_application"/>
# --------------------------------------------------------------------
# Olap Application Field
# --------------------------------------------------------------------
<record model="ir.ui.view" id="view_olap_application_field_tree">
<field name="name">olap.application.field.tree</field>
<field name="model">olap.application.field</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Olap Application Field">
<field name="name"/>
<field name="table_name"/>
<field name="field_name"/>
<field name="is_hidden" />
<field name="application_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_olap_application_field_form">
<field name="name">olap.application.field.form</field>
<field name="model">olap.application.field</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Olap Application Field">
<newline/>
<field name="name" select="1" colspan="2"/>
<field name="field_name" select="1" />
<field name="table_name" select="1" />
<newline/>
<field name="is_hidden" select="1" colspan="2"/>
<field name="application_id" select="1" />
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_view_olap_application_field_form">
<field name="name">Olap Applicatiion Field</field>
<field name="res_model">olap.application.field</field>
<field name="view_type">form</field>
</record>
<menuitem
name="Application Field"
action="action_view_olap_application_field_form"
id="menu_view_olap_application_field_form"
parent="menu_bi_conf_known_application"/>
</data>
</openerp>
+155
View File
@@ -0,0 +1,155 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="access_olap_application" model="ir.model.access">
<field name="name">Olap Application</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.application')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
<record id="access_olap_application_field" model="ir.model.access">
<field name="name">Olap Application Field</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.application.field')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
<record id="access_olap_application_table" model="ir.model.access">
<field name="name">Olap Application Table</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.application.table')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
<record id="access_olap_cube" model="ir.model.access">
<field name="name">Olap Cube</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.cube')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
<record id="access_olap_cube_table" model="ir.model.access">
<field name="name">Olap Cube Table</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.cube.table')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
<record id="access_olap_cube_table_line" model="ir.model.access">
<field name="name">Olap Cube Table Line</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.cube.table.line')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
<record id="access_olap_database_columns" model="ir.model.access">
<field name="name">Olap Database Columns</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.database.columns')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
<record id="access_olap_database_tables" model="ir.model.access">
<field name="name">Olap Database Tables</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.database.tables')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
<record id="access_olap_dimension" model="ir.model.access">
<field name="name">Olap Dimension</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.dimension')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
<record id="access_olap_fact_database" model="ir.model.access">
<field name="name">Olap Fact Database</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.fact.database')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
<record id="access_olap_hierarchy" model="ir.model.access">
<field name="name">Olap Hierarchy</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.hierarchy')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
<record id="access_olap_level" model="ir.model.access">
<field name="name">Olap Level</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.level')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
<record id="access_olap_schema" model="ir.model.access">
<field name="name">Olap Schema</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.schema')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
<record id="access_olap_measure" model="ir.model.access">
<field name="name">Olap Measure</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.measure')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
<record id="access_olap_query_logs" model="ir.model.access">
<field name="name">Olap Query Logs</field>
<field model="ir.model" name="model_id" search="[('model', '=', 'olap.query.logs')]"/>
<field name="group_id" ref="base.group_system"/>
<field eval="True" name="perm_read"/>
<field eval="True" name="perm_write"/>
<field eval="True" name="perm_create"/>
<field eval="True" name="perm_unlink"/>
</record>
</data>
</openerp>

Some files were not shown because too many files have changed in this diff Show More