diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index 1ff58367b47..abd3d1f459d 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -46,14 +46,18 @@ module named account_voucherss
'security/account_security.xml',
'security/ir.model.access.csv',
'account_menuitem.xml',
+ 'account_wizard.xml',
+ 'wizard/account_statement_from_invoice_view.xml',
+ 'wizard/account_move_bank_reconcile_view.xml',
+ 'wizard/account_use_model_view.xml',
+ 'account_view.xml',
+ 'account_report.xml',
'wizard/account_invoice_refund_view.xml',
'wizard/account_period_close_view.xml',
'wizard/account_fiscalyear_close_state.xml',
'wizard/account_chart_view.xml',
- 'wizard/account_move_bank_reconcile_view.xml',
- 'wizard/account_move_line_reconcile_select_view.xml',
'wizard/account_move_journal_view.xml',
- 'account_wizard.xml',
+ 'wizard/account_move_line_reconcile_select_view.xml',
'wizard/account_open_closed_fiscalyear_view.xml',
'wizard/account_move_line_unreconcile_select_view.xml',
'wizard/account_vat_view.xml',
@@ -66,17 +70,19 @@ module named account_voucherss
'wizard/account_journal_select_view.xml',
'wizard/account_change_currency_view.xml',
'wizard/account_validate_move_view.xml',
- 'wizard/account_statement_from_invoice_view.xml',
'wizard/account_pay_invoice_view.xml',
'wizard/account_unreconcile_view.xml',
+ 'wizard/account_general_ledger_report_view.xml',
'wizard/account_invoice_state_view.xml',
- 'wizard/account_use_model_view.xml',
'wizard/account_partner_balance_report_view.xml',
+ 'wizard/account_balance_report_view.xml',
+ 'wizard/account_move_line_select_view.xml',
+ 'wizard/account_aged_trial_balance_view.xml',
+ 'wizard/account_compare_account_balance_report_view.xml',
+ 'wizard/account_third_party_ledger.xml',
'project/wizard/project_account_analytic_line_view.xml',
- 'account_view.xml',
'account_end_fy.xml',
'account_invoice_view.xml',
- 'account_report.xml',
'partner_view.xml',
'data/account_invoice.xml',
'data/account_data2.xml',
@@ -93,17 +99,16 @@ module named account_voucherss
'account_installer.xml',
'report/account_invoice_report_view.xml',
'report/account_report_view.xml',
+ 'report/account_analytic_report_view.xml',
],
'demo_xml': [
+ #'demo/price_accuracy00.yml',
'account_demo.xml',
'project/project_demo.xml',
'project/analytic_account_demo.xml',
'demo/account_minimal.xml',
'account_unit_test.xml',
],
- 'test': [
- 'test/price_accuracy00.yml',
- ],
'installable': True,
'active': False,
'certificate': '0080331923549',
diff --git a/addons/account/account.py b/addons/account/account.py
index 21931dd5361..74531102073 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -291,7 +291,7 @@ class account_account(osv.osv):
"special effects in Open ERP: view can not have entries, consolidation are accounts that "\
"can have children accounts for multi-company consolidations, payable/receivable are for "\
"partners accounts (for debit/credit computations), closed for depreciated accounts."),
- 'user_type': fields.many2one('account.account.type', 'Account Type', required=True,
+ 'user_type': fields.many2one('account.account.type', 'Account Type', required=True,
help="These types are defined according to your country. The type contains more information "\
"about the account and its specificities."),
'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade'),
@@ -437,18 +437,18 @@ class account_account(osv.osv):
elif method == 'unlink':
raise osv.except_osv(_('Error !'), _('You cannot remove an account which has account entries!. '))
return True
-
+
def write(self, cr, uid, ids, vals, context=None):
if not context:
context = {}
if 'active' in vals and not vals['active']:
self._check_moves(cr, uid, ids, "write", context)
return super(account_account, self).write(cr, uid, ids, vals, context=context)
-
+
def unlink(self, cr, uid, ids, context={}):
self._check_moves(cr, uid, ids, "unlink", context)
return super(account_account, self).unlink(cr, uid, ids, context)
-
+
account_account()
class account_journal_view(osv.osv):
@@ -791,7 +791,7 @@ class account_move(osv.osv):
for id in ids:
result.setdefault(id, 0.0)
return result
-
+
def _search_amount(self, cr, uid, obj, name, args, context):
ids = []
cr.execute('select move_id,sum(debit) from account_move_line group by move_id')
@@ -801,10 +801,10 @@ class account_move(osv.osv):
if item[1] == '>=':
res = [('id', 'in', [k for k,v in result.iteritems() if v >= item[2]])]
else:
- res = [('id', 'in', [k for k,v in result.iteritems() if v <= item[2]])]
+ res = [('id', 'in', [k for k,v in result.iteritems() if v <= item[2]])]
ids += res
- if not ids:
+ if not ids:
return [('id', '>', '0')]
return ids
@@ -1062,7 +1062,7 @@ class account_move(osv.osv):
# Example:
# difference == 0.01 is OK iff price_accuracy <= 1!
# difference == 0.0001 is OK iff price_accuracy <= 3!
- if abs(amount) < 10 ** -(int(config['price_accuracy'])1):
+ if abs(amount) < 10 ** -(int(config['price_accuracy'])+1):
if not len(line_draft_ids):
continue
self.pool.get('account.move.line').write(cr, uid, line_draft_ids, {
@@ -1132,7 +1132,7 @@ class account_move_reconcile(osv.osv):
'name': lambda self,cr,uid,ctx={}: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile') or '/',
}
def reconcile_partial_check(self, cr, uid, ids, type='auto', context={}):
- total = 0.0
+ total = 0.0
for rec in self.browse(cr, uid, ids, context):
for line in rec.line_partial_ids:
total += (line.debit or 0.0) - (line.credit or 0.0)
@@ -1886,7 +1886,7 @@ account_account_template()
class account_add_tmpl_wizard(osv.osv_memory):
"""Add one more account from the template.
-
+
With the 'nocreate' option, some accounts may not be created. Use this to add them later."""
_name = 'account.addtmpl.wizard'
@@ -1912,7 +1912,7 @@ class account_add_tmpl_wizard(osv.osv_memory):
_defaults = {
'cparent_id': _get_def_cparent,
}
-
+
def action_create(self,cr,uid,ids,context=None):
acc_obj=self.pool.get('account.account')
tmpl_obj=self.pool.get('account.account.template')
@@ -1939,7 +1939,7 @@ class account_add_tmpl_wizard(osv.osv_memory):
# print "Creating:", vals
new_account = acc_obj.create(cr,uid,vals)
return {'type':'state', 'state': 'end' }
-
+
def action_cancel(self,cr,uid,ids,context=None):
return { 'type': 'state', 'state': 'end' }
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index a386901a083..9ace27294fa 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1382,14 +1382,14 @@
[('account_id','child_of', [active_id]),('state','<>','draft')]
{'account_id':active_id}
-
-
-
-
- Account Entries
-
-
-
+
+
+
+
+
+
+
+
diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml
index e5825f6b2da..93dba0e5249 100644
--- a/addons/account/account_wizard.xml
+++ b/addons/account/account_wizard.xml
@@ -1,12 +1,12 @@
-
+
+
+
+
+
+
@@ -71,19 +71,21 @@
-->
-
-
-
+
+
+
-
-
+
+
+
-
-
@@ -105,11 +107,11 @@
-
-
+
+
-
-
+
+
+
+
+
+
@@ -44,60 +50,85 @@
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -110,6 +141,7 @@
account.invoice.report
form
tree,graph
+ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
diff --git a/addons/account/report/aged_trial_balance.py b/addons/account/report/aged_trial_balance.py
index c13ea96ea50..26e24031c3a 100644
--- a/addons/account/report/aged_trial_balance.py
+++ b/addons/account/report/aged_trial_balance.py
@@ -18,8 +18,8 @@
# along with this program. If not, see .
#
##############################################################################
-
import time
+
import pooler
import rml_parse
from report import report_sxw
@@ -45,7 +45,6 @@ class aged_trial_report(rml_parse.rml_parse):
def _get_lines(self, form):
-
if (form['result_selection'] == 'customer' ):
self.ACCOUNT_TYPE = ['receivable']
elif (form['result_selection'] == 'supplier'):
diff --git a/addons/account/report/compare_account_balance.py b/addons/account/report/compare_account_balance.py
index 52205055298..28054377834 100755
--- a/addons/account/report/compare_account_balance.py
+++ b/addons/account/report/compare_account_balance.py
@@ -368,15 +368,15 @@ class account_balance(report_sxw.rml_parse):
self.total_for_perc=self.linesForTotal(form,ids={},doneAccount={},level=1)
self.done_total=0
- for t1 in range(0,len(form['fiscalyear'][0][2])):
+ for t1 in range(0,len(form['fiscalyear'])):
locale.setlocale(locale.LC_ALL, '')
self.result_total["sum_credit" + str(t1)]=locale.format("%.2f", self.result_total["sum_credit" + str(t1)], grouping=True)
self.result_total["sum_debit" + str(t1)]=locale.format("%.2f", self.result_total["sum_debit" + str(t1)], grouping=True)
# self.flag=1
# self.result_total = {}
- for temp in range(0,len(form['fiscalyear'][0][2])):
- fy=self.pool.get('account.fiscalyear').name_get(self.cr,self.uid,form['fiscalyear'][0][2][temp])
+ for temp in range(0,len(form['fiscalyear'])):
+ fy=self.pool.get('account.fiscalyear').name_get(self.cr,self.uid,form['fiscalyear'][temp])
years["year"+str(temp)]=fy[0][1][12:16]
return [years]
@@ -395,11 +395,11 @@ class account_balance(report_sxw.rml_parse):
ctx = self.context.copy()
result_total_parent=[]
- for id in form['fiscalyear'][0][2]:
+ for id in form['fiscalyear']:
tmp=[]
ctx['fiscalyear'] = id
- ctx['periods'] = form['periods'][0][2]
+ ctx['periods'] = form['periods']
ctx['period_manner'] = form['period_manner']
ctx['state'] = form['context'].get('state','all')
tmp = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy())
@@ -453,10 +453,10 @@ class account_balance(report_sxw.rml_parse):
result = []
ctx = self.context.copy()
tmp1=[]
- for id in form['fiscalyear'][0][2]:
+ for id in form['fiscalyear']:
ctx['fiscalyear'] = id
- ctx['periods'] = form['periods'][0][2]
+ ctx['periods'] = form['periods']
ctx['period_manner']=form['period_manner']
ctx['state'] = form['context'].get('state','all')
tmp1 = self.pool.get('account.account').browse(self.cr, self.uid, ids,ctx.copy())
@@ -571,7 +571,7 @@ class account_balance(report_sxw.rml_parse):
if entry[0].child_id:
- for q in range(0,len(form['fiscalyear'][0][2])):
+ for q in range(0,len(form['fiscalyear'])):
self.baldiv["baldiv"+str(level)+str(q)]=entry[q].balance
ids2 = [(x.code,x.id) for x in entry[0].child_id]
@@ -579,7 +579,7 @@ class account_balance(report_sxw.rml_parse):
dir=[]
dir += self.lines(form, [x[1] for x in ids2], done, level+1)
if dir==[]:
- for w in range(0,len(form['fiscalyear'][0][2])):
+ for w in range(0,len(form['fiscalyear'])):
if entry[w].credit <> 0.0 or entry[w].debit <> 0.0 or entry[w].balance<>0.00:
dont_pop=1
break
@@ -597,9 +597,9 @@ class account_balance(report_sxw.rml_parse):
def get_years(self,form):
result =[]
res={}
- for temp in range(0,len(form['fiscalyear'][0][2])):
+ for temp in range(0,len(form['fiscalyear'])):
res={}
- fy=self.pool.get('account.fiscalyear').name_get(self.cr,self.uid,form['fiscalyear'][0][2][temp])
+ fy=self.pool.get('account.fiscalyear').name_get(self.cr,self.uid,form['fiscalyear'][temp])
res['year']=fy[0][1]
res['last_str']=temp
diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py
index b06aa1198fc..00031a77ed8 100644
--- a/addons/account/report/general_ledger.py
+++ b/addons/account/report/general_ledger.py
@@ -41,7 +41,7 @@ class general_ledger(rml_parse.rml_parse):
##
new_ids = []
if (data['model'] == 'account.account'):
- new_ids = ids
+ new_ids = 'active_ids' in data['form']['context'] and data['form']['context']['active_ids'] or []
else:
new_ids.append(data['form']['Account_list'])
@@ -117,7 +117,7 @@ class general_ledger(rml_parse.rml_parse):
borne_max = res[0]['stop_date']
if form['state'] == 'byperiod':
## This function will return the most aged date
- periods = form['periods'][0][2]
+ periods = form['periods']
if not periods:
self.cr.execute("""
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = %s""",(form['fiscalyear'],))
@@ -131,13 +131,16 @@ class general_ledger(rml_parse.rml_parse):
borne_min = form['date_from']
borne_max = form['date_to']
elif form['state'] == 'all':
- periods = form['periods'][0][2]
+ periods = form['periods']
if not periods:
- self.cr.execute("""
- Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = %s""",(form['fiscalyear'],))
+ if form['fiscalyear'] == False:
+ fiscalyears = self.pool.get('account.fiscalyear').search(self.cr, self.uid, [('state', '=', 'draft')])
+ else:
+ fiscalyears = [form['fiscalyear']]
+ self.cr.execute("select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id =ANY(%s)" ,(fiscalyears,))
else:
- self.cr.execute("""
- Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id =ANY(%s)""",(periods,))
+ self.cr.execute("""
+ Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id =ANY(%s)""",(periods,))
res = self.cr.dictfetchall()
period_min = res[0]['start_date']
period_max = res[0]['stop_date']
@@ -180,7 +183,7 @@ class general_ledger(rml_parse.rml_parse):
ctx['state'] = form['context'].get('state','all')
if form.has_key('fiscalyear'):
ctx['fiscalyear'] = form['fiscalyear']
- ctx['periods'] = form['periods'][0][2]
+ ctx['periods'] = form['periods']
else:
ctx['date_from'] = form['date_from']
ctx['date_to'] = form['date_to']
diff --git a/addons/account/report/general_ledger_landscape.py b/addons/account/report/general_ledger_landscape.py
index c888994622b..472f0675519 100644
--- a/addons/account/report/general_ledger_landscape.py
+++ b/addons/account/report/general_ledger_landscape.py
@@ -42,12 +42,10 @@ class general_ledger_landscape(rml_parse.rml_parse):
##
new_ids = []
if (data['model'] == 'account.account'):
- new_ids = ids
+ new_ids = 'active_ids' in data['form']['context'] and data['form']['context']['active_ids'] or []
else:
new_ids.append(data['form']['Account_list'])
-
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
-
super(general_ledger_landscape, self).set_context(objects, data, new_ids,report_type)
def __init__(self, cr, uid, name, context):
@@ -118,7 +116,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
borne_max = res[0]['stop_date']
if form['state'] == 'byperiod':
## This function will return the most aged date
- periods = form['periods'][0][2]
+ periods = form['periods']
if not periods:
self.cr.execute("""
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = %s""" ,(form['fiscalyear'],))
@@ -133,11 +131,13 @@ class general_ledger_landscape(rml_parse.rml_parse):
borne_min = form['date_from']
borne_max = form['date_to']
elif form['state'] == 'all':
- periods = form['periods'][0][2]
+ periods = form['periods']
if not periods:
- self.cr.execute("""
- Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = = %s""" ,(form['fiscalyear'],))
-
+ if form['fiscalyear'] == False:
+ fiscalyears = self.pool.get('account.fiscalyear').search(self.cr, self.uid, [('state', '=', 'draft')])
+ else:
+ fiscalyears = [form['fiscalyear']]
+ self.cr.execute("select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id =ANY(%s)" ,(fiscalyears,))
else:
self.cr.execute("""
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id =ANY(%s)""",(periods,))
@@ -182,7 +182,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
ctx['state'] = form['context'].get('state','all')
if form.has_key('fiscalyear'):
ctx['fiscalyear'] = form['fiscalyear']
- ctx['periods'] = form['periods'][0][2]
+ ctx['periods'] = form['periods']
else:
ctx['date_from'] = form['date_from']
ctx['date_to'] = form['date_to']
diff --git a/addons/account/report/third_party_ledger.py b/addons/account/report/third_party_ledger.py
index 0ae5bf8ce1a..1dca4dfb64a 100644
--- a/addons/account/report/third_party_ledger.py
+++ b/addons/account/report/third_party_ledger.py
@@ -59,10 +59,10 @@ class third_party_ledger(rml_parse.rml_parse):
#
def transform_period_into_date_array(self,data):
## Get All Period Date
- if not data['form']['periods'][0][2] :
+ if not data['form']['periods']:
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
else:
- periods_id = data['form']['periods'][0][2]
+ periods_id = data['form']['periods']
date_array = []
for period_id in periods_id:
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
@@ -77,10 +77,10 @@ class third_party_ledger(rml_parse.rml_parse):
def transform_both_into_date_array(self,data):
- if not data['form']['periods'][0][2] :
+ if not data['form']['periods']:
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
else:
- periods_id = data['form']['periods'][0][2]
+ periods_id = data['form']['periods']
date_array = []
for period_id in periods_id:
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
diff --git a/addons/account/test/test_parent_structure.py b/addons/account/test/test_parent_structure.py
new file mode 100644
index 00000000000..ba27d91c87c
--- /dev/null
+++ b/addons/account/test/test_parent_structure.py
@@ -0,0 +1,54 @@
+# -*- 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 .
+#
+##############################################################################
+
+#
+# TODO: move this in a YAML test with !python tag
+#
+
+import xmlrpclib
+
+DB = 'training3'
+USERID = 1
+USERPASS = 'admin'
+
+
+sock = xmlrpclib.ServerProxy('http://%s:%s/xmlrpc/object' % ('localhost',8069))
+
+ids = sock.execute(DB, USERID, USERPASS, 'account.account', 'search', [], {})
+account_lists = sock.execute(DB, USERID, USERPASS, 'account.account', 'read', ids, ['parent_id','parent_left','parent_right'])
+
+accounts = dict(map(lambda x: (x['id'],x), account_lists))
+for a in account_lists:
+ if a['parent_id']:
+ assert a['parent_left'] > accounts[a['parent_id'][0]]['parent_left']
+ assert a['parent_right'] < accounts[a['parent_id'][0]]['parent_right']
+ assert a['parent_left'] < a['parent_right']
+ for a2 in account_lists:
+ assert not ((a2['parent_right']>a['parent_left']) and
+ (a2['parent_left']a['parent_left']) and (a2['parent_right'] parent_right of all childs
- . if an account is a child it is included in parent_left-parent_right
- . if an account is not a child it is not included in parent_left-parent_right
+-
+ We retrieve all accounts and test they are in a tree data structure.
-
!python {model: account.account}: |
ids = self.search(cr, uid, [])
diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py
index db19cfe9961..91fb10e5205 100644
--- a/addons/account/wizard/__init__.py
+++ b/addons/account/wizard/__init__.py
@@ -30,21 +30,21 @@ import account_move_journal
import account_journal_select
import account_move_bank_reconcile
import account_subscription_generate
-import wizard_aged_trial_balance
-import wizard_general_ledger_report
-import wizard_third_party_ledger
+import account_aged_trial_balance
+import account_general_ledger_report
+import account_third_party_ledger
import account_partner_balance_report
+import account_balance_report
import account_period_close
import account_fiscalyear_close
import account_fiscalyear_close_state
import account_vat
import account_open_closed_fiscalyear
-import wizard_compare_account_balance_report
+import account_compare_account_balance_report
import account_invoice_state
-import wizard_account_duplicate
import account_chart
-import wizard_move_line_select
+import account_move_line_select
import account_validate_account_move
import account_use_model
diff --git a/addons/account/wizard/account_aged_trial_balance.py b/addons/account/wizard/account_aged_trial_balance.py
new file mode 100755
index 00000000000..bdcb8af735a
--- /dev/null
+++ b/addons/account/wizard/account_aged_trial_balance.py
@@ -0,0 +1,106 @@
+# -*- 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 time
+import datetime
+from mx.DateTime import *
+
+from osv import osv, fields
+from tools.translate import _
+
+class account_aged_trial_balance(osv.osv_memory):
+
+ _name = 'account.aged.trial.balance'
+ _description = 'Account Aged Trial balance Report'
+
+ _columns = {
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'period_length':fields.integer('Period length (days)', required=True),
+ 'date1': fields.date('Start of period', required=True),
+ 'result_selection': fields.selection([('customer','Receivable'),
+ ('supplier','Payable'),
+ ('all','Receivable and Payable')],
+ 'Filter on Partners', required=True),
+ 'direction_selection': fields.selection([('past','Past'),
+ ('future','Future')],
+ 'Analysis Direction', required=True),
+ }
+
+ def _get_company(self, cr, uid, ids, context=None):
+ user_obj = self.pool.get('res.users')
+ company_obj = self.pool.get('res.company')
+ if context is None:
+ context = {}
+ user = user_obj.browse(cr, uid, uid, context=context)
+ if user.company_id:
+ return user.company_id.id
+ else:
+ return company_obj.search(cr, uid, [('parent_id', '=', False)])[0]
+
+ _defaults = {
+ 'company_id' : _get_company,
+ 'period_length' : 30,
+ 'date1' : time.strftime('%Y-%m-%d'),
+ 'result_selection' : 'all',
+ 'direction_selection' : 'past',
+ }
+
+ def calc_dates(self, cr, uid, ids, context=None):
+ fiscalyear_obj = self.pool.get('account.fiscalyear')
+ data={}
+ res = {}
+ if context is None:
+ context = {}
+ data['ids'] = context.get('active_ids',[])
+ data['model'] = 'res.partner'
+ data['form'] = self.read(cr, uid, ids, [])[0]
+ data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
+ period_length = data['form']['period_length']
+ if period_length<=0:
+ raise osv.except_osv(_('UserError'), _('You must enter a period length that cannot be 0 or below !'))
+ start = datetime.date.fromtimestamp(time.mktime(time.strptime(data['form']['date1'],"%Y-%m-%d")))
+ start = DateTime(int(start.year),int(start.month),int(start.day))
+ if data['form']['direction_selection'] == 'past':
+ for i in range(5)[::-1]:
+ stop = start - RelativeDateTime(days=period_length)
+ res[str(i)] = {
+ 'name' : str((5-(i+1))*period_length) + '-' + str((5-i)*period_length),
+ 'stop': start.strftime('%Y-%m-%d'),
+ 'start' : stop.strftime('%Y-%m-%d'),
+ }
+ start = stop - RelativeDateTime(days=1)
+ else:
+ for i in range(5):
+ stop = start + RelativeDateTime(days=period_length)
+ res[str(5-(i+1))] = {
+ 'name' : str((i)*period_length)+'-'+str((i+1)*period_length),
+ 'start': start.strftime('%Y-%m-%d'),
+ 'stop' : stop.strftime('%Y-%m-%d'),
+ }
+ start = stop + RelativeDateTime(days=1)
+ data['form'].update(res)
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.aged_trial_balance',
+ 'datas': data,
+ }
+
+account_aged_trial_balance()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_aged_trial_balance_view.xml b/addons/account/wizard/account_aged_trial_balance_view.xml
new file mode 100644
index 00000000000..7984f69e86e
--- /dev/null
+++ b/addons/account/wizard/account_aged_trial_balance_view.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+ Aged Partner Balance
+ account.aged.trial.balance
+ form
+
+
+
+
+
+
+ Aged Partner Balance
+ account.aged.trial.balance
+ ir.actions.act_window
+ form
+ tree,form
+
+ {'record_id':active_id}
+ new
+
+
+
+
+
+
diff --git a/addons/account/wizard/account_balance_report.py b/addons/account/wizard/account_balance_report.py
new file mode 100644
index 00000000000..2873f479629
--- /dev/null
+++ b/addons/account/wizard/account_balance_report.py
@@ -0,0 +1,136 @@
+# -*- 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 time
+
+from osv import osv, fields
+from tools.translate import _
+
+class account_balance_report(osv.osv_memory):
+ """
+ This wizard will provide the account balance report by periods, between any two dates.
+ """
+ _name = 'account.balance.report'
+ _description = 'Account Balance Report'
+ _columns = {
+ 'Account_list': fields.many2one('account.account', 'Chart account',
+ required=True, domain = [('parent_id','=',False)]),
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'display_account': fields.selection([('bal_mouvement','With movements'),
+ ('bal_all','All'),
+ ('bal_solde','With balance is not equal to 0'),
+ ],'Display accounts'),
+ 'fiscalyear': fields.many2one('account.fiscalyear', 'Fiscal year', help='Keep empty for all open fiscal year'),
+ 'state': fields.selection([('bydate','By Date'),
+ ('byperiod','By Period'),
+ ('all','By Date and Period'),
+ ('none','No Filter')
+ ],'Date/Period Filter'),
+ 'periods': fields.many2many('account.period', 'period_account_balance_rel',
+ 'report_id', 'period_id', 'Periods',
+ help='Keep empty for all open fiscal year'),
+ 'date_from': fields.date('Start date', required=True),
+ 'date_to': fields.date('End date', required=True),
+ }
+
+ def _get_company(self, cr, uid, ids, context=None):
+ user_obj = self.pool.get('res.users')
+ company_obj = self.pool.get('res.company')
+ user = user_obj.browse(cr, uid, uid, context=context)
+ if user.company_id:
+ return user.company_id.id
+ else:
+ return company_obj.search(cr, uid, [('parent_id', '=', False)])[0]
+
+ _defaults={
+ 'state' : 'none',
+ 'date_from' : time.strftime('%Y-01-01'),
+ 'date_to' : time.strftime('%Y-%m-%d'),
+ 'company_id' : _get_company,
+ 'fiscalyear' : False,
+ 'display_account': 'bal_all',
+ }
+
+ def next_view(self, cr, uid, ids, context=None):
+ obj_model = self.pool.get('ir.model.data')
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, [])[0]
+ context.update({'Account_list': data['Account_list']})
+ model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','account_balance_report_view')])
+ resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'])[0]['res_id']
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'account.balance.report',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ 'context': context
+ }
+
+ def check_state(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
+ data={}
+ data['ids'] = context['active_ids']
+ data['form'] = self.read(cr, uid, ids, ['date_from', 'company_id', 'state', 'periods', 'date_to', 'display_account', 'fiscalyear'])[0]
+ data['form']['Account_list'] = context.get('Account_list',[])
+ data['form']['context'] = context
+ if data['form']['Account_list']:
+ data['model'] = 'ir.ui.menu'
+ else:
+ data['model'] = 'account.account'
+
+ if data['form']['state'] == 'bydate' :
+ return self._check_date(cr, uid, data, context)
+ elif data['form']['state'] == 'byperiod':
+ if not data['form']['periods']:
+ raise osv.except_osv(_('Warning'),_('Please Enter Periods ! '))
+
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.account.balance',
+ 'datas': data,
+ }
+
+ def _check_date(self, cr, uid, data, context=None):
+ if context is None:
+ context = {}
+ sql = """
+ SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """
+ cr.execute(sql,(data['form']['date_from'],))
+ res = cr.dictfetchall()
+ if res:
+
+ if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']):
+ raise osv.except_osv(_('UserError'),_('Date to must be set between %s and %s') % (res[0]['date_start'], res[0]['date_stop']))
+ else:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.account.balance',
+ 'datas': data,
+ }
+ else:
+ raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year'))
+
+account_balance_report()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_balance_report_view.xml b/addons/account/wizard/account_balance_report_view.xml
new file mode 100644
index 00000000000..dd1b7147f13
--- /dev/null
+++ b/addons/account/wizard/account_balance_report_view.xml
@@ -0,0 +1,93 @@
+
+
+
+
+
+ Select period
+ account.balance.report
+ form
+
+
+
+
+
+
+ Account Balance
+ account.balance.report
+ ir.actions.act_window
+ form
+ form
+
+ new
+
+
+
+
+
+ Account Balance
+ client_print_multi
+
+ action
+ account.account
+
+
+
+ Account Balance
+ account.balance.report
+ form
+
+
+
+
+
+
+ Select Account
+ account.balance.report
+ ir.actions.act_window
+ form
+ tree,form
+
+ {'record_id':active_id}
+ new
+
+
+
+
+
+
diff --git a/addons/account/wizard/account_compare_account_balance_report.py b/addons/account/wizard/account_compare_account_balance_report.py
new file mode 100755
index 00000000000..fd1d4d55ada
--- /dev/null
+++ b/addons/account/wizard/account_compare_account_balance_report.py
@@ -0,0 +1,136 @@
+# -*- 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 time
+
+from osv import osv, fields
+from tools.translate import _
+
+class account_compare_account_balance_report(osv.osv_memory):
+ """
+ This wizard will provide the account balance comparision report by fiscal years.
+ """
+ _name = 'account.compare.account.balance.report'
+ _description = 'Account Balance Report'
+ _columns = {
+ 'fiscalyear': fields.many2many('account.fiscalyear', 'account_fiscalyear_rel','account_id','fiscalyear_id','Fiscal year', help='Keep empty for all open fiscal year'),
+ 'select_account': fields.many2one('account.account','Select Reference Account(for % comparision)',help='Keep empty for comparision to its parent'),
+ 'account_choice': fields.selection([('all','All accounts'),
+ ('bal_zero','With balance is not equal to 0'),
+ ('moves','With movements')],'Show Accounts'),
+ 'show_columns': fields.boolean('Show Debit/Credit Information'),
+ 'landscape': fields.boolean('Show Report in Landscape Form'),
+ 'format_perc': fields.boolean('Show Comparision in %'),
+ 'compare_pattern': fields.selection([('bal_cash','Cash'),
+ ('bal_perc','Percentage'),
+ ('none','Don'+ "'" +'t Compare')],'Compare Selected Years In Terms Of'),
+ 'period_manner': fields.selection([('actual','Financial Period'),('created','Creation Date')],'Entries Selection Based on'),
+ 'periods': fields.many2many('account.period', 'period_account_balance_rel',
+ 'report_id', 'period_id', 'Periods',
+ help='Keep empty for all open fiscal year'),
+ }
+
+ _defaults={
+ 'compare_pattern': 'none',
+ 'account_choice': 'moves',
+ 'period_manner': 'actual',
+ }
+
+ def check(self, cr, uid, ids, context=None):
+ data={}
+ if context is None:
+ context = {}
+ data = {
+ 'ids':context['active_ids'],
+ 'form': self.read(cr, uid, ids, ['fiscalyear', 'select_account', 'account_choice', 'periods', 'show_columns', 'landscape', 'format_perc','compare_pattern','period_manner'])[0],
+ }
+
+ data['form']['context'] = context
+ if (len(data['form']['fiscalyear'])==0) or (len(data['form']['fiscalyear'])>1 and (data['form']['compare_pattern']!='none') and (data['form']['format_perc']==1) and (data['form']['show_columns']==1) and (data['form']['landscape']!=1)):
+ raise osv.except_osv(_('Warning !'), _('You have to select at least 1 Fiscal Year. \nYou may have selected the compare options with more than 1 year with credit/debit columns and % option.This can lead contents to be printed out of the paper.Please try again.'))
+
+
+ if ((len(data['form']['fiscalyear'])==3) and (data['form']['format_perc']!=1) and (data['form']['show_columns']!=1)):
+ if data['form']['landscape']==1:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.account.balance.landscape',
+ 'datas': data,
+ }
+ else:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.balance.account.balance',
+ 'datas': data,
+ }
+ if data['form']['format_perc']==1:
+ if len(data['form']['fiscalyear'])<=2:
+ if data['form']['landscape']==1:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.account.balance.landscape',
+ 'datas': data,
+ }
+ else:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.balance.account.balance',
+ 'datas': data,
+ }
+ else:
+ if len(data['form']['fiscalyear'])==3:
+ if data['form']['landscape']==1:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.account.balance.landscape',
+ 'datas': data,
+ }
+ else:
+ raise osv.except_osv(_('Warning !'), _('You might have done following mistakes. Please correct them and try again. \n 1. You have selected more than 3 years in any case. \n 2. You have not selected Percentage option, but you have selected more than 2 years. \n You can select maximum 3 years. Please check again. \n 3. You have selected Percentage option with more than 2 years, but you have not selected landscape format. You have to select Landscape option. Please Check it.'))
+ else:
+ raise osv.except_osv(_('Warning !'), _('You might have done following mistakes. Please correct them and try again. \n 1. You have selected more than 3 years in any case. \n 2. You have not selected Percentage option, but you have selected more than 2 years. \n You can select maximum 3 years. Please check again. \n 3. You have selected Percentage option with more than 2 years, but you have not selected landscape format. You have to select Landscape option. Please Check it.'))
+ else:
+ if len(data['form']['fiscalyear'])>2:
+ if data['form']['landscape']==1:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.account.balance.landscape',
+ 'datas': data,
+ }
+ else:
+ raise osv.except_osv(_('Warning !'), _('You might have done following mistakes. Please correct them and try again. \n 1. You have selected more than 3 years in any case. \n 2. You have not selected Percentage option, but you have selected more than 2 years. \n You can select maximum 3 years. Please check again. \n 3. You have selected Percentage option with more than 2 years, but you have not selected landscape format. You have to select Landscape option. Please Check it.'))
+ else:
+ if data['form']['landscape']==1:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.account.balance.landscape',
+ 'datas': data,
+ }
+ else:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.balance.account.balance',
+ 'datas': data,
+ }
+account_compare_account_balance_report()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account/wizard/account_compare_account_balance_report_view.xml b/addons/account/wizard/account_compare_account_balance_report_view.xml
new file mode 100644
index 00000000000..e153d11bfaa
--- /dev/null
+++ b/addons/account/wizard/account_compare_account_balance_report_view.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+ account.compare.account.balance.report.form
+ account.compare.account.balance.report
+ form
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/wizard/account_general_ledger_report.py b/addons/account/wizard/account_general_ledger_report.py
new file mode 100644
index 00000000000..6292709e29d
--- /dev/null
+++ b/addons/account/wizard/account_general_ledger_report.py
@@ -0,0 +1,151 @@
+# -*- 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 time
+
+from osv import fields, osv
+from tools.translate import _
+import tools
+
+class account_general_ledger_report(osv.osv_memory):
+ _name = "account.general.ledger.report"
+ _description = "General Ledger Report"
+
+ _columns = {
+ 'Account_list': fields.many2one('account.account', 'Chart account', required=True, domain = [('parent_id','=',False)]),
+
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'state': fields.selection([('bydate','By Date'),
+ ('byperiod','By Period'),
+ ('all','By Date and Period'),
+ ('none','No Filter')],"Date/Period Filter"),
+ 'fiscalyear': fields.many2one('account.fiscalyear', 'Fiscal year', help='Keep empty for all open fiscal year'),
+ 'periods': fields.many2many('account.period', 'ledger_period_rel', 'ledger_id', 'period_id', 'Periods', help='All periods if empty' ),
+ 'sortbydate': fields.selection([('sort_date','Date'),
+ ('sort_mvt','Movement')],"Sort by:"),
+ 'display_account': fields.selection([('bal_mouvement','With movements'),
+ ('bal_all','All'),
+ ('bal_solde','With balance is not equal to 0')],"Display accounts"),
+ 'landscape': fields.boolean("Landscape Mode"),
+ 'soldeinit': fields.boolean("Include initial balances"),
+ 'amount_currency': fields.boolean("With Currency"),
+ 'date_from': fields.date("Start date", required=True),
+ 'date_to': fields.date("End date", required=True)
+ }
+
+ def _get_company(self, cr, uid, ids, context=None):
+ user_obj = self.pool.get('res.users')
+ company_obj = self.pool.get('res.company')
+ if context is None:
+ context = {}
+ user = user_obj.browse(cr, uid, uid, context=context)
+ if user.company_id:
+ return user.company_id.id
+ else:
+ return company_obj.search(cr, uid, [('parent_id', '=', False)])[0]
+
+ _defaults = {
+ 'state' : 'none',
+ 'date_from' : lambda *a: time.strftime('%Y-01-01'),
+ 'date_to' : lambda *a: time.strftime('%Y-%m-%d'),
+ 'company_id' : _get_company,
+ 'display_account' : 'bal_all',
+ 'sortbydate' : 'sort_date',
+ 'fiscalyear' : False,
+ 'landscape': True,
+ 'amount_currency' : True,
+ }
+
+ def next_view(self, cr, uid, ids, context=None):
+ obj_model = self.pool.get('ir.model.data')
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, [])[0]
+ context.update({'Account_list': data['Account_list']})
+ model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','account_general_ledger_report_view')])
+ resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'])[0]['res_id']
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'account.general.ledger.report',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ 'context': context
+ }
+
+ def _check_date(self, cr, uid, data, context=None):
+ if context is None:
+ context = {}
+ sql = """
+ SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """
+ cr.execute(sql,(data['form']['date_from'],))
+ res = cr.dictfetchall()
+ if res:
+ if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']):
+ raise osv.except_osv(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop'])))
+ else:
+ if data['form']['landscape'] == True:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.general.ledger_landscape',
+ 'datas': data,
+ }
+ else:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.general.ledger',
+ 'datas': data,
+ }
+ else:
+ raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year'))
+
+ def check_report(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
+ data={}
+ data['ids'] = context.get('active_ids',[])
+ data['form'] = self.read(cr, uid, ids, ['date_from', 'sortbydate', 'company_id', 'soldeinit', 'state', 'periods', 'date_to', 'amount_currency', 'display_account', 'landscape', 'fiscalyear'])[0]
+ data['form']['Account_list'] = context.get('Account_list',[])
+ if data['form']['Account_list']:
+ data['model'] = 'ir.ui.menu'
+ else:
+ data['model'] = 'account.account'
+ data['form']['context'] = context
+ if data['form']['state'] == 'bydate':
+ return self._check_date(cr, uid, data, context)
+ elif data['form']['state'] == 'byperiod':
+ if not data['form']['periods']:
+ raise osv.except_osv(_('Data Insufficient !'),_('Please select periods.'))
+ if data['form']['landscape'] == True:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.general.ledger_landscape',
+ 'datas': data,
+ }
+ else:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.general.ledger',
+ 'datas': data,
+ }
+account_general_ledger_report()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_general_ledger_report_view.xml b/addons/account/wizard/account_general_ledger_report_view.xml
new file mode 100644
index 00000000000..0790a1654b9
--- /dev/null
+++ b/addons/account/wizard/account_general_ledger_report_view.xml
@@ -0,0 +1,102 @@
+
+
+
+
+
+ General Ledger
+ account.general.ledger.report
+ form
+
+
+
+
+
+
+ General Ledger
+ ir.actions.act_window
+ account.general.ledger.report
+ form
+ form
+
+ new
+
+
+
+
+
+ Account General Ledger
+ client_print_multi
+
+ action
+ account.account
+
+
+
+ General Ledger
+ account.general.ledger.report
+ form
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/account/wizard/account_move_line_reconcile_select_view.xml b/addons/account/wizard/account_move_line_reconcile_select_view.xml
index ae7f9567748..dbd25408fe1 100644
--- a/addons/account/wizard/account_move_line_reconcile_select_view.xml
+++ b/addons/account/wizard/account_move_line_reconcile_select_view.xml
@@ -31,9 +31,6 @@
new
-
-
diff --git a/addons/account/wizard/wizard_move_line_select.py b/addons/account/wizard/account_move_line_select.py
similarity index 58%
rename from addons/account/wizard/wizard_move_line_select.py
rename to addons/account/wizard/account_move_line_select.py
index 76ff699e4e9..474018e2fde 100644
--- a/addons/account/wizard/wizard_move_line_select.py
+++ b/addons/account/wizard/account_move_line_select.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,54 +15,61 @@
# 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
+from osv import fields, osv
+from tools.translate import _
-class wizard_move_line_select(wizard.interface):
- def _open_window(self, cr, uid, data, context):
- mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data')
- act_obj = pooler.get_pool(cr.dbname).get('ir.actions.act_window')
- account_obj = pooler.get_pool(cr.dbname).get('account.account')
- fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
+class account_move_line_select(osv.osv_memory):
+ """
+ Account move line select
+ """
+ _name = "account.move.line.select"
+ _description = "Account move line select"
- if not context.get('fiscalyear', False):
+ def open_window(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ act_obj = self.pool.get('ir.actions.act_window')
+ account_obj = self.pool.get('account.account')
+ fiscalyear_obj = self.pool.get('account.fiscalyear')
+
+ if context is None:
+ context = {}
+
+ if 'fiscalyear' not in context:
fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('state', '=', 'draft')])
else:
fiscalyear_ids = [context['fiscalyear']]
+ fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('state', '=', 'draft')])
fiscalyears = fiscalyear_obj.browse(cr, uid, fiscalyear_ids)
+
period_ids = []
- for fiscalyear in fiscalyears:
- for period in fiscalyear.period_ids:
- period_ids.append(period.id)
- domain = str(('period_id', 'in', period_ids))
+ if fiscalyears :
+ for fiscalyear in fiscalyears:
+ for period in fiscalyear.period_ids:
+ period_ids.append(period.id)
+ domain = str(('period_id', 'in', period_ids))
result = mod_obj._get_id(cr, uid, 'account', 'action_move_line_tree1')
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
result = act_obj.read(cr, uid, [id])[0]
result['context'] = {
- 'fiscalyear': context.get('fiscalyear', False),
- 'account_id': data['id']
+ 'fiscalyear': False ,
+ 'account_id': context['active_id'],
+ 'active_id': context['active_id'],
}
- if data['id']:
- acc_data = account_obj.browse(cr, uid, data['id']).child_consol_ids
+
+ if context['active_id']:
+ acc_data = account_obj.browse(cr, uid, context['active_id']).child_consol_ids
if acc_data:
result['context'].update({'consolidate_childs': True})
result['domain']=result['domain'][0:-1]+','+domain+result['domain'][-1]
return result
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'action', 'action': _open_window, 'state': 'end'}
- }
- }
-wizard_move_line_select('account.move.line.select')
-
+account_move_line_select()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_move_line_select_view.xml b/addons/account/wizard/account_move_line_select_view.xml
new file mode 100644
index 00000000000..d0b6a2f709a
--- /dev/null
+++ b/addons/account/wizard/account_move_line_select_view.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+ Open Move Line Button
+ account.move.line.select
+ form
+
+
+
+
+
+
+ Open Account
+ account.move.line.select
+ form
+ form
+
+ new
+
+
+
+ tree_but_open
+ account.account
+ Open Account
+
+
+
+
+
+
diff --git a/addons/account/wizard/account_third_party_ledger.py b/addons/account/wizard/account_third_party_ledger.py
new file mode 100755
index 00000000000..a40c469a184
--- /dev/null
+++ b/addons/account/wizard/account_third_party_ledger.py
@@ -0,0 +1,129 @@
+# -*- 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 time
+
+from tools.translate import _
+from osv import fields, osv
+
+class account_partner_ledger(osv.osv_memory):
+ """
+ This wizard will provide the partner Ledger report by periods, between any two dates.
+ """
+ _name = 'account.partner.ledger'
+ _description = 'Account Partner Ledger'
+ _columns = {
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'state': fields.selection([('bydate','By Date'),
+ ('byperiod','By Period'),
+ ('all','By Date and Period'),
+ ('none','No Filter')
+ ],'Date/Period Filter'),
+ 'fiscalyear': fields.many2one('account.fiscalyear', 'Fiscal year', help='Keep empty for all open fiscal year'),
+ 'periods': fields.many2many('account.period', 'period_ledger_rel', 'report_id', 'period_id', 'Periods', help='All periods if empty', states={'none':[('readonly',True)],'bydate':[('readonly',True)]}),
+ 'result_selection': fields.selection([('customer','Receivable Accounts'),
+ ('supplier','Payable Accounts'),
+ ('all','Receivable and Payable Accounts')],
+ 'Partner', required=True),
+ 'soldeinit': fields.boolean('Include initial balances'),
+ 'reconcil': fields.boolean('Include Reconciled Entries'),
+ 'page_split': fields.boolean('One Partner Per Page'),
+ 'date1': fields.date('Start date', required=True),
+ 'date2': fields.date('End date', required=True),
+ }
+
+ def _get_company(self, cr, uid, ids, context=None):
+ user_obj = self.pool.get('res.users')
+ company_obj = self.pool.get('res.company')
+ if context is None:
+ context = {}
+ user = user_obj.browse(cr, uid, uid, context=context)
+ if user.company_id:
+ return user.company_id.id
+ else:
+ return company_obj.search(cr, uid, [('parent_id', '=', False)])[0]
+
+ _defaults={
+ 'state' : 'none',
+ 'date1' : time.strftime('%Y-01-01'),
+ 'date2' : time.strftime('%Y-%m-%d'),
+ 'result_selection' : 'all',
+ 'reconcile' : True,
+ 'soldeinit' : True,
+ 'page_split' : False,
+ 'company_id' : _get_company,
+ 'fiscalyear' : False,
+ }
+
+ def check_state(self, cr, uid, ids, context=None):
+ obj_fiscalyear = self.pool.get('account.fiscalyear')
+ obj_periods = self.pool.get('account.period')
+ if context is None:
+ context = {}
+ data={}
+ data['ids'] = context.get('active_ids',[])
+ data['form'] = self.read(cr, uid, ids, [])[0]
+ data['form']['fiscalyear'] = obj_fiscalyear.find(cr, uid)
+ data['form']['periods'] = obj_periods.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
+ data['form']['display_account']='bal_all'
+ data['model'] = 'ir.ui.menu'
+ acc_id = self.pool.get('account.invoice').search(cr, uid, [('state','=','open')])
+ if not acc_id:
+ raise osv.except_osv(_('No Data Available'), _('No records found for your selection!'))
+ if data['form']['state'] == 'bydate' or data['form']['state'] == 'all':
+ data['form']['fiscalyear'] = False
+ else :
+ data['form']['fiscalyear'] = True
+ return self._check_date(cr, uid, data, context)
+ if data['form']['page_split']:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.third_party_ledger',
+ 'datas': data,
+ }
+ else:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.third_party_ledger_other',
+ 'datas': data,
+ }
+
+ def _check_date(self, cr, uid, data, context=None):
+ if context is None:
+ context = {}
+ sql = """
+ SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """
+ cr.execute(sql,(data['form']['date1'],))
+ res = cr.dictfetchall()
+ if res:
+ if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']):
+ raise osv.except_osv(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop'])))
+ else:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.third_party_ledger',
+ 'datas': data,
+ }
+ else:
+ raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year'))
+
+account_partner_ledger()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_third_party_ledger.xml b/addons/account/wizard/account_third_party_ledger.xml
new file mode 100644
index 00000000000..6ddc9a1e847
--- /dev/null
+++ b/addons/account/wizard/account_third_party_ledger.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+ Select period
+ account.partner.ledger
+ form
+
+
+
+
+
+
+ Select Period
+ account.partner.ledger
+ ir.actions.act_window
+ form
+ tree,form
+
+ {'record_id':active_id}
+ new
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/account/wizard/account_vat_view.xml b/addons/account/wizard/account_vat_view.xml
index edd6eaf7874..7662594bb79 100644
--- a/addons/account/wizard/account_vat_view.xml
+++ b/addons/account/wizard/account_vat_view.xml
@@ -2,11 +2,6 @@
-
-
Account Vat Declaration
account.vat.declaration
diff --git a/addons/account/wizard/wizard_account_balance_report.py b/addons/account/wizard/wizard_account_balance_report.py
deleted file mode 100644
index 26538d06b4b..00000000000
--- a/addons/account/wizard/wizard_account_balance_report.py
+++ /dev/null
@@ -1,145 +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 pooler
-import time
-from tools.translate import _
-
-period_form = '''
-'''
-
-period_fields = {
- 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
- 'state':{
- 'string':"Date/Period Filter",
- 'type':'selection',
- 'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
- 'default': lambda *a:'none'
- },
- 'fiscalyear': {
- 'string':'Fiscal year',
- 'type':'many2one',
- 'relation':'account.fiscalyear',
- 'help':'Keep empty for all open fiscal year'
- },
- 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
- 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
- 'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
- 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
-}
-
-account_form = '''
-'''
-
-account_fields = {
- 'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
-}
-
-class wizard_report(wizard.interface):
- def _get_defaults(self, cr, uid, data, context={}):
- user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
- if user.company_id:
- company_id = user.company_id.id
- else:
- company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
- data['form']['company_id'] = company_id
- fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
-# periods_obj=pooler.get_pool(cr.dbname).get('account.period')
- data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
-# data['form']['periods'] = periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
-# data['form']['fiscalyear'] = False
- data['form']['display_account'] = 'bal_all'
- data['form']['context'] = context
- return data['form']
-
- def _check_state(self, cr, uid, data, context):
-
- if data['form']['state'] == 'bydate':
- self._check_date(cr, uid, data, context)
-# data['form']['fiscalyear'] = 0
-# else :
-# data['form']['fiscalyear'] = 1
- return data['form']
-
- def _check_path(self, cr, uid, data, context):
- if data['model'] == 'account.account':
- return 'checktype'
- else:
- return 'account_selection'
-
- def _check_date(self, cr, uid, data, context):
- sql = """
- SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """
- cr.execute(sql,(data['form']['date_from'],))
- res = cr.dictfetchall()
- if res:
- if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']):
- raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (res[0]['date_start'], res[0]['date_stop']))
- else:
- return 'report'
- else:
- raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year'))
-
- states = {
-
- 'init': {
- 'actions': [],
- 'result': {'type':'choice','next_state':_check_path}
- },
- 'account_selection': {
- 'actions': [],
- 'result': {'type':'form', 'arch':account_form,'fields':account_fields, 'state':[('end','Cancel','gtk-cancel'),('checktype','Next','gtk-go-forward')]}
- },
- 'checktype': {
- 'actions': [_get_defaults],
- 'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel','gtk-cancel'),('report','Print','gtk-print')]}
- },
- 'report': {
- 'actions': [_check_state],
- 'result': {'type':'print', 'report':'account.account.balance', 'state':'end'}
- }
- }
-wizard_report('account.account.balance.report')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/wizard_aged_trial_balance.py b/addons/account/wizard/wizard_aged_trial_balance.py
deleted file mode 100755
index d21a64c0bbf..00000000000
--- a/addons/account/wizard/wizard_aged_trial_balance.py
+++ /dev/null
@@ -1,113 +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 time
-import datetime
-import pooler
-
-from mx.DateTime import *
-from tools.translate import _
-
-_aged_trial_form = """
-"""
-
-_aged_trial_fields = {
- 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
- 'period_length': {'string': 'Period length (days)', 'type': 'integer', 'required': True, 'default': lambda *a:30},
- 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'result_selection':{
- 'string':"Filter on Partners",
- 'type':'selection',
- 'selection':[('customer','Receivable'),('supplier','Payable'),('all','Receivable and Payable')],
- 'required':True,
- 'default': lambda *a: 'all',
- },
- 'direction_selection':{
- 'string':"Analysis Direction",
- 'type':'selection',
- 'selection':[('past','Past'),('future','Future')],
- 'required':True,
- 'default': lambda *a: 'past',
- },
-}
-
-def _calc_dates(self, cr, uid, data, context):
- res = {}
- period_length = data['form']['period_length']
- if period_length<=0:
- raise wizard.except_wizard(_('UserError'), _('You must enter a period length that cannot be 0 or below !'))
- start = datetime.date.fromtimestamp(time.mktime(time.strptime(data['form']['date1'],"%Y-%m-%d")))
- start = DateTime(int(start.year),int(start.month),int(start.day))
- if data['form']['direction_selection'] == 'past':
- for i in range(5)[::-1]:
- stop = start - RelativeDateTime(days=period_length)
- res[str(i)] = {
- 'name' : str((5-(i+1))*period_length) + '-' + str((5-i)*period_length),
-
- 'stop': start.strftime('%Y-%m-%d'),
- 'start' : stop.strftime('%Y-%m-%d'),
- }
- start = stop - RelativeDateTime(days=1)
- else:
- for i in range(5):
- stop = start + RelativeDateTime(days=period_length)
- res[str(5-(i+1))] = {
- 'name' : str((i)*period_length)+'-'+str((i+1)*period_length),
- 'start': start.strftime('%Y-%m-%d'),
- 'stop' : stop.strftime('%Y-%m-%d'),
- }
- start = stop + RelativeDateTime(days=1)
- return res
-
-class wizard_report(wizard.interface):
- def _get_defaults(self, cr, uid, data, context):
- fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
- data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
- user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
- if user.company_id:
- company_id = user.company_id.id
- else:
- company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
- data['form']['company_id'] = company_id
- return data['form']
- states = {
- 'init': {
- 'actions': [_get_defaults],
- 'result': {'type':'form', 'arch':_aged_trial_form, 'fields':_aged_trial_fields, 'state':[('end','Cancel', 'gtk-cancel'),('print','Print', 'gtk-ok')]},
- },
- 'print': {
- 'actions': [_calc_dates],
- 'result': {'type':'print', 'report':'account.aged_trial_balance', 'state':'end'},
- },
- }
-wizard_report('account.aged.trial.balance')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/wizard_compare_account_balance_report.py b/addons/account/wizard/wizard_compare_account_balance_report.py
deleted file mode 100755
index 8000d37536d..00000000000
--- a/addons/account/wizard/wizard_compare_account_balance_report.py
+++ /dev/null
@@ -1,175 +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 ir
-import pooler
-import time
-import netsvc
-from osv import fields, osv
-import mx.DateTime
-from mx.DateTime import RelativeDateTime
-
-from tools import config
-
-
-dates_form = '''
-'''
-
-dates_fields = {
- 'fiscalyear': {'string': 'Fiscal year', 'type': 'many2many', 'relation': 'account.fiscalyear'},
- 'select_account': {'string': 'Select Reference Account(for % comparision)', 'type': 'many2one', 'relation': 'account.account','help': 'Keep empty for comparision to its parent'},
- 'account_choice': {'string': 'Show Accounts', 'type': 'selection','selection':[('all','All accounts'),('bal_zero','With balance is not equal to 0'),('moves','With movements')]},
- 'show_columns': {'string': 'Show Debit/Credit Information', 'type': 'boolean'},
- 'landscape': {'string': 'Show Report in Landscape Form', 'type': 'boolean'},
- 'format_perc': {'string': 'Show Comparision in %', 'type': 'boolean'},
- 'compare_pattern':{'string':"Compare Selected Years In Terms Of",'type':'selection','selection':[('bal_cash','Cash'),('bal_perc','Percentage'),('none','Don'+ "'" +'t Compare')]},
- 'period_manner':{'string':"Entries Selection Based on",'type':'selection','selection':[('actual','Financial Period'),('created','Creation Date')]},
- 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'}
-}
-
-back_form='''
-'''
-
-back_fields={
-}
-
-zero_form='''
-'''
-
-zero_fields={
-}
-
-def _check(self, cr, uid, data, context):
- if (len(data['form']['fiscalyear'][0][2])==0) or (len(data['form']['fiscalyear'][0][2])>1 and (data['form']['compare_pattern']!='none') and (data['form']['format_perc']==1) and (data['form']['show_columns']==1) and (data['form']['landscape']!=1)):
- return 'zero_years'
-
- if ((len(data['form']['fiscalyear'][0][2])==3) and (data['form']['format_perc']!=1) and (data['form']['show_columns']!=1)):
- if data['form']['landscape']==1:
- return 'report_landscape'
- else:
- return 'report'
-
-
- if data['form']['format_perc']==1:
- if len(data['form']['fiscalyear'][0][2])<=2:
- if data['form']['landscape']==1:
- return 'report_landscape'
- else:
- return 'report'
- else:
- if len(data['form']['fiscalyear'][0][2])==3:
- if data['form']['landscape']==1:
- return 'report_landscape'
- else:
- return 'backtoinit'
- else:
- return 'backtoinit'
-
- else:
- if len(data['form']['fiscalyear'][0][2])>2:
- if data['form']['landscape']==1:
- return 'report_landscape'
- else:
- return 'backtoinit'
- else:
- if data['form']['landscape']==1:
- return 'report_landscape'
- else:
- return 'report'
-
-
-
-
-class wizard_report(wizard.interface):
- def _get_defaults(self, cr, uid, data, context={}):
- data['form']['context'] = context
- fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
- data['form']['fiscalyear']=[fiscalyear_obj.find(cr, uid)]
-# p_ids=pooler.get_pool(cr.dbname).get('account.period').search(cr,uid,[('fiscalyear_id','=',fiscalyear_obj.find(cr, uid))])
-# data['form']['periods']=p_ids
- data['form']['compare_pattern']='none'
- data['form']['account_choice']='moves'
- data['form']['period_manner']='actual'
- return data['form']
-
-
- states = {
- 'init': {
- 'actions': [_get_defaults],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel', 'gtk-cancel'),('checkyear','Print', 'gtk-ok')]}
- },
- 'backtoinit': {
- 'actions': [],
- 'result': {'type':'form','arch':back_form,'fields':back_fields,'state':[('end','Ok')]}
- },
- 'zero_years': {
- 'actions': [],
- 'result': {'type':'form','arch':zero_form,'fields':zero_fields,'state':[('end','Ok')]}
- },
- 'checkyear': {
- 'actions': [],
- 'result': {'type':'choice','next_state':_check}
- },
- 'report_landscape': {
- 'actions': [],
- 'result': {'type':'print', 'report':'account.account.balance.landscape', 'state':'end'}
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'account.balance.account.balance', 'state':'end'}
- }
- }
-wizard_report('account.balance.account.balance.report')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/wizard/wizard_general_ledger_report.py b/addons/account/wizard/wizard_general_ledger_report.py
deleted file mode 100644
index d5f8ac0fa98..00000000000
--- a/addons/account/wizard/wizard_general_ledger_report.py
+++ /dev/null
@@ -1,179 +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 pooler
-import locale
-import time
-from tools.translate import _
-
-account_form = '''
-'''
-
-account_fields = {
- 'Account_list': {'string':'Chart of Accounts', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
-}
-
-period_form = '''
-'''
-
-period_fields = {
- 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
- 'state':{
- 'string':"Date/Period Filter",
- 'type':'selection',
- 'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
- 'default': lambda *a:'none'
- },
- 'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
- 'help': 'Keep empty for all open fiscal year'},
- 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
- 'sortbydate':{'string':"Sort by:",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Movement')]},
- 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
- 'landscape':{'string':"Landscape Mode",'type':'boolean'},
- 'soldeinit':{'string':"Include initial balances",'type':'boolean'},
- 'amount_currency':{'string':"With Currency",'type':'boolean'},
- 'date_from': {'string':" Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
- 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
-}
-def _check_path(self, cr, uid, data, context):
- if data['model'] == 'account.account':
- return 'checktype'
- else:
- return 'account_selection'
-
-def _check(self, cr, uid, data, context):
- if data['form']['landscape']==True:
- return 'report_landscape'
- else:
- return 'report'
-
-def _check_date(self, cr, uid, data, context):
-
- sql = """
- SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """
- cr.execute(sql,(data['form']['date_from'],))
- res = cr.dictfetchall()
- if res:
- if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']):
- raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop'])))
- else:
- return 'checkreport'
-
- else:
- raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year'))
-
-def _check_state(self, cr, uid, data, context):
-
- if data['form']['state'] == 'bydate':
- _check_date(self, cr, uid, data, context)
-# data['form']['fiscalyear'] = 0
-# else :
-#
-# data['form']['fiscalyear'] = 1
- return data['form']
-
-
-class wizard_report(wizard.interface):
- def _get_defaults(self, cr, uid, data, context={}):
- user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
- if user.company_id:
- company_id = user.company_id.id
- else:
- company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
- data['form']['company_id'] = company_id
- fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
-
- data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
- #periods_obj=pooler.get_pool(cr.dbname).get('account.period')
- #data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
- data['form']['sortbydate'] = 'sort_date'
- data['form']['display_account']='bal_all'
- data['form']['landscape']=True
- data['form']['fiscalyear'] = False
- data['form']['amount_currency'] = True
- data['form']['context'] = context
- return data['form']
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'choice','next_state':_check_path}
- },
- 'account_selection': {
- 'actions': [],
- 'result': {'type':'form', 'arch':account_form,'fields':account_fields, 'state':[('end','Cancel','gtk-cancel'),('checktype','Next','gtk-go-forward')]}
- },
- 'checktype': {
- 'actions': [_get_defaults],
- 'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel','gtk-cancel'),('checkreport','Print','gtk-print')]}
- },
- 'checkreport': {
- 'actions': [],
- 'result': {'type':'choice','next_state':_check}
- },
- 'report_landscape': {
- 'actions': [_check_state],
- 'result': {'type':'print', 'report':'account.general.ledger_landscape', 'state':'end'}
- },
- 'report': {
- 'actions': [_check_state],
- 'result': {'type':'print', 'report':'account.general.ledger', 'state':'end'}
- }
- }
-wizard_report('account.general.ledger.report')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/wizard_third_party_ledger.py b/addons/account/wizard/wizard_third_party_ledger.py
deleted file mode 100755
index 6bf415d0ca6..00000000000
--- a/addons/account/wizard/wizard_third_party_ledger.py
+++ /dev/null
@@ -1,161 +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 time
-import wizard
-import pooler
-from tools.translate import _
-
-
-period_form = '''
-'''
-
-period_fields = {
- 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
- 'state':{
- 'string':"Date/Period Filter",
- 'type':'selection',
- 'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
- 'default': lambda *a:'none'
- },
- 'fiscalyear': {
- 'string':'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
- 'help': 'Keep empty for all open fiscal year',
- 'default': lambda *a:False,
- },
- 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty','states':{'none':[('readonly',True)],'bydate':[('readonly',True)]}},
- 'result_selection':{
- 'string':"Partner",
- 'type':'selection',
- 'selection':[('customer','Receivable Accounts'),('supplier','Payable Accounts'),('all','Receivable and Payable Accounts')],
- 'required':True
- },
- 'soldeinit':{'string':"Include initial balances",'type':'boolean'},
- 'reconcil':{'string':" Include Reconciled Entries",'type':'boolean'},
- 'page_split':{'string':"One Partner Per Page",'type':'boolean'},
- 'date1': {'string':' Start date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
- 'date2': {'string':'End date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
-}
-
-
-class wizard_report(wizard.interface):
-
- def _get_defaults(self, cr, uid, data, context):
- fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
- data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
- data['form']['display_account']='bal_all'
- data['form']['result_selection'] = 'all'
- user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
- if user.company_id:
- company_id = user.company_id.id
- else:
- company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
- data['form']['company_id'] = company_id
- periods_obj=pooler.get_pool(cr.dbname).get('account.period')
- data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
- data['form']['fiscalyear'] =False
- data['form']['page_split'] = False
- data['form']['reconcil'] = False
- data['form']['soldeinit'] = True
- return data['form']
-
- def _check(self, cr, uid, data, context):
- if data['form']['page_split']:
- return 'report'
- else:
- return 'report_other'
-
- def _check_date(self, cr, uid, data, context):
-
- sql = """
- SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """
- cr.execute(sql,(data['form']['date1'],))
- res = cr.dictfetchall()
- if res:
- if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']):
- raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']) , str(res[0]['date_stop'])))
- else:
- return 'report'
- else:
- raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year'))
-
- def _check_state(self, cr, uid, data, context):
- if data['form']['state'] == 'bydate' or data['form']['state'] == 'all':
- data['form']['fiscalyear'] = False
- else :
- data['form']['fiscalyear'] = True
- self._check_date(cr, uid, data, context)
- acc_id = pooler.get_pool(cr.dbname).get('account.invoice').search(cr, uid, [('state','=','open')])
- if not acc_id:
- raise wizard.except_wizard(_('No Data Available'), _('No records found for your selection!'))
- return data['form']
-
-
- states = {
- 'init': {
- 'actions': [_get_defaults],
- 'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel','gtk-cancel'),('checkreport','Print','gtk-print')]}
- },
- 'checkreport': {
- 'actions': [],
- 'result': {'type':'choice','next_state':_check}
- },
- 'report': {
- 'actions': [_check_state],
- 'result': {'type':'print', 'report':'account.third_party_ledger', 'state':'end'}
- },
- 'report_other': {
- 'actions': [_check_state],
- 'result': {'type':'print', 'report':'account.third_party_ledger_other', 'state':'end'}
- }
-
- }
-wizard_report('account.third_party_ledger.report')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_payment/i18n/cs.po b/addons/account_payment/i18n/cs.po
index 7139ac0c822..1b10c28c59e 100644
--- a/addons/account_payment/i18n/cs.po
+++ b/addons/account_payment/i18n/cs.po
@@ -7,13 +7,17 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-04-07 22:24+0000\n"
-"Last-Translator: mitev.dmitry \n"
+"PO-Revision-Date: 2009-02-03 06:24+0000\n"
+"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+<<<<<<< TREE
+"X-Launchpad-Export-Date: 2010-03-30 04:07+0000\n"
+=======
"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
+>>>>>>> MERGE-SOURCE
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
@@ -46,7 +50,7 @@ msgstr ""
#: field:payment.line,info_owner:0
#: view:payment.order:0
msgid "Owner Account"
-msgstr "Majitel účtu"
+msgstr ""
#. module: account_payment
#: help:account.invoice,amount_to_pay:0
@@ -65,17 +69,17 @@ msgstr ""
#. module: account_payment
#: field:payment.order,date_prefered:0
msgid "Preferred date"
-msgstr "Preferované datum"
+msgstr ""
#. module: account_payment
#: selection:payment.line,state:0
msgid "Free"
-msgstr "Volný"
+msgstr ""
#. module: account_payment
#: wizard_field:populate_payment,search,entries:0
msgid "Entries"
-msgstr "Příspěvky"
+msgstr ""
#. module: account_payment
#: wizard_field:populate_payment,init,duedate:0
@@ -96,7 +100,7 @@ msgstr ""
#: rml:payment.order:0
#: view:payment.order:0
msgid "Amount"
-msgstr "Částka"
+msgstr ""
#. module: account_payment
#: rml:payment.order:0
@@ -111,7 +115,7 @@ msgstr ""
#. module: account_payment
#: selection:payment.order,state:0
msgid "Cancelled"
-msgstr "Zrušeno"
+msgstr ""
#. module: account_payment
#: model:ir.actions.act_window,name:account_payment.action_payment_order_tree_new
@@ -123,7 +127,7 @@ msgstr ""
#: rml:payment.order:0
#: field:payment.order,reference:0
msgid "Reference"
-msgstr "Odkaz"
+msgstr ""
#. module: account_payment
#: model:ir.actions.act_window,name:account_payment.action_payment_order_tree
@@ -134,7 +138,7 @@ msgstr ""
#. module: account_payment
#: selection:payment.order,date_prefered:0
msgid "Directly"
-msgstr "Přímo"
+msgstr ""
#. module: account_payment
#: model:ir.actions.act_window,name:account_payment.action_payment_line_form
@@ -157,7 +161,7 @@ msgstr ""
#. module: account_payment
#: selection:payment.order,state:0
msgid "Confirmed"
-msgstr "Potvrzeno"
+msgstr ""
#. module: account_payment
#: help:payment.line,ml_date_created:0
@@ -177,12 +181,12 @@ msgstr ""
#. module: account_payment
#: selection:payment.line,state:0
msgid "Structured"
-msgstr "Strukturované"
+msgstr ""
#. module: account_payment
#: field:payment.order,state:0
msgid "State"
-msgstr "Stav"
+msgstr ""
#. module: account_payment
#: view:payment.line:0
@@ -223,17 +227,17 @@ msgstr ""
#. module: account_payment
#: field:payment.order,date_done:0
msgid "Execution date"
-msgstr "Datum představení"
+msgstr ""
#. module: account_payment
#: selection:payment.order,date_prefered:0
msgid "Fixed date"
-msgstr "Pevné datum"
+msgstr ""
#. module: account_payment
#: field:payment.line,info_partner:0
msgid "Destination Account"
-msgstr "Protiúčet"
+msgstr ""
#. module: account_payment
#: view:payment.line:0
@@ -251,12 +255,12 @@ msgstr ""
#: wizard_button:populate_payment,search,end:0
#: wizard_button:populate_statement,init,end:0
msgid "_Cancel"
-msgstr "Zrušit"
+msgstr ""
#. module: account_payment
#: field:payment.line,create_date:0
msgid "Created"
-msgstr "Vytvořeno"
+msgstr ""
#. module: account_payment
#: view:payment.line:0
@@ -281,12 +285,12 @@ msgstr ""
#. module: account_payment
#: field:payment.line,communication:0
msgid "Communication"
-msgstr "Komunikace"
+msgstr ""
#. module: account_payment
#: selection:payment.order,date_prefered:0
msgid "Due date"
-msgstr "Termín dokončení"
+msgstr ""
#. module: account_payment
#: field:account.invoice,amount_to_pay:0
@@ -307,7 +311,7 @@ msgstr ""
#: view:payment.type:0
#: help:payment.type,name:0
msgid "Payment Type"
-msgstr "Typ platby"
+msgstr ""
#. module: account_payment
#: help:payment.line,amount_currency:0
diff --git a/addons/analytic/project.py b/addons/analytic/project.py
index 0c3c46690ac..9194bd9906b 100644
--- a/addons/analytic/project.py
+++ b/addons/analytic/project.py
@@ -63,13 +63,13 @@ class account_analytic_account(osv.osv):
res = {}
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
acc_set = ",".join(map(str, ids2))
-
+
for i in ids:
res.setdefault(i,0.0)
-
+
if not ids2:
return res
-
+
where_date = ''
if context.get('from_date',False):
where_date += " AND l.date >= '" + context['from_date'] + "'"
@@ -78,18 +78,18 @@ class account_analytic_account(osv.osv):
cr.execute("SELECT a.id, COALESCE(SUM(l.amount_currency),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id "+where_date+") WHERE l.amount_currency<0 and a.id =ANY(%s) GROUP BY a.id",(ids2,))
r = dict(cr.fetchall())
return self._compute_currency_for_level_tree(cr, uid, ids, ids2, r, acc_set, context)
-
+
def _debit_calc(self, cr, uid, ids, name, arg, context={}):
res = {}
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
acc_set = ",".join(map(str, ids2))
-
+
for i in ids:
res.setdefault(i,0.0)
-
+
if not ids2:
return res
-
+
where_date = ''
if context.get('from_date',False):
where_date += " AND l.date >= '" + context['from_date'] + "'"
@@ -98,48 +98,48 @@ class account_analytic_account(osv.osv):
cr.execute("SELECT a.id, COALESCE(SUM(l.amount_currency),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id "+where_date+") WHERE l.amount_currency>0 and a.id =ANY(%s) GROUP BY a.id" ,(ids2,))
r= dict(cr.fetchall())
return self._compute_currency_for_level_tree(cr, uid, ids, ids2, r, acc_set, context)
-
+
def _balance_calc(self, cr, uid, ids, name, arg, context={}):
res = {}
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
acc_set = ",".join(map(str, ids2))
-
+
for i in ids:
res.setdefault(i,0.0)
-
+
if not ids2:
return res
-
+
where_date = ''
if context.get('from_date',False):
where_date += " AND l.date >= '" + context['from_date'] + "'"
if context.get('to_date',False):
where_date += " AND l.date <= '" + context['to_date'] + "'"
cr.execute("SELECT a.id, COALESCE(SUM(l.amount_currency),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id "+where_date+") WHERE a.id =ANY(%s) GROUP BY a.id",(ids2,))
-
+
for account_id, sum in cr.fetchall():
res[account_id] = sum
return self._compute_currency_for_level_tree(cr, uid, ids, ids2, res, acc_set, context)
-
+
def _quantity_calc(self, cr, uid, ids, name, arg, context={}):
#XXX must convert into one uom
res = {}
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
acc_set = ",".join(map(str, ids2))
-
+
for i in ids:
res.setdefault(i,0.0)
-
+
if not ids2:
return res
-
+
where_date = ''
if context.get('from_date',False):
where_date += " AND l.date >= '" + context['from_date'] + "'"
if context.get('to_date',False):
where_date += " AND l.date <= '" + context['to_date'] + "'"
-
+
cr.execute('SELECT a.id, COALESCE(SUM(l.unit_amount), 0) \
FROM account_analytic_account a \
LEFT JOIN account_analytic_line l ON (a.id = l.account_id ' + where_date + ') \
@@ -182,7 +182,7 @@ class account_analytic_account(osv.osv):
def _get_account_currency(self, cr, uid, ids, field_name, arg, context={}):
result=self._get_company_currency(cr, uid, ids, field_name, arg, context={})
return result
-
+
_columns = {
'name' : fields.char('Account Name', size=128, required=True),
'complete_name': fields.function(_complete_name_calc, method=True, type='char', string='Full Account Name'),
@@ -192,10 +192,10 @@ class account_analytic_account(osv.osv):
'parent_id': fields.many2one('account.analytic.account', 'Parent Analytic Account', select=2),
'child_ids': fields.one2many('account.analytic.account', 'parent_id', 'Child Accounts'),
'line_ids': fields.one2many('account.analytic.line', 'account_id', 'Analytic Entries'),
- 'balance' : fields.function(_balance_calc, method=True, type='float', string='Balance'),
- 'debit' : fields.function(_debit_calc, method=True, type='float', string='Debit'),
- 'credit' : fields.function(_credit_calc, method=True, type='float', string='Credit'),
- 'quantity': fields.function(_quantity_calc, method=True, type='float', string='Quantity'),
+ 'balance' : fields.function(_balance_calc, method=True, type='float', string='Balance',store=True),
+ 'debit' : fields.function(_debit_calc, method=True, type='float', string='Debit',store=True),
+ 'credit' : fields.function(_credit_calc, method=True, type='float', string='Credit',store=True),
+ 'quantity': fields.function(_quantity_calc, method=True, type='float', string='Quantity',store=True),
'quantity_max': fields.float('Maximum Quantity', help='Sets the higher limit of quantity of hours.'),
'partner_id' : fields.many2one('res.partner', 'Associated Partner'),
'contact_id' : fields.many2one('res.partner.address', 'Contact'),
diff --git a/addons/audittrail/i18n/it.po b/addons/audittrail/i18n/it.po
index 5ba61eb14a7..f795546b2fe 100644
--- a/addons/audittrail/i18n/it.po
+++ b/addons/audittrail/i18n/it.po
@@ -7,19 +7,23 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-04-07 08:27+0000\n"
-"Last-Translator: iTuxer \n"
+"PO-Revision-Date: 2009-02-03 12:33+0000\n"
+"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+<<<<<<< TREE
+"X-Launchpad-Export-Date: 2010-03-30 04:13+0000\n"
+=======
"X-Launchpad-Export-Date: 2010-04-17 04:17+0000\n"
+>>>>>>> MERGE-SOURCE
"X-Generator: Launchpad (build Unknown)\n"
#. module: audittrail
#: model:ir.module.module,shortdesc:audittrail.module_meta_information
msgid "Audit Trail"
-msgstr "Audit Trail"
+msgstr ""
#. module: audittrail
#: constraint:ir.model:0
@@ -32,22 +36,22 @@ msgstr ""
#. module: audittrail
#: field:audittrail.log.line,log_id:0
msgid "Log"
-msgstr "Log"
+msgstr ""
#. module: audittrail
#: selection:audittrail.rule,state:0
msgid "Subscribed"
-msgstr "Iscritto"
+msgstr ""
#. module: audittrail
#: view:audittrail.log:0
msgid "Old Value : "
-msgstr "Valore precendente : "
+msgstr ""
#. module: audittrail
#: selection:audittrail.log,method:0
msgid "Create"
-msgstr "Crea"
+msgstr ""
#. module: audittrail
#: wizard_view:audittrail.view.log,init:0
@@ -67,7 +71,7 @@ msgstr ""
#. module: audittrail
#: field:audittrail.log.line,old_value:0
msgid "Old Value"
-msgstr "Valore precedente"
+msgstr ""
#. module: audittrail
#: constraint:ir.actions.act_window:0
diff --git a/addons/base_contact/i18n/ko.po b/addons/base_contact/i18n/ko.po
index a5dbaad3f46..d209a3d2db3 100644
--- a/addons/base_contact/i18n/ko.po
+++ b/addons/base_contact/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 04:03+0000\n"
+>>>>>>> MERGE-SOURCE
"X-Generator: Launchpad (build Unknown)\n"
#. module: base_contact
diff --git a/addons/base_setup/i18n/fa.po b/addons/base_setup/i18n/fa.po
deleted file mode 100644
index 4977c9a4a3f..00000000000
--- a/addons/base_setup/i18n/fa.po
+++ /dev/null
@@ -1,283 +0,0 @@
-# Persian 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-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-04-08 14:27+0000\n"
-"Last-Translator: Sadegh Ismael Nattaj \n"
-"Language-Team: Persian \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:05+0000\n"
-"X-Generator: Launchpad (build Unknown)\n"
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,city:0
-#: wizard_field:base_setup.base_setup,init,city:0
-#: wizard_field:base_setup.base_setup,update,city:0
-msgid "City"
-msgstr "شهر"
-
-#. module: base_setup
-#: wizard_view:base_setup.base_setup,finish:0
-msgid ""
-"You can start configuring the system or connect directly to the database "
-"using the default setup."
-msgstr ""
-"شما میتوانید با بکارگیری از سوارسازی پیشفرض آغاز به پیکربندی سامانه کنید و "
-"یا یکراست به دادگان متصل شوید."
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,zip:0
-#: wizard_field:base_setup.base_setup,init,zip:0
-#: wizard_field:base_setup.base_setup,update,zip:0
-msgid "Zip code"
-msgstr "کد پستی"
-
-#. module: base_setup
-#: wizard_view:base_setup.base_setup,init:0
-msgid "Select a Profile"
-msgstr "یک پروفایل را برگزینید"
-
-#. module: base_setup
-#: wizard_view:base_setup.base_setup,company:0
-msgid "Report header"
-msgstr "سرنویس گزارش"
-
-#. module: base_setup
-#: wizard_button:base_setup.base_setup,finish,config:0
-msgid "Start Configuration"
-msgstr "آغاز پیکربندی"
-
-#. module: base_setup
-#: wizard_view:base_setup.base_setup,init:0
-msgid ""
-"You'll be able to install more modules later through the Administration menu."
-msgstr ""
-"شما میتوانید از طریق منوی راهبری پیمانههای بیشتری را در آینده برپاسازی "
-"نمایید."
-
-#. module: base_setup
-#: wizard_view:base_setup.base_setup,init:0
-msgid ""
-"A profile sets a pre-selection of modules for specific needs. These profiles "
-"have been setup to help you discover the different aspects of OpenERP. This "
-"is just an overview, we have 300+ available modules."
-msgstr ""
-"یک پروفایل دارای پیمانههای از پیش گزینش شده برای نیازهای خاص است. این "
-"پروفایلها برای این سوار میشوند تا به شما برای شناخت بیشتر جنبههای متفاوت "
-"اپن ایآرپی کمک نماید. این تنها یک پیشنمایش است، ما بیش از ۳۰۰ پیمانه "
-"آماده داریم."
-
-#. module: base_setup
-#: wizard_button:base_setup.base_setup,company,update:0
-#: wizard_button:base_setup.base_setup,init,company:0
-msgid "Next"
-msgstr "پس"
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,email:0
-#: wizard_field:base_setup.base_setup,init,email:0
-#: wizard_field:base_setup.base_setup,update,email:0
-msgid "E-mail"
-msgstr "ایمیل"
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,state_id:0
-#: wizard_field:base_setup.base_setup,init,state_id:0
-#: wizard_field:base_setup.base_setup,update,state_id:0
-msgid "State"
-msgstr "استان"
-
-#. module: base_setup
-#: wizard_view:base_setup.base_setup,finish:0
-msgid "Your new database is now fully installed."
-msgstr "دادگان نو شما بطور کامل برپاسازی گردید."
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,profile:0
-#: wizard_field:base_setup.base_setup,init,profile:0
-#: wizard_field:base_setup.base_setup,update,profile:0
-msgid "Profile"
-msgstr "پروفایل"
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,rml_footer1:0
-#: wizard_field:base_setup.base_setup,init,rml_footer1:0
-#: wizard_field:base_setup.base_setup,update,rml_footer1:0
-msgid "Report Footer 1"
-msgstr "پانویس گزارش ۱"
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,rml_footer2:0
-#: wizard_field:base_setup.base_setup,init,rml_footer2:0
-#: wizard_field:base_setup.base_setup,update,rml_footer2:0
-msgid "Report Footer 2"
-msgstr "پانویس گزارش ۲"
-
-#. module: base_setup
-#: wizard_view:base_setup.base_setup,company:0
-msgid "General Information"
-msgstr "آگهگان عمومی"
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,street2:0
-#: wizard_field:base_setup.base_setup,init,street2:0
-#: wizard_field:base_setup.base_setup,update,street2:0
-msgid "Street2"
-msgstr "خیابان۲"
-
-#. module: base_setup
-#: wizard_view:base_setup.base_setup,company:0
-msgid "Report Information"
-msgstr "آگهگان گزارش"
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,phone:0
-#: wizard_field:base_setup.base_setup,init,phone:0
-#: wizard_field:base_setup.base_setup,update,phone:0
-msgid "Phone"
-msgstr "تلفن"
-
-#. module: base_setup
-#: wizard_view:base_setup.base_setup,company:0
-msgid "Define Main Company"
-msgstr "تعریف شرکت اصلی"
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,name:0
-#: wizard_field:base_setup.base_setup,init,name:0
-#: wizard_field:base_setup.base_setup,update,name:0
-msgid "Company Name"
-msgstr "نام شرکت"
-
-#. module: base_setup
-#: help:base_setup.base_setup,company,rml_footer2:0
-#: help:base_setup.base_setup,init,rml_footer2:0
-#: help:base_setup.base_setup,update,rml_footer2:0
-msgid ""
-"This sentence will appear at the bottom of your reports.\n"
-"We suggest you to put bank information here:\n"
-"IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701"
-msgstr ""
-"این جمله در پایین گزارشهای شما ظاهر خواهد شد.\n"
-"پیشنهاد میکنیم آگهگان بانکی را اینجا وارد نمایید:\n"
-"IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701"
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,country_id:0
-#: wizard_field:base_setup.base_setup,init,country_id:0
-#: wizard_field:base_setup.base_setup,update,country_id:0
-msgid "Country"
-msgstr "کشور"
-
-#. module: base_setup
-#: wizard_view:base_setup.base_setup,company:0
-#: wizard_view:base_setup.base_setup,finish:0
-#: wizard_view:base_setup.base_setup,init:0
-#: wizard_view:base_setup.base_setup,update:0
-#: model:ir.actions.wizard,name:base_setup.action_wizard_setup
-#: model:ir.actions.wizard,name:base_setup.wizard_base_setup
-msgid "Setup"
-msgstr "سوارکردن"
-
-#. module: base_setup
-#: help:base_setup.base_setup,company,rml_footer1:0
-#: help:base_setup.base_setup,init,rml_footer1:0
-#: help:base_setup.base_setup,update,rml_footer1:0
-msgid ""
-"This sentence will appear at the bottom of your reports.\n"
-"We suggest you to write legal sentences here:\n"
-"Web: http://openerp.com - Fax: +32.81.73.35.01 - Fortis Bank: 126-2013269-07"
-msgstr ""
-"این جمله در پایین گزارشهای شما ظاهر خواهد شد.\n"
-"پیشنهاد میکنیم تا از عبارات قانونی در اینجا بکار ببرید:\n"
-"Web: http://openerp.com - Fax: +32.81.73.35.01 - Fortis Bank: 126-2013269-07"
-
-#. module: base_setup
-#: wizard_view:base_setup.base_setup,update:0
-msgid "Summary"
-msgstr "چکیده"
-
-#. module: base_setup
-#: wizard_button:base_setup.base_setup,update,finish:0
-msgid "Install"
-msgstr "برپایی"
-
-#. module: base_setup
-#: wizard_view:base_setup.base_setup,finish:0
-msgid "Installation Done"
-msgstr "برپایی انجام شد"
-
-#. module: base_setup
-#: help:base_setup.base_setup,company,rml_header1:0
-#: help:base_setup.base_setup,init,rml_header1:0
-#: help:base_setup.base_setup,update,rml_header1:0
-msgid ""
-"This sentence will appear at the top right corner of your reports.\n"
-"We suggest you to put a slogan here:\n"
-"\"Open Source Business Solutions\"."
-msgstr ""
-"این جمله در گوشه بالا سمت راست گزارشهای شما ظاهر خواهد شد.\n"
-"پیشنهاد میکنیم شعار خود را اینجا قرار دهید:\n"
-"\"راهکارهای بازمتن برای تجارت\"."
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,rml_header1:0
-#: wizard_field:base_setup.base_setup,init,rml_header1:0
-#: wizard_field:base_setup.base_setup,update,rml_header1:0
-msgid "Report Header"
-msgstr "سرنویس گزارش"
-
-#. module: base_setup
-#: wizard_view:base_setup.base_setup,company:0
-msgid "Your Logo - Use a size of about 450x150 pixels."
-msgstr "نشان شما - اندازه تصویری ۱۵۰×۴۵۰ پیکسل را بکار برید."
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,currency:0
-#: wizard_field:base_setup.base_setup,init,currency:0
-#: wizard_field:base_setup.base_setup,update,currency:0
-msgid "Currency"
-msgstr "ارز"
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,street:0
-#: wizard_field:base_setup.base_setup,init,street:0
-#: wizard_field:base_setup.base_setup,update,street:0
-msgid "Street"
-msgstr "خیابان"
-
-#. module: base_setup
-#: wizard_button:base_setup.base_setup,finish,menu:0
-msgid "Use Directly"
-msgstr "بکارگیری آنی"
-
-#. module: base_setup
-#: wizard_button:base_setup.base_setup,init,menu:0
-msgid "Cancel"
-msgstr "لغو"
-
-#. module: base_setup
-#: wizard_field:base_setup.base_setup,company,logo:0
-#: wizard_field:base_setup.base_setup,init,logo:0
-#: wizard_field:base_setup.base_setup,update,logo:0
-msgid "Logo"
-msgstr "نشان"
-
-#. module: base_setup
-#: model:ir.module.module,shortdesc:base_setup.module_meta_information
-msgid "Base Setup"
-msgstr "سوارکردن پایه"
-
-#. module: base_setup
-#: wizard_button:base_setup.base_setup,company,init:0
-#: wizard_button:base_setup.base_setup,update,company:0
-msgid "Previous"
-msgstr "پیش"
diff --git a/addons/board_account/__openerp__.py b/addons/board_account/__openerp__.py
index 82ecb16fa37..58de913f2ea 100644
--- a/addons/board_account/__openerp__.py
+++ b/addons/board_account/__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 .
#
##############################################################################
@@ -38,9 +38,6 @@
'account',
'hr_timesheet_invoice',
'board',
- 'report_account',
- 'report_analytic',
- 'report_analytic_line',
'account_report'
],
'update_xml': ['board_account_view.xml'],
diff --git a/addons/board_account/board_account_view.xml b/addons/board_account/board_account_view.xml
index 50b0fedd37e..2beb9899cb6 100644
--- a/addons/board_account/board_account_view.xml
+++ b/addons/board_account/board_account_view.xml
@@ -41,7 +41,7 @@
-
+
diff --git a/addons/board_crm_configuration/__init__.py b/addons/board_crm/__init__.py
similarity index 100%
rename from addons/board_crm_configuration/__init__.py
rename to addons/board_crm/__init__.py
diff --git a/addons/board_crm_configuration/__openerp__.py b/addons/board_crm/__openerp__.py
similarity index 100%
rename from addons/board_crm_configuration/__openerp__.py
rename to addons/board_crm/__openerp__.py
diff --git a/addons/board_crm_configuration/board_crm_demo.xml b/addons/board_crm/board_crm_demo.xml
similarity index 100%
rename from addons/board_crm_configuration/board_crm_demo.xml
rename to addons/board_crm/board_crm_demo.xml
diff --git a/addons/board_crm_configuration/board_crm_statistical_view.xml b/addons/board_crm/board_crm_statistical_view.xml
similarity index 91%
rename from addons/board_crm_configuration/board_crm_statistical_view.xml
rename to addons/board_crm/board_crm_statistical_view.xml
index 2b3c348c6a4..9a43e4e96c2 100644
--- a/addons/board_crm_configuration/board_crm_statistical_view.xml
+++ b/addons/board_crm/board_crm_statistical_view.xml
@@ -6,40 +6,38 @@
-->
Leads By Stage - Graph
- report.crm.lead.section.stage
+ crm.lead.report
graph
-
report.crm.opportunity.categ.graph
- report.crm.opportunity.categ
+ crm.opportunity.report
graph
-
- report.crm.lead.section.stage
+ crm.lead.report
form
graph,tree,form
@@ -48,7 +46,7 @@
+
+
+
+ CRM Configuration
+
+
+ crm.opportunity.user.graph1
+ crm.opportunity.report
+ graph
+
+
+
+
+
+
+
+
+ crm.lead
+ form
+ tree,form
+
+ [('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]
+
+
+ crm.meeting
+ form
+ tree,form
+
+ [('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]
+
+
+
+ crm.lead.report
+ form
+ graph,tree,form
+
+ [('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]
+
+
+
+ crm.opportunity.report
+ form
+ graph,tree,form
+
+ [('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]
+
+
+
+ CRM - Dashboard Form
+ board.board
+ form
+
+
+
+
+
+ CRM Dashboard
+ board.board
+ form
+ form
+ menu
+
+
+
+
+
+
+
+
diff --git a/addons/board_crm_configuration/i18n/ar.po b/addons/board_crm/i18n/ar.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/ar.po
rename to addons/board_crm/i18n/ar.po
diff --git a/addons/board_crm_configuration/i18n/bg.po b/addons/board_crm/i18n/bg.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/bg.po
rename to addons/board_crm/i18n/bg.po
diff --git a/addons/board_crm_configuration/i18n/board_crm_configuration.pot b/addons/board_crm/i18n/board_crm_configuration.pot
similarity index 100%
rename from addons/board_crm_configuration/i18n/board_crm_configuration.pot
rename to addons/board_crm/i18n/board_crm_configuration.pot
diff --git a/addons/board_crm_configuration/i18n/bs.po b/addons/board_crm/i18n/bs.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/bs.po
rename to addons/board_crm/i18n/bs.po
diff --git a/addons/board_crm_configuration/i18n/ca.po b/addons/board_crm/i18n/ca.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/ca.po
rename to addons/board_crm/i18n/ca.po
diff --git a/addons/board_crm_configuration/i18n/cs.po b/addons/board_crm/i18n/cs.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/cs.po
rename to addons/board_crm/i18n/cs.po
diff --git a/addons/board_crm_configuration/i18n/de.po b/addons/board_crm/i18n/de.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/de.po
rename to addons/board_crm/i18n/de.po
diff --git a/addons/board_crm_configuration/i18n/el.po b/addons/board_crm/i18n/el.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/el.po
rename to addons/board_crm/i18n/el.po
diff --git a/addons/board_crm_configuration/i18n/es.po b/addons/board_crm/i18n/es.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/es.po
rename to addons/board_crm/i18n/es.po
diff --git a/addons/board_crm_configuration/i18n/es_AR.po b/addons/board_crm/i18n/es_AR.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/es_AR.po
rename to addons/board_crm/i18n/es_AR.po
diff --git a/addons/board_crm_configuration/i18n/et.po b/addons/board_crm/i18n/et.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/et.po
rename to addons/board_crm/i18n/et.po
diff --git a/addons/board_crm_configuration/i18n/fr.po b/addons/board_crm/i18n/fr.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/fr.po
rename to addons/board_crm/i18n/fr.po
diff --git a/addons/board_crm_configuration/i18n/hr.po b/addons/board_crm/i18n/hr.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/hr.po
rename to addons/board_crm/i18n/hr.po
diff --git a/addons/board_crm_configuration/i18n/hu.po b/addons/board_crm/i18n/hu.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/hu.po
rename to addons/board_crm/i18n/hu.po
diff --git a/addons/board_crm_configuration/i18n/id.po b/addons/board_crm/i18n/id.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/id.po
rename to addons/board_crm/i18n/id.po
diff --git a/addons/board_crm_configuration/i18n/it.po b/addons/board_crm/i18n/it.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/it.po
rename to addons/board_crm/i18n/it.po
diff --git a/addons/board_crm_configuration/i18n/ko.po b/addons/board_crm/i18n/ko.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/ko.po
rename to addons/board_crm/i18n/ko.po
diff --git a/addons/board_crm_configuration/i18n/lt.po b/addons/board_crm/i18n/lt.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/lt.po
rename to addons/board_crm/i18n/lt.po
diff --git a/addons/board_crm_configuration/i18n/nl.po b/addons/board_crm/i18n/nl.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/nl.po
rename to addons/board_crm/i18n/nl.po
diff --git a/addons/board_crm_configuration/i18n/nl_BE.po b/addons/board_crm/i18n/nl_BE.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/nl_BE.po
rename to addons/board_crm/i18n/nl_BE.po
diff --git a/addons/board_crm_configuration/i18n/pl.po b/addons/board_crm/i18n/pl.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/pl.po
rename to addons/board_crm/i18n/pl.po
diff --git a/addons/board_crm_configuration/i18n/pt.po b/addons/board_crm/i18n/pt.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/pt.po
rename to addons/board_crm/i18n/pt.po
diff --git a/addons/board_crm_configuration/i18n/pt_BR.po b/addons/board_crm/i18n/pt_BR.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/pt_BR.po
rename to addons/board_crm/i18n/pt_BR.po
diff --git a/addons/board_crm_configuration/i18n/ro.po b/addons/board_crm/i18n/ro.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/ro.po
rename to addons/board_crm/i18n/ro.po
diff --git a/addons/board_crm_configuration/i18n/ru.po b/addons/board_crm/i18n/ru.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/ru.po
rename to addons/board_crm/i18n/ru.po
diff --git a/addons/board_crm_configuration/i18n/sk.po b/addons/board_crm/i18n/sk.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/sk.po
rename to addons/board_crm/i18n/sk.po
diff --git a/addons/board_crm_configuration/i18n/sl.po b/addons/board_crm/i18n/sl.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/sl.po
rename to addons/board_crm/i18n/sl.po
diff --git a/addons/board_crm_configuration/i18n/sq.po b/addons/board_crm/i18n/sq.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/sq.po
rename to addons/board_crm/i18n/sq.po
diff --git a/addons/board_crm_configuration/i18n/sv.po b/addons/board_crm/i18n/sv.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/sv.po
rename to addons/board_crm/i18n/sv.po
diff --git a/addons/board_crm_configuration/i18n/tlh.po b/addons/board_crm/i18n/tlh.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/tlh.po
rename to addons/board_crm/i18n/tlh.po
diff --git a/addons/board_crm_configuration/i18n/tr.po b/addons/board_crm/i18n/tr.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/tr.po
rename to addons/board_crm/i18n/tr.po
diff --git a/addons/board_crm_configuration/i18n/uk.po b/addons/board_crm/i18n/uk.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/uk.po
rename to addons/board_crm/i18n/uk.po
diff --git a/addons/board_crm_configuration/i18n/vi.po b/addons/board_crm/i18n/vi.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/vi.po
rename to addons/board_crm/i18n/vi.po
diff --git a/addons/board_crm_configuration/i18n/zh_CN.po b/addons/board_crm/i18n/zh_CN.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/zh_CN.po
rename to addons/board_crm/i18n/zh_CN.po
diff --git a/addons/board_crm_configuration/i18n/zh_TW.po b/addons/board_crm/i18n/zh_TW.po
similarity index 100%
rename from addons/board_crm_configuration/i18n/zh_TW.po
rename to addons/board_crm/i18n/zh_TW.po
diff --git a/addons/board_crm_configuration/board_crm_view.xml b/addons/board_crm_configuration/board_crm_view.xml
deleted file mode 100644
index 51f09c25d62..00000000000
--- a/addons/board_crm_configuration/board_crm_view.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
-
- CRM Configuration
-
-
-
- crm.opportunity.user.graph1
- report.crm.opportunity.user
- graph
-
-
-
-
-
-
-
-
-
- crm.lead
- form
- tree,form
-
- [('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]
-
-
-
- crm.meeting
- form
- tree,form
-
- [('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]
-
-
-
-
-
- report.crm.lead.section.stage
- form
- graph,tree,form
-
- [('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]
-
-
-
- report.crm.opportunity.user
- form
- graph,tree,form
-
- [('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]
-
-
-
- CRM - Dashboard Form
- board.board
- form
-
-
-
-
-
- CRM Dashboard
- board.board
- form
- form
- menu
-
-
-
-
-
-
-
-
diff --git a/addons/board_hr/__openerp__.py b/addons/board_hr/__openerp__.py
index b64d09c1b33..500887abb52 100644
--- a/addons/board_hr/__openerp__.py
+++ b/addons/board_hr/__openerp__.py
@@ -32,7 +32,7 @@ This module implements a dashboard for human resource management that includes:
""",
'author': 'Tiny',
'depends': [ 'project_issue','board','hr_expense','hr_timesheet_sheet','hr_holidays'
- ],
+ , 'hr_evaluation'],
'update_xml': ['board_hr_view.xml'],
'demo_xml': [],
'installable': True,
diff --git a/addons/board_hr/board_hr_view.xml b/addons/board_hr/board_hr_view.xml
index 710a6d88b4a..d26b4b2e6cf 100644
--- a/addons/board_hr/board_hr_view.xml
+++ b/addons/board_hr/board_hr_view.xml
@@ -15,25 +15,52 @@
-
- Timesheets
+
+ My Current Evaluations
ir.actions.act_window
- hr_timesheet_sheet.sheet
+ hr_evaluation.evaluation
form
- [('date_to','>=',time.strftime('%Y-%m-01')),('date_from','<=',time.strftime('%Y-%m-01'))]
-
+ [('state','!=','done'),('create_uid','=',uid)]
+
My Leaves
ir.actions.act_window
- hr.holidays.per.user
+ hr.holidays
form
tree,form
-
+ [('user_id','=',uid)]
+
+
+ Timesheets by Month
+ ir.actions.act_window
+ timesheet.report
+ form
+ graph,tree
+ [('user_id','=',uid), ('month', '=' , time.strftime('%m')), ('year', '=', time.strftime('%Y'))]
+
+
+
+ Remaining Leaves by User
+ ir.actions.act_window
+ hr.holidays.remaining.leaves.user
+ form
+ graph,tree
+ [('user_id','=',uid)]
+
+
+
+ Timesheets
+ ir.actions.act_window
+ hr_timesheet_sheet.sheet
+ form
+ graph,tree
+
+
board.hr.form
board.board
@@ -42,11 +69,13 @@
diff --git a/addons/board_project/__openerp__.py b/addons/board_project/__openerp__.py
index 92a8aeb1518..f934c7d3bc5 100644
--- a/addons/board_project/__openerp__.py
+++ b/addons/board_project/__openerp__.py
@@ -34,16 +34,14 @@ This module implements a dashboard for project member that includes:
'author': 'Tiny',
'depends': [
'project',
- 'report_timesheet',
'board',
'project_planning',
- 'report_analytic_line',
- 'report_task',
'hr_timesheet_sheet',
'project_issue',
- 'resource'
+ 'resource',
+ 'scrum'
],
- 'update_xml': ['board_project_view.xml', 'board_project_manager_view.xml'],
+ 'update_xml': ['board_project_view.xml', 'board_project_manager_view.xml','board_project_issue_view.xml','board_scrum_view.xml'],
'demo_xml': ['board_project_demo.xml'],
'installable': True,
'active': False,
diff --git a/addons/board_project/board_project_issue_view.xml b/addons/board_project/board_project_issue_view.xml
new file mode 100644
index 00000000000..eaf3a2f8612
--- /dev/null
+++ b/addons/board_project/board_project_issue_view.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+ Project issues
+ project.issue
+ form
+ tree,form
+ [('create_date', '>=', time.strftime('%Y-%m-%d 00:00:00')),('create_date', '<=', time.strftime('%Y-%m-%d 23:59:59'))]
+
+
+
+
+ board.project.issue.form
+ board.board
+ form
+
+
+
+
+
+
+ Project Issue Dashboard
+ board.board
+ form
+ form
+ menu
+
+
+
+
+
diff --git a/addons/board_project/board_project_manager_view.xml b/addons/board_project/board_project_manager_view.xml
index f22a2acde55..e2ce251e49b 100644
--- a/addons/board_project/board_project_manager_view.xml
+++ b/addons/board_project/board_project_manager_view.xml
@@ -13,13 +13,13 @@
-
- Pipeline of tasks
- report.task.user.pipeline.open
- form
- graph,tree
- [('user_id','in',department_users_get())]
-
+
+
+
+
+
+
+
hr.timesheet.sheet.tree.simplified.board
@@ -66,7 +66,6 @@
-
diff --git a/addons/board_project/board_project_view.xml b/addons/board_project/board_project_view.xml
index 231aebdb110..1c5093cb047 100644
--- a/addons/board_project/board_project_view.xml
+++ b/addons/board_project/board_project_view.xml
@@ -47,6 +47,14 @@
[('user_id','=',uid),('state','=','open')]
+
+ My Pending Tasks
+ project.task
+ form
+ tree,form
+ [('user_id','=',uid),('state','=','pending')]
+
+
My Task's Deadlines
project.task
@@ -91,13 +99,18 @@
-
-
+
+
+
+
+
+
+
+
diff --git a/addons/board_project/board_scrum_view.xml b/addons/board_project/board_scrum_view.xml
new file mode 100644
index 00000000000..daf3cb375ca
--- /dev/null
+++ b/addons/board_project/board_scrum_view.xml
@@ -0,0 +1,63 @@
+
+
+
+
+ scrum.sprint.dashboard.tree
+ scrum.sprint
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sprint's List
+ scrum.sprint
+ form
+ tree,form
+
+
+
+ board.project.form
+ board.board
+ form
+
+
+
+
+
+ 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 = '''
-'''
-
-duplicate_fields = {
- 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
+{
+ 'name': 'Board for Purchase Management',
+ 'version': '1.0',
+ 'category': 'Board/Purchase',
+ 'description': """
+This module implements a dashboard for purcgase management that includes:
+ * Current Purchase Orders
+ * Draft Purchase Orders
+ * Graph for quantity and amount per month
+ """,
+ 'author': 'Tiny',
+ 'depends': [ 'purchase','board',
+ ],
+ 'update_xml': ['board_purchase_view.xml'],
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
}
-
-def _do_duplicate(self, cr, uid, data, context):
- account_obj = pooler.get_pool(cr.dbname).get('account.account')
- account_obj.copy(cr, uid, data['id'], data['form'], context=context)
- return {}
-
-class wizard_account_duplicate(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch': duplicate_form, 'fields': duplicate_fields, 'state': (('end', 'Cancel', 'gtk-cancel'), ('duplicate', 'Duplicate', 'gtk-ok'))},
- },
- 'duplicate': {
- 'actions': [_do_duplicate],
- 'result': {'type': 'state', 'state': 'end'},
- },
- }
-wizard_account_duplicate('account.wizard.account.duplicate')
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/board_purchase/board_purchase_view.xml b/addons/board_purchase/board_purchase_view.xml
new file mode 100644
index 00000000000..2370e247eec
--- /dev/null
+++ b/addons/board_purchase/board_purchase_view.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+ Quotation Request
+ ir.actions.act_window
+ purchase.order
+ form
+ tree,form
+ [('date_order','>',time.strftime('%Y-01-01 00:00:00')),('date_order','<',time.strftime('%Y-12-31 23:59:59')), ('state','in',('wait','confirmed'))]
+
+
+
+
+ board.purchase.form
+ board.board
+ 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.form
board.board
form
-
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 @@
form
tree,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.fundraising
tree,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.helpdesk
tree,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.lead
tree,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.meeting
calendar,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 e147d4ed20d..204890e348c 100644
--- a/addons/crm/crm_opportunity.py
+++ b/addons/crm/crm_opportunity.py
@@ -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={}):
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.opportunity
tree,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"
+ />
form
tree,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 @@
Claims
crm.claim.report
form
- 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.report
tree
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -67,8 +68,14 @@
search
-
-
+
+
+
+
+
+
+
+
@@ -79,8 +86,8 @@
crm.fundraising.report
form
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_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" />
form
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_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 @@
Leads
crm.lead.report
form
+ {"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.report
tree
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
+
@@ -69,15 +70,24 @@
search
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -88,7 +98,7 @@
crm.opportunity.report
form
tree,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.report
form
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_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.report
form
tree,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 de8fac00fce..5e6ab5a094c 100755
--- a/addons/crm/scripts/openerp_mailgate/openerp_mailgate.py
+++ b/addons/crm/scripts/openerp_mailgate/openerp_mailgate.py
@@ -168,8 +168,8 @@ class email_parser(object):
def _decode_header(self, s):
from email.Header import decode_header
- s = decode_header(s)
- return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s))
+ s = decode_header(s)
+ return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s or []))
def msg_new(self, msg):
message = self.msg_body_get(msg)
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/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 @@
-
-
+
diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml
index 5125052c499..5e04cf1aaad 100644
--- a/addons/hr/hr_view.xml
+++ b/addons/hr/hr_view.xml
@@ -314,7 +314,7 @@
-
+
diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py
index 1d0be1f288e..a1d89f67b28 100644
--- a/addons/hr_evaluation/hr_evaluation.py
+++ b/addons/hr_evaluation/hr_evaluation.py
@@ -318,8 +318,7 @@ class hr_evaluation_interview(osv.osv):
record = record and record[0]
context.update({'survey_id': record.survey_id.id, 'response_id' : [record.response.id], 'response_no':0,})
value = self.pool.get("survey").action_print_survey(cr, uid, ids, context)
- return value
-
+ return value
hr_evaluation_interview()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:1
diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml
index bf6e45376e7..cff66266686 100644
--- a/addons/hr_evaluation/hr_evaluation_view.xml
+++ b/addons/hr_evaluation/hr_evaluation_view.xml
@@ -202,14 +202,24 @@
-
+
+ hr_evaluation.evaluation.graph
+ hr_evaluation.evaluation
+ graph
+
+
+
+
+
+
+
hr_evaluation.evaluation_search
hr_evaluation.evaluation
search
-
+
@@ -242,7 +252,7 @@
hr_evaluation.evaluation
form
- tree,form
+ tree,form,graph
@@ -297,8 +307,8 @@
-
+
diff --git a/addons/hr_evaluation/report/hr_evaluation_report.py b/addons/hr_evaluation/report/hr_evaluation_report.py
index 3b318905bbe..504bdcd08f4 100644
--- a/addons/hr_evaluation/report/hr_evaluation_report.py
+++ b/addons/hr_evaluation/report/hr_evaluation_report.py
@@ -27,14 +27,24 @@ class hr_evaluation_report(osv.osv):
_auto = False
_rec_name = 'date'
_columns = {
- 'create_date': fields.datetime('Create Date', readonly=True),
+ 'create_date': fields.date('Create Date', readonly=True),
+ 'day': fields.char('Day', size=128, readonly=True),
'deadline': fields.date("Deadline", readonly=True),
+ 'request_id': fields.many2one('survey.request','Request_id', readonly=True),
'closed': fields.date("closed", 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),
+ 'plan_id': fields.many2one('hr_evaluation.plan', 'Plan', readonly=True),
'employee_id': fields.many2one('hr.employee', "Employee", readonly=True),
+ 'rating': fields.selection([
+ ('0','Significantly bellow expectations'),
+ ('1','Did not meet expectations'),
+ ('2','Meet expectations'),
+ ('3','Exceeds expectations'),
+ ('4','Significantly exceeds expectations'),
+ ], "Overall Rating", readonly=True),
'nbr':fields.integer('# of Requests', readonly=True),
'state': fields.selection([
('draft','Draft'),
@@ -51,21 +61,35 @@ class hr_evaluation_report(osv.osv):
create or replace view hr_evaluation_report as (
select
min(l.id) as id,
- s.create_date as create_date,
+ date_trunc('day',s.create_date) as create_date,
+ to_char(s.create_date, 'YYYY-MM-DD') as day,
s.employee_id,
+ l.request_id,
+ s.plan_id,
+ s.rating,
s.date as deadline,
s.date_close as closed,
to_char(s.create_date, 'YYYY') as year,
to_char(s.create_date, 'MM') as month,
- count(*) as nbr,
+ count(l.*) as nbr,
s.state
from
hr_evaluation_interview l
left join
hr_evaluation_evaluation s on (s.id=l.evaluation_id)
group by
- s.create_date,s.state,s.employee_id,
- s.date,s.date_close
+ s.create_date,
+ date_trunc('day',s.create_date),
+ to_char(s.create_date, 'YYYY-MM-DD'),
+ to_char(s.create_date, 'YYYY'),
+ to_char(s.create_date, 'MM'),
+ s.state,
+ s.employee_id,
+ s.date,
+ s.date_close,
+ l.request_id,
+ s.rating,
+ s.plan_id
)
""")
hr_evaluation_report()
diff --git a/addons/hr_evaluation/report/hr_evaluation_report_view.xml b/addons/hr_evaluation/report/hr_evaluation_report_view.xml
index 2048c8337db..0417fb0ffd2 100644
--- a/addons/hr_evaluation/report/hr_evaluation_report_view.xml
+++ b/addons/hr_evaluation/report/hr_evaluation_report_view.xml
@@ -7,49 +7,95 @@
tree
-
-
-
+
+
+
+
+
+
-
+
+
+ hr.evaluation.report.graph
+ hr.evaluation.report
+ graph
+
+
+
+
+
+
+
+
+
hr.evaluation.report.search
hr.evaluation.report
search
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
@@ -61,7 +107,8 @@
Evaluations
hr.evaluation.report
form
- tree
+ tree,graph
+ {'search_default_month':1,'search_default_employee':1,'group_by_no_leaf':1,'group_by':[]}
diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml
index b8f3c1928ed..292cbf6f027 100644
--- a/addons/hr_expense/hr_expense_view.xml
+++ b/addons/hr_expense/hr_expense_view.xml
@@ -66,6 +66,7 @@
@@ -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.report
form
tree,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.py b/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py
new file mode 100644
index 00000000000..27c0a2c49bd
--- /dev/null
+++ b/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py
@@ -0,0 +1,116 @@
+# -*- 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 .
+#
+##############################################################################
+
+import time
+
+from osv import osv, fields
+from tools.translate import _
+
+class job2phonecall(osv.osv_memory):
+ _name = 'hr.recruitment.job2phonecall'
+ _description = 'Schedule Phone Call'
+ _columns = {
+ 'user_id': fields.many2one('res.users', 'Assign To'),
+ 'deadline': fields.datetime('Planned Date'),
+ 'note': fields.text('Goals'),
+ 'category_id': fields.many2one('crm.case.categ', 'Category', required=True),
+ }
+
+ def _date_user(self, cr, uid, context=None):
+ case_obj = self.pool.get('hr.applicant')
+ case = case_obj.browse(cr, uid, context['active_id'])
+ return case.user_id and case.user_id.id or False
+
+ def _date_category(self, cr, uid, context=None):
+ categ_id = self.pool.get('crm.case.categ').search(cr, uid, [('name','=','Outbound')])
+ return categ_id and categ_id[0] or case.categ_id and case.categ_id.id or False
+
+ def _get_note(self, cr, uid, context=None):
+ case_obj = self.pool.get('hr.applicant')
+ case = case_obj.browse(cr, uid, context['active_id'])
+ return case.description or ''
+
+ _defaults = {
+ 'user_id': _date_user,
+ 'category_id': _date_category,
+ 'note': _get_note
+ }
+
+ def make_phonecall(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ job_case_obj = self.pool.get('hr.applicant')
+ data_obj = self.pool.get('ir.model.data')
+ phonecall_case_obj = self.pool.get('crm.phonecall')
+
+ form = self.read(cr, uid, ids, [], context=context)[0]
+# form = data['form']
+ result = mod_obj._get_id(cr, uid, 'crm', 'view_crm_case_phonecalls_filter')
+ res = mod_obj.read(cr, uid, result, ['res_id'])
+ # Select the view
+
+ id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_phone_tree_view')
+ id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_phone_form_view')
+ if id2:
+ id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+ if id3:
+ id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+
+ for job in job_case_obj.browse(cr, uid, context['active_ids']):
+ #TODO : Take other info from job
+ new_phonecall_id = phonecall_case_obj.create(cr, uid, {
+ 'name' : job.name,
+ 'user_id' : form['user_id'],
+ 'categ_id' : form['category_id'],
+ 'description' : form['note'],
+ 'date' : form['deadline'],
+# 'section_id' : form['section_id'],
+ 'description':job.description,
+ 'partner_id':job.partner_id.id,
+ 'partner_address_id':job.partner_address_id.id,
+ 'partner_phone':job.partner_phone,
+ 'partner_mobile':job.partner_mobile,
+ 'description':job.description,
+ 'date':job.date,
+ }, context=context)
+ new_phonecall = phonecall_case_obj.browse(cr, uid, new_phonecall_id)
+ vals = {}
+# if not job.case_id:
+# vals.update({'phonecall_id' : new_phonecall.id})
+ job_case_obj.write(cr, uid, [job.id], vals)
+ job_case_obj.case_cancel(cr, uid, [job.id])
+ phonecall_case_obj.case_open(cr, uid, [new_phonecall_id])
+
+ value = {
+ 'name': _('Phone Call'),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'crm.phonecall',
+ 'res_id' : new_phonecall_id,
+ 'views': [(id3,'form'),(id2,'tree'),(False,'calendar'),(False,'graph')],
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': res['res_id']
+ }
+ return value
+
+job2phonecall()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:>>>>>>> MERGE-SOURCE
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
deleted file mode 100644
index a12ff4957eb..00000000000
--- a/addons/hr_recruitment/wizard/hr_recruitment_wizard.py
+++ /dev/null
@@ -1,218 +0,0 @@
-# -*- 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 mx.DateTime import now
-
-import wizard
-import netsvc
-import ir
-import pooler
-import time
-
-from tools.translate import _
-
-class job2phonecall(wizard.interface):
- case_form = """
- """
-
- case_fields = {
- 'user_id' : {'string' : 'Assign To', 'type' : 'many2one', 'relation' : 'res.users'},
- 'deadline' : {'string' : 'Planned Date', 'type' : 'datetime'},
- 'note' : {'string' : 'Goals', 'type' : 'text'},
- 'category_id' : {'string' : 'Category', 'type' : 'many2one', 'relation' : 'crm.case.categ', 'required' : True},
- 'section_id' : {'string' : 'Section', 'type' : 'many2one', 'relation' : 'hr.case.section'},
-
- }
- def _default_values(self, cr, uid, data, context):
-
- case_obj = pooler.get_pool(cr.dbname).get('hr.applicant')
- categ_id=pooler.get_pool(cr.dbname).get('crm.case.categ').search(cr, uid, [('name','=','Outbound')])
- case = case_obj.browse(cr, uid, data['id'])
- return {
- 'user_id' : case.user_id and case.user_id.id,
- 'category_id' : categ_id and categ_id[0] or case.categ_id and case.categ_id.id,
- 'section_id' : case.section_id and case.section_id.id or False,
- 'note' : case.description
- }
-
- def _doIt(self, cr, uid, data, context):
- form = data['form']
- pool = pooler.get_pool(cr.dbname)
- mod_obj = pool.get('ir.model.data')
- result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter')
- res = mod_obj.read(cr, uid, result, ['res_id'])
- phonecall_case_obj = pool.get('hr.phonecall')
- job_case_obj = pool.get('hr.applicant')
- # Select the view
-
- data_obj = pool.get('ir.model.data')
- id2 = data_obj._get_id(cr, uid, 'hr', 'hr_case_phone_tree_view')
- id3 = data_obj._get_id(cr, uid, 'hr', 'hr_case_phone_form_view')
- if id2:
- id2 = data_obj.browse(cr, uid, id2, context=context).res_id
- if id3:
- id3 = data_obj.browse(cr, uid, id3, context=context).res_id
-
- for job in job_case_obj.browse(cr, uid, data['ids']):
- #TODO : Take other info from job
- new_phonecall_id = phonecall_case_obj.create(cr, uid, {
- 'name' : job.name,
- 'user_id' : form['user_id'],
- 'categ_id' : form['category_id'],
- 'description' : form['note'],
- 'date' : form['deadline'],
- 'section_id' : form['section_id'],
- 'description':job.description,
- 'partner_id':job.partner_id.id,
- 'partner_address_id':job.partner_address_id.id,
- 'partner_phone':job.partner_phone,
- 'partner_mobile':job.partner_mobile,
- 'description':job.description,
- 'date':job.date,
- }, context=context)
- new_phonecall = phonecall_case_obj.browse(cr, uid, new_phonecall_id)
- vals = {}
- if not job.case_id:
- vals.update({'phonecall_id' : new_phonecall.id})
- job_case_obj.write(cr, uid, [job.id], vals)
- job_case_obj.case_cancel(cr, uid, [job.id])
- phonecall_case_obj.case_open(cr, uid, [new_phonecall_id])
- value = {
- 'name': _('Phone Call'),
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'hr.phonecall',
- 'res_id' : new_phonecall_id,
- 'views': [(id3,'form'),(id2,'tree'),(False,'calendar'),(False,'graph')],
- 'type': 'ir.actions.act_window',
- 'search_view_id': res['res_id']
- }
- return value
-
- states = {
- 'init': {
- 'actions': [_default_values],
- 'result': {'type': 'form', 'arch': case_form, 'fields': case_fields,
- 'state' : [('end', 'Cancel','gtk-cancel'),('order', 'Schedule Phone Call','gtk-go-forward')]}
- },
- 'order': {
- 'actions': [],
- 'result': {'type': 'action', 'action': _doIt, 'state': 'end'}
- }
- }
-
-job2phonecall('hr.applicant.reschedule_phone_call')
-
-class partner_create(wizard.interface):
-
- case_form = """
- """
-
- case_fields = {
- 'close': {'type':'boolean', 'string':'Close job request'}
- }
-
- def _selectPartner(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- case_obj = pool.get('hr.applicant')
- for case in case_obj.browse(cr, uid, data['ids']):
- if case.partner_id:
- raise wizard.except_wizard(_('Warning !'),
- _('A partner is already defined on this job request.'))
- return {}
-
- def _makeOrder(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, 'base', 'view_res_partner_filter')
- res = mod_obj.read(cr, uid, result, ['res_id'])
- case_obj = pool.get('hr.applicant')
- partner_obj = pool.get('res.partner')
- contact_obj = pool.get('res.partner.address')
- for case in case_obj.browse(cr, uid, data['ids']):
- partner_id = partner_obj.search(cr, uid, [('name', '=', case.partner_name or case.name)])
- if partner_id:
- raise wizard.except_wizard(_('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_name2,
- 'phone': case.partner_phone,
- 'mobile': case.partner_mobile,
- 'email': case.email_from
- })
-
-
- case_obj.write(cr, uid, data['ids'], {
- 'partner_id': partner_id,
- 'partner_address_id': contact_id
- })
- if data['form']['close']:
- case_obj.case_close(cr, uid, data['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
-
- states = {
- 'init': {
- 'actions': [_selectPartner],
- 'result': {'type': 'form', 'arch': case_form, 'fields': case_fields,
- 'state' : [('end', 'Cancel', 'gtk-cancel'),('confirm', 'Create Partner', 'gtk-go-forward')]}
- },
- 'confirm': {
- 'actions': [],
- 'result': {'type': 'action', 'action': _makeOrder, 'state': 'end'}
- }
- }
-
-partner_create('hr.applicant.partner_create')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
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..1a8b110d690 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.form
hr_timesheet_sheet.sheet.account
@@ -181,10 +192,10 @@
-
+
-
-
+
+
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.py b/addons/mrp/mrp.py
index 429a3497634..675c4a73bb0 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -162,16 +162,25 @@ class mrp_bom(osv.osv):
"""
result = {}
bom_obj = self.pool.get('mrp.bom')
+ bom_id = context and context.get('active_id', False) or False
+ cr.execute('select id from mrp_bom')
+ if all(bom_id != r[0] for r in cr.fetchall()):
+ ids.sort()
+ bom_id = ids[0]
+ bom_parent = bom_obj.browse(cr, uid, bom_id)
for bom in self.browse(cr, uid, ids, context=context):
- result[bom.id] = map(lambda x: x.id, bom.bom_lines)
+ if (bom_parent and bom_parent.multi_level_bom) or bom.id == bom_id:
+ result[bom.id] = map(lambda x: x.id, bom.bom_lines)
+ else:
+ result[bom.id] = []
if bom.bom_lines:
continue
ok = ((name=='child_complete_ids') and (bom.product_id.supply_method=='produce'))
- if bom.type=='phantom' or ok:
+ if (bom.type=='phantom' or ok) and bom_parent.multi_level_bom:
sids = bom_obj.search(cr, uid, [('bom_id','=',False),('product_id','=',bom.product_id.id)])
if sids:
bom2 = bom_obj.browse(cr, uid, sids[0], context=context)
- result[bom.id] += map(lambda x: x.id, bom2.bom_lines)
+ result[bom.id] += map(lambda x: x.id, bom2.bom_lines)
return result
@@ -267,7 +276,7 @@ class mrp_bom(osv.osv):
v['name'] = prod.name
return {'value': v}
return {}
-
+
def _bom_find(self, cr, uid, product_id, product_uom, properties=[]):
""" Finds BoM for particular product and product uom.
@param product_id: Selected product.
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index 6e7a1afb6dc..5b8b7c41084 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -253,13 +253,13 @@
-
+
-
+
@@ -618,7 +618,8 @@
-
form
tree,form,calendar,graph,gantt
- {"search_default_current":1}
@@ -852,7 +852,7 @@
-
+
mrp.procurement
form
- {"search_default_current":1}