bzr revid: fp@tinyerp.com-20100121082734-up8syb6019o9q25d
This commit is contained in:
Fabien Pinckaers
2010-01-21 09:27:34 +01:00
285 changed files with 37199 additions and 1929 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"
+7 -7
View File
@@ -7,13 +7,13 @@ 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 11:15+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-01-19 09:48+0000\n"
"Last-Translator: lem0na <nickyk@gmx.net>\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:18+0000\n"
"X-Launchpad-Export-Date: 2010-01-20 04:36+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: auction
@@ -44,19 +44,19 @@ msgstr "продавач"
#. module: auction
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "Невалидно име на модел при задаване на действие"
#. module: auction
#: selection:auction.lots.send.aie,date_ask,numerotation:0
#: selection:auction.lots.send.aie,init,numerotation:0
msgid "Provisoire"
msgstr ""
msgstr "Временен"
#. module: auction
#: selection:auction.lots.send.aie,date_ask,numerotation:0
#: selection:auction.lots.send.aie,init,numerotation:0
msgid "Definitive (ordre catalogue)"
msgstr ""
msgstr "Зададен (за каталог)"
#. module: auction
#: model:ir.ui.menu,name:auction.menu_report_auction_object_date_tree1_my
@@ -71,7 +71,7 @@ msgstr "История на партида"
#. module: auction
#: field:report.seller.auction,avg_estimation:0
msgid "Avg estimation"
msgstr ""
msgstr "Усреднена оценка"
#. module: auction
#: field:report.auction.object.date,obj_num:0
+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-19 04:41+0000\n"
"X-Launchpad-Export-Date: 2010-01-20 04:36+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: auction
+44 -44
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: 2009-09-08 13:21+0000\n"
"Last-Translator: Pedro_Maschio <pedro.bicudo@tgtconsult.com.br>\n"
"PO-Revision-Date: 2010-01-20 01:10+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: 2009-12-16 05:24+0000\n"
"X-Launchpad-Export-Date: 2010-01-21 04:34+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: audittrail
@@ -32,32 +32,32 @@ msgstr ""
#. module: audittrail
#: field:audittrail.log.line,log_id:0
msgid "Log"
msgstr ""
msgstr "Registro (log)"
#. module: audittrail
#: selection:audittrail.rule,state:0
msgid "Subscribed"
msgstr ""
msgstr "Inscrito"
#. module: audittrail
#: view:audittrail.log:0
msgid "Old Value : "
msgstr ""
msgstr "Valor Anterior : "
#. module: audittrail
#: selection:audittrail.log,method:0
msgid "Create"
msgstr ""
msgstr "Criar"
#. module: audittrail
#: wizard_view:audittrail.view.log,init:0
msgid "Audit Logs"
msgstr ""
msgstr "Logs de auditoria"
#. module: audittrail
#: field:audittrail.rule,state:0
msgid "State"
msgstr ""
msgstr "Status"
#. module: audittrail
#: selection:audittrail.rule,state:0
@@ -67,12 +67,12 @@ msgstr ""
#. module: audittrail
#: field:audittrail.log.line,old_value:0
msgid "Old Value"
msgstr ""
msgstr "Valor Anterior"
#. module: audittrail
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "Nome de modelo inválido na definição da ação."
#. module: audittrail
#: model:ir.actions.wizard,name:audittrail.wizard_audittrail_log
@@ -87,7 +87,7 @@ msgstr ""
#. module: audittrail
#: field:audittrail.log,method:0
msgid "Method"
msgstr ""
msgstr "Método"
#. module: audittrail
#: wizard_field:audittrail.view.log,init,from:0
@@ -97,17 +97,17 @@ msgstr ""
#. module: audittrail
#: field:audittrail.log.line,log:0
msgid "Log ID"
msgstr ""
msgstr "Log ID"
#. module: audittrail
#: field:audittrail.log,res_id:0
msgid "Resource Id"
msgstr ""
msgstr "ID Recurso"
#. module: audittrail
#: selection:audittrail.log,method:0
msgid "Write"
msgstr ""
msgstr "Escrever"
#. module: audittrail
#: model:ir.ui.menu,name:audittrail.menu_action_audittrail
@@ -117,23 +117,23 @@ msgstr ""
#. module: audittrail
#: view:audittrail.log:0
msgid "Log Lines"
msgstr ""
msgstr "Linhas do Log"
#. module: audittrail
#: view:audittrail.rule:0
msgid "Subscribe"
msgstr ""
msgstr "Assinar"
#. module: audittrail
#: selection:audittrail.log,method:0
msgid "Read"
msgstr ""
msgstr "Ler"
#. module: audittrail
#: field:audittrail.log,object_id:0
#: field:audittrail.rule,object_id:0
msgid "Object"
msgstr ""
msgstr "Objeto"
#. module: audittrail
#: view:audittrail.rule:0
@@ -162,12 +162,12 @@ msgstr ""
#. module: audittrail
#: field:audittrail.log,timestamp:0
msgid "Date"
msgstr ""
msgstr "Data"
#. module: audittrail
#: field:audittrail.log,user_id:0
msgid "User"
msgstr ""
msgstr "Usuário"
#. module: audittrail
#: view:audittrail.log:0
@@ -182,92 +182,92 @@ msgstr "Invalido XML para Arquitetura da View"
#. module: audittrail
#: field:audittrail.log,name:0
msgid "Name"
msgstr ""
msgstr "Nome"
#. module: audittrail
#: field:audittrail.log,line_ids:0
msgid "Log lines"
msgstr ""
msgstr "Linhas de Log"
#. module: audittrail
#: model:ir.ui.menu,name:audittrail.menu_action_audittrail_rule_tree_sub
msgid "Subscribed Rules"
msgstr ""
msgstr "Regras Inscritas"
#. module: audittrail
#: field:audittrail.log.line,field_id:0
msgid "Fields"
msgstr ""
msgstr "Campos"
#. module: audittrail
#: view:audittrail.rule:0
msgid "AuditTrail Rules"
msgstr ""
msgstr "Regras de Auditoria"
#. module: audittrail
#: model:ir.model,name:audittrail.model_audittrail_rule
msgid "audittrail.rule"
msgstr ""
msgstr "audittrail.rule"
#. module: audittrail
#: view:audittrail.rule:0
msgid "UnSubscribe"
msgstr ""
msgstr "Remover Inscrição"
#. module: audittrail
#: field:audittrail.rule,log_write:0
msgid "Log writes"
msgstr ""
msgstr "Escritas de Log"
#. module: audittrail
#: model:ir.model,name:audittrail.model_audittrail_log
msgid "audittrail.log"
msgstr ""
msgstr "audittrail.log"
#. module: audittrail
#: field:audittrail.log.line,field_description:0
msgid "Field Description"
msgstr ""
msgstr "Descrição do Campo"
#. module: audittrail
#: selection:audittrail.log,method:0
msgid "Delete"
msgstr ""
msgstr "Apagar"
#. module: audittrail
#: wizard_button:audittrail.view.log,init,open:0
msgid "Open Logs"
msgstr ""
msgstr "Abrir Logs"
#. module: audittrail
#: field:audittrail.log.line,new_value_text:0
msgid "New value Text"
msgstr ""
msgstr "Texto do novo valor"
#. module: audittrail
#: field:audittrail.rule,name:0
msgid "Rule Name"
msgstr ""
msgstr "Nome da Regra"
#. module: audittrail
#: field:audittrail.rule,log_read:0
msgid "Log reads"
msgstr ""
msgstr "Leituras de Log"
#. module: audittrail
#: model:ir.ui.menu,name:audittrail.menu_action_audittrail_log_tree
msgid "Logs"
msgstr ""
msgstr "Logs"
#. module: audittrail
#: field:audittrail.log.line,new_value:0
msgid "New Value"
msgstr ""
msgstr "Novo Valor"
#. module: audittrail
#: model:ir.ui.menu,name:audittrail.menu_action_log_tree2
msgid "View Logs"
msgstr ""
msgstr "Ver Logs"
#. module: audittrail
#: field:audittrail.rule,log_create:0
@@ -277,7 +277,7 @@ msgstr ""
#. module: audittrail
#: view:audittrail.log:0
msgid "AuditTrail Logs"
msgstr ""
msgstr "Logs de Auditoria"
#. module: audittrail
#: model:ir.ui.menu,name:audittrail.menu_action_audittrail_rule_tree
@@ -287,22 +287,22 @@ msgstr "Regras"
#. module: audittrail
#: view:audittrail.log:0
msgid "New Value : "
msgstr ""
msgstr "Novo Valor: "
#. module: audittrail
#: field:audittrail.rule,user_id:0
msgid "Users"
msgstr ""
msgstr "Usuários"
#. module: audittrail
#: field:audittrail.log.line,old_value_text:0
msgid "Old value Text"
msgstr ""
msgstr "Texto do Valor Antigo"
#. module: audittrail
#: wizard_button:audittrail.view.log,init,end:0
msgid "Cancel"
msgstr ""
msgstr "Cancelar"
#. module: audittrail
#: field:audittrail.rule,log_unlink:0
+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"
+1 -1
View File
@@ -37,7 +37,7 @@ This module implements a dashboard for CRM that includes:
'depends': ['board', 'crm', 'report_crm'],
'update_xml': ['board_crm_statistical_view.xml', 'board_crm_view.xml'],
'demo_xml': ['board_crm_demo.xml'],
'installable': False,
'installable': True,
'active': False,
'certificate': '0071599098909',
}
@@ -6,7 +6,7 @@
-->
<record model="ir.ui.view" id="view_crm_lead_stage_graph1">
<field name="name">Leads By Stage - Graph</field>
<field name="model">report.crm.case.section.stage</field>
<field name="model">report.crm.lead.section.stage</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Leads By Stage" type="pie">
@@ -17,12 +17,12 @@
</field>
</record>
<record model="ir.ui.view" id="view_crm_case_categ_graph">
<field name="name">report.crm.case.categ.graph</field>
<field name="model">report.crm.case.categ</field>
<record model="ir.ui.view" id="view_crm_opportunity_categ_graph">
<field name="name">report.crm.opportunity.categ.graph</field>
<field name="model">report.crm.opportunity.categ</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Cases by Sections and Categories" type="bar" orientation="horizontal">
<graph string="Opportunity by Sections and Categories" type="bar" orientation="horizontal">
<field name="categ_id"/>
<field name="nbr" operator="+"/>
<field name="state" group="True"/>
@@ -31,34 +31,27 @@
</record>
<act_window name="Opportunities By Categories"
domain="[('section_id', '=', 'Opportunities'),('state','!=','done'),('state','!=','cancel')]"
res_model="report.crm.case.categ"
domain="[('state','!=','done'),('state','!=','cancel')]"
res_model="report.crm.opportunity.categ"
view_type="form"
view_mode="graph,tree,form"
view_id="view_crm_case_categ_graph"
view_id="view_crm_opportunity_categ_graph"
id="act_oppor_categ"/>
<record model="ir.actions.act_window" id="act_leads_state">
<field name="res_model">report.crm.case.section.stage</field>
<field name="res_model">report.crm.lead.section.stage</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_lead_stage_graph1"/>
<field name="domain">[('section_id', '=', 'Leads'),('state','!=','done'),('state','!=','cancel')]</field>
<field name="domain">[('state','!=','done'),('state','!=','cancel')]</field>
</record>
<act_window name="Jobs Requests Of The Month by Applied Job"
domain="[('section_id', '=', 'Jobs'),('name','=',time.strftime('%Y-%m-01')),('state','!=','done'),('state','!=','cancel')]"
res_model="report.crm.case.categ"
view_type="form"
view_mode="graph,tree,form"
view_id="view_crm_case_categ_graph"
id="act_jobs_categ"/>
<act_window name="Leads Of The Month By User"
domain="[('section_id', '=', 'Leads'),('name','=',time.strftime('%Y-%m-01')),('state','!=','cancel')]"
res_model="report.crm.case.user"
domain="[('month','=',time.strftime('%%m')),('state','!=','cancel')]"
res_model="report.crm.lead.user"
view_type="form"
view_mode="graph,tree,form"
view_id="view_crm_lead_stage_graph1"
id="act_leads_month_user"/>
<record model="ir.ui.view" id="board_crm_statistical_form">
@@ -84,11 +77,6 @@
</child1>
<child2>
<action
string="Jobs Requests Of The Month by Applied Job"
name="%(act_jobs_categ)d"
colspan="4"/>
<action
string="Leads Of The Month By User"
@@ -110,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
@@ -4,13 +4,13 @@
<record model="board.note.type" id="note_crm_type">
<field name="name">CRM Configuration</field>
</record>
<record model="ir.ui.view" id="view_crm_case_user_graph1">
<field name="name">crm.case.user.graph1</field>
<field name="model">report.crm.case.user</field>
<record model="ir.ui.view" id="view_crm_opportunity_user_graph1">
<field name="name">crm.opportunity.user.graph1</field>
<field name="model">report.crm.opportunity.user</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Cases by User and Section" type="pie">
<graph string="Opportunities by User and Section" type="pie">
<field name="state"/>
<field name="nbr" operator="+"/>
</graph>
@@ -18,21 +18,21 @@
</record>
<record model="ir.actions.act_window" id="act_my_leads">
<field name="res_model">crm.case</field>
<field name="res_model">crm.lead</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="crm.crm_case_tree_view_leads"/>
<field name="domain">[('section_id.name', '=', 'Prospects'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
<field name="domain">[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
</record>
<record model="ir.actions.act_window" id="act_my_meetings">
<field name="res_model">crm.case</field>
<field name="res_model">crm.meeting</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="crm.crm_case_tree_view_meet"/>
<field name="domain">[('section_id.name', '=', 'Meetings'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
<field name="domain">[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
</record>
<act_window name="My Cases"
domain="[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]"
res_model="crm.case"
@@ -41,27 +41,19 @@
id="act_my_cases"/>
<record model="ir.actions.act_window" id="act_my_leads_stage">
<field name="res_model">report.crm.case.section.stage</field>
<field name="res_model">report.crm.lead.section.stage</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_lead_stage_graph1"/>
<field name="domain">[('section_id.name', '=', 'Leads'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
<field name="domain">[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
</record>
<record model="ir.actions.act_window" id="act_sales_pipeline">
<field name="res_model">report.crm.case.user</field>
<field name="res_model">report.crm.opportunity.user</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_case_user_graph1"/>
<field name="domain">[('section_id.name', '=', 'Opportunities'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
</record>
<record model="ir.actions.act_window" id="act_jobs_requests">
<field name="res_model">report.crm.case.user</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_case_user_graph1"/>
<field name="domain">[('section_id.name','=','Jobs'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
<field name="view_id" ref="view_crm_opportunity_user_graph1"/>
<field name="domain">[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
</record>
<record model="ir.ui.view" id="board_crm_form">
@@ -86,7 +78,7 @@
name="%(act_my_meetings)d"
height="150"
colspan="4"/>
<action
string="My Cases"
name="%(act_my_cases)d"
@@ -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',
+1
View File
@@ -53,6 +53,7 @@ class crm_claim(osv.osv):
'partner_mobile': fields.char('Mobile', size=32),
'partner_phone': fields.char('Phone', size=32),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]"),
'probability': fields.float('Probability (%)'),
}
_defaults = {
+2
View File
@@ -38,6 +38,7 @@
<field name="partner_id"/>
<field name="date" string="Date"/>
<field name="categ_id" string="Type" select="1"/>
<field name="probability"/>
<field name="state"/>
</tree>
</field>
@@ -71,6 +72,7 @@
<field name="partner_mobile"/>
<newline/>
<field name="planned_cost" string="Claim Cost"/>
<field name="probability"/>
<newline/>
<field name="priority"/>
<field name="type_id" string="Type of Action" select="1"/>
+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')]", \
+2 -2
View File
@@ -7,12 +7,12 @@
<record model="crm.case.categ" id="categ_meet1">
<field name="name">Customer Meeting</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
<field name="object_id" search="[('model','=','crm.meeting')]" model="ir.model"/>
</record>
<record model="crm.case.categ" id="categ_meet2">
<field name="name">Internal Meeting</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
<field name="object_id" search="[('model','=','crm.meeting')]" model="ir.model"/>
</record>
<record model="crm.case.categ" id="categ_meet3">
<field name="name">Phone Call</field>
+18 -3
View File
@@ -1,6 +1,20 @@
<?xml version="1.0"?>
<openerp>
<data>
# ------------------------------------------------------
# Meetings Categories
# ------------------------------------------------------
<record id="crm_meeting_categ_action" model="ir.actions.act_window">
<field name="name">Meeting Categories</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'crm.meeting')]</field>
<field name="context">{'object_id':'crm.meeting'}</field>
</record>
<menuitem action="crm_meeting_categ_action" id="menu_crm_case_meeting-act" parent="crm.menu_crm_case_categ"/>
# ------------------------------------------------------
# Meetings
# ------------------------------------------------------
@@ -22,7 +36,7 @@
<field name="duration" widget="float_time" />
<field name="date_deadline" string="End Date" required="1" />
<field name="location" />
<field name="categ_id" widget="selection" />
<field name="categ_id"/>
<group colspan="2" col="3" attrs="{'readonly':[('recurrent_uid','!=',False)]}">
<field name="rrule_type" string="Recurrency"
on_change="onchange_rrule_type(rrule_type)"
@@ -71,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" />
@@ -84,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
+490 -244
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -105,6 +105,8 @@ class lead2opportunity(wizard.interface):
'partner_id': data['form']['partner_id'],
'section_id':lead.section_id.id,
'description':lead.description,
'partner_address_id':lead.partner_address_id.id,
'priority':lead.priority,
})
new_opportunity = opportunity_case_obj.browse(cr, uid, new_opportunity_id)
+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']
}
+1
View File
@@ -22,5 +22,6 @@
import crm_hr
import report
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+4 -2
View File
@@ -30,7 +30,7 @@
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['crm','hr'],
'depends': ['crm','hr','board_crm_configuration'],
'init_xml': [
'crm_hr_data.xml'
],
@@ -38,7 +38,9 @@
'crm_hr_wizard.xml',
'crm_hr_view.xml',
'crm_hr_menu.xml',
'security/crm_hr_security.xml',
'report_crm_hr_view.xml',
'security/crm_hr_security.xml',
'board_crm_hr_statistical_view.xml',
],
'demo_xml': [
'crm_hr_demo.xml'
@@ -0,0 +1,44 @@
<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_crm_job_categ_graph">
<field name="name">report.crm.job.categ.graph</field>
<field name="model">report.crm.job.categ</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Jobs by Sections and Categories" type="bar" orientation="horizontal">
<field name="categ_id"/>
<field name="nbr" operator="+"/>
<field name="state" group="True"/>
</graph>
</field>
</record>
<act_window name="Jobs Requests Of The Month by Applied Job"
domain="[('month','=',time.strftime('%%m')),('state','!=','done'),('state','!=','cancel')]"
res_model="report.crm.job.categ"
view_type="form"
view_mode="graph,tree,form"
view_id="view_crm_job_categ_graph"
id="act_jobs_categ"/>
<record model="ir.ui.view" id="board_crm_hr_statistical_form">
<field name="name">CRM - Statistical Dashboard Form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="board_crm_configuration.board_crm_statistical_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Statistics Dashboard">
<hpaned>
<child2>
<action
string="Jobs Requests Of The Month by Applied Job"
name="%(act_jobs_categ)d"
colspan="4"/>
</child2>
</hpaned>
</form>
</field>
</record>
</data>
</openerp>
+25
View File
@@ -0,0 +1,25 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# 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 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import report_crm_hr
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+131
View File
@@ -0,0 +1,131 @@
from osv import fields,osv
import tools
class report_crm_job_user(osv.osv):
_name = "report.crm.job.user"
_description = "Job by user and section"
_auto = False
_inherit = "report.crm.case.user"
_columns = {
'probability': fields.float('Avg. Probability', readonly=True),
'amount_revenue': fields.float('Est.Revenue', readonly=True),
'amount_costs': fields.float('Est.Cost', readonly=True),
'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
'delay_close': fields.char('Delay to close', size=20, readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_job_user')
cr.execute("""
create or replace view report_crm_job_user as (
select
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
c.state,
c.user_id,
c.section_id,
count(*) as nbr,
sum(planned_revenue) as amount_revenue,
sum(planned_cost) as amount_costs,
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
avg(probability)::decimal(16,2) as probability,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_job c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id
)""")
report_crm_job_user()
class report_crm_job_categ(osv.osv):
_name = "report.crm.job.categ"
_description = "Jobs by section and category"
_auto = False
_inherit = "report.crm.case.categ"
_columns = {
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.job')]"),
'amount_revenue': fields.float('Est.Revenue', readonly=True),
'amount_costs': fields.float('Est.Cost', readonly=True),
'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
'probability': fields.float('Avg. Probability', readonly=True),
'delay_close': fields.char('Delay Close', size=20, readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_job_categ')
cr.execute("""
create or replace view report_crm_job_categ as (
select
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
c.categ_id,
c.state,
c.section_id,
count(*) as nbr,
sum(planned_revenue) as amount_revenue,
sum(planned_cost) as amount_costs,
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
avg(probability)::decimal(16,2) as probability,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_job c
group by c.categ_id,to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state,c.section_id
)""")
report_crm_job_categ()
class report_crm_job_section(osv.osv):
_name = "report.crm.job.section"
_description = "job by Section"
_auto = False
_inherit = "report.crm.case.section"
def _get_data(self, cr, uid, ids, field_name, arg, context={}):
res = {}
state_perc = 0.0
avg_ans = 0.0
for case in self.browse(cr, uid, ids, context):
if field_name != 'avg_answers':
state = field_name[5:]
cr.execute("select count(*) from crm_job where section_id =%s and state='%s'"%(case.section_id.id,state))
state_cases = cr.fetchone()[0]
perc_state = (state_cases / float(case.nbr_cases) ) * 100
res[case.id] = perc_state
else:
cr.execute('select count(*) from crm_case_log l where l.section_id=%s'%(case.section_id.id))
logs = cr.fetchone()[0]
avg_ans = logs / case.nbr_cases
res[case.id] = avg_ans
return res
_columns = {
'avg_answers': fields.function(_get_data,string='Avg. Answers', method=True,type="integer"),
'perc_done': fields.function(_get_data,string='%Done', method=True,type="float"),
'perc_cancel': fields.function(_get_data,string='%Cancel', method=True,type="float"),
'delay_close': fields.char('Delay to close', size=20, readonly=True),
}
_order = 'name desc, section_id'
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_job_section')
cr.execute("""
create or replace view report_crm_job_section as (
select
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
count(*) as nbr_cases,
c.section_id as section_id,
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_job c
group by to_char(c.create_date, 'YYYY'),to_char(c.create_date, 'MM'),c.section_id
)""")
report_crm_job_section()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+197
View File
@@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
jobs by user and section
-->
<record id="view_crm_job_user_tree" model="ir.ui.view">
<field name="name">report.crm.job.user.tree</field>
<field name="model">report.crm.job.user</field>
<field name="inherit_id" ref="report_crm.view_crm_case_user_tree"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_job_user_form" model="ir.ui.view">
<field name="name">report.crm.job.user.form</field>
<field name="model">report.crm.job.user</field>
<field name="inherit_id" ref="report_crm.view_crm_case_user_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_job_user_graph" model="ir.ui.view">
<field name="name">report.crm.job.user.graph</field>
<field name="model">report.crm.job.user</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="jobs by User and Section" type="bar">
<field name="state"/>
<field name="nbr" operator="+"/>
<field group="True" name="user_id"/>
</graph>
</field>
</record>
<record id="view_crm_job_user_filter" model="ir.ui.view">
<field name="name">report.crm.job.user.select</field>
<field name="model">report.crm.job.user</field>
<field name="inherit_id" ref="report_crm.view_crm_case_user_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="state" position="before">
</field>
</field>
</record>
<record id="action_report_crm_job_user_tree" model="ir.actions.act_window">
<field name="name">Jobs by User and Section</field>
<field name="res_model">report.crm.job.user</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_crm_job_user_graph"/>
<field name="search_view_id" ref="view_crm_job_user_filter"/>
</record>
<menuitem
id="hr.menu_hr_reporting"
name="Reporting"
parent="hr.menu_hr_root"
sequence="40" />
<menuitem name="Jobs" id="menu_crm_jobs_tree" parent="hr.menu_hr_reporting"/>
<menuitem action="action_report_crm_job_user_tree" id="menu_crm_job_user_tree" parent="menu_crm_jobs_tree"/>
<!-- # jobs by section and category of case -->
<record id="view_crm_job_categ_tree" model="ir.ui.view">
<field name="name">report.crm.job.categ.tree</field>
<field name="model">report.crm.job.categ</field>
<field name="inherit_id" ref="report_crm.view_crm_case_categ_tree"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_job_categ_form" model="ir.ui.view">
<field name="name">report.crm.job.categ.form</field>
<field name="model">report.crm.job.categ</field>
<field name="inherit_id" ref="report_crm.view_crm_case_categ_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_job_categ_graph" model="ir.ui.view">
<field name="name">report.crm.job.categ.graph</field>
<field name="model">report.crm.job.categ</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="jobs by Section and Categories" type="bar">
<field name="state"/>
<field name="nbr" operator="+"/>
<field group="True" name="categ_id"/>
</graph>
</field>
</record>
<record id="view_crm_job_categ_filter" model="ir.ui.view">
<field name="name">report.crm.job.categ.select</field>
<field name="model">report.crm.job.categ</field>
<field name="inherit_id" ref="report_crm.view_crm_case_categ_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="state" position="before">
</field>
</field>
</record>
<record id="action_report_crm_job_categ_tree" model="ir.actions.act_window">
<field name="name">Jobs by Categories and Section</field>
<field name="res_model">report.crm.job.categ</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_crm_job_categ_graph"/>
<field name="search_view_id" ref="view_crm_job_categ_filter"/>
</record>
<menuitem action="action_report_crm_job_categ_tree" id="menu_crm_job_categ_tree" parent="menu_crm_jobs_tree"/>
<!-- jobs by Section -->
<record id="view_report_crm_job_section_tree" model="ir.ui.view">
<field name="name">report.crm.job.section.tree</field>
<field name="model">report.crm.job.section</field>
<field name="inherit_id" ref="report_crm.view_report_crm_case_section_tree"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="nbr_cases" position="after">
<field name="avg_answers"/>
<field name="perc_done" select="2"/>
<field name="perc_cancel" select="2"/>
<field name="delay_close"/>
</field>
</field>
</record>
<record id="view_report_crm_job_section_graph" model="ir.ui.view">
<field name="name">report.crm.job.section.graph</field>
<field name="model">report.crm.job.section</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="jobs by Section" type="bar">
<field name="name"/>
<field name="nbr_cases" operator="+"/>
</graph>
</field>
</record>
<record id="view_report_crm_job_section_filter" model="ir.ui.view">
<field name="name">report.crm.job.section.select</field>
<field name="model">report.crm.job.section</field>
<field name="inherit_id" ref="report_crm.view_report_crm_case_section_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="nbr_cases" position="before">
</field>
</field>
</record>
<record id="action_report_crm_job_section_tree" model="ir.actions.act_window">
<field name="name">Jobs by Section</field>
<field name="res_model">report.crm.job.section</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_report_crm_job_section_graph"/>
<field name="search_view_id" ref="view_report_crm_job_section_filter"/>
</record>
<menuitem action="action_report_crm_job_section_tree" id="menu_crm_job_section_tree" parent="menu_crm_jobs_tree"/>
</data>
</openerp>
+2
View File
@@ -23,4 +23,6 @@
import crm_project_bug
import crm_project_feature
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+1
View File
@@ -39,6 +39,7 @@
'crm_bugs_menu.xml',
'crm_feature_view.xml',
'crm_feature_menu.xml',
'report_crm_project_bug_view.xml',
'security/crm_project_security.xml'
],
'demo_xml': ['crm_bugs_demo.xml'],
+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 report_crm_project_bug
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,131 @@
from osv import fields,osv
import tools
class report_crm_project_bug_user(osv.osv):
_name = "report.crm.project.bug.user"
_description = "Project Bug by user and section"
_auto = False
_inherit = "report.crm.case.user"
_columns = {
'probability': fields.float('Avg. Probability', readonly=True),
'amount_revenue': fields.float('Est.Revenue', readonly=True),
'amount_costs': fields.float('Est.Cost', readonly=True),
'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
'delay_close': fields.char('Delay to close', size=20, readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_project_bug_user')
cr.execute("""
create or replace view report_crm_project_bug_user as (
select
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
c.state,
c.user_id,
c.section_id,
count(*) as nbr,
sum(planned_revenue) as amount_revenue,
sum(planned_cost) as amount_costs,
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
avg(probability)::decimal(16,2) as probability,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_project_bug c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id
)""")
report_crm_project_bug_user()
class report_crm_project_bug_categ(osv.osv):
_name = "report.crm.project.bug.categ"
_description = "Project Bug by section and category"
_auto = False
_inherit = "report.crm.case.categ"
_columns = {
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.project.bug')]"),
'amount_revenue': fields.float('Est.Revenue', readonly=True),
'amount_costs': fields.float('Est.Cost', readonly=True),
'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
'probability': fields.float('Avg. Probability', readonly=True),
'delay_close': fields.char('Delay Close', size=20, readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_project_bug_categ')
cr.execute("""
create or replace view report_crm_project_bug_categ as (
select
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
c.categ_id,
c.state,
c.section_id,
count(*) as nbr,
sum(planned_revenue) as amount_revenue,
sum(planned_cost) as amount_costs,
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
avg(probability)::decimal(16,2) as probability,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_project_bug c
group by c.categ_id,to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state,c.section_id
)""")
report_crm_project_bug_categ()
class report_crm_project_bug_section(osv.osv):
_name = "report.crm.project.bug.section"
_description = "Project bug by Section"
_auto = False
_inherit = "report.crm.case.section"
def _get_data(self, cr, uid, ids, field_name, arg, context={}):
res = {}
state_perc = 0.0
avg_ans = 0.0
for case in self.browse(cr, uid, ids, context):
if field_name != 'avg_answers':
state = field_name[5:]
cr.execute("select count(*) from crm_project_bug where section_id =%s and state='%s'"%(case.section_id.id,state))
state_cases = cr.fetchone()[0]
perc_state = (state_cases / float(case.nbr_cases) ) * 100
res[case.id] = perc_state
else:
cr.execute('select count(*) from crm_case_log l where l.section_id=%s'%(case.section_id.id))
logs = cr.fetchone()[0]
avg_ans = logs / case.nbr_cases
res[case.id] = avg_ans
return res
_columns = {
'avg_answers': fields.function(_get_data,string='Avg. Answers', method=True,type="integer"),
'perc_done': fields.function(_get_data,string='%Done', method=True,type="float"),
'perc_cancel': fields.function(_get_data,string='%Cancel', method=True,type="float"),
'delay_close': fields.char('Delay to close', size=20, readonly=True),
}
_order = 'name desc, section_id'
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_project_bug_section')
cr.execute("""
create or replace view report_crm_project_bug_section as (
select
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
count(*) as nbr_cases,
c.section_id as section_id,
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_project_bug c
group by to_char(c.create_date, 'YYYY'),to_char(c.create_date, 'MM'),c.section_id
)""")
report_crm_project_bug_section()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,193 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
Project Bug by user and section
-->
<record id="view_crm_project_bug_user_tree" model="ir.ui.view">
<field name="name">report.crm.project.bug.user.tree</field>
<field name="model">report.crm.project.bug.user</field>
<field name="inherit_id" ref="report_crm.view_crm_case_user_tree"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_project_bug_user_form" model="ir.ui.view">
<field name="name">report.crm.project.bug.user.form</field>
<field name="model">report.crm.project.bug.user</field>
<field name="inherit_id" ref="report_crm.view_crm_case_user_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_project_bug_user_graph" model="ir.ui.view">
<field name="name">report.crm.project.bug.user.graph</field>
<field name="model">report.crm.project.bug.user</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="Project Bug by User and Section" type="bar">
<field name="state"/>
<field name="nbr" operator="+"/>
<field group="True" name="user_id"/>
</graph>
</field>
</record>
<record id="view_crm_project_bug_user_filter" model="ir.ui.view">
<field name="name">report.crm.project.bug.user.select</field>
<field name="model">report.crm.project.bug.user</field>
<field name="inherit_id" ref="report_crm.view_crm_case_user_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="state" position="before">
</field>
</field>
</record>
<record id="action_report_crm_project_bug_user_tree" model="ir.actions.act_window">
<field name="name">Project Bug by User and Section</field>
<field name="res_model">report.crm.project.bug.user</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_crm_project_bug_user_graph"/>
<field name="search_view_id" ref="view_crm_project_bug_user_filter"/>
</record>
<menuitem id="menu_project_report" name="Reporting" parent="project.menu_main" sequence="50"/>
<menuitem name="Project Bug" id="menu_crm_project_bug_tree" parent="menu_project_report"/>
<menuitem action="action_report_crm_project_bug_user_tree" id="menu_crm_project_bug_user_tree" parent="menu_crm_project_bug_tree"/>
<!-- # Project Bug by section and category of case -->
<record id="view_crm_project_bug_categ_tree" model="ir.ui.view">
<field name="name">report.crm.project.bug.categ.tree</field>
<field name="model">report.crm.project.bug.categ</field>
<field name="inherit_id" ref="report_crm.view_crm_case_categ_tree"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_project_bug_categ_form" model="ir.ui.view">
<field name="name">report.crm.project.bug.categ.form</field>
<field name="model">report.crm.project.bug.categ</field>
<field name="inherit_id" ref="report_crm.view_crm_case_categ_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_project_bug_categ_graph" model="ir.ui.view">
<field name="name">report.crm.project.bug.categ.graph</field>
<field name="model">report.crm.project.bug.categ</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="project_bugs by Section and Categories" type="bar">
<field name="state"/>
<field name="nbr" operator="+"/>
<field group="True" name="categ_id"/>
</graph>
</field>
</record>
<record id="view_crm_project_bug_categ_filter" model="ir.ui.view">
<field name="name">report.crm.project.bug.categ.select</field>
<field name="model">report.crm.project.bug.categ</field>
<field name="inherit_id" ref="report_crm.view_crm_case_categ_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="state" position="before">
</field>
</field>
</record>
<record id="action_report_crm_project_bug_categ_tree" model="ir.actions.act_window">
<field name="name">Project Bugs by Categories and Section</field>
<field name="res_model">report.crm.project.bug.categ</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_crm_project_bug_categ_graph"/>
<field name="search_view_id" ref="view_crm_project_bug_categ_filter"/>
</record>
<menuitem action="action_report_crm_project_bug_categ_tree" id="menu_crm_project_bug_categ_tree" parent="menu_crm_project_bug_tree"/>
<!-- Project Bug by Section -->
<record id="view_report_crm_project_bug_section_tree" model="ir.ui.view">
<field name="name">report.crm.project.bug.section.tree</field>
<field name="model">report.crm.project.bug.section</field>
<field name="inherit_id" ref="report_crm.view_report_crm_case_section_tree"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="nbr_cases" position="after">
<field name="avg_answers"/>
<field name="perc_done" select="2"/>
<field name="perc_cancel" select="2"/>
<field name="delay_close"/>
</field>
</field>
</record>
<record id="view_report_crm_project_bug_section_graph" model="ir.ui.view">
<field name="name">report.crm.project.bug.section.graph</field>
<field name="model">report.crm.project.bug.section</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="project_bugs by Section" type="bar">
<field name="name"/>
<field name="nbr_cases" operator="+"/>
</graph>
</field>
</record>
<record id="view_report_crm_project_bug_section_filter" model="ir.ui.view">
<field name="name">report.crm.project.bug.section.select</field>
<field name="model">report.crm.project.bug.section</field>
<field name="inherit_id" ref="report_crm.view_report_crm_case_section_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="nbr_cases" position="before">
</field>
</field>
</record>
<record id="action_report_crm_project_bug_section_tree" model="ir.actions.act_window">
<field name="name">Project Bugs by Section</field>
<field name="res_model">report.crm.project.bug.section</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_report_crm_project_bug_section_graph"/>
<field name="search_view_id" ref="view_report_crm_project_bug_section_filter"/>
</record>
<menuitem action="action_report_crm_project_bug_section_tree" id="menu_crm_project_bug_section_tree" parent="menu_crm_project_bug_tree"/>
</data>
</openerp>
+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',required=True),
'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>
+186
View File
@@ -0,0 +1,186 @@
<?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">
<field name="plan_id" invisible="1"/>
<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" domain="[('plan_id', '=', plan_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
+198
View File
@@ -0,0 +1,198 @@
# Brazilian Portuguese translation for openobject-addons
# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-12-08 11:46+0000\n"
"PO-Revision-Date: 2010-01-20 00:41+0000\n"
"Last-Translator: pedrobom <pedrobomlimeira@gmail.com>\n"
"Language-Team: Brazilian Portuguese <pt_BR@li.org>\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-21 04:34+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: multi_company
#: help:multi_company.default,object_id:0
msgid "Object affect by this rules"
msgstr "Objeto afetado por esta regra"
#. module: multi_company
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
"O nome do Objeto deve iniciar com x_ e não conter nenhum caracter especial!"
#. module: multi_company
#: constraint:product.template:0
msgid ""
"Error: The default UOM and the purchase UOM must be in the same category."
msgstr ""
"Erro: A unidade padrão e a unidade de compra devem ser da mesma categoria."
#. module: multi_company
#: constraint:res.partner:0
msgid "The VAT doesn't seem to be correct."
msgstr "O imposto não parece estar correto."
#. module: multi_company
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr "Nome de modelo inválido na definição da ação"
#. module: multi_company
#: model:res.company,overdue_msg:multi_company.res_company_odoo
#: model:res.company,overdue_msg:multi_company.res_company_oerp_be
#: model:res.company,overdue_msg:multi_company.res_company_oerp_editor
#: model:res.company,overdue_msg:multi_company.res_company_oerp_in
#: model:res.company,overdue_msg:multi_company.res_company_oerp_us
msgid ""
"Would your payment have been carried out after this mail was sent, please "
"consider the present one as void. Do not hesitate to contact our accounting "
"department"
msgstr ""
#. module: multi_company
#: field:multi_company.default,company_dest_id:0
msgid "Default Company"
msgstr "Empresa Padrão"
#. module: multi_company
#: field:multi_company.default,object_id:0
msgid "Object"
msgstr "Objeto"
#. module: multi_company
#: model:ir.module.module,shortdesc:multi_company.module_meta_information
#: view:multi_company.default:0
msgid "Multi Company"
msgstr "Multi Empresa"
#. module: multi_company
#: model:ir.module.module,description:multi_company.module_meta_information
msgid ""
"This module add the possibility to easily manage \n"
" the default value for each object\n"
" "
msgstr ""
"Este módulo acrescenta a possibilidade de gerenciar facilmente \n"
" o valor padrão para cada objeto\n"
" "
#. module: multi_company
#: field:multi_company.default,company_id:0
msgid "Main Company"
msgstr "Empresa principal"
#. module: multi_company
#: view:multi_company.default:0
msgid "Condition"
msgstr "Condição"
#. module: multi_company
#: help:multi_company.default,company_dest_id:0
msgid "Company to store the current record"
msgstr "Empresa para guardar o registro atual"
#. module: multi_company
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "XML inválido para Arquitetura da View"
#. module: multi_company
#: field:multi_company.default,name:0
msgid "Name"
msgstr "Nome"
#. module: multi_company
#: constraint:product.template:0
msgid "Error: UOS must be in a different category than the UOM"
msgstr ""
"Erro: Unidade de venda deve ser de categoria diferente da unidade de medida"
#. module: multi_company
#: model:product.category,name:multi_company.Odoo1
msgid "Odoo Offers"
msgstr ""
#. module: multi_company
#: constraint:res.company:0
msgid "Error! You can not create recursive companies."
msgstr "Erro! Você não pode criar empresas recursivas."
#. module: multi_company
#: help:multi_company.default,name:0
msgid "Name it to easily find a record"
msgstr ""
#. module: multi_company
#: model:ir.ui.menu,name:multi_company.menu_custom_multicompany
msgid "Multi company"
msgstr "Multi empresa"
#. module: multi_company
#: model:ir.model,name:multi_company.model_multi_company_default
msgid "multi_company.default"
msgstr ""
#. module: multi_company
#: help:multi_company.default,company_id:0
msgid "Company where the user is connected"
msgstr "Empresa onde o usuário está conectado"
#. module: multi_company
#: model:ir.actions.act_window,name:multi_company.action_inventory_form
msgid "Default Company per Object"
msgstr "Empresa Padrão por Objeto"
#. module: multi_company
#: field:multi_company.default,expression:0
msgid "Expression"
msgstr "Expressão"
#. module: multi_company
#: model:product.template,name:multi_company.product_product_odoo1_product_template
msgid "Odoo Offer"
msgstr ""
#. module: multi_company
#: field:multi_company.default,sequence:0
msgid "Sequence"
msgstr "Seqüência"
#. module: multi_company
#: constraint:product.category:0
msgid "Error ! You can not create recursive categories."
msgstr "Erro! Você não pode criar categorias recursivas."
#. module: multi_company
#: constraint:product.product:0
msgid "Error: Invalid ean code"
msgstr "Erro: Código EAN inválido"
#. module: multi_company
#: help:multi_company.default,expression:0
msgid "Expression, must be True to match"
msgstr ""
#. module: multi_company
#: model:ir.ui.menu,name:multi_company.menu_action_inventory_form
msgid "Default company per Object"
msgstr "Empresa padrão por Objeto"
#. module: multi_company
#: code:addons/multi_company/multi_company.py:0
#, python-format
msgid " (copy)"
msgstr " (cópia)"
#. module: multi_company
#: view:multi_company.default:0
msgid "Matching"
msgstr ""
+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 *

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