+
+
+
+ Scrum Dashboard
+ board.board
+ form
+ form
+ menu
+
+
+
+
+
diff --git a/addons/board_purchase/__init__.py b/addons/board_purchase/__init__.py
new file mode 100644
index 00000000000..3c3121d954a
--- /dev/null
+++ b/addons/board_purchase/__init__.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# 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 .
+#
+##############################################################################
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account/wizard/wizard_account_duplicate.py b/addons/board_purchase/__terp__.py
similarity index 50%
rename from addons/account/wizard/wizard_account_duplicate.py
rename to addons/board_purchase/__terp__.py
index abded25e9ad..f5ada7cfe46 100644
--- a/addons/account/wizard/wizard_account_duplicate.py
+++ b/addons/board_purchase/__terp__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,39 +15,27 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
-import wizard
-import pooler
-duplicate_form = '''
-
+
+
+
+
+ Purchase Dashboard
+ board.board
+ form
+ form
+ menu
+
+
+
+
+
+
diff --git a/addons/board_sale/__openerp__.py b/addons/board_sale/__openerp__.py
index bf4e572d031..1c9d01d376a 100644
--- a/addons/board_sale/__openerp__.py
+++ b/addons/board_sale/__openerp__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
diff --git a/addons/board_sale/board_sale_view.xml b/addons/board_sale/board_sale_view.xml
index c58a4983185..d04b6204940 100644
--- a/addons/board_sale/board_sale_view.xml
+++ b/addons/board_sale/board_sale_view.xml
@@ -5,39 +5,37 @@
Sales
-
- crm.phonecall
- form
- tree,calendar
-
- [('user_id','=',uid)]
-
-
-
-
-
- crm.meeting
- tree,form,gantt
-
- [('user_id','=',uid)]
- [('date','>=',time.strftime('%Y-%m-%d')),('date','<=',(datetime.datetime.today() + datetime.timedelta(days=2)).strftime('%Y-%m-%d'))]
-
-
+
board.sales.manager.formboard.boardform
-
+
-
-
+
+
-
-
-
+
+
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index adfbf0ca772..85a27bb5d55 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -432,11 +432,20 @@ class crm_case(osv.osv):
"""
if not context:
context = {}
+
+ hist_obj = self.pool.get('crm.case.history')
+ log_obj = self.pool.get('crm.case.log')
for case in self.browse(cr, uid, ids, context):
if (not case.section_id.allow_unlink) and (case.state <> 'draft'):
raise osv.except_osv(_('Warning !'),
_('You can not delete this case. You should better cancel it.'))
+
+ # Also removing history and logs
+ history_ids = map(lambda x: x.id, case.history_line)
+ log_ids = map(lambda x: x.id, case.log_ids)
+ hist_obj.unlink(cr, uid, history_ids, context=context)
+ log_obj.unlink(cr, uid, log_ids, context=context)
return super(crm_case, self).unlink(cr, uid, ids, context)
def stage_next(self, cr, uid, ids, context=None):
@@ -620,7 +629,9 @@ class crm_case(osv.osv):
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
self.__history(cr, uid, cases, _('Close'))
- self.write(cr, uid, ids, {'state': 'done', 'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')})
+ self.write(cr, uid, ids, {'state': 'done',
+ 'date_closed': time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'probability' : 100.0})
#
# We use the cache of cases to keep the old case state
#
@@ -681,7 +692,9 @@ class crm_case(osv.osv):
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
self.__history(cr, uid, cases, _('Cancel'))
- self.write(cr, uid, ids, {'state': 'cancel', 'active': True})
+ self.write(cr, uid, ids, {'state': 'cancel',
+ 'active': True,
+ 'probability' : 0.0})
self._action(cr, uid, cases, 'cancel')
return True
@@ -764,7 +777,7 @@ class crm_case_history(osv.osv):
_columns = {
'description': fields.text('Description'),
'note': fields.function(_note_get, method=True, string="Description", type="text"),
- 'email_to': fields.char('Email TO', size=84),
+ 'email_to': fields.char('Email To', size=84),
'email_from' : fields.char('Email From', size=84),
'log_id': fields.many2one('crm.case.log','Log',ondelete='cascade'),
'message_id': fields.char('Message Id', size=1024, readonly=True, help="Message Id on Email Server.", select=True),
diff --git a/addons/crm/crm_claims_menu.xml b/addons/crm/crm_claims_menu.xml
index 7b52343342e..16711036100 100644
--- a/addons/crm/crm_claims_menu.xml
+++ b/addons/crm/crm_claims_menu.xml
@@ -14,7 +14,7 @@
formtree,calendar,form,graph
- {"search_default_section_id":section_id,"search_default_current":1,"search_default_my_claims":1}
+ {"search_default_section_id":section_id,"search_default_current":1,"search_default_my_claims":1}
diff --git a/addons/crm/crm_claims_view.xml b/addons/crm/crm_claims_view.xml
index 722c1f3db94..39cc8778e0b 100644
--- a/addons/crm/crm_claims_view.xml
+++ b/addons/crm/crm_claims_view.xml
@@ -161,7 +161,7 @@
-
+
@@ -183,7 +183,7 @@
@@ -245,9 +245,9 @@
search
-
-
+
+ widget="selection"
+ default="context.get('section_id', False)">
diff --git a/addons/crm/crm_fund_menu.xml b/addons/crm/crm_fund_menu.xml
index bc4b91fa409..7a53ab1aa18 100644
--- a/addons/crm/crm_fund_menu.xml
+++ b/addons/crm/crm_fund_menu.xml
@@ -13,7 +13,6 @@
crm.fundraisingtree,form,graph
- {"search_default_my_funds":1,"search_default_section_id":section_id}
diff --git a/addons/crm/crm_fund_view.xml b/addons/crm/crm_fund_view.xml
index a2a104adf15..20d3f5a286a 100644
--- a/addons/crm/crm_fund_view.xml
+++ b/addons/crm/crm_fund_view.xml
@@ -196,7 +196,7 @@
@@ -257,7 +257,7 @@
diff --git a/addons/crm/crm_helpdesk_menu.xml b/addons/crm/crm_helpdesk_menu.xml
index b1a7dfcc428..bd3f0889bd1 100644
--- a/addons/crm/crm_helpdesk_menu.xml
+++ b/addons/crm/crm_helpdesk_menu.xml
@@ -11,7 +11,6 @@
crm.helpdesktree,calendar,form
- {"search_default_my_hd_request":1,"search_default_section_id":section_id}
diff --git a/addons/crm/crm_helpdesk_view.xml b/addons/crm/crm_helpdesk_view.xml
index dc11b071a4c..fa2071f950b 100644
--- a/addons/crm/crm_helpdesk_view.xml
+++ b/addons/crm/crm_helpdesk_view.xml
@@ -104,7 +104,7 @@
-
+
@@ -126,7 +126,7 @@
@@ -224,8 +224,9 @@
-
+ date_until:
- break
+ break
duration = len(no_days)
res[lead.id][field] = abs(int(duration))
return res
@@ -126,9 +126,9 @@ class crm_lead(osv.osv):
'referred': fields.char('Referred By', size=64),
'date_open': fields.datetime('Opened', readonly=True),
'day_open': fields.function(_compute_day, string='Days to Open', \
- method=True, multi='day_open', type="integer", store=True),
+ method=True, multi='day_open', type="float", store=True),
'day_close': fields.function(_compute_day, string='Days to Close', \
- method=True, multi='day_close', type="integer", store=True),
+ method=True, multi='day_close', type="float", store=True),
'function_name': fields.char('Function', size=64),
}
diff --git a/addons/crm/crm_lead_menu.xml b/addons/crm/crm_lead_menu.xml
index d9424b77fc4..4d752ca8a9b 100644
--- a/addons/crm/crm_lead_menu.xml
+++ b/addons/crm/crm_lead_menu.xml
@@ -7,8 +7,6 @@
crm.leadtree,form
- {"search_default_current":1,"search_default_my_lead":1,"search_default_section_id":section_id}
- {"search_default_current":1,"search_default_my_lead":1,"search_default_section_id":section_id}
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index 829372fb30b..03318270e9b 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -264,8 +264,9 @@
search
-
-
-
+ gantt
-
-
+ gantt
@@ -85,7 +85,6 @@
crm.meetingcalendar,tree,form,gantt
- {"search_default_current":1,"search_default_section_id":section_id}
@@ -116,27 +115,26 @@
+ parent="base.menu_base_partner" sequence="3" />
+ action="crm_case_categ_meet" parent="menu_meeting_sale"
+ sequence="1" />
- Meeting Invitations
- ir.actions.act_window
- calendar.attendee
- form
- tree,form
-
+ Meeting Invitations
+ ir.actions.act_window
+ calendar.attendee
+ form
+ tree,form
+ [('ref','like','crm.meeting,')]
- {'default_sent_by_uid': uid}
-
+ {'default_sent_by_uid': uid}
+
+ name="Meeting Invitations" parent="crm.menu_meeting_sale"
+ sequence="10" action="action_view_attendee_form" />
@@ -146,7 +144,7 @@
tree,calendar,form,gantt
+ eval="[('state','in',('pending','draft','open')),('date','>=',time.strftime('%Y-%m-%d'))]" />
@@ -170,7 +168,7 @@
-
+ gantt
diff --git a/addons/crm/crm_opportunity.py b/addons/crm/crm_opportunity.py
index 3e1fc24a803..204890e348c 100644
--- a/addons/crm/crm_opportunity.py
+++ b/addons/crm/crm_opportunity.py
@@ -27,7 +27,7 @@ import time
import mx.DateTime
AVAILABLE_STATES = [
- ('draft','New'),
+ ('draft','Draft'),
('open','Open'),
('cancel', 'Lost'),
('done', 'Converted'),
@@ -62,9 +62,9 @@ class crm_opportunity(osv.osv):
@param ids: List of Openday’s IDs
@return: difference between current date and log date
@param context: A standard dictionary for contextual values
- """
- cal_obj = self.pool.get('resource.calendar')
- res_obj = self.pool.get('resource.resource')
+ """
+ cal_obj = self.pool.get('resource.calendar')
+ res_obj = self.pool.get('resource.resource')
res = {}
for opportunity in self.browse(cr, uid, ids , context):
@@ -93,7 +93,7 @@ class crm_opportunity(osv.osv):
duration = float(ans.days)
if opportunity.section_id.resource_calendar_id:
- duration = float(ans.days) * 24
+ duration = float(ans.days) * 24
new_dates = cal_obj.interval_get(cr,
uid,
opportunity.section_id.resource_calendar_id and opportunity.section_id.resource_calendar_id.id or False,
@@ -105,9 +105,9 @@ class crm_opportunity(osv.osv):
date_until = mx.DateTime.strptime(date_until, '%Y-%m-%d %H:%M:%S')
for in_time, out_time in new_dates:
if in_time.date not in no_days:
- no_days.append(in_time.date)
+ no_days.append(in_time.date)
if out_time > date_until:
- break
+ break
duration = len(no_days)
res[opportunity.id][field] = abs(int(duration))
return res
@@ -138,9 +138,9 @@ class crm_opportunity(osv.osv):
'date_open': fields.datetime('Opened', readonly=True),
'day_open': fields.function(_compute_day, string='Days to Open', \
- method=True, multi='day_open', type="integer", store=True),
+ method=True, multi='day_open', type="float", store=True),
'day_close': fields.function(_compute_day, string='Days to Close', \
- method=True, multi='day_close', type="integer", store=True),
+ method=True, multi='day_close', type="float", store=True),
}
def onchange_stage_id(self, cr, uid, ids, stage_id, context={}):
@@ -190,6 +190,7 @@ class crm_opportunity(osv.osv):
_defaults = {
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.opportunity', context=c),
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
+ 'state' : 'draft',
}
def action_makeMeeting(self, cr, uid, ids, context=None):
diff --git a/addons/crm/crm_opportunity_menu.xml b/addons/crm/crm_opportunity_menu.xml
index ba01ca72be4..3bcdbc7bb9f 100644
--- a/addons/crm/crm_opportunity_menu.xml
+++ b/addons/crm/crm_opportunity_menu.xml
@@ -27,7 +27,6 @@
crm.opportunitytree,form,graph
- {"search_default_my_oprtnit":1,"search_default_new_oprtnit":1,"search_default_section_id":section_id}
diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml
index b7019885a4a..4bdc0d90158 100644
--- a/addons/crm/crm_opportunity_view.xml
+++ b/addons/crm/crm_opportunity_view.xml
@@ -86,13 +86,15 @@
-
+
+ on_change="onchange_partner_id(partner_id, email_from)"
+ colspan="2" />
+ on_change="onchange_partner_address_id(partner_address_id, email_from)"
+ colspan="1" />
@@ -104,7 +106,7 @@
domain="[('object_id.model', '=', 'crm.opportunity')]" />
-
+
@@ -216,7 +218,7 @@
-
+
@@ -264,6 +266,7 @@
-
+ help="My Opportunities" default="1"
+ />
formtree,calendar
- {"set_editable":True,"default_state":'open',"search_default_my_calls":1,"search_default_state":1,"search_default_section_id":section_id}
@@ -56,7 +55,7 @@
tree,calendar
- {"default_state":'open',"search_default_my_calls":1,"search_default_state":1,"search_default_section_id":section_id}
+ {'set_editable':True,'default_state':'open'}
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index dfa949ad0b7..e5d6c7565df 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -176,9 +176,9 @@
-
+
diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml
index f3c178afb74..31d82cd94fb 100644
--- a/addons/crm/crm_view.xml
+++ b/addons/crm/crm_view.xml
@@ -404,7 +404,7 @@
@@ -436,7 +436,7 @@
+ default="1" help="Cases Related to Current User" />
+ default="context.get('section_id', False)" select="1"
+ widget="selection"/>
@@ -528,6 +529,7 @@
diff --git a/addons/crm/i18n/fi.po b/addons/crm/i18n/fi.po
index ee51240f4c7..d8d7144e92c 100644
--- a/addons/crm/i18n/fi.po
+++ b/addons/crm/i18n/fi.po
@@ -14,7 +14,11 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+<<<<<<< TREE
+"X-Launchpad-Export-Date: 2010-04-07 03:46+0000\n"
+=======
"X-Launchpad-Export-Date: 2010-04-17 04:01+0000\n"
+>>>>>>> MERGE-SOURCE
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm
diff --git a/addons/crm/report/crm_claim_report.py b/addons/crm/report/crm_claim_report.py
index 03e439d889e..4148a834810 100644
--- a/addons/crm/report/crm_claim_report.py
+++ b/addons/crm/report/crm_claim_report.py
@@ -21,6 +21,7 @@
from osv import fields,osv
import tools
+import crm_report
class crm_claim_report(osv.osv):
@@ -32,7 +33,7 @@ class crm_claim_report(osv.osv):
_description = "CRM Claim Report"
_columns = {
- 'delay_close': fields.char('Delay to close', size=20, readonly=True),
+ 'delay_close': fields.float('Delay to close', digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.claim')]", readonly=True),
@@ -41,6 +42,10 @@ class crm_claim_report(osv.osv):
('object_id.model', '=', 'crm.claim')]", readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
+ 'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority'),
+ 'type_id': fields.many2one('crm.case.resource.type', 'Claim Type',\
+ domain="[('section_id','=',section_id),\
+ ('object_id.model', '=', 'crm.claim')]"),
}
def init(self, cr):
@@ -56,6 +61,7 @@ class crm_claim_report(osv.osv):
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
+ to_char(c.create_date, 'YYYY-MM-DD') as day,
c.state,
c.user_id,
c.stage_id,
@@ -67,12 +73,16 @@ class crm_claim_report(osv.osv):
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
+ c.priority as priority,
+ c.type_id as type_id,
+ date_trunc('day',c.create_date) as create_date,
+ avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
from
crm_claim c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), \
c.state, c.user_id,c.section_id, c.stage_id,\
- c.categ_id,c.partner_id,c.company_id
+ c.categ_id,c.partner_id,c.company_id,c.create_date,to_char(c.create_date, 'YYYY-MM-DD')
+ ,c.priority,c.type_id,c.som
)""")
crm_claim_report()
diff --git a/addons/crm/report/crm_claim_report_view.xml b/addons/crm/report/crm_claim_report_view.xml
index 4d544c97711..647a0125179 100644
--- a/addons/crm/report/crm_claim_report_view.xml
+++ b/addons/crm/report/crm_claim_report_view.xml
@@ -10,17 +10,20 @@
tree
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -66,12 +69,33 @@
search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -81,9 +105,9 @@
Claimscrm.claim.reportform
- tree,graph
+ tree,graph
+ {"search_default_User":1,"search_default_This Month":1,'group_by_no_leaf':1,'group_by':[]}
- {"search_default_section_id":section_id,"search_default_this_year":1,"search_default_this_month":1,"search_default_by_user":1}
diff --git a/addons/crm/report/crm_fundraising_report.py b/addons/crm/report/crm_fundraising_report.py
index d0ff60a4055..af867ea0008 100644
--- a/addons/crm/report/crm_fundraising_report.py
+++ b/addons/crm/report/crm_fundraising_report.py
@@ -35,10 +35,10 @@ class crm_fundraising_report(osv.osv):
'categ_id': fields.many2one('crm.case.categ', 'Category', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.fundraising')]"),
- 'probability': fields.float('Avg. Probability', readonly=True),
- 'amount_revenue': fields.float('Est.Revenue', readonly=True),
- 'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
- 'delay_close': fields.char('Delay to close', size=20, readonly=True),
+ 'probability': fields.float('Avg. Probability',digits=(16,2),readonly=True, group_operator="avg"),
+ 'amount_revenue': fields.float('Est.Revenue',readonly=True,digits=(16,2)),
+ 'amount_revenue_prob': fields.float('Est. Rev*Prob.',digits=(16,2),readonly=True),
+ 'delay_close': fields.float('Delay to close', digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'partner_id': fields.many2one('res.partner', 'Partner'),
'company_id': fields.many2one('res.company', 'Company'),
}
@@ -56,6 +56,7 @@ class crm_fundraising_report(osv.osv):
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
+ to_char(c.create_date, 'YYYY-MM-DD') as day,
c.state,
c.user_id,
c.section_id,
@@ -66,14 +67,16 @@ class crm_fundraising_report(osv.osv):
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
+ date_trunc('day',c.create_date) as create_date,
sum(planned_revenue) as amount_revenue,
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
+ avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
from
crm_fundraising c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
- c.state, c.user_id,c.section_id,c.categ_id,c.partner_id,c.company_id
+ c.state, c.user_id,c.section_id,c.categ_id,c.partner_id,c.company_id,
+ c.create_date,to_char(c.create_date, 'YYYY-MM-DD')
)""")
crm_fundraising_report()
diff --git a/addons/crm/report/crm_fundraising_report_view.xml b/addons/crm/report/crm_fundraising_report_view.xml
index c051ab8dcb8..e1c32726b4f 100644
--- a/addons/crm/report/crm_fundraising_report_view.xml
+++ b/addons/crm/report/crm_fundraising_report_view.xml
@@ -9,20 +9,21 @@
crm.fundraising.reporttree
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -67,8 +68,14 @@
search
-
-
+
+
+
+
+
+
+
+
@@ -79,8 +86,8 @@
crm.fundraising.reportformtree,graph
+ {"search_default_User":1,"search_default_This Month":1,'group_by_no_leaf':1,'group_by':[]}
- {"search_default_section_id":section_id,"search_default_this_year":1,"search_default_this_month":1,"search_default_by_user":1}
diff --git a/addons/crm/report/crm_helpdesk_report_view.xml b/addons/crm/report/crm_helpdesk_report_view.xml
index 0852d343c95..b10f51162e7 100644
--- a/addons/crm/report/crm_helpdesk_report_view.xml
+++ b/addons/crm/report/crm_helpdesk_report_view.xml
@@ -66,40 +66,40 @@
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
-
+
+
-
-
-
-
+
+
+
+ domain="[]" context="{'group_by':'user_id'}"
+ default="1" />
formtree,graph
- {"search_default_section_id":section_id,"search_default_this_year":1,"search_default_this_month":1,"search_default_by_user":1}
diff --git a/addons/crm/report/crm_lead_report.py b/addons/crm/report/crm_lead_report.py
index 6c092f4f984..d400700c0b5 100644
--- a/addons/crm/report/crm_lead_report.py
+++ b/addons/crm/report/crm_lead_report.py
@@ -22,6 +22,14 @@
from osv import fields,osv
import tools
+AVAILABLE_STATES = [
+ ('draft','Draft'),
+ ('open','Open'),
+ ('cancel', 'Cancelled'),
+ ('done', 'Closed'),
+ ('pending','Pending')
+]
+
class crm_lead_report(osv.osv):
""" CRM Lead Report """
_name = "crm.lead.report"
@@ -30,7 +38,7 @@ class crm_lead_report(osv.osv):
_description = "CRM Lead Report"
_columns = {
- 'delay_close': fields.char('Delay to close', size=20, readonly=True),
+ 'delay_close': fields.float('Delay to close',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'categ_id': fields.many2one('crm.case.categ', 'Category',\
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.lead')]" , readonly=True),
@@ -54,7 +62,8 @@ class crm_lead_report(osv.osv):
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
- c.state,
+ to_char(c.create_date, 'YYYY-MM-DD') as day,
+ c.state as state,
c.user_id,
c.stage_id,
c.company_id,
@@ -65,11 +74,13 @@ class crm_lead_report(osv.osv):
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
+ date_trunc('day',c.create_date) as create_date,
+ avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
from
crm_lead c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
c.state, c.user_id,c.section_id,c.stage_id,categ_id,c.partner_id,c.company_id
+ ,c.create_date,to_char(c.create_date, 'YYYY-MM-DD')
)""")
crm_lead_report()
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index 30c1ab2135c..d6502c190d9 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -10,14 +10,15 @@
tree
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -63,12 +64,21 @@
search
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -78,8 +88,8 @@
Leadscrm.lead.reportform
+ {"search_default_User":1,"search_default_This Month":1,'group_by_no_leaf':1,'group_by':[]}tree,graph
- {"search_default_section_id":section_id,"search_default_this_year":1,"search_default_this_month":1,"search_default_by_user":1}
diff --git a/addons/crm/report/crm_opportunity_report.py b/addons/crm/report/crm_opportunity_report.py
index 36dec45ddf7..a3af4be8b7c 100644
--- a/addons/crm/report/crm_opportunity_report.py
+++ b/addons/crm/report/crm_opportunity_report.py
@@ -22,6 +22,14 @@
from osv import fields,osv
import tools
+AVAILABLE_STATES = [
+ ('draft','Draft'),
+ ('open','Open'),
+ ('cancel', 'Cancelled'),
+ ('done', 'Closed'),
+ ('pending','Pending')
+]
+
class crm_opportunity_report(osv.osv):
""" CRM Opportunity Report """
_name = "crm.opportunity.report"
@@ -29,11 +37,10 @@ class crm_opportunity_report(osv.osv):
_inherit = "crm.case.report"
_description = "CRM Opportunity Report"
_columns = {
- 'probability': fields.float('Avg. Probability', readonly=True, group_operator="avg"),
+ 'probability': fields.float('Avg. Probability', readonly=True,group_operator='avg'),
'amount_revenue': fields.float('Est.Revenue', readonly=True),
'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
- 'delay_close': fields.float('Days to Close', digits=(16,2), readonly=True, group_operator="avg",
- help="Number of Days to close the opportunities"),
+ 'delay_close': fields.float('Delay to close',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'categ_id': fields.many2one('crm.case.categ', 'Category',\
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.opportunity')]", readonly=True),
@@ -57,7 +64,8 @@ class crm_opportunity_report(osv.osv):
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
- c.state,
+ to_char(c.create_date, 'YYYY-MM-DD') as day,
+ c.state as state,
c.user_id,
c.section_id,
c.categ_id,
@@ -68,21 +76,25 @@ class crm_opportunity_report(osv.osv):
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
+ date_trunc('day',c.create_date) as create_date,
sum(planned_revenue) as amount_revenue,
sum((planned_revenue*probability)/100.0)::decimal(16,2) as amount_revenue_prob,
avg(probability)::decimal(16,2) as probability,
- avg(extract('epoch' from (date_closed-c.create_date)))/(3600*24) as delay_close
+ avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
from
crm_opportunity c
group by
to_char(c.create_date, 'YYYY'),
to_char(c.create_date, 'MM'),
+ to_char(c.create_date, 'YYYY-MM-DD'),
c.state,
c.user_id,
c.section_id,
c.stage_id,
c.categ_id,
- c.partner_id,company_id
+ c.partner_id,
+ company_id,
+ create_date
)""")
crm_opportunity_report()
diff --git a/addons/crm/report/crm_opportunity_report_view.xml b/addons/crm/report/crm_opportunity_report_view.xml
index 58768ebceef..29a66b838f0 100644
--- a/addons/crm/report/crm_opportunity_report_view.xml
+++ b/addons/crm/report/crm_opportunity_report_view.xml
@@ -9,21 +9,22 @@
crm.opportunity.reporttree
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
+
@@ -69,15 +70,24 @@
search
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -88,7 +98,7 @@
crm.opportunity.reportformtree,graph
- {"search_default_section_id":section_id,"search_default_this_year":1,"search_default_this_month":1,"search_default_by_user":1, "group_by": [], 'group_by_no_leaf': 1}
+ {"search_default_User":1,"search_default_This Month":1,'group_by_no_leaf':1,'group_by':[]}
diff --git a/addons/crm/report/crm_phonecall_report.py b/addons/crm/report/crm_phonecall_report.py
index a72bfbd9c1f..40b34779aba 100644
--- a/addons/crm/report/crm_phonecall_report.py
+++ b/addons/crm/report/crm_phonecall_report.py
@@ -31,7 +31,7 @@ class crm_phonecall_report(osv.osv):
_inherit = "crm.case.report"
_columns = {
- 'delay_close': fields.char('Delay to close', size=20, readonly=True),
+ 'delay_close': fields.float('Delay to close', digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'categ_id': fields.many2one('crm.case.categ', 'Category', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.phonecall')]"),
@@ -52,6 +52,7 @@ class crm_phonecall_report(osv.osv):
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
+ to_char(c.create_date, 'YYYY-MM-DD') as day,
c.state,
c.user_id,
c.section_id,
@@ -62,11 +63,13 @@ class crm_phonecall_report(osv.osv):
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
+ date_trunc('day',c.create_date) as create_date,
+ avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
from
crm_phonecall c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
c.state, c.user_id,c.section_id, c.categ_id,c.partner_id,c.company_id
+ ,to_char(c.create_date, 'YYYY-MM-DD'),c.create_date
)""")
crm_phonecall_report()
diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml
index e937ef6bd22..698a9b88fa3 100644
--- a/addons/crm/report/crm_phonecall_report_view.xml
+++ b/addons/crm/report/crm_phonecall_report_view.xml
@@ -10,17 +10,18 @@
tree
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
@@ -64,8 +65,14 @@
search
-
-
+
+
+
+
+
+
+
+
@@ -76,8 +83,8 @@
crm.phonecall.reportformtree,graph
+ {"search_default_User":1,"search_default_This Month":1,'group_by_no_leaf':1,'group_by':[]}
- {"search_default_section_id":section_id,"search_default_this_year":1,"search_default_this_month":1,"search_default_by_user":1}
diff --git a/addons/crm/report/crm_report.py b/addons/crm/report/crm_report.py
index 82f3a049de4..f2b3a48d339 100644
--- a/addons/crm/report/crm_report.py
+++ b/addons/crm/report/crm_report.py
@@ -29,6 +29,13 @@ AVAILABLE_STATES = [
('done', 'Closed'),
('pending','Pending')
]
+AVAILABLE_PRIORITIES = [
+ ('5', 'Lowest'),
+ ('4', 'Low'),
+ ('3', 'Normal'),
+ ('2', 'High'),
+ ('1', 'Highest')
+]
class crm_case_report(osv.osv):
""" Cases and section """
@@ -89,6 +96,8 @@ class crm_case_report(osv.osv):
('09', 'September'), ('10', 'October'),\
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
+ 'create_date': fields.datetime('Create Date', readonly=True),
+ 'day': fields.char('Day', size=128, readonly=True)
}
_order = 'name desc, user_id'
@@ -104,15 +113,18 @@ class crm_case_report(osv.osv):
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
+ to_char(c.create_date, 'YYYY-MM-DD') as day,
c.state,
c.user_id,
c.section_id,
c.company_id,
- count(*) as nbr
+ count(*) as nbr,
+ c.create_date as create_date
from
crm_case c
- group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
+ group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),
c.state, c.user_id,c.section_id,c.company_id
+ ,c.create_date,to_char(c.create_date, 'YYYY-MM-DD')
)""")
crm_case_report()
@@ -124,7 +136,6 @@ class report_crm_case_service_dashboard(osv.osv):
_name = "report.crm.case.service.dashboard"
_description = "Report of Closed and Open CRM Cases within past 15 days"
_auto = False
-
_columns = {
'date_deadline': fields.datetime('Deadline', readonly=True),
'name': fields.char('Description', size=64, readonly=True),
@@ -143,7 +154,7 @@ class report_crm_case_service_dashboard(osv.osv):
select
cse.id as id, cse.date_deadline as date_deadline,
cse.name as name, cse.user_id as user_id,
- cse.state as state,
+ cse.state as state,
cse.create_date as create_date
from
crm_case cse
diff --git a/addons/crm/report/crm_report_view.xml b/addons/crm/report/crm_report_view.xml
index 3cd8b518b5d..97fa4feb6f1 100644
--- a/addons/crm/report/crm_report_view.xml
+++ b/addons/crm/report/crm_report_view.xml
@@ -63,26 +63,33 @@
+
+ domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"/>
-
+
+
+
+
-
-
-
-
-
+
+
+
@@ -100,14 +107,23 @@
-
+
-
-
+
+
+
+
+
+
+
+
+
+
@@ -145,7 +164,6 @@
crm.case.reportformtree,graph
- {"search_default_section_id":section_id,"search_default_this_year":1,"search_default_this_month":1}
diff --git a/addons/crm/scripts/openerp_mailgate/openerp_mailgate.py b/addons/crm/scripts/openerp_mailgate/openerp_mailgate.py
index bb0adb0444a..de8fac00fce 100755
--- a/addons/crm/scripts/openerp_mailgate/openerp_mailgate.py
+++ b/addons/crm/scripts/openerp_mailgate/openerp_mailgate.py
@@ -183,6 +183,7 @@ class email_parser(object):
'email_cc': msg_cc,
'user_id': False,
'description': message['body'],
+ 'state' : 'draft',
}
data.update(self.partner_get(msg_from))
diff --git a/addons/crm/wizard/crm_email_add_cc_view.xml b/addons/crm/wizard/crm_email_add_cc_view.xml
index 45ae389ba72..7c6ea96df23 100644
--- a/addons/crm/wizard/crm_email_add_cc_view.xml
+++ b/addons/crm/wizard/crm_email_add_cc_view.xml
@@ -1,43 +1,39 @@
-
+
-
+
-
+ Add CCcrm.email.add.ccform
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
Add CC
@@ -48,5 +44,5 @@
new
-
+
diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py
index f4b97ad2f14..c8cce059f09 100644
--- a/addons/crm/wizard/crm_lead_to_opportunity.py
+++ b/addons/crm/wizard/crm_lead_to_opportunity.py
@@ -51,74 +51,82 @@ class crm_lead2opportunity(osv.osv_memory):
@return : Dictionary value for created Opportunity form
"""
- value = {}
record_id = context and context.get('active_id', False) or False
- if record_id:
- lead_obj = self.pool.get('crm.lead')
- opp_obj = self. pool.get('crm.opportunity')
- data_obj = self.pool.get('ir.model.data')
- history_obj = self.pool.get('crm.case.history')
- model_obj = self.pool.get('ir.model')
+ if not record_id:
+ return {}
- # Get Opportunity views
- result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_opportunities_filter')
- res = data_obj.read(cr, uid, result, ['res_id'])
- id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_form_view_oppor')
- id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_tree_view_oppor')
- if id2:
- id2 = data_obj.browse(cr, uid, id2, context=context).res_id
- if id3:
- id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+ lead_obj = self.pool.get('crm.lead')
+ opp_obj = self. pool.get('crm.opportunity')
+ data_obj = self.pool.get('ir.model.data')
+ history_obj = self.pool.get('crm.case.history')
+ model_obj = self.pool.get('ir.model')
- lead = lead_obj.browse(cr, uid, record_id, context=context)
- model_ids = model_obj.search(cr, uid, [('model', '=', 'crm.opportunity')])
+ # Get Opportunity views
+ result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_opportunities_filter')
+ res = data_obj.read(cr, uid, result, ['res_id'])
+ id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_form_view_oppor')
+ id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_tree_view_oppor')
+ if id2:
+ id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+ if id3:
+ id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+
+ lead = lead_obj.browse(cr, uid, record_id, context=context)
+ model_ids = model_obj.search(cr, uid, [('model', '=', 'crm.opportunity')])
- for this in self.browse(cr, uid, ids, context=context):
- new_opportunity_id = opp_obj.create(cr, uid, {
- 'name': this.name,
- 'referred': this.referred,
- 'planned_revenue': this.planned_revenue,
- 'probability': this.probability,
- 'partner_id': lead.partner_id and lead.partner_id.id or False ,
- 'section_id': lead.section_id and lead.section_id.id or False,
- 'description': lead.description or False,
- 'date_deadline': lead.date_deadline or False,
- 'partner_address_id': lead.partner_address_id and \
- lead.partner_address_id.id or False ,
- 'priority': lead.priority,
- 'phone': lead.phone,
- 'email_from': lead.email_from
- })
- new_opportunity = opp_obj.browse(cr, uid, new_opportunity_id)
- vals = {
- 'partner_id': this.partner_id and this.partner_id.id or False,
- }
- if not lead.opportunity_id:
- vals.update({'opportunity_id' : new_opportunity.id})
+ for this in self.browse(cr, uid, ids, context=context):
+ new_opportunity_id = opp_obj.create(cr, uid, {
+ 'name': this.name,
+ 'referred': lead.referred,
+ 'planned_revenue': this.planned_revenue,
+ 'probability': this.probability,
+ 'partner_id': lead.partner_id and lead.partner_id.id or False,
+ 'section_id': lead.section_id and lead.section_id.id or False,
+ 'description': lead.description or False,
+ 'date_deadline': lead.date_deadline or False,
+ 'partner_address_id': lead.partner_address_id and lead.partner_address_id.id or False ,
+ 'priority': lead.priority,
+ 'phone': lead.phone,
+ 'email_from': lead.email_from
+ })
+ new_opportunity = opp_obj.browse(cr, uid, new_opportunity_id)
+ vals = {
+ 'partner_id': this.partner_id and this.partner_id.id or False,
+ }
+ if not lead.opportunity_id:
+ vals.update({'opportunity_id' : new_opportunity.id})
- lead_obj.write(cr, uid, [lead.id], vals)
- lead_obj.case_close(cr, uid, [lead.id])
-
- # Copy lead history to opportunity
- for his_id in lead.history_line:
- history_ids = history_obj.copy(cr, uid, his_id.id, \
- {'model_id': model_ids[0], \
- 'res_id': new_opportunity_id})
+ model_opportunity_id = self.pool.get('ir.model').search(cr, uid, [('model', '=', 'crm.opportunity')], context=context)[0]
- opp_obj.case_open(cr, uid, [new_opportunity_id])
+ for model in ('crm.case.log', 'crm.case.history'):
+ log_proxy = self.pool.get(model)
+ log_ids = log_proxy.search(cr, uid, [('model_id.model', '=', 'crm.lead'),('res_id', '=', lead.id)], context=context)
+ for log_id in log_ids:
+ log_proxy.copy(cr, uid, log_id, {'model_id':model_opportunity_id}, context=context)
- value = {
- 'name': _('Opportunity'),
- 'view_type': 'form',
- 'view_mode': 'form,tree',
- 'res_model': 'crm.opportunity',
- 'res_id': int(new_opportunity_id),
- 'view_id': False,
- 'views': [(id2, 'form'), (id3, 'tree'), (False, 'calendar'), (False, 'graph')],
- 'type': 'ir.actions.act_window',
- 'search_view_id': res['res_id']
- }
+ lead_obj.write(cr, uid, [lead.id], vals)
+ lead_obj.case_close(cr, uid, [lead.id])
+
+ # Copy lead history to opportunity
+ for his_id in lead.history_line:
+ history_ids = history_obj.copy(cr, uid, his_id.id, \
+ {'model_id': model_ids[0], \
+ 'res_id': new_opportunity_id})
+
+ #opp_obj.case_open(cr, uid, [new_opportunity_id])
+
+ value = {
+ 'name': _('Opportunity'),
+ 'view_type': 'form',
+ 'view_mode': 'form,tree',
+ 'res_model': 'crm.opportunity',
+ 'res_id': int(new_opportunity_id),
+ 'view_id': False,
+ 'views': [(id2, 'form'), (id3, 'tree'), (False, 'calendar'), (False, 'graph')],
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': res['res_id']
+ }
return value
_columns = {
diff --git a/addons/crm/wizard/crm_send_email.py b/addons/crm/wizard/crm_send_email.py
index 7054c77cb90..a0f91fb2ae5 100644
--- a/addons/crm/wizard/crm_send_email.py
+++ b/addons/crm/wizard/crm_send_email.py
@@ -165,7 +165,7 @@ class crm_send_new_email(osv.osv_memory):
if 'email_cc' in fields:
res.update({'email_cc': case.email_cc or ''})
if 'text' in fields:
- res.update({'text': '\n\n'+(case.user_id.signature or '')})
+ res.update({'text': '\n\n'+(case.user_id.signature or '') + '\n\n' + (case.description or '')})
if 'state' in fields:
res.update({'state': 'pending'})
return res
diff --git a/addons/crm/wizard/crm_send_email_view.xml b/addons/crm/wizard/crm_send_email_view.xml
index 976e0578d05..4db670de61f 100644
--- a/addons/crm/wizard/crm_send_email_view.xml
+++ b/addons/crm/wizard/crm_send_email_view.xml
@@ -9,27 +9,26 @@
crm.send.mailform
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/delivery/i18n/ru.po b/addons/delivery/i18n/ru.po
index c59e964b00a..fa64529594b 100644
--- a/addons/delivery/i18n/ru.po
+++ b/addons/delivery/i18n/ru.po
@@ -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-11-18 06:25+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2010-04-23 09:08+0000\n"
+"Last-Translator: grisha \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-04-17 03:58+0000\n"
+"X-Launchpad-Export-Date: 2010-04-24 03:52+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: delivery
@@ -42,7 +42,7 @@ msgstr "Назначение"
#. module: delivery
#: model:product.template,name:delivery.delivery_product_product_template
msgid "Delivery by Poste"
-msgstr ""
+msgstr "Доставка почтой"
#. module: delivery
#: constraint:ir.ui.view:0
@@ -52,7 +52,7 @@ msgstr "Неправильный XML для просмотра архитект
#. module: delivery
#: constraint:res.partner:0
msgid "Error ! You can not create recursive associated members."
-msgstr ""
+msgstr "Ошибка! Вы не можете создать рекурсивных связанных участников."
#. module: delivery
#: field:delivery.grid,state_ids:0
@@ -62,7 +62,7 @@ msgstr "Cостояния"
#. module: delivery
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Недопустимое имя модели в определении действия"
#. module: delivery
#: help:res.partner,property_delivery_carrier:0
@@ -72,7 +72,7 @@ msgstr ""
#. module: delivery
#: model:ir.model,name:delivery.model_delivery_grid
msgid "Delivery Grid"
-msgstr ""
+msgstr "Расценки на доставку"
#. module: delivery
#: field:delivery.grid,zip_from:0
@@ -119,12 +119,12 @@ msgstr ""
#. module: delivery
#: field:delivery.grid.line,grid_id:0
msgid "Grid"
-msgstr ""
+msgstr "Расценка"
#. module: delivery
#: view:res.partner:0
msgid "Deliveries Properties"
-msgstr ""
+msgstr "Свойства доставки"
#. module: delivery
#: field:delivery.carrier,active:0
@@ -151,7 +151,7 @@ msgstr "="
#. module: delivery
#: field:delivery.carrier,product_id:0
msgid "Delivery Product"
-msgstr ""
+msgstr "Услуга или изделие, соответствующее доставке"
#. module: delivery
#: view:delivery.grid.line:0
@@ -166,7 +166,7 @@ msgstr ""
#. module: delivery
#: field:delivery.grid.line,standard_price:0
msgid "Cost Price"
-msgstr ""
+msgstr "Себестоимость"
#. module: delivery
#: field:delivery.grid.line,name:0
@@ -177,6 +177,8 @@ msgstr "Название"
#: constraint:product.template:0
msgid "Error: UOS must be in a different category than the UOM"
msgstr ""
+"Ошибка. Единицы продажи и единицы измерения должны принадлежать к разным "
+"категориям."
#. module: delivery
#: field:delivery.grid,country_ids:0
@@ -323,7 +325,7 @@ msgstr "Ошибка: Неправильный штрих-код"
#. module: delivery
#: view:delivery.grid:0
msgid "Delivery grids"
-msgstr ""
+msgstr "Расценки на доставку"
#. module: delivery
#: wizard_button:delivery.sale.order,init,end:0
diff --git a/addons/document_email/document_email.py b/addons/document_email/document_email.py
index a4406f7a4d5..e4e94fa6c1f 100644
--- a/addons/document_email/document_email.py
+++ b/addons/document_email/document_email.py
@@ -79,7 +79,7 @@ class email_to_document(osv.osv):
if file_ext[1] not in ext:
logger.notifyChannel('document', netsvc.LOG_WARNING, 'file type %s is not allows to process for directory %s' % (file_ext[1], dr.directory_id.name))
continue
-
+
data_attach = {
'name': attactment,
'datas':binascii.b2a_base64(str(attachents.get(attactment))),
diff --git a/addons/document_email/document_email.xml b/addons/document_email/document_email.xml
index 9dd550acd7c..bfcde49816a 100644
--- a/addons/document_email/document_email.xml
+++ b/addons/document_email/document_email.xml
@@ -93,11 +93,11 @@
[]
-
+
+
+
+
+
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py
index feb88b57136..611b7c178fb 100644
--- a/addons/fetchmail/fetchmail.py
+++ b/addons/fetchmail/fetchmail.py
@@ -320,12 +320,22 @@ class email_server(osv.osv):
return res_id
+ def __fetch_mail(self, cr, uid, ids, context={}):
+ sendmail_thread = threading.Thread(target=self.fetch_mail, args=(cr, uid, ids))
+ sendmail_thread.start()
+ return True
+
def _fetch_mails(self, cr, uid, ids=False, context={}):
if not ids:
ids = self.search(cr, uid, [])
return self.fetch_mail(cr, uid, ids, context)
def fetch_mail(self, cr, uid, ids, context={}):
+
+ fp = os.popen('ping www.google.com -c 1 -w 5',"r")
+ if not fp.read():
+ logger.notifyChannel('imap', netsvc.LOG_WARNING, 'lost internet connection !')
+
for server in self.browse(cr, uid, ids, context):
logger.notifyChannel('imap', netsvc.LOG_INFO, 'fetchmail start checking for new emails on %s' % (server.name))
@@ -356,7 +366,7 @@ class email_server(osv.osv):
pop_server = POP3_SSL(server.server, int(server.port))
else:
pop_server = POP3(server.server, int(server.port))
-
+
#TODO: use this to remove only unread messages
#pop_server.user("recent:"+server.user)
pop_server.user(server.user)
@@ -373,9 +383,10 @@ class email_server(osv.osv):
pop_server.quit()
logger.notifyChannel('imap', netsvc.LOG_INFO, 'fetchmail fetch %s email(s) from %s' % (numMsgs, server.name))
-
+
+ self.write(cr, uid, [server.id], {'state':'done'})
except Exception, e:
- logger.notifyChannel('IMAP', netsvc.LOG_WARNING, '%s' % (e))
+ logger.notifyChannel(server.type, netsvc.LOG_WARNING, '%s' % (e))
return True
diff --git a/addons/fetchmail/fetchmail_view.xml b/addons/fetchmail/fetchmail_view.xml
index 80d0b60a74f..a3a8534b559 100644
--- a/addons/fetchmail/fetchmail_view.xml
+++ b/addons/fetchmail/fetchmail_view.xml
@@ -58,8 +58,7 @@
-
-
+
+
@@ -147,10 +148,11 @@
-
@@ -171,7 +173,6 @@
Expenseshr.expense.expenseform
- {"search_default_my_expns":1}
diff --git a/addons/hr_expense/report/hr_expense_report.py b/addons/hr_expense/report/hr_expense_report.py
index 81cb18dcc09..cc3f282e9fa 100644
--- a/addons/hr_expense/report/hr_expense_report.py
+++ b/addons/hr_expense/report/hr_expense_report.py
@@ -31,12 +31,16 @@ class hr_expense_report(osv.osv):
_columns = {
'date': fields.date('Date', readonly=True),
'year': fields.char('Year', size=4, readonly=True),
+ 'day': fields.char('Day', size=128, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
+ 'journal_id': fields.many2one('account.journal', 'Force Journal', readonly=True),
'product_qty':fields.float('Qty', readonly=True),
'employee_id': fields.many2one('hr.employee', "Employee's Name", readonly=True),
+ 'date_confirm': fields.date('Confirmation Date', readonly=True),
+ 'date_valid': fields.date('Validation Date', readonly=True),
'invoice_id': fields.many2one('account.invoice', 'Invoice',readonly=True),
'department_id':fields.many2one('hr.department','Department',readonly=True),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
@@ -60,12 +64,16 @@ class hr_expense_report(osv.osv):
create or replace view hr_expense_report as (
select
min(l.id) as id,
- s.date as date,
+ date_trunc('day',s.create_date) as date,
s.employee_id,
+ s.journal_id,
+ to_date(to_char(s.date_confirm, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_confirm,
+ to_date(to_char(s.date_valid, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_valid,
s.invoice_id,
s.department_id,
- to_char(s.date, 'YYYY') as year,
- to_char(s.date, 'MM') as month,
+ to_char(date_trunc('day',s.create_date), 'YYYY') as year,
+ to_char(date_trunc('day',s.create_date), 'MM') as month,
+ to_char(date_trunc('day',s.create_date), 'YYYY-MM-DD') as day,
l.product_id as product_id,
sum(l.unit_quantity * u.factor) as product_qty,
s.user_id as user_id,
@@ -80,10 +88,19 @@ class hr_expense_report(osv.osv):
hr_expense_expense s on (s.id=l.expense_id)
left join product_uom u on (u.id=l.uom_id)
group by
- s.date, l.product_id,s.invoice_id,
+ date_trunc('day',s.create_date),
+ to_char(date_trunc('day',s.create_date), 'YYYY-MM-DD'),
+ to_date(to_char(s.date_confirm, 'dd-MM-YYYY'),'dd-MM-YYYY'),
+ to_date(to_char(s.date_valid, 'dd-MM-YYYY'),'dd-MM-YYYY'),
+ l.product_id,
+ s.invoice_id,
s.department_id,
- l.uom_id, s.user_id, s.state,
- s.company_id,s.employee_id
+ l.uom_id,
+ s.user_id,
+ s.state,
+ s.journal_id,
+ s.company_id,
+ s.employee_id
)
""")
hr_expense_report()
diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml
index 2f9a0afb29c..972557edd0c 100644
--- a/addons/hr_expense/report/hr_expense_report_view.xml
+++ b/addons/hr_expense/report/hr_expense_report_view.xml
@@ -7,16 +7,18 @@
tree
-
-
-
+
+
+
+
-
-
+
+
+
@@ -31,8 +33,9 @@
graph
-
-
+
+
+
@@ -43,41 +46,81 @@
search
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
+
+
+
+
@@ -90,7 +133,7 @@
hr.expense.reportformtree,graph
- {"search_default_expenses":1,"search_default_by_user":1}
+ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
diff --git a/addons/hr_holidays/__openerp__.py b/addons/hr_holidays/__openerp__.py
index f5a57313348..83ce130e360 100644
--- a/addons/hr_holidays/__openerp__.py
+++ b/addons/hr_holidays/__openerp__.py
@@ -55,6 +55,8 @@
'hr_holidays_view.xml',
'hr_holidays_wizard.xml',
'hr_holidays_report.xml',
+ 'report/hr_holidays_report_view.xml',
+ 'report/available_holidays_view.xml',
'wizard/hr_holidays_summary_department_view.xml',
'wizard/hr_holidays_summary_employees_view.xml',
#'process/hr_holidays_process.xml'
diff --git a/addons/hr_holidays/hr_holidays_report.xml b/addons/hr_holidays/hr_holidays_report.xml
index 165b54c72f0..23d1e1a75bf 100644
--- a/addons/hr_holidays/hr_holidays_report.xml
+++ b/addons/hr_holidays/hr_holidays_report.xml
@@ -1,23 +1,14 @@
-
-
+
+
-
-
-
-
+
diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml
index 92e4acd7f63..d5e0602e5bb 100644
--- a/addons/hr_holidays/hr_holidays_view.xml
+++ b/addons/hr_holidays/hr_holidays_view.xml
@@ -10,8 +10,9 @@
-
-
+
+
-
-
+
+
-
+
diff --git a/addons/hr_holidays/report/__init__.py b/addons/hr_holidays/report/__init__.py
index 00783721fe3..a617b4b6d8a 100644
--- a/addons/hr_holidays/report/__init__.py
+++ b/addons/hr_holidays/report/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,11 +15,12 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
import holidays_summary_report
import available_holidays
+import hr_holidays_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_holidays/report/available_holidays.py b/addons/hr_holidays/report/available_holidays.py
index e69de29bb2d..4a1972f1f7d 100644
--- a/addons/hr_holidays/report/available_holidays.py
+++ b/addons/hr_holidays/report/available_holidays.py
@@ -0,0 +1,76 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# 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 .
+#
+##############################################################################
+from osv import fields,osv
+import tools
+
+class available_holidays_report(osv.osv):
+ _name = "available.holidays.report"
+ _auto = False
+ _columns = {
+ 'date': fields.datetime('Date', readonly=True),
+ 'year': fields.char('Year', size=4, readonly=True),
+ 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
+ ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
+ ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
+ 'employee_id': fields.many2one ('hr.employee', 'Employee', readonly=True),
+ 'holiday_status_id': fields.many2one('hr.holidays.status', 'Leave Type', readonly=True),
+ 'max_leave': fields.float('Allocated Leaves', readonly=True),
+ 'taken_leaves': fields.float('Taken Leaves', readonly=True),
+ 'remaining_leave': fields.float('Remaining Leaves',readonly=True),
+ 'user_id':fields.many2one('res.users', 'User', readonly=True),
+ }
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'available_holidays_report')
+ cr.execute("""
+ create or replace view available_holidays_report as (
+ select
+ min(h.id) as id,
+ date_trunc('day',h.create_date) as date,
+ to_char(s.create_date, 'YYYY') as year,
+ to_char(s.create_date, 'MM') as month,
+ h.employee_id as employee_id,
+ h.user_id as user_id,
+ h.state as state,
+ h.holiday_status_id as holiday_status_id,
+ sum(number_of_days) as remaining_leave,
+ (select sum(number_of_days_temp) from hr_holidays
+ where type='remove'
+ and employee_id=h.employee_id
+ and holiday_status_id=h.holiday_status_id
+ and state='validate') as taken_leaves,
+ (select sum(number_of_days_temp) from hr_holidays
+ where type='add'
+ and employee_id=h.employee_id
+ and holiday_status_id=h.holiday_status_id
+ and state='validate') as max_leave
+ from hr_holidays h
+ left join hr_holidays_status s on (s.id = h.holiday_status_id)
+ where h.state='validate'
+ and h.employee_id is not null
+ and s.active <> 'f'
+ group by h.holiday_status_id, h.employee_id,
+ date_trunc('day',h.create_date),to_char(s.create_date, 'YYYY'),
+ to_char(s.create_date, 'MM'),h.user_id,h.state
+
+ )""")
+available_holidays_report()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_holidays/report/available_holidays_view.xml b/addons/hr_holidays/report/available_holidays_view.xml
new file mode 100644
index 00000000000..18ea7d58d45
--- /dev/null
+++ b/addons/hr_holidays/report/available_holidays_view.xml
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+ available.holidays.report.tree
+ available.holidays.report
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ available.holidays.report.form
+ available.holidays.report
+ form
+
+
+
+
+
+
+
+
+
+ available.holidays.report.graph
+ available.holidays.report
+ graph
+
+
+
+
+
+
+
+
+
+
+ available.holidays.report.search
+ available.holidays.report
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Available Holidays
+ available.holidays.report
+ form
+ tree,graph
+
+
+
+
+
+
+ tree
+
+
+
+
+
+
+
+ graph
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/hr_holidays/report/hr_holidays_report.py b/addons/hr_holidays/report/hr_holidays_report.py
index 59a0a361eeb..435eee71ea5 100644
--- a/addons/hr_holidays/report/hr_holidays_report.py
+++ b/addons/hr_holidays/report/hr_holidays_report.py
@@ -63,6 +63,7 @@ class hr_holidays_report(osv.osv):
s.state
from
hr_holidays s
+ where type='remove'
group by
s.create_date,s.state,s.date_from,s.date_to,
s.number_of_days_temp,s.employee_id,s.user_id
@@ -70,3 +71,37 @@ class hr_holidays_report(osv.osv):
""")
hr_holidays_report()
+class hr_holidays_remaining_leaves_user(osv.osv):
+ _name = "hr.holidays.remaining.leaves.user"
+ _description = "Total holidays by type"
+ _auto = False
+ _columns = {
+ 'name': fields.char('Employee',size=64),
+ 'no_of_leaves': fields.integer('Remaining leaves'),
+ 'user_id': fields.many2one('res.users','User'),
+ 'leave_type': fields.char('Leave Type',size=64),
+
+ }
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'hr_holidays_remaining_leaves_user')
+ cr.execute("""
+ create or replace view hr_holidays_remaining_leaves_user as (
+ select
+ min(hrs.id) as id,
+ rr.name as name,
+ sum(hrs.number_of_days) as no_of_leaves,
+ rr.user_id as user_id,
+ hhs.name as leave_type
+ from
+ hr_holidays as hrs, hr_employee as hre,
+ resource_resource as rr,hr_holidays_status as hhs
+ where
+ hrs.employee_id = hre.id and
+ hre.resource_id = rr.id and
+ hhs.id = hrs.holiday_status_id
+ group by
+ rr.name,rr.user_id,hhs.name
+ )
+ """)
+
+hr_holidays_remaining_leaves_user()
diff --git a/addons/hr_holidays/report/hr_holidays_report_view.xml b/addons/hr_holidays/report/hr_holidays_report_view.xml
index 66094e70f5c..e9e0e6aae36 100644
--- a/addons/hr_holidays/report/hr_holidays_report_view.xml
+++ b/addons/hr_holidays/report/hr_holidays_report_view.xml
@@ -9,7 +9,6 @@
-
@@ -47,6 +46,20 @@
domain="[('month','=',time.strftime('%%m'))]"
help="Leaves of this month"/>
+
+
+
+
+
+
-
+
@@ -72,10 +85,36 @@
hr.holidays.reportformtree,graph
+ {'search_default_employee': 1}
-
+
-
+
+ hr.holidays.remaining.leaves.user.tree
+ hr.holidays.remaining.leaves.user
+ tree
+
+
+
+
+
+
+
+
+
+
+ hr.holidays.remaining.leaves.user.graph
+ hr.holidays.remaining.leaves.user
+ graph
+
+
+
+
+
+
+
+
+
diff --git a/addons/hr_holidays/security/ir.model.access.csv b/addons/hr_holidays/security/ir.model.access.csv
index a7426724594..d928a8dcb9b 100644
--- a/addons/hr_holidays/security/ir.model.access.csv
+++ b/addons/hr_holidays/security/ir.model.access.csv
@@ -3,3 +3,9 @@
"access_hr_holidays_user","hr holidays user","model_hr_holidays","hr.group_hr_user",1,1,1,0
"access_hr_holydays_status_manager","hr.holidays.status manager","model_hr_holidays_status","hr.group_hr_manager",1,1,1,1
"access_hr_holidays_manager","hr holidays manager","model_hr_holidays","hr.group_hr_manager",1,1,1,1
+"access_hr_holidays_remain","hr holidays user","model_hr_holidays_remaining_leaves_user","hr.group_hr_user",1,0,0,0
+"access_hr_holidays_report","hr.holidays.report","model_hr_holidays_report","hr.group_hr_manager",1,1,1,1
+"access_hr_holidays_remaining_leaves_user","hr.hr.holidays.remaining.leaves.user","model_hr_holidays_remaining_leaves_user","hr.group_hr_manager",1,1,1,1
+"access_available_holidays_report","hr.available.holidays.report","model_available_holidays_report","hr.group_hr_manager",1,1,1,1
+"access_hr_holidays_report_user","hr.holidays.report","model_hr_holidays_report","hr.group_hr_user",1,0,0,0
+"access_available_holidays_report_user","hr.available.holidays.report","model_available_holidays_report","hr.group_hr_user",1,0,0,0
diff --git a/addons/hr_recruitment/__openerp__.py b/addons/hr_recruitment/__openerp__.py
index a19ef25515b..14557c33c42 100644
--- a/addons/hr_recruitment/__openerp__.py
+++ b/addons/hr_recruitment/__openerp__.py
@@ -39,14 +39,15 @@ system to store and search in your CV base.
'hr_recruitment_data.xml'
],
'update_xml': [
- 'hr_recruitment_wizard.xml',
+ 'wizard/hr_recruitment_phonecall_view.xml',
'hr_recruitment_view.xml',
'hr_recruitment_menu.xml',
# 'report_hr_recruitment_view.xml',
'security/hr_recruitment_security.xml',
'security/ir.model.access.csv',
'board_hr_recruitment_statistical_view.xml',
- 'report/hr_recruitment_report_view.xml'
+ 'report/hr_recruitment_report_view.xml',
+ 'wizard/hr_recruitment_create_partner_job_view.xml',
],
'demo_xml': [
'hr_recruitment_demo.xml'
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py
index 6fe8b91aa3e..eb0d1ae1334 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -20,7 +20,6 @@
##############################################################################
from osv import fields,osv,orm
-from tools.translate import _
AVAILABLE_STATES = [
('draft','New'),
@@ -55,8 +54,8 @@ class hr_applicant(osv.osv):
'partner_name': fields.char("Applicant's Name", size=64),
'partner_phone': fields.char('Phone', size=32),
'partner_mobile': fields.char('Mobile', size=32),
- 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'hr.applicant')]"),
- 'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('object_id.model', '=', 'hr.applicant')]"),
+ 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]"),
+ 'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]"),
'department_id':fields.many2one('hr.department','Department'),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
'survey' : fields.related('job_id', 'survey_id', type='many2one', relation='survey', string='Survey'),
@@ -65,7 +64,7 @@ class hr_applicant(osv.osv):
def stage_previous(self, cr, uid, ids, context=None):
"""This function computes previous stage for case from its current stage
- using available stage for that case type
+ using available stage for that case type
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@@ -83,7 +82,7 @@ class hr_applicant(osv.osv):
def stage_next(self, cr, uid, ids, context=None):
"""This function computes next stage for case from its current stage
- using available stage for that case type
+ using available stage for that case type
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@@ -168,7 +167,6 @@ class hr_applicant(osv.osv):
context.update({'survey_id': record.survey.id, 'response_id' : [record.response], 'response_no':0,})
value = self.pool.get("survey").action_print_survey(cr, uid, ids, context)
return value
-
hr_applicant()
class hr_job(osv.osv):
diff --git a/addons/hr_recruitment/hr_recruitment_menu.xml b/addons/hr_recruitment/hr_recruitment_menu.xml
index bbf32cf0501..ba3278b3c66 100644
--- a/addons/hr_recruitment/hr_recruitment_menu.xml
+++ b/addons/hr_recruitment/hr_recruitment_menu.xml
@@ -9,7 +9,6 @@
hr.applicanttree,form,graph
- {"search_default_current":1,"search_default_my_recrui":1}
diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml
index 2367603502c..beb9467814c 100644
--- a/addons/hr_recruitment/hr_recruitment_view.xml
+++ b/addons/hr_recruitment/hr_recruitment_view.xml
@@ -43,8 +43,8 @@
-
-
+
+
@@ -71,16 +71,16 @@
-
+
+ name="%(action_hr_recruitment_phonecall)d" icon="gtk-redo" type="action"/>
+ icon="gtk-execute" context="{'survey_id': survey, 'response_id': [response], 'response_no':0 ,'active' : response, 'object' : 'hr.applicant', 'cur_id' :active_id}" attrs="{'readonly':[('survey','=',False)]}"/>
@@ -160,10 +160,10 @@
+ string="Reply to Last Email"
+ name="%(crm.action_crm_send_mail)d"
+ context="{'mail':'reply', 'model': 'hr.applicant'}"
+ icon="gtk-undo" type="action" />
@@ -172,9 +172,9 @@
+ name="%(crm.action_crm_send_mail)d"
+ context="{'mail':'new', 'model': 'hr.applicant'}"
+ icon="gtk-go-forward" type="action" />
@@ -201,10 +201,10 @@
search
-
-
-
-
+
@@ -232,9 +231,8 @@
domain="[('department_id','=',context.get('department_id',False))]"
help="My Department"/>
-
-
+
diff --git a/addons/hr_recruitment/hr_recruitment_wizard.xml b/addons/hr_recruitment/hr_recruitment_wizard.xml
index b2ef149d604..d82153eabbb 100644
--- a/addons/hr_recruitment/hr_recruitment_wizard.xml
+++ b/addons/hr_recruitment/hr_recruitment_wizard.xml
@@ -9,6 +9,14 @@
multi="True"
string="Schedule Phone Call" />
+
+
tree
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -39,57 +44,88 @@
search
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -100,7 +136,7 @@
hr.recruitment.reportformtree,graph
- {"search_default_user_id":1,"search_default_by_user":1}
+ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
diff --git a/addons/hr_recruitment/wizard/__init__.py b/addons/hr_recruitment/wizard/__init__.py
index 48e225c5a54..c946ed7264f 100644
--- a/addons/hr_recruitment/wizard/__init__.py
+++ b/addons/hr_recruitment/wizard/__init__.py
@@ -20,10 +20,8 @@
##############################################################################
-import hr_recruitment_wizard
-
-
-
+import hr_recruitment_phonecall
+import hr_recruitment_create_partner_job
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py b/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py
new file mode 100644
index 00000000000..4627751f731
--- /dev/null
+++ b/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py
@@ -0,0 +1,92 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (). 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 .
+#
+##############################################################################
+
+from osv import osv, fields
+from tools.translate import _
+
+class hr_recruitment_partner_create(osv.osv_memory):
+ _name = 'hr.recruitment.partner.create'
+ _description = 'Create Partner from job application'
+ _columns = {
+ 'close': fields.boolean('Close job request'),
+ }
+
+ def view_init(self, cr , uid , fields_list, context=None):
+ case_obj = self.pool.get('hr.applicant')
+ for case in case_obj.browse(cr, uid, context['active_ids']):
+ if case.partner_id:
+ raise osv.except_osv(_('Warning !'),
+ _('A partner is already defined on this job request.'))
+ pass
+
+ def make_order(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ partner_obj = self.pool.get('res.partner')
+ contact_obj = self.pool.get('res.partner.address')
+ case_obj = self.pool.get('hr.applicant')
+
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, [], context)[0]
+ result = mod_obj._get_id(cr, uid, 'base', 'view_res_partner_filter')
+ res = mod_obj.read(cr, uid, result, ['res_id'])
+
+ for case in case_obj.browse(cr, uid, context['active_ids']):
+ partner_id = partner_obj.search(cr, uid, [('name', '=', case.partner_name or case.name)])
+ if partner_id:
+ raise osv.except_osv(_('Warning !'),_('A partner is already existing with the same name.'))
+ else:
+ partner_id = partner_obj.create(cr, uid, {
+ 'name': case.partner_name or case.name,
+ 'user_id': case.user_id.id,
+ 'comment': case.description,
+ })
+ contact_id = contact_obj.create(cr, uid, {
+ 'partner_id': partner_id,
+ 'name': case.partner_name,
+ 'phone': case.partner_phone,
+ 'mobile': case.partner_mobile,
+ 'email': case.email_from
+ })
+
+ case_obj.write(cr, uid, context['active_ids'], {
+ 'partner_id': partner_id,
+ 'partner_address_id': contact_id
+ })
+ if data['close']:
+ case_obj.case_close(cr, uid, context['active_ids'])
+
+ value = {
+ 'domain': "[]",
+ 'view_type': 'form',
+ 'view_mode': 'form,tree',
+ 'res_model': 'res.partner',
+ 'res_id': int(partner_id),
+ 'view_id': False,
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': res['res_id']
+ }
+ return value
+
+hr_recruitment_partner_create()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job_view.xml b/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job_view.xml
new file mode 100644
index 00000000000..1eaaa2fefdd
--- /dev/null
+++ b/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job_view.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+ hr.recruitment.partner.create.form
+ hr.recruitment.partner.create
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Create Partner
+ ir.actions.act_window
+ hr.recruitment.partner.create
+ form
+ form
+ new
+
+
+
+
+
+ Create Partner
+ client_action_multi
+
+ action
+ hr.applicant
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml b/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml
new file mode 100644
index 00000000000..f7c162594d2
--- /dev/null
+++ b/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+ hr.recruitment.job2phonecall.form
+ hr.recruitment.job2phonecall
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Schedule Phone Call
+ ir.actions.act_window
+ hr.recruitment.job2phonecall
+ form
+ form
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_wizard.py b/addons/hr_recruitment/wizard/hr_recruitment_wizard.py
index a12ff4957eb..bd6fa8ba134 100644
--- a/addons/hr_recruitment/wizard/hr_recruitment_wizard.py
+++ b/addons/hr_recruitment/wizard/hr_recruitment_wizard.py
@@ -132,6 +132,61 @@ class job2phonecall(wizard.interface):
job2phonecall('hr.applicant.reschedule_phone_call')
+class job2meeting(wizard.interface):
+
+ def _makeMeeting(self, cr, uid, data, context):
+ pool = pooler.get_pool(cr.dbname)
+ job_case_obj = pool.get('hr.applicant')
+ meeting_case_obj = pool.get('hr.meeting')
+ for job in job_case_obj.browse(cr, uid, data['ids']):
+ new_meeting_id = meeting_case_obj.create(cr, uid, {
+ 'name': job.name,
+ 'date': job.date,
+ 'duration': job.duration,
+ })
+ new_meeting = meeting_case_obj.browse(cr, uid, new_meeting_id)
+ vals = {}
+ job_case_obj.write(cr, uid, [job.id], vals)
+ job_case_obj.case_cancel(cr, uid, [job.id])
+ meeting_case_obj.case_open(cr, uid, [new_meeting_id])
+
+ data_obj = pool.get('ir.model.data')
+ result = data_obj._get_id(cr, uid, 'hr', 'view_hr_case_meetings_filter')
+ id = data_obj.read(cr, uid, result, ['res_id'])
+ id1 = data_obj._get_id(cr, uid, 'hr', 'hr_case_calendar_view_meet')
+ id2 = data_obj._get_id(cr, uid, 'hr', 'hr_case_form_view_meet')
+ id3 = data_obj._get_id(cr, uid, 'hr', 'hr_case_tree_view_meet')
+ if id1:
+ id1 = data_obj.browse(cr, uid, id1, context=context).res_id
+ if id2:
+ id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+ if id3:
+ id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+ return {
+ 'name': _('Meetings'),
+ 'view_type': 'form',
+ 'view_mode': 'calendar,form,tree',
+ 'res_model': 'hr.meeting',
+ 'view_id': False,
+ 'views': [(id1,'calendar'),(id2,'form'),(id3,'tree'),(False,'graph')],
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': id['res_id']
+ }
+
+ states = {
+ 'init': {
+ 'actions': [],
+ 'result': {'type': 'action', 'action': _makeMeeting, 'state': 'order'}
+ },
+ 'order': {
+ 'actions': [],
+ 'result': {'type': 'state', 'state': 'end'}
+ }
+ }
+
+job2meeting('hr.applicant.meeting_set')
+
+
class partner_create(wizard.interface):
case_form = """
diff --git a/addons/hr_timesheet/i18n/de.po b/addons/hr_timesheet/i18n/de.po
index c0dc16b4145..8da6cb5fbef 100644
--- a/addons/hr_timesheet/i18n/de.po
+++ b/addons/hr_timesheet/i18n/de.po
@@ -13,7 +13,11 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+<<<<<<< TREE
+"X-Launchpad-Export-Date: 2010-04-07 03:46+0000\n"
+=======
"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
+>>>>>>> MERGE-SOURCE
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet_invoice/__openerp__.py b/addons/hr_timesheet_invoice/__openerp__.py
index 3f4aecb9d3f..72148b83f63 100644
--- a/addons/hr_timesheet_invoice/__openerp__.py
+++ b/addons/hr_timesheet_invoice/__openerp__.py
@@ -40,6 +40,9 @@ reports, eso.""",
'report/report_analytic_view.xml',
'report/hr_timesheet_invoice_report_view.xml',
'wizard/hr_timesheet_invoice_analytic_cost_ledger_view.xml',
+ 'wizard/hr_timesheet_analytic_profit_view.xml',
+ 'wizard/hr_timesheet_invoice_create_view.xml',
+ 'wizard/hr_timesheet_invoice_create_final_view.xml',
],
'demo_xml': ['hr_timesheet_invoice_demo.xml'],
'installable': True,
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml
index bed54ff7d0d..f2d9f5a8c4a 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml
@@ -24,7 +24,7 @@
rml="hr_timesheet_invoice/report/account_analytic_profit.rml"
string="Timesheet Profit"/>
-
+ groups="hr.group_hr_manager"/>-->
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_wizard.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_wizard.xml
index 350f30c780d..50ca292d39d 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_wizard.xml
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_wizard.xml
@@ -1,8 +1,8 @@
-
-
-
+
+
+
diff --git a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py
index 28f129dce22..b7cf2e8a2df 100644
--- a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py
+++ b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,13 +15,67 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
from osv import fields,osv
from tools.sql import drop_view_if_exists
+class report_timesheet_line(osv.osv):
+ _name = "report.timesheet.line"
+ _description = "Timesheet Line"
+ _auto = False
+ _columns = {
+ 'name': fields.char('Year',size=64,required=False, readonly=True),
+ 'user_id':fields.many2one('res.users', 'User', readonly=True),
+ 'date' : fields.date('Date', readonly=True),
+ 'day': fields.char('Day', size=128, readonly=True),
+ 'quantity': fields.float('Quantity', readonly=True),
+ 'cost': fields.float('Cost', readonly=True),
+ 'product_id' : fields.many2one('product.product', 'Product',readonly=True),
+ 'account_id' : fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
+ 'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True),
+ 'invoice_id': fields.many2one('account.invoice', 'Invoiced', readonly=True),
+ 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
+ ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
+ }
+ _order = 'name desc,user_id desc'
+ def init(self, cr):
+ drop_view_if_exists(cr, 'report_timesheet_line')
+ cr.execute("""
+ create or replace view report_timesheet_line as (
+ select
+ min(l.id) as id,
+ l.date as date,
+ to_char(l.date,'YYYY') as name,
+ to_char(l.date,'MM') as month,
+ l.user_id,
+ to_char(l.date, 'YYYY-MM-DD') as day,
+ l.invoice_id,
+ l.product_id,
+ l.account_id,
+ l.general_account_id,
+ sum(l.unit_amount) as quantity,
+ sum(l.amount) as cost
+ from
+ account_analytic_line l
+ where
+ l.user_id is not null
+ group by
+ l.date,
+ l.user_id,
+ l.product_id,
+ l.account_id,
+ l.general_account_id,
+ l.invoice_id
+ )
+ """)
+report_timesheet_line()
+
+
+
+
class report_timesheet_user(osv.osv):
_name = "report_timesheet.user"
_description = "Timesheet per day"
@@ -102,7 +156,7 @@ class report_timesheet_account_date(osv.osv):
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
}
_order = 'name desc,account_id desc,user_id desc'
-
+
def init(self, cr):
drop_view_if_exists(cr, 'report_timesheet_account_date')
cr.execute("""
@@ -167,7 +221,7 @@ class report_random_timsheet(osv.osv):
_name = "report.random.timesheet"
_description = "Random Timesheet Report"
_auto = False
-
+
_columns = {
'analytic_account_id' : fields.many2one('account.analytic.account','Analytic Account', readonly=True),
'name': fields.char('Description', size=64, readonly=True),
@@ -176,34 +230,34 @@ class report_random_timsheet(osv.osv):
'user_id' : fields.many2one('res.users', 'User', readonly=True)
}
_order = "date desc"
-
+
def __init__(self, pool, cr):
super(report_random_timsheet, self).__init__(pool, cr)
self.called = False
-
+
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
""" To call the init() method timely
"""
if not self.called:
self.init(cr, user)
self.called = True # To make sure that init doesn't get called multiple times
-
+
res = super(report_random_timsheet, self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
return res
-
+
def init(self, cr, uid=1):
drop_view_if_exists(cr, 'report_random_timesheet')
-
+
cr.execute("""create or replace view report_random_timesheet as (
- select
+ select
line.id as id, line.account_id as analytic_account_id, line.name as name,
line.unit_amount as quantity, line.date as date, line.user_id as user_id
- from
+ from
account_analytic_line line, hr_department dept,hr_department_user_rel dept_user
where
(dept.id = dept_user.department_id AND dept_user.user_id=line.user_id AND line.user_id is not null)
- AND (dept.manager_id = """ + str(uid) + """ )
+ AND (dept.manager_id = """ + str(uid) + """ )
AND (line.date <= CURRENT_DATE AND line.date > (CURRENT_DATE-3))
LIMIT 10
)
@@ -215,32 +269,32 @@ class random_timesheet_lines(osv.osv):
_name = "random.timesheet.lines"
_description = "Random Timesheet Lines"
_auto = False
-
+
_columns = {
- 'date': fields.date('Date', readonly=True),
+ 'date': fields.date('Date', readonly=True),
'name': fields.char('Description', size=64, readonly=True),
'user_id' : fields.many2one('res.users', 'User', readonly=True),
'quantity' : fields.float('Quantity', readonly=True),
- 'product_id' : fields.many2one('product.product', 'Product', readonly=True),
+ 'product_id' : fields.many2one('product.product', 'Product', readonly=True),
'analytic_account_id' : fields.many2one('account.analytic.account','Analytic Account', readonly=True),
'uom_id' : fields.many2one('product.uom', 'UoM', readonly=True),
'amount' : fields.float('Amount', readonly=True),
'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Invoicing', readonly=True),
'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True)
}
-
+
_order = "date desc"
-
+
def init(self, cr):
drop_view_if_exists(cr, 'random_timesheet_lines')
-
+
cr.execute("""create or replace view random_timesheet_lines as (
- select
+ select
line.id as id, line.date as date, line.name as name, line.unit_amount as quantity,
line.product_id as product_id, line.account_id as analytic_account_id,
line.product_uom_id as uom_id, line.amount as amount, line.to_invoice as to_invoice,
- line.general_account_id as general_account_id, line.user_id as user_id
- from
+ line.general_account_id as general_account_id, line.user_id as user_id
+ from
account_analytic_line line
where
(line.date <= CURRENT_DATE AND line.date > (CURRENT_DATE-15))
diff --git a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
index c895250284e..4de60162d1a 100644
--- a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
+++ b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
@@ -6,6 +6,106 @@
name="Reporting"
parent="hr.menu_hr_root"
sequence="40" />
+
+
+ report.timesheet.line.graph
+ report.timesheet.line
+ graph
+
+
+
+
+
+
+
+
+
+
+ report.timesheet.line.tree
+ report.timesheet.line
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ report.timesheet.line.search
+ report.timesheet.line
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Timesheet Line
+ report.timesheet.line
+ form
+ tree,graph
+ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
+
+
+
+
+
@@ -89,7 +189,7 @@
graph,tree
-
+
@@ -155,7 +255,7 @@
graph,tree
-
+
@@ -229,7 +329,7 @@
graph,tree
-
+
@@ -304,7 +404,7 @@
graph,tree
-
+
diff --git a/addons/hr_timesheet_invoice/wizard/__init__.py b/addons/hr_timesheet_invoice/wizard/__init__.py
index b3921b01008..6dce6a7b651 100644
--- a/addons/hr_timesheet_invoice/wizard/__init__.py
+++ b/addons/hr_timesheet_invoice/wizard/__init__.py
@@ -20,7 +20,7 @@
##############################################################################
import hr_timesheet_invoice_create
-import account_analytic_profit
+import hr_timesheet_analytic_profit
import hr_timesheet_final_invoice_create
import hr_timesheet_analytic_cost_ledger_report
diff --git a/addons/hr_timesheet_invoice/wizard/account_analytic_profit.py b/addons/hr_timesheet_invoice/wizard/account_analytic_profit.py
deleted file mode 100644
index 90861b6f5a9..00000000000
--- a/addons/hr_timesheet_invoice/wizard/account_analytic_profit.py
+++ /dev/null
@@ -1,99 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# 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 .
-#
-##############################################################################
-
-import wizard
-import datetime
-import pooler
-from tools.translate import _
-
-form='''
-
-
-
-
-
-
'''
-
-class wizard_report(wizard.interface):
- def _date_from(*a):
- return datetime.datetime.today().strftime('%Y-%m-1')
-
- def _date_to(*a):
- return datetime.datetime.today().strftime('%Y-%m-%d')
-
- def _check(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- line_obj = pool.get('account.analytic.line')
- product_obj = pool.get('product.product')
- price_obj = pool.get('product.pricelist')
- ids = line_obj.search(cr, uid, [
- ('date', '>=', data['form']['date_from']),
- ('date', '<=', data['form']['date_to']),
- ('journal_id', 'in', data['form']['journal_ids'][0][2]),
- ('user_id', 'in', data['form']['employee_ids'][0][2]),
- ])
- if not ids:
- raise wizard.except_wizard(_('Data Insufficient!'), _('No Records Found for Report!'))
-
- return data['form']
-
-
- fields={
- 'date_from':{
- 'string':'From',
- 'type':'date',
- 'required':True,
- 'default':_date_from,
- },
- 'date_to':{
- 'string':'To',
- 'type':'date',
- 'required':True,
- 'default':_date_to,
- },
- 'journal_ids':{
- 'string':'Journal',
- 'type':'many2many',
- 'relation':'account.analytic.journal',
- 'required':True,
- },
- 'employee_ids':{
- 'string':'Employee',
- 'type':'many2many',
- 'relation':'res.users',
- 'required':True,
- },
- }
-
- states={
- 'init':{
- 'actions':[],
- 'result':{'type':'form', 'arch':form, 'fields':fields, 'state':[('end', 'Cancel', 'gtk-cancel'), ('report', 'Print', 'gtk-ok')]}
- },
- 'report':{
- 'actions':[_check],
- 'result':{'type':'print', 'report':'account.analytic.profit', 'state':'end'}
- }
- }
-wizard_report('account.analytic.profit')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py
new file mode 100644
index 00000000000..f5b37256a02
--- /dev/null
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# 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 .
+#
+##############################################################################
+import datetime
+
+from osv import osv, fields
+from tools.translate import _
+
+class account_analytic_profit(osv.osv_memory):
+ _name = 'hr.timesheet.analytic.profit'
+ _description = 'Print Timesheet Profit'
+ _columns = {
+ 'date_from': fields.date('From', required=True),
+ 'date_to': fields.date('To', required=True),
+ 'journal_ids': fields.many2many('account.analytic.journal', 'analytic_profit_journal_rel', 'analytic_id', 'journal_id', 'Journal', required=True),
+ 'employee_ids': fields.many2many('res.users', 'analytic_profit_emp_rel', 'analytic_id', 'emp_id', 'Employee', required=True),
+ }
+
+ def _date_from(*a):
+ return datetime.datetime.today().strftime('%Y-%m-1')
+
+ def _date_to(*a):
+ return datetime.datetime.today().strftime('%Y-%m-%d')
+
+ _defaults = {
+ 'date_from': _date_from,
+ 'date_to': _date_to
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ line_obj = self.pool.get('account.analytic.line')
+ product_obj = self.pool.get('product.product')
+ price_obj = self.pool.get('product.pricelist')
+ data = {}
+ data['form'] = self.read(cr, uid , ids, [], context=context)[0]
+ if context is None:
+ context = {}
+ ids_chk = line_obj.search(cr, uid, [
+ ('date', '>=', data['form']['date_from']),
+ ('date', '<=', data['form']['date_to']),
+ ('journal_id', 'in', data['form']['journal_ids']),
+ ('user_id', 'in', data['form']['employee_ids']),
+ ])
+ if not ids_chk:
+ raise osv.except_osv(_('Data Insufficient!'), _('No Records Found for Report!'))
+
+ data['form']['journal_ids'] = [(6, 0, data['form']['journal_ids'])] # Improve me => Change the rml/sxw so that it can support withou [0][2]
+ data['form']['employee_ids'] = [(6, 0, data['form']['employee_ids'])]
+ datas = {
+ 'ids': [],
+ 'model': 'account.analytic.line',
+ 'form': data['form']
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.profit',
+ 'datas': datas,
+ }
+
+account_analytic_profit()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit_view.xml b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit_view.xml
new file mode 100644
index 00000000000..f79cae2eef8
--- /dev/null
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit_view.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+ Timesheet Profit
+ hr.timesheet.analytic.profit
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Timesheet Profit
+ ir.actions.act_window
+ hr.timesheet.analytic.profit
+ form
+ form
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
index 1f9efe9641f..e8309d84921 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,15 +15,14 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
-import wizard
-import pooler
import time
-from tools.translate import _
+from osv import osv, fields
+from tools.translate import _
#
# Create an final invoice based on selected timesheet lines
#
@@ -31,26 +30,37 @@ from tools.translate import _
#
# TODO: check unit of measure !!!
#
-class final_invoice_create(wizard.interface):
- def _get_defaults(self, cr, uid, data, context):
- return {}
+class final_invoice_create(osv.osv_memory):
+ _name = 'hr.timesheet.invoice.create.final'
+ _description = 'Create invoice from timesheet final'
+ _columns = {
+ 'date': fields.boolean('Date', help='Display date in the history of works'),
+ 'time': fields.boolean('Time spent', help='Display time in the history of works'),
+ 'name': fields.boolean('Name of entry', help='Display detail of work in the invoice line.'),
+ 'price': fields.boolean('Cost', help='Display cost of the item you reinvoice'),
+ 'balance_product': fields.many2one('product.product', 'Balance product', help='The product that will be used to invoice the remaining amount'),
+ }
- def _do_create(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- mod_obj = pool.get('ir.model.data')
+ def do_create(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ analytic_account_obj = self.pool.get('account.analytic.account')
+ res_partner_obj = self.pool.get('res.partner')
+ account_payment_term_obj = self.pool.get('account.payment.term')
+ invoices = []
+
+ if context is None:
+ context = {}
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
res = mod_obj.read(cr, uid, result, ['res_id'])
- analytic_account_obj = pool.get('account.analytic.account')
- res_partner_obj = pool.get('res.partner')
- account_payment_term_obj = pool.get('account.payment.term')
- account_ids = data['ids']
- invoices = []
+ data = self.read(cr, uid, ids, [], context)[0]
+ account_ids = 'active_ids' in context and context['active_ids'] or []
+
for account in analytic_account_obj.browse(cr, uid, account_ids, context):
partner = account.partner_id
amount_total=0.0
if (not partner) or not (account.pricelist_id):
- raise wizard.except_wizard(_('Analytic account incomplete'),
+ raise osv.except_osv(_('Analytic account incomplete'),
_('Please fill in the partner and pricelist field '
'in the analytic account:\n%s') % (account.name,))
@@ -67,15 +77,15 @@ class final_invoice_create(wizard.interface):
curr_invoice = {
'name': time.strftime('%D')+' - '+account.name,
'partner_id': account.partner_id.id,
- 'address_contact_id': pool.get('res.partner').address_get(cr, uid, [account.partner_id.id], adr_pref=['contact'])['contact'],
- 'address_invoice_id': pool.get('res.partner').address_get(cr, uid, [account.partner_id.id], adr_pref=['invoice'])['invoice'],
+ 'address_contact_id': self.pool.get('res.partner').address_get(cr, uid, [account.partner_id.id], adr_pref=['contact'])['contact'],
+ 'address_invoice_id': self.pool.get('res.partner').address_get(cr, uid, [account.partner_id.id], adr_pref=['invoice'])['invoice'],
'payment_term': partner.property_payment_term.id or False,
'account_id': partner.property_account_receivable.id,
'currency_id': account.pricelist_id.currency_id.id,
'date_due': date_due,
'fiscal_position': account.partner_id.property_account_position.id
}
- last_invoice = pool.get('account.invoice').create(cr, uid, curr_invoice)
+ last_invoice = self.pool.get('account.invoice').create(cr, uid, curr_invoice)
invoices.append(last_invoice)
context2=context.copy()
@@ -106,14 +116,14 @@ class final_invoice_create(wizard.interface):
line.product_uom_id,
move_line.ref""", (account.id,))
for product_id, amount, account_id, product_uom_id, ref in cr.fetchall():
- product = pool.get('product.product').browse(cr, uid, product_id, context2)
+ product = self.pool.get('product.product').browse(cr, uid, product_id, context2)
if product:
taxes = product.taxes_id
else:
taxes = []
- tax = pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
+ tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
curr_line = {
'price_unit': -amount,
'quantity': 1.0,
@@ -126,14 +136,14 @@ class final_invoice_create(wizard.interface):
'account_id': account_id,
'account_analytic_id': account.id
}
- pool.get('account.invoice.line').create(cr, uid, curr_line)
+ self.pool.get('account.invoice.line').create(cr, uid, curr_line)
- if not data['form']['balance_product']:
- raise wizard.except_wizard(_('Balance product needed'), _('Please fill a Balance product in the wizard'))
- product = pool.get('product.product').browse(cr, uid, data['form']['balance_product'], context2)
+ if not data['balance_product']:
+ raise osv.except_osv(_('Balance product needed'), _('Please fill a Balance product in the wizard'))
+ product = self.pool.get('product.product').browse(cr, uid, data['balance_product'], context2)
taxes = product.taxes_id
- tax = pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
+ tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
curr_line = {
'price_unit': account.amount_max - amount_total,
@@ -147,9 +157,9 @@ class final_invoice_create(wizard.interface):
'account_id': account_id,
'account_analytic_id': account.id
}
- pool.get('account.invoice.line').create(cr, uid, curr_line)
+ self.pool.get('account.invoice.line').create(cr, uid, curr_line)
if account.amount_max < amount_total:
- pool.get('account.invoice').write(cr, uid, [last_invoice], {'type': 'out_refund',})
+ self.pool.get('account.invoice').write(cr, uid, [last_invoice], {'type': 'out_refund',})
cr.execute('update account_analytic_line set invoice_id=%s where invoice_id is null and account_id=%s', (last_invoice, account.id))
return {
@@ -161,40 +171,9 @@ class final_invoice_create(wizard.interface):
'view_id': False,
'context': "{'type':'out_invoice'}",
'type': 'ir.actions.act_window',
- 'search_view_id': res['res_id']
- }
+ 'search_view_id': res['res_id']
+ }
+final_invoice_create()
- _create_form = """
-
-
-
-
-
-
-
-
-
"""
-
- _create_fields = {
- 'date': {'string':'Date', 'type':'boolean', 'help':"Display date in the history of works"},
- 'time': {'string':'Time spent', 'type':'boolean', 'help':"Display time in the history of works"},
- 'name': {'string':'Name of entry', 'type':'boolean', 'help':"Display detail of work in the invoice line."},
- 'price': {'string':'Cost', 'type':'boolean', 'help':"Display cost of the item you reinvoice"},
- 'balance_product': {'string':'Balance product', 'type': 'many2one', 'relation':'product.product', 'help':"The product that will be used to invoice the remaining amount."},
- }
-
- states = {
- 'init' : {
- 'actions' : [_get_defaults],
- 'result' : {'type':'form', 'arch':_create_form, 'fields':_create_fields, 'state': [('end','Cancel', 'gtk-cancel'),('create','Create invoices', 'gtk-ok')]},
- },
- 'create' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_do_create, 'state':'end'},
- },
- }
-final_invoice_create('hr.timesheet.final.invoice.create')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
index 7e5edca5474..89ff5e92697 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
@@ -19,52 +19,69 @@
#
##############################################################################
-import wizard
-import pooler
import time
+
+from osv import osv, fields
from tools.translate import _
-#
-# Create an invoice based on selected timesheet lines
+## Create an invoice based on selected timesheet lines
#
#
# TODO: check unit of measure !!!
#
-class invoice_create(wizard.interface):
- def _get_accounts(self, cr, uid, data, context):
- if not len(data['ids']):
+class hr_timesheet_invoice_create(osv.osv_memory):
+
+ _name = 'hr.timesheet.invoice.create'
+ _description = 'Create invoice from timesheet'
+ _columns = {
+ 'accounts': fields.many2many('account.analytic.account', 'invoice_id', 'account_id', 'Analytic Accounts', required=True),
+ 'date': fields.boolean('Date', help='The real date of each work will be displayed on the invoice'),
+ 'time': fields.boolean('Time spent', help='The time of each work done will be displayed on the invoice'),
+ 'name': fields.boolean('Name of entry', help='The detail of each work done will be displayed on the invoice'),
+ 'price': fields.boolean('Cost', help='The cost of each work done will be displayed on the invoice. You probably don\'t want to check this'),
+ 'product': fields.many2one('product.product', 'Product', help='Complete this field only if you want to force to use a specific product. Keep empty to use the real product that comes from the cost.'),
+ }
+
+ def _get_accounts(self, cr, uid, context=None):
+ if context is None:
+ context = {}
+ if not len(context['active_ids']):
return {}
#Checking whether the analytic line is invoiced or not
- pool = pooler.get_pool(cr.dbname)
- analytic_line_obj = pool.get('account.analytic.line').browse(cr, uid, data['ids'], context)
+ analytic_line_obj = self.pool.get('account.analytic.line').browse(cr, uid, context['active_ids'], context)
for obj_acc in analytic_line_obj:
if obj_acc.invoice_id and obj_acc.invoice_id.state !='cancel':
- raise wizard.except_wizard(_('Warning'),_('The analytic entry "%s" is already invoiced!')%(obj_acc.name,))
-
- cr.execute("SELECT distinct(account_id) from account_analytic_line where id =ANY(%s)",(data['ids'],))
- account_ids = cr.fetchall()
- return {'accounts': [x[0] for x in account_ids]}
+ raise osv.except_osv(_('Warning'),_('The analytic entry "%s" is already invoiced!')%(obj_acc.name,))
+
+ cr.execute("SELECT distinct(account_id) from account_analytic_line where id =ANY(%s)",(context['active_ids'],))
+ account_ids = cr.fetchall()
+ return [x[0] for x in account_ids]
+
+ _defaults = {
+ 'accounts': _get_accounts
+ }
+
+ def do_create(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ analytic_account_obj = self.pool.get('account.analytic.account')
+ res_partner_obj = self.pool.get('res.partner')
+ account_payment_term_obj = self.pool.get('account.payment.term')
+ invoices = []
- def _do_create(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- mod_obj = pool.get('ir.model.data')
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
res = mod_obj.read(cr, uid, result, ['res_id'])
- analytic_account_obj = pool.get('account.analytic.account')
- res_partner_obj = pool.get('res.partner')
- account_payment_term_obj = pool.get('account.payment.term')
- account_ids = data['form']['accounts'][0][2]
- invoices = []
+ data = self.read(cr, uid, ids, [], context)[0]
+ account_ids = data['accounts']
for account in analytic_account_obj.browse(cr, uid, account_ids, context):
partner = account.partner_id
if (not partner) or not (account.pricelist_id):
- raise wizard.except_wizard(_('Analytic Account incomplete'),
+ raise osv.except_osv(_('Analytic Account incomplete'),
_('Please fill in the Associate Partner and Sale Pricelist fields in the Analytic Account:\n%s') % (account.name,))
if not partner.address:
- raise wizard.except_wizard(_('Partner incomplete'),
+ raise osv.except_osv(_('Partner incomplete'),
_('Please fill in the Address field in the Partner: %s.') % (partner.name,))
date_due = False
@@ -90,7 +107,7 @@ class invoice_create(wizard.interface):
'date_due': date_due,
'fiscal_position': account.partner_id.property_account_position.id
}
- last_invoice = pool.get('account.invoice').create(cr, uid, curr_invoice)
+ last_invoice = self.pool.get('account.invoice').create(cr, uid, curr_invoice)
invoices.append(last_invoice)
context2=context.copy()
@@ -99,26 +116,26 @@ class invoice_create(wizard.interface):
"FROM account_analytic_line as line " \
"WHERE account_id = %s " \
"AND id =ANY(%s) AND to_invoice IS NOT NULL " \
- "GROUP BY product_id,to_invoice", (account.id,data['ids'],))
+ "GROUP BY product_id,to_invoice", (account.id,context['active_ids'],))
for product_id,factor_id,qty in cr.fetchall():
product = pool.get('product.product').browse(cr, uid, product_id, context2)
if not product:
- raise wizard.except_wizard(_('Error'), _('At least one line has no product !'))
+ raise osv.except_osv(_('Error'), _('At least one line has no product !'))
factor_name = ''
factor = pool.get('hr_timesheet_invoice.factor').browse(cr, uid, factor_id, context2)
- if not data['form']['product']:
+ if not data['product']:
if factor.customer_name:
factor_name = product.name+' - '+factor.customer_name
else:
factor_name = product.name
else:
- factor_name = pool.get('product.product').name_get(cr, uid, [data['form']['product']], context=context)[0][1]
+ factor_name = pool.get('product.product').name_get(cr, uid, [data['product']], context=context)[0][1]
if account.pricelist_id:
pl = account.pricelist_id.id
- price = pool.get('product.pricelist').price_get(cr,uid,[pl], data['form']['product'] or product_id, qty or 1.0, account.partner_id.id)[pl]
+ price = pool.get('product.pricelist').price_get(cr,uid,[pl], data['product'] or product_id, qty or 1.0, account.partner_id.id)[pl]
else:
price = 0.0
@@ -132,7 +149,7 @@ class invoice_create(wizard.interface):
'invoice_line_tax_id': [(6,0,tax )],
'invoice_id': last_invoice,
'name': factor_name,
- 'product_id': data['form']['product'] or product_id,
+ 'product_id': data['product'] or product_id,
'invoice_line_tax_id': [(6,0,tax)],
'uos_id': product.uom_id.id,
'account_id': account_id,
@@ -149,27 +166,27 @@ class invoice_create(wizard.interface):
for line in line_ids:
# set invoice_line_note
details = []
- if data['form']['date']:
+ if data['date']:
details.append(line['date'])
- if data['form']['time']:
+ if data['time']:
if line['product_uom_id']:
details.append("%s %s" % (line['unit_amount'], pool.get('product.uom').browse(cr, uid, [line['product_uom_id']])[0].name))
else:
details.append("%s" % (line['unit_amount'], ))
- if data['form']['name']:
+ if data['name']:
details.append(line['name'])
- #if data['form']['price']:
+ #if data['price']:
# details.append(abs(line['amount']))
note.append(u' - '.join(map(lambda x: unicode(x) or '',details)))
curr_line['note'] = "\n".join(map(lambda x: unicode(x) or '',note))
pool.get('account.invoice.line').create(cr, uid, curr_line)
- cr.execute("update account_analytic_line set invoice_id=%s WHERE account_id = %s and id =ANY(%s)" ,(last_invoice,account.id,data['ids']))
+ cr.execute("update account_analytic_line set invoice_id=%s WHERE account_id = %s and id =ANY(%s)" ,(last_invoice, account.id,data['ids']))
- pool.get('account.invoice').button_reset_taxes(cr, uid, [last_invoice], context)
+ self.pool.get('account.invoice').button_reset_taxes(cr, uid, [last_invoice], context)
- mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data')
- act_obj = pooler.get_pool(cr.dbname).get('ir.actions.act_window')
+ mod_obj = self.pool.get('ir.model.data')
+ act_obj = self.pool.get('ir.actions.act_window')
mod_id = mod_obj.search(cr, uid, [('name', '=', 'action_invoice_tree1')])[0]
res_id = mod_obj.read(cr, uid, mod_id, ['res_id'])['res_id']
@@ -190,45 +207,8 @@ class invoice_create(wizard.interface):
# 'search_view_id': res['res_id']
# }
- _create_form = """
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
"""
- _create_fields = {
- 'accounts': {'string':'Analytic Accounts', 'type':'many2many', 'required':'true', 'relation':'account.analytic.account'},
- 'date': {'string':'Date', 'type':'boolean', 'help':'The real date of each work will be displayed on the invoice'},
- 'time': {'string':'Time spent', 'type':'boolean', 'help':'The time of each work done will be displayed on the invoice'},
- 'name': {'string':'Name of entry', 'type':'boolean', 'help':'The detail of each work done will be displayed on the invoice'},
- 'price': {'string':'Cost', 'type':'boolean', 'help':'The cost of each work done will be displayed on the invoice. You probably don\'t want to check this.'},
- 'product': {'string':'Product', 'type':'many2one', 'relation': 'product.product', 'help':"Complete this field only if you want to force to use a specific product. Keep empty to use the real product that comes from the cost."},
- }
-
- states = {
- 'init' : {
- 'actions' : [_get_accounts],
- 'result' : {'type':'form', 'arch':_create_form, 'fields':_create_fields, 'state': [('end','Cancel', 'gtk-cancel'),('create','Create Invoices', 'gtk-ok')]},
- },
- 'create' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_do_create, 'state':'end'},
- },
- }
-invoice_create('hr.timesheet.invoice.create')
+hr_timesheet_invoice_create()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_final_view.xml b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_final_view.xml
new file mode 100644
index 00000000000..7b3f5ed4d6a
--- /dev/null
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_final_view.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+ hr.timesheet.invoice.create.final.form
+ hr.timesheet.invoice.create.final
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Final Invoice
+ ir.actions.act_window
+ hr.timesheet.invoice.create.final
+ form
+ form
+ new
+
+
+
+
+
+ Final Invoice
+ client_action_multi
+
+ action
+ account.analytic.account
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_view.xml b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_view.xml
new file mode 100644
index 00000000000..7ddf3bc99a7
--- /dev/null
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_view.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+ hr.timesheet.invoice.create.form
+ hr.timesheet.invoice.create
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Invoice analytic lines
+ ir.actions.act_window
+ hr.timesheet.invoice.create
+ form
+ form
+ new
+
+
+
+
+
+ Invoice analytic lines
+ client_action_multi
+
+ action
+ account.analytic.line
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_timesheet_sheet/__init__.py b/addons/hr_timesheet_sheet/__init__.py
index 46961316bb4..d7635359c74 100644
--- a/addons/hr_timesheet_sheet/__init__.py
+++ b/addons/hr_timesheet_sheet/__init__.py
@@ -21,6 +21,6 @@
import hr_timesheet_sheet
import wizard
-
+import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_timesheet_sheet/__openerp__.py b/addons/hr_timesheet_sheet/__openerp__.py
index 9042d4200f1..44058d048cb 100644
--- a/addons/hr_timesheet_sheet/__openerp__.py
+++ b/addons/hr_timesheet_sheet/__openerp__.py
@@ -52,7 +52,8 @@ The validation can be configured in te company:
'security/hr_timesheet_data.xml',
'hr_timesheet_sheet_view.xml',
'hr_timesheet_workflow.xml',
- 'process/hr_timesheet_sheet_process.xml'
+ 'process/hr_timesheet_sheet_process.xml',
+ 'report/timesheet_report_view.xml',
],
'demo_xml': ['hr_timesheet_sheet_demo.xml'],
'installable': True,
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
index 81b86fecfa6..04d9451a4bf 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
@@ -20,7 +20,18 @@
-
+
+ hr.timesheet.sheet.graph
+ hr_timesheet_sheet.sheet
+ graph
+
+
+
+
+
+
+
+ hr.timesheet.account.formhr_timesheet_sheet.sheet.account
@@ -181,7 +192,7 @@
-
+
diff --git a/addons/hr_timesheet_sheet/report/__init__.py b/addons/hr_timesheet_sheet/report/__init__.py
new file mode 100644
index 00000000000..89f12b7c9a6
--- /dev/null
+++ b/addons/hr_timesheet_sheet/report/__init__.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# 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 .
+#
+##############################################################################
+
+import timesheet_report
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report.py b/addons/hr_timesheet_sheet/report/timesheet_report.py
new file mode 100644
index 00000000000..ee016df56d7
--- /dev/null
+++ b/addons/hr_timesheet_sheet/report/timesheet_report.py
@@ -0,0 +1,94 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# 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 .
+#
+##############################################################################
+
+import tools
+from osv import fields,osv
+
+class timesheet_report(osv.osv):
+ _name = "timesheet.report"
+ _description = "Timesheet"
+ _auto = False
+ _columns = {
+ 'year': fields.char('Year',size=64,required=False, readonly=True),
+ 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
+ ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
+ ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
+ 'day': fields.char('Day', size=128, readonly=True),
+ 'name': fields.char('Description', size=64,readonly=True),
+ 'user_id': fields.many2one('res.users', 'User',readonly=True),
+ 'nbr': fields.integer('#Nbr',readonly=True),
+ 'company_id': fields.many2one('res.company', 'Company',readonly=True),
+ 'department_id':fields.many2one('hr.department','Department',readonly=True),
+ 'date_from': fields.date('Date from',readonly=True,),
+ 'date_to': fields.date('Date to',readonly=True),
+ 'date_current': fields.date('Current date', required=True),
+ 'state' : fields.selection([
+ ('new', 'New'),
+ ('draft','Draft'),
+ ('confirm','Confirmed'),
+ ('done','Done')], 'State', readonly=True),
+ 'total_att': fields.float('Total Timesheet',readonly=True),
+ 'total_ts': fields.float('Total Attendance',readonly=True),
+ 'total_diff': fields.float('Difference', readonly=True),
+ }
+
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'timesheet_report')
+ cr.execute("""
+ create or replace view timesheet_report as (
+ select
+ min(aal.id) as id,
+ htss.date_current,
+ htss.name,
+ htss.date_from,
+ htss.date_to,
+ to_char(htss.date_current,'YYYY') as year,
+ to_char(htss.date_current,'MM') as month,
+ to_char(htss.date_current, 'YYYY-MM-DD') as day,
+ count(*) as nbr,
+ sum(day.total_attendance) as total_att,
+ sum(day.total_timesheet) as total_ts,
+ sum(day.total_difference) as total_diff,
+ aal.account_id,
+ htss.user_id,
+ htss.company_id,
+ htss.department_id,
+ htss.state
+ from account_analytic_line as aal
+ left join hr_analytic_timesheet as hat ON (hat.line_id=aal.id)
+ left join hr_timesheet_sheet_sheet as htss ON (hat.line_id=htss.id)
+ left join hr_timesheet_sheet_sheet_day AS day ON (htss.id = day.sheet_id)
+ group by
+ to_char(htss.date_current,'YYYY'),
+ to_char(htss.date_current,'MM'),
+ to_char(htss.date_current, 'YYYY-MM-DD'),
+ aal.account_id,
+ htss.date_from,
+ htss.date_to,
+ htss.date_current,
+ htss.name,
+ htss.company_id,
+ htss.state,
+ htss.department_id,
+ htss.user_id
+ )
+ """)
+timesheet_report()
\ No newline at end of file
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
new file mode 100644
index 00000000000..976b2a6f8ea
--- /dev/null
+++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
@@ -0,0 +1,119 @@
+
+
+
+
+ timesheet.report.graph
+ timesheet.report
+ graph
+
+
+
+
+
+
+
+
+
+
+ timesheet.report.tree
+ timesheet.report
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ timesheet.report.search
+ timesheet.report
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Timesheet
+ timesheet.report
+ form
+ tree,graph
+ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
+
+
+
+
+
diff --git a/addons/hr_timesheet_sheet/wizard/__init__.py b/addons/hr_timesheet_sheet/wizard/__init__.py
index f6fba6021af..485bfbe5db2 100644
--- a/addons/hr_timesheet_sheet/wizard/__init__.py
+++ b/addons/hr_timesheet_sheet/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,12 +15,11 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
-import wizard_timesheet_current
-import wizard_timesheet_department
+import hr_timesheet_current
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_timesheet_sheet/wizard/wizard_timesheet_current.py b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py
similarity index 73%
rename from addons/hr_timesheet_sheet/wizard/wizard_timesheet_current.py
rename to addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py
index 8613df3bc82..4d9998014c8 100644
--- a/addons/hr_timesheet_sheet/wizard/wizard_timesheet_current.py
+++ b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,27 +15,27 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
-
-
-import wizard
-import netsvc
import time
-import pooler
-from osv import osv
+
+from osv import osv, fields
from tools.translate import _
-class wiz_timesheet_open(wizard.interface):
- def _open_timesheet(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- user_ids = pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)])
- if not len(user_ids):
- raise wizard.except_wizard(_('Error !'), _('No employee defined for your user !'))
- ts = pool.get('hr_timesheet_sheet.sheet')
- ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))])
+class hr_timesheet_current_open(osv.osv_memory):
+ _name = 'hr.timesheet.current.open'
+ _description = 'hr.timesheet.current.open'
+
+ def open_timesheet(self, cr, uid, ids, context=None):
+ ts = self.pool.get('hr_timesheet_sheet.sheet')
view_type = 'form,tree'
+
+ user_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)])
+ if not len(user_ids):
+ raise osv.except_osv(_('Error !'), _('No employee defined for your user !'))
+ ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))])
+
if len(ids) > 1:
view_type = 'tree,form'
domain = "[('id','in',["+','.join(map(str, ids))+"]),('user_id', '=', uid)]"
@@ -46,7 +46,7 @@ class wiz_timesheet_open(wizard.interface):
domain = "[('user_id', '=', uid)]"
value = {
'domain': domain,
- 'name': 'Open timesheet',
+ 'name': 'Open Timesheet',
'view_type': 'form',
'view_mode': view_type,
'res_model': 'hr_timesheet_sheet.sheet',
@@ -57,14 +57,6 @@ class wiz_timesheet_open(wizard.interface):
value['res_id'] = ids[0]
return value
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_open_timesheet, 'state':'end'}
- }
- }
-wiz_timesheet_open('hr_timesheet_sheet.current.open')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+hr_timesheet_current_open()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet_sheet/wizard/wizard_timesheet_department.py b/addons/hr_timesheet_sheet/wizard/wizard_timesheet_department.py
deleted file mode 100644
index 93aa12045ba..00000000000
--- a/addons/hr_timesheet_sheet/wizard/wizard_timesheet_department.py
+++ /dev/null
@@ -1,114 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# 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 .
-#
-##############################################################################
-
-
-import wizard
-import netsvc
-import time
-import pooler
-from osv import osv
-
-class wiz_timesheet_open(wizard.interface):
- def _open_timesheet(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- dep_ids = pool.get('hr.department').search(cr, uid, [('manager_id','=',uid)])
- user_ids = {}
- for dep in pool.get('hr.department').browse(cr, uid, dep_ids, context):
- for user in dep.member_ids:
- user_ids[user.id] = 1
- value = {
- 'domain': "[('user_id', 'in', "+str(user_ids.keys())+")]",
- 'name': 'Timesheets',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'hr_timesheet_sheet.sheet',
- 'view_id': False,
- 'type': 'ir.actions.act_window'
- }
- return value
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_open_timesheet, 'state':'end'}
- }
- }
-wiz_timesheet_open('hr_timesheet_sheet.department.open')
-
-class wiz_timesheet_confirm_open(wizard.interface):
- def _open_timesheet(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- dep_ids = pool.get('hr.department').search(cr, uid, [('manager_id','=',uid)])
- user_ids = {}
- for dep in pool.get('hr.department').browse(cr, uid, dep_ids, context):
- for user in dep.member_ids:
- user_ids[user.id] = 1
- value = {
- 'domain': "[('user_id', 'in', "+str(user_ids.keys())+"),('state','=','draft')]",
- 'name': 'Timesheets',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'hr_timesheet_sheet.sheet',
- 'view_id': False,
- 'type': 'ir.actions.act_window'
- }
- return value
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_open_timesheet, 'state':'end'}
- }
- }
-wiz_timesheet_confirm_open('hr_timesheet_sheet.department.confirm.open')
-
-
-class wiz_timesheet_validate_open(wizard.interface):
- def _open_timesheet(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- dep_ids = pool.get('hr.department').search(cr, uid, [('manager_id','=',uid)])
- user_ids = {}
- for dep in pool.get('hr.department').browse(cr, uid, dep_ids, context):
- for user in dep.member_ids:
- user_ids[user.id] = 1
- value = {
- 'domain': "[('user_id', 'in', "+str(user_ids.keys())+"),('state','=','confirm')]",
- 'name': 'Timesheets',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'hr_timesheet_sheet.sheet',
- 'view_id': False,
- 'type': 'ir.actions.act_window'
- }
- return value
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_open_timesheet, 'state':'end'}
- }
- }
-wiz_timesheet_validate_open('hr_timesheet_sheet.department.validate.open')
-
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index 2c33f69d577..5b8b7c41084 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -618,7 +618,8 @@
- formtree,form,calendar,graph,gantt
- {"search_default_current":1}
@@ -852,7 +852,7 @@
-
+ mrp.procurementform
- {"search_default_current":1}
@@ -325,7 +322,7 @@
-
+
@@ -340,9 +337,5 @@
id="menu_view_olap_application_field_form"
parent="menu_bi_conf_known_application"/>
-
-
-
-
diff --git a/addons/olap/olap.py b/addons/olap/olap.py
index 338d61f81fa..6097c6dbf14 100644
--- a/addons/olap/olap.py
+++ b/addons/olap/olap.py
@@ -96,8 +96,8 @@ class olap_fact_database(osv.osv):
raise osv.except_osv('Error (cx_Oracle) : ', e)
except Exception,e:
- raise osv.except_osv('BI Error !', e)
-
+ raise osv.except_osv('Error !', e)
+ raise osv.except_osv('Message', 'Connection Successful !')
return True
_columns = {
diff --git a/addons/olap/test/olap_test00.yml b/addons/olap/test/olap_test00.yml
new file mode 100644
index 00000000000..af87950468f
--- /dev/null
+++ b/addons/olap/test/olap_test00.yml
@@ -0,0 +1,111 @@
+-
+ In order to check olap module which is used to configure BI from OpenERP client.I create olap fact database record.
+-
+ !record {model: olap.fact.database, id: olap_fact_database_openerp0}:
+ connection_type: port
+ db_host: localhost
+ db_login: postgres
+ db_name: tiny
+ db_password: '123456'
+ db_port: 5432
+ name: OpenERP
+ type: postgres
+-
+ I will check the connection for successful login. >>>>>>(Problem)
+# !python {model: olap.fact.database}: |
+ # self.test_connection(cr, uid,[ref('olap_fact_database_openerp0')], context)
+-
+ In order to test schema,I create a new schema record.
+-
+ !record {model: olap.schema, id: olap_schema_Partners0}:
+ database_id: olap_fact_database_openerp0
+ name: Partners
+-
+ I press "Connect to Database" and I see that the Schema State is "Database Connected" now
+-
+ !workflow {model: olap.schema, action: dbconnect, ref: olap_schema_Partners0}
+-
+ Now I will load the structure of the database. by structure we mean tables, columns and the relations. This will help in defining cube easily.
+-
+ !record {model: bi.load.db.wizard, id: bi_load_db_wizard_0}:
+ db_name: OpenERP
+ fact_table: Partners
+-
+ I can see two buttons for Configuration one for manually and the other is for Automatically.I press "Configure Automatically".After configuration I can see that the Boolean Configuring Data-structure is True now Schema State is "The Structure is Configured" and there is one button "Mark as Configured"
+-
+ !record {model: bi.auto.configure.wizard, id: bi_auto_configure_wizard_Partners0}:
+ name: Partners
+-
+ Performing a workflow action load on module olap.schema
+-
+ !workflow {model: olap.schema, action: dbload, ref: olap_schema_Partners0}
+-
+ Performing a workflow action configure on module olap.schema
+-
+ !workflow {model: olap.schema, action: dbconfigure, ref: olap_schema_Partners0}
+-
+ Performing a workflow action dbready on module olap.schema
+-
+ !workflow {model: olap.schema, action: dbready, ref: olap_schema_Partners0}
+-
+ In order to create Cube I first define the fact table.Fact table are the key tables in which measures are stored and we can branch to other tables for other parameters.
+-
+ !record {model: olap.database.tables, id: database_table_res_partner}:
+ active: True
+ fact_database_id: fact_database_terp
+ name: res_partner
+ table_db_name: res_partner
+-
+ I create cube table and select ID of as Relational Column.Then I select related record in Joined tables.
+-
+ !record {model: olap.cube.table, id: olap_cube_table_partnercubetable0}:
+ column_link_id: olap.columns_res_partner_id
+ name: Partner cube table
+ available_table_ids:
+ - olap.columns_res_partner_date
+ - olap.columns_res_partner_id
+ - olap.columns_res_partner_credit_limit
+ - olap.columns_res_partner_user_id
+
+-
+ I can configure Cube from BI Cube Designer.I make sure that OpenERP BI web-client is running.From Configuration I click on "Cube Designer" and It will open Cube Designer in my system browser.I can see that the schema "Partners" is visible through Cube Designer.
+-
+ Creating olap cube
+-
+ !record {model: olap.cube, id: olap_cube_partnercube0}:
+ name: Partner cube
+ query_log: true
+ schema_id: olap_schema_Partners0
+ table_id: olap_cube_table_partnercubetable0
+-
+ After cube we can decide upon the dimensions to be used for the cube.In order to analyze Partner I create one dimension.
+-
+ !record {model: olap.dimension, id: olap_dimension_products0}:
+ name: Products
+ cube_id: olap_cube_partnercube0
+-
+ After adding the dimension I create hierarchy.
+-
+ !record {model: olap.hierarchy, id: olap_hierarchy_allproducts0}:
+ dimension_id: olap_dimension_products0
+ name: All Products
+ sequence: 1
+ table_id: olap_cube_table_partnercubetable0
+-
+ After adding the hierarchy I create level.I select Product's default_code as Columns Name that is loaded in Fact columns.
+-
+ !record {model: olap.level, id: olap_level_productscode0}:
+ column_id_name: name
+ column_name: olap.columns_res_user_name
+ hierarchy_id: olap_hierarchy_allproducts0
+ name: Products code
+ sequence: 1
+ table_name: res_users
+ type: normal
+-
+ I will check that columns is loaded in Fact Table.
+-
+ !python {model: olap.load.column}: |
+ ids = self.search(cr, uid, [])
+ self.get_table_data(cr, uid, ids, {'active_ids': [ref('olap_cube_table_partnercubetable0')]})
+
diff --git a/addons/olap/wizard/olap_load_column.py b/addons/olap/wizard/olap_load_column.py
index 422a50abcff..65517626d62 100644
--- a/addons/olap/wizard/olap_load_column.py
+++ b/addons/olap/wizard/olap_load_column.py
@@ -26,7 +26,6 @@ class olap_load_column(osv.osv_memory):
_description = "Olap Load Column"
def get_table_data(self, cr, uid, ids, context={}):
-
"""
This function load column
@param cr: the current row, from the database cursor,
diff --git a/addons/olap_extract/i18n/zh_CN.po b/addons/olap_extract/i18n/zh_CN.po
deleted file mode 100644
index d38f5a530e8..00000000000
--- a/addons/olap_extract/i18n/zh_CN.po
+++ /dev/null
@@ -1,56 +0,0 @@
-# Chinese (Simplified) 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 , 2010.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: openobject-addons\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-11-26 05:29+0000\n"
-"PO-Revision-Date: 2010-04-08 02:07+0000\n"
-"Last-Translator: Silence \n"
-"Language-Team: Chinese (Simplified) \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:21+0000\n"
-"X-Generator: Launchpad (build Unknown)\n"
-
-#. module: olap_extract
-#: model:ir.module.module,shortdesc:olap_extract.module_meta_information
-msgid "olap_extract"
-msgstr ""
-
-#. module: olap_extract
-#: wizard_button:olap.extract.schema,init,ok:0
-msgid "OK"
-msgstr "确定"
-
-#. module: olap_extract
-#: model:ir.actions.wizard,name:olap_extract.bi_olap_extract_schema
-msgid "Olap Extract"
-msgstr "Olap提取"
-
-#. module: olap_extract
-#: model:ir.module.module,description:olap_extract.module_meta_information
-msgid ""
-"\n"
-" Extracts the schema structure.\n"
-" "
-msgstr ""
-
-#. module: olap_extract
-#: wizard_field:olap.extract.schema,init,module_name:0
-msgid "Module Name"
-msgstr "模块名称"
-
-#. module: olap_extract
-#: wizard_button:olap.extract.schema,init,end:0
-msgid "Cancel"
-msgstr "取消"
-
-#. module: olap_extract
-#: wizard_view:olap.extract.schema,init:0
-msgid "New Module Name"
-msgstr "新的模块名"
diff --git a/addons/product/partner_view.xml b/addons/product/partner_view.xml
index 61ef58b8941..66e4ba84c37 100644
--- a/addons/product/partner_view.xml
+++ b/addons/product/partner_view.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/addons/product/pricelist_view.xml b/addons/product/pricelist_view.xml
index 0d4685593c3..604c2b75324 100644
--- a/addons/product/pricelist_view.xml
+++ b/addons/product/pricelist_view.xml
@@ -2,10 +2,7 @@
-
+
product.pricelist.version.form
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 86f10e46b97..196b70eceb1 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -30,7 +30,7 @@
-
+
@@ -49,7 +49,7 @@
-
@@ -110,18 +110,22 @@
-
+
-
+
-
+
+
+
+
+
@@ -152,7 +156,6 @@
form[]
- {"search_default_open":1,"search_default_member":1}
@@ -403,25 +406,25 @@
-
+
-
+
-
+
-
-
+
+
@@ -440,8 +443,8 @@
tree,form,calendar,gantt,graph
- {"search_default_current":1,"search_default_my_task":1}
+
@@ -535,25 +538,25 @@
- res.users.project.form1
- res.users
- form
-
-
-
-
-
-
-
+ res.users.project.form1
+ res.users
+ form
+
+
+
+
+
+
+
- view.users.form.project.modif.inherited1
- res.users
-
- form
-
-
+ view.users.form.project.modif.inherited1
+ res.users
+
+ form
+
+
@@ -603,12 +606,12 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/addons/project/report/__init__.py b/addons/project/report/__init__.py
index 3c104dc54ec..295b8c9674d 100644
--- a/addons/project/report/__init__.py
+++ b/addons/project/report/__init__.py
@@ -19,5 +19,6 @@
#
##############################################################################
import project_report
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project/report/project_report.py b/addons/project/report/project_report.py
index 5c28d106c22..e4cd21f0b48 100644
--- a/addons/project/report/project_report.py
+++ b/addons/project/report/project_report.py
@@ -27,25 +27,42 @@ class report_project_task_user(osv.osv):
_description = "Tasks by user and project"
_auto = False
_columns = {
- 'name': fields.char('Year',size=64,required=False, readonly=True),
+ 'name': fields.char('Task Summary', size=128, readonly=True),
+ 'day': fields.char('Day', size=128, readonly=True),
+ 'year': fields.char('Year',size=64,required=False, readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
- 'date_start': fields.datetime('Starting Date'),
- 'date_end': fields.datetime('Ending Date'),
- 'date_deadline': fields.date('Deadline'),
+ 'date_start': fields.datetime('Starting Date',readonly=True),
+ 'no_of_days': fields.integer('#Days', size=128, readonly=True),
+ 'description': fields.text('Description',readonly=True),
+ 'date_end': fields.datetime('Ending Date',readonly=True),
+ 'date_deadline': fields.date('Deadline',readonly=True),
'project_id':fields.many2one('project.project', 'Project', readonly=True),
'hours_planned': fields.float('Planned Hours', readonly=True),
'hours_effective': fields.float('Effective Hours', readonly=True),
'hours_delay': fields.float('Avg. Plan.-Eff.', readonly=True),
- 'closing_days': fields.char('Avg Closing Delay', size=64, readonly=True),
+# 'closing_days': fields.char('Avg Closing Delay', size=64, readonly=True),
+ 'closing_days': fields.float('Avg Closing Delay', digits=(16,2), readonly=True, group_operator="avg",
+ help="Number of Days to close the task"),
+
'nbr': fields.integer('#Number of tasks', readonly=True),
+ 'priority' : fields.selection([('4','Very Low'),
+ ('3','Low'),
+ ('2','Medium'),
+ ('1','Urgent'),
+ ('0','Very urgent')],
+ 'Importance',readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
- 'state': fields.selection([('draft', 'Draft'),
+ 'state': fields.selection([
+ ('draft', 'Draft'),
('open', 'In Progress'),
('pending', 'Pending'),
('cancelled', 'Cancelled'),
('done', 'Done')],
'State', readonly=True),
+ 'company_id': fields.many2one('res.company', 'Company',readonly=True),
+ 'partner_id': fields.many2one('res.partner', 'Partner',readonly=True),
+ 'type': fields.many2one('project.task.type', 'Stage',readonly=True),
}
_order = 'name desc, project_id'
@@ -55,17 +72,24 @@ class report_project_task_user(osv.osv):
create or replace view report_project_task_user as (
select
min(t.id) as id,
- to_char(date_start, 'YYYY') as name,
+ to_char(date_start, 'YYYY') as year,
to_char(date_start, 'MM') as month,
+ to_char(date_start, 'YYYY-MM-DD') as day,
count(distinct t.id) as nbr,
date_trunc('day',t.date_start) as date_start,
date_trunc('day',t.date_end) as date_end,
- date_trunc('day',t.date_deadline) as date_deadline,
+ to_date(to_char(t.date_deadline, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_deadline,
+ sum(cast(to_char(date_trunc('day',t.date_end) - date_trunc('day',t.date_start),'DD') as int)) as no_of_days,
t.user_id,
t.project_id,
t.state,
+ t.priority,
+ t.name,
+ t.company_id,
+ t.partner_id,
+ t.type,
sum(planned_hours) as hours_planned,
- to_char(avg(date_end::abstime-t.create_date::timestamp), 'DD"d" HH24:MI:SS') as closing_days,
+ avg(extract('epoch' from (t.date_end-t.create_date)))/(3600*24) as closing_days,
sum(w.hours) as hours_effective,
((sum(planned_hours)-sum(w.hours))/count(distinct t.id))::decimal(16,2) as hours_delay
from project_task t
@@ -73,12 +97,119 @@ class report_project_task_user(osv.osv):
group by
to_char(date_start, 'YYYY'),
to_char(date_start, 'MM'),
- t.user_id,t.state,t.date_end,
- t.date_deadline,t.date_start,
- t.project_id
+ t.priority,
+ t.user_id,
+ t.state,
+ date_trunc('day',t.date_end),
+ to_date(to_char(t.date_deadline, 'dd-MM-YYYY'),'dd-MM-YYYY'),
+ date_trunc('day',t.date_start),
+ t.company_id,
+ t.partner_id,
+ t.type,
+ t.name,
+ t.project_id,
+ t.date_start
)
""")
report_project_task_user()
+#This class is generated for project deshboard purpose
+class project_vs_remaining_hours(osv.osv):
+ _name = "project.vs.remaining.hours"
+ _description = " Project vs Remaining hours"
+ _auto = False
+ _columns = {
+ 'project': fields.char('Project', size=128, required=True),
+ 'remaining_hours': fields.float('Remaining Hours', readonly=True),
+ 'state': fields.selection([('draft','Draft'),('open','Open'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Close'),('template', 'Template')], 'State', required=True,readonly=True)
+ }
+ _order = 'project desc'
+ def init(self, cr):
+ tools.sql.drop_view_if_exists(cr, 'project_vs_remaining_hours')
+ cr.execute("""
+ create or replace view project_vs_remaining_hours as (
+ select
+ min(pt.id) as id,
+ aaa.user_id as uid,
+ aaa.name as project,
+ aaa.state,
+ sum(pt.remaining_hours) as remaining_hours
+ from project_project as pp,
+ account_analytic_account as aaa,
+ project_task as pt
+ where aaa.id=pp.category_id and pt.project_id=pp.id and pp.category_id=aaa.id
+ group by aaa.user_id,aaa.state,aaa.name
+ UNION All
+ select
+ min(pt.id) as id,
+ pur.uid as uid,
+ aaa.name as project,
+ aaa.state,
+ sum(pt.remaining_hours) as remaining_hours
+ from project_project as pp,
+ project_user_rel as pur,
+ account_analytic_account as aaa,
+ project_task as pt
+ where pur.project_id=pp.id and pt.project_id=pp.id and pp.category_id=aaa.id
+ group by pur.uid,aaa.state,aaa.name
+ )
+ """)
+project_vs_remaining_hours()
+
+class task_by_days(osv.osv):
+ _name = "task.by.days"
+ _description = "Task By Days"
+ _auto = False
+ _columns = {
+ 'day': fields.char('Day', size=128, required=True),
+ 'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True),
+ 'total_task': fields.float('Total tasks', readonly=True),
+ 'project_id':fields.many2one('project.project','Project')
+ }
+ _order = 'day desc'
+ def init(self, cr):
+ tools.sql.drop_view_if_exists(cr, 'task_by_days')
+ cr.execute("""
+ create or replace view task_by_days as (
+ select
+ min(pt.id) as id,
+ to_char(pt.create_date, 'YYYY-MM-DD') as day,
+ count(*) as total_task,
+ pt.state as state,
+ pt.project_id
+ from
+ project_task as pt
+ group by
+ to_char(pt.create_date, 'YYYY-MM-DD'),pt.state,pt.project_id
+ )
+ """)
+task_by_days()
+
+class task_by_days_vs_planned_hours(osv.osv):
+ _name = "task.by.days.vs.planned.hours"
+ _description = "Task By Days vs Planned Hours"
+ _auto = False
+ _columns = {
+ 'day': fields.char('Day', size=128, required=True),
+ 'planned_hour': fields.float('Planned Hours', readonly=True),
+ 'project_id':fields.many2one('project.project','Project')
+ }
+ _order = 'day desc'
+ def init(self, cr):
+ tools.sql.drop_view_if_exists(cr, 'task_by_days_vs_planned_hours')
+ cr.execute("""
+ create or replace view task_by_days_vs_planned_hours as (
+ select
+ min(pt.id) as id,
+ to_char(pt.create_date, 'YYYY-MM-DD') as day,
+ sum(planned_hours) as planned_hour,
+ pt.project_id
+ from
+ project_task as pt
+ group by
+ to_char(pt.create_date, 'YYYY-MM-DD'),pt.project_id
+ )
+ """)
+task_by_days_vs_planned_hours()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index 09a4374b156..9ee400e6472 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -9,51 +9,128 @@
tree
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ report.project.task.user.graph
+ report.project.task.user
+ graph
+
+
+
+
+
+
+
+
+
report.project.task.user.searchreport.project.task.usersearch
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
-
+
+
-
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -63,11 +140,117 @@
Tasksreport.project.task.userform
- tree
- {"search_default_my_task":1}
+ tree,graph
+ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
+
+
+
+ project.vs.remaining.hour.tree
+ project.vs.remaining.hours
+ tree
+
+
+
+
+
+
+
+
+
+
+ project.vs.remaining.hour.graph
+ project.vs.remaining.hours
+ graph
+
+
+
+
+
+
+
+
+
+
+ Project and remaining hours
+ project.vs.remaining.hours
+ form
+ graph,tree
+ [('uid','=',uid)]
+
+
+
+
+ task.by.days.tree
+ task.by.days
+ tree
+
+
+
+
+
+
+
+
+
+
+ task.by.days.graph
+ task.by.days
+ graph
+
+
+
+
+
+
+
+
+
+
+
+ Task By Days
+ task.by.days
+ form
+ graph,tree
+ [('day','<=',time.strftime('%Y-%m-%d')),('day','>=', time.strftime('%Y-%m-%d', time.localtime(time.time()-(15*24*3600))))]
+
+
+
+
+
+ task.by.days.vs.planned.hours.tree
+ task.by.days.vs.planned.hours
+ tree
+
+
+
+
+
+
+
+
+
+ task.by.days.vs.planned.hours.graph
+ task.by.days.vs.planned.hours
+ graph
+
+
+
+
+
+
+
+
+
+
+ Task By Days vs Planned Hours
+ task.by.days.vs.planned.hours
+ form
+ graph,tree
+
+
diff --git a/addons/project/security/ir.model.access.csv b/addons/project/security/ir.model.access.csv
index abedc99cfd6..f31c6f0401f 100644
--- a/addons/project/security/ir.model.access.csv
+++ b/addons/project/security/ir.model.access.csv
@@ -14,3 +14,6 @@
"access_project_message","project.message","model_project_message","project.group_project_user",1,0,0,0
"access_project_installer","project.installer","model_project_installer","project.group_project_user",1,0,0,0
"access_report_project_task_user","report.project.task.user","model_report_project_task_user","project.group_project_manager",1,0,0,0
+"access_project_vs_remaining_hours","project.vs.remaining.hours","model_project_vs_remaining_hours","project.group_project_user",1,1,1,1
+"access_task_by_days_vs_planned_hours","task.by.days.vs.planned.hour","model_task_by_days_vs_planned_hours","project.group_project_user",1,1,1,1
+"access_task_by_days","task.by.days","model_task_by_days","project.group_project_user",1,1,1,1
diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py
index ef1e002ae78..775e4b933f0 100755
--- a/addons/project_issue/report/project_issue_report.py
+++ b/addons/project_issue/report/project_issue_report.py
@@ -7,15 +7,20 @@ class project_issue_report(osv.osv):
_auto = False
_inherit = "crm.case.report"
_columns = {
- 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'project.issue.report')]"),
- 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'project.issue.report')]"),
- 'nbr': fields.integer('# of Issues', reaadonly=True),
- 'delay_close': fields.char('Delay to close', size=20, readonly=True),
+ 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'project.issue')]"),
+ 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'project.issue')]"),
+ 'nbr': fields.integer('# of Issues', readonly=True),
+ 'delay_close': fields.float('Avg Closing Delay', digits=(16,2), readonly=True, group_operator="avg",
+ help="Number of Days to close the project issue"),
'company_id' : fields.many2one('res.company', 'Company'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
- 'project_id':fields.many2one('project.project', 'Project'),
- 'type_id': fields.many2one('crm.case.resource.type', 'Bug Type', domain="[('object_id.model', '=', 'project.issue')]"),
+ 'project_id':fields.many2one('project.project', 'Project',readonly=True),
+ 'type_id': fields.many2one('crm.case.resource.type', 'Type', domain="[('object_id.model', '=', 'project.issue')]"),
'date_closed': fields.datetime('Close Date', readonly=True),
+ 'assigned_to' : fields.many2one('res.users', 'Assigned to',readonly=True),
+ 'partner_id': fields.many2one('res.partner','Partner',domain="[('object_id.model', '=', 'project.issue')]"),
+ 'canal_id': fields.many2one('res.partner.canal', 'Channel',readonly=True),
+ 'task_id': fields.many2one('project.task', 'Task',domain="[('object_id.model', '=', 'project.issue')]" )
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'project_issue_report')
@@ -25,6 +30,7 @@ class project_issue_report(osv.osv):
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
+ to_char(c.create_date, 'YYYY-MM-DD') as day,
c.state,
c.user_id,
c.section_id,
@@ -35,18 +41,41 @@ class project_issue_report(osv.osv):
c.priority as priority,
c.project_id as project_id,
c.type_id as type_id,
- count(*) as nbr,
- to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
+ count(*) as nbr,
+ c.assigned_to,
+ c.partner_id,
+ c.canal_id,
+ c.task_id,
+ date_trunc('day',c.create_date) as create_date,
+ avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
from
project_issue c
left join
res_users u on (c.id = u.id)
- group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.categ_id,c.stage_id
- ,c.date_closed,u.company_id,c.priority,c.project_id,c.type_id
+ group by
+ to_char(c.create_date, 'YYYY'),
+ to_char(c.create_date, 'MM'),
+ to_char(c.create_date, 'YYYY-MM-DD'),
+ c.state,
+ c.user_id,
+ c.section_id,
+ c.categ_id,
+ c.stage_id,
+ c.date_closed,
+ u.company_id,
+ c.priority,
+ c.project_id,
+ c.type_id,
+ date_trunc('day',c.create_date),
+ c.assigned_to,
+ c.partner_id,
+ c.canal_id,
+ c.task_id
)""")
project_issue_report()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml
index 72d665cdff0..24290530be7 100755
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -7,23 +7,28 @@
project.issue.reporttree
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
-
+
+
+
+
+
@@ -45,39 +50,34 @@
search
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -85,8 +85,15 @@
-
-
+
+
+
+
+
+
+
+
+
@@ -97,6 +104,7 @@
project.issue.reportformgraph,tree
+ {"search_default_This Month":1,"search_default_User":1,'group_by_no_leaf':1,'group_by':[]}
@@ -117,5 +125,7 @@
+
+
-
+
\ No newline at end of file
diff --git a/addons/project_long_term/project_long_term_view.xml b/addons/project_long_term/project_long_term_view.xml
index 0be0f88a576..ae06ebb3b71 100644
--- a/addons/project_long_term/project_long_term_view.xml
+++ b/addons/project_long_term/project_long_term_view.xml
@@ -196,7 +196,7 @@
-
+
@@ -205,7 +205,7 @@
-
+
@@ -225,7 +225,6 @@
project.phaseformtree,form,calendar,gantt
- {"search_default_current":1,"search_default_my_phase":1}
diff --git a/addons/project_timesheet/report/task_report_view.xml b/addons/project_timesheet/report/task_report_view.xml
index 3b10af43026..e44e399b292 100644
--- a/addons/project_timesheet/report/task_report_view.xml
+++ b/addons/project_timesheet/report/task_report_view.xml
@@ -71,7 +71,7 @@
search
-
+
@@ -81,7 +81,7 @@
-
+
@@ -102,7 +102,7 @@
domain="[('priority','=','4')]"/>
-
+
@@ -124,7 +124,6 @@
formtree,graph[]
- {"search_default_my_task":1}
@@ -163,7 +162,7 @@
-
+
@@ -175,7 +174,6 @@
report.timesheet.task.userformtree
- {"search_default_by_user":1}
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index 40926ec2aa3..c301116db2a 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -94,7 +94,7 @@
-
+
@@ -161,13 +161,13 @@
-
+
-
-
+
+
@@ -203,7 +203,7 @@
{'search_default_draft': 1}tree,form,graph,calendar
-
@@ -247,12 +247,12 @@
-
+
-
+
@@ -290,7 +290,7 @@
name="Product purchases"
res_model="purchase.order.line"
src_model="product.product"/>
-
+
+ sale.order.by.clients.tree
+ sale.order.by.clients
+ tree
+
+
+
+
+
+
+
+
+
+ sale.order.by.clients.graph
+ sale.order.by.clients
+ graph
+
+
+
+
+
+
+
+
+
+ Sales Orders
+ sale.order.by.clients
+ form
+ tree,graph
+
+
+
+
+ uninvoiced.lines.per.month.tree
+ uninvoiced.lines.per.month
+ tree
+
+
+
+
+
+
+
+
+
+
+ uninvoiced.lines.per.month.graph
+ uninvoiced.lines.per.month
+ graph
+
+
+
+
+
+
+
+
+
+ Uninvoiced Lines
+ uninvoiced.lines.per.month
+ form
+ tree,graph
+
+
+
+
+ product.bought.by.sale.order.tree
+ product.bought.by.sale.order
+ tree
+
+
+
+
+
+
+
+
+
+ product.bought.by.sale.order.graph
+ product.bought.by.sale.order
+ graph
+
+
+
+
+
+
+
+
+
+ Product bought by sale order
+ product.bought.by.sale.order
+ form
+ tree,graph
+
+
+
+
+ sales.by.regions.tree
+ sales.by.regions
+ tree
+
+
+
+
+
+
+
+
+
+ sales.by.regions.graph
+ sales.by.regions
+ graph
+
+
+
+
+
+
+
+
+
+ Sales by regions
+ sales.by.regions
+ form
+ tree,graph
+
+
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 156ede282d0..0c5a1252d59 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -16,7 +16,7 @@
-
+
@@ -29,7 +29,7 @@
-
+
@@ -111,7 +111,7 @@
-
@@ -259,7 +259,7 @@
-
+
@@ -279,7 +279,6 @@
sale.orderformtree,form,calendar,graph
- {"search_default_my_sale":1}
@@ -427,7 +426,7 @@
-
+
@@ -442,22 +441,20 @@
search
-
-
-
-
+
diff --git a/addons/scrum/i18n/ko.po b/addons/scrum/i18n/ko.po
index 53022cb34d4..7715e88937c 100644
--- a/addons/scrum/i18n/ko.po
+++ b/addons/scrum/i18n/ko.po
@@ -14,7 +14,11 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+<<<<<<< TREE
+"X-Launchpad-Export-Date: 2010-04-07 03:46+0000\n"
+=======
"X-Launchpad-Export-Date: 2010-04-17 03:59+0000\n"
+>>>>>>> MERGE-SOURCE
"X-Generator: Launchpad (build Unknown)\n"
#. module: scrum
diff --git a/addons/scrum/scrum_report.xml b/addons/scrum/scrum_report.xml
index 845a677c356..8d95d8bdc37 100644
--- a/addons/scrum/scrum_report.xml
+++ b/addons/scrum/scrum_report.xml
@@ -1,6 +1,6 @@
-
-
+
+
diff --git a/addons/scrum/scrum_view.xml b/addons/scrum/scrum_view.xml
index 8824f9dad62..329a77bc56d 100644
--- a/addons/scrum/scrum_view.xml
+++ b/addons/scrum/scrum_view.xml
@@ -103,7 +103,7 @@
-
- Product Backlogsscrum.product.backlogform
- {"search_default_current":1,"search_default_my_features":1,"search_default_project_id":project_id}
diff --git a/addons/survey/test/survey00.yml b/addons/survey/test/survey00.yml
new file mode 100644
index 00000000000..7bfe8a5320d
--- /dev/null
+++ b/addons/survey/test/survey00.yml
@@ -0,0 +1,159 @@
+- |
+ Survey Scenario:
+ In order to check the survey module in OpenERP.
+-
+ I Create the one survey and give survey title "Partner Feedback" and define the survey pages and survey question.
+-
+ I Create "Partner Feedback" survey.
+-
+ !record {model: 'survey', id: survey_partner_0}:
+ title: 'Partner Feedback'
+ max_response_limit: 20
+-
+ I Create "Who are you?" page in "Partner Feedback" survey with title .
+-
+ !record {model: 'survey.page', id: survey_partner_page_0}:
+ title: 'Who are you?'
+ survey_id: survey_partner_0
+-
+ I Create "What is your company name?" question in "Who are you" survey page.
+-
+ !record {model: 'survey.question', id: survey_p_question_0}:
+ question: 'What is your company name?'
+ type: single_textbox
+ sequence: 1
+ page_id: survey_partner_page_0
+-
+ I Create "What is your company size?" question in "Who are you" survey page.
+-
+ !record {model: 'survey.question', id: survey_p_question_1}:
+ question: 'What is your company size?'
+ type: multiple_choice_only_one_ans
+ sequence: 2
+ is_require_answer: true
+ page_id: survey_partner_page_0
+-
+ I Create "1-50" answer in question "What is your company size?"
+-
+ !record {model: 'survey.answer', id: survey_p_1_1}:
+ answer: '1 - 50'
+ sequence: 1
+ question_id : survey_p_question_1
+-
+ I Create "51 - 100" answer in question "What is your company size?"
+-
+ !record {model: 'survey.answer', id: survey_p_1_2}:
+ answer: '51 - 100'
+ sequence: 2
+ question_id : survey_p_question_1
+-
+ I Create "100 - 500" answer in question "What is your company size?"
+-
+ !record {model: 'survey.answer', id: survey_p_1_3}:
+ answer: '100 - 500'
+ sequence: 3
+ question_id : survey_p_question_1
+-
+ I Create "500 - 1000" answer in question "What is your company size?"
+-
+ !record {model: 'survey.answer', id: survey_p_1_4}:
+ answer: '500 - 1000'
+ sequence: 4
+ question_id : survey_p_question_1
+-
+ I Create "> 1000" answer in question "What is your company size?"
+-
+ !record {model: 'survey.answer', id: survey_p_1_5}:
+ answer: '> 1000'
+ sequence: 5
+ question_id : survey_p_question_1
+-
+ I Create another "Contract" page in "Partner Feedback" survey.
+-
+ !record {model: 'survey.page', id: survey_partner_page_1}:
+ title: 'Contract'
+ survey_id: survey_partner_0
+-
+ I Create "Which maintenance contract do you sell to your customers." question in "Contract" survey page.
+-
+ !record {model: 'survey.question', id: survey_p_question_3}:
+ question: 'Which maintenance contract do you sell to your customers.'
+ type: multiple_choice_only_one_ans
+ sequence: 1
+ page_id: survey_partner_page_1
+-
+ I Create "OpenERP maintenance contract" answer in question "Which maintenance contract do you sell to your customers."
+-
+ !record {model: 'survey.answer', id: survey_p_3_1}:
+ answer: 'OpenERP maintenance contract'
+ sequence: 1
+ question_id : survey_p_question_3
+-
+ I Create "Your own contract, but you buy an OpenERP one" answer in question "Which maintenance contract do you sell to your customers."
+-
+ !record {model: 'survey.answer', id: survey_p_3_2}:
+ answer: 'Your own contract, but you buy an OpenERP one'
+ sequence: 2
+ question_id : survey_p_question_3
+-
+ I Create "Your own contract without buying an OpenERP one" answer in question "Which maintenance contract do you sell to your customers."
+-
+ !record {model: 'survey.answer', id: survey_p_3_3}:
+ answer: 'Your own contract without buying an OpenERP one'
+ sequence: 3
+ question_id : survey_p_question_3
+-
+ I Create "When do you propose a maintenance contract to your customers?" question in "Contract" survey page.
+-
+ !record {model: 'survey.question', id: survey_p_question_4}:
+ question: When do you propose a maintenance contract to your customers?
+ type: multiple_choice_only_one_ans
+ sequence: 2
+ comment_field_type: text
+ comment_label: Why?
+ is_require_answer: true
+ is_comment_require: true
+ page_id: survey_partner_page_1
+-
+ I Create "With each integration" answer in question "When do you propose a maintenance contract to your customers?"
+-
+ !record {model: 'survey.answer', id: survey_p_4_1}:
+ answer: 'With each integration'
+ sequence: 1
+ question_id : survey_p_question_4
+-
+ I Create "Sometimes" answer in question "When do you propose a maintenance contract to your customers?"
+-
+ !record {model: 'survey.answer', id: survey_p_4_2}:
+ answer: 'Sometimes'
+ sequence: 2
+ question_id : survey_p_question_4
+-
+ I Create "Never... " answer in question "When do you propose a maintenance contract to your customers?"
+-
+ !record {model: 'survey.answer', id: survey_p_4_3}:
+ answer: 'Never... '
+ sequence: 3
+ question_id : survey_p_question_4
+-
+ Now Survey set in open state.
+-
+ !python {model: survey}: |
+ self.survey_open(cr, uid, [ref("survey_partner_0")], context)
+-
+ Give answer of the survey, Run "Answer a Survey" wizard and select the survey and press on start button then run the selected survey.
+-
+ !python {model: survey.name.wiz}: |
+ ids = self.create(cr, uid, {'survey_id': ref("survey_partner_0")})
+ self.action_next(cr, uid, [ids], context)
+-
+ Give answer of the first and second page in "Partner Feedback" suvey.
+-
+ !python {model: survey.question.wiz}: |
+ ids = self.create(cr, uid, {str(ref("survey_p_question_0")) +"_single" :'Tiny' , str(ref("survey_p_question_1")) + "_selection" :int(ref("survey_p_1_1"))}, context)
+ ids = self.create(cr, uid, {str(ref("survey_p_question_3")) +"_selection" : int(ref("survey_p_3_1")), str(ref("survey_p_question_4")) +"_selection": int(ref("survey_p_4_1"))},context)
+-
+ Set the value in "Total start survey" field.
+-
+ !python {model: survey}: |
+ ids = self.write(cr, uid, ref("survey_partner_0"), {'tot_start_survey' : 1}, context)
diff --git a/addons/thunderbird/i18n/zh_CN.po b/addons/thunderbird/i18n/zh_CN.po
deleted file mode 100644
index f25ba3b39f7..00000000000
--- a/addons/thunderbird/i18n/zh_CN.po
+++ /dev/null
@@ -1,85 +0,0 @@
-# Chinese (Simplified) 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 , 2010.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: openobject-addons\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-11-26 06:05+0000\n"
-"PO-Revision-Date: 2010-04-08 00:41+0000\n"
-"Last-Translator: Silence \n"
-"Language-Team: Chinese (Simplified) \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:21+0000\n"
-"X-Generator: Launchpad (build Unknown)\n"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,copy_to:0
-msgid "Copy To"
-msgstr "复制到"
-
-#. module: thunderbird
-#: constraint:ir.model:0
-msgid ""
-"The Object name must start with x_ and not contain any special character !"
-msgstr "对象名必须是以x_开头并且不能含有特殊字符"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,description:0
-msgid "Description"
-msgstr "描述"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,reference:0
-msgid "Reference"
-msgstr "参考"
-
-#. module: thunderbird
-#: model:ir.model,name:thunderbird.model_tinythunderbird_partner
-msgid "Thunderbid mails"
-msgstr ""
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,attachments:0
-msgid "Attached Files"
-msgstr "添加附件"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,res_user_id:0
-msgid "User"
-msgstr "用户"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,receiver:0
-msgid "Receiver"
-msgstr "收件人"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,date:0
-msgid "Date"
-msgstr "日期"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,title:0
-msgid "Subject"
-msgstr "主题"
-
-#. module: thunderbird
-#: code:addons/thunderbird/partner/partner.py:0
-#, python-format
-msgid "Archive"
-msgstr "存档"
-
-#. module: thunderbird
-#: model:ir.module.module,shortdesc:thunderbird.module_meta_information
-msgid "Thunderbird Interface"
-msgstr "Thunderbird接口"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,sender:0
-msgid "Sender"
-msgstr "发件人"
diff --git a/addons/wiki/__openerp__.py b/addons/wiki/__openerp__.py
index 033060ad1a7..65a4212c289 100644
--- a/addons/wiki/__openerp__.py
+++ b/addons/wiki/__openerp__.py
@@ -42,7 +42,8 @@
'data/wiki_main.xml',
'security/ir.model.access.csv'
],
- 'demo_xml': [],
+ 'demo_xml': ['test/wiki_test00.yml'],
+ # 'demo_xml': [],
'installable': True,
'active': False,
'certificate': '0086363630317',
diff --git a/addons/wiki/test/wiki_test00.yml b/addons/wiki/test/wiki_test00.yml
new file mode 100755
index 00000000000..cdaa28c1829
--- /dev/null
+++ b/addons/wiki/test/wiki_test00.yml
@@ -0,0 +1,72 @@
+-
+ In order to test the wiki in OpenERP, I create a new wiki group on Select Display Method Tree
+-
+ !record {model: wiki.groups, id: wiki_groups_wikigrouptest0}:
+ method: tree
+ name: Wiki Group Test
+ notes: I can Generate New Group for Select Display method = Tree.
+-
+ Now I will create new wikipage and assign Group test to this page
+-
+ !record {model: wiki.wiki, id: wiki_wiki_openerpwikiediting0}:
+ group_id: wiki.wiki_groups_wikigrouptest0
+ name: OpenERP Wiki Test
+ section: '1.1'
+ text_area: '=The Open ERP wiki=
+
+ The Open ERP wiki allows you to manage your enterprise contents using wiki
+
+ restructured texts. This module provides a collaborative way to manage internal
+
+ FAQs, quality manuals, technical references, etc.
+
+ '
+-
+ I Get Help on this current page by clicking on "Basic wiki Editing" wizard
+-
+ !python {model: wiki.wiki}: |
+ self.open_wiki_page(cr, uid, [ref("wiki_wiki_openerpwikiediting0")], context)
+-
+ I create Index on this current page by clicking on "Create Index" wizard
+-
+ !python {model: wiki.make.index}: |
+ ids = self.search(cr, uid, [])
+ self.wiki_do_index(cr, uid, ids , {'active_ids': [ref('wiki_wiki_openerpwikiediting0')]})
+-
+ # Remaining Act window
+ I check the page history for the current page by clicking on "Page History".After that find difference between history.
+-
+ I create a new wiki group on the Given Home Page
+-
+ !record {model: wiki.groups, id: wiki_groups_wikigroupediting0}:
+ name: Wiki Group Editing
+ home: wiki.wiki_wiki_quickstart0
+-
+ I open a wiki page on this given group and page by clicking on Open wiki Page wizard.
+-
+ !python {model: wiki.wiki.page.open}: |
+ ids = self.search(cr, uid, [])
+ self.open_wiki_page(cr, uid, ids, {'active_ids': [ref('wiki_groups_wikigroupediting0')]})
+-
+ # Remaining beacuse of Act window (I search the page by clicking on the "search page".)
+ In order to create a menu I will create wizard data
+-
+ !record {model: wiki.groups, id: wiki.wiki_groups_wikiformatting0}:
+ home: wiki.wiki_wiki_main
+-
+ I create a Menu by clicking on "create menu" button.
+ # The folowing is not running properly because of osv memory problem
+-
+ !record {model: wiki.create.menu, id: wiki_create_menu_0}:
+ menu_name: Wiki Test menu
+ menu_parent_id: base.menu_base_partner
+ page: wiki.wiki_wiki_openerpwikiediting0
+-
+ #I will check that menu is generated properly
+-
+ # Remaining because some problem occur
+ #!python {model: wiki.create.menu}: |
+ # ids = self.search(cr, uid, [])
+ # self.wiki_menu_create(cr, uid, ids, context)
+
+