-
+
-
+
diff --git a/addons/account/product_view.xml b/addons/account/product_view.xml
index 1000cef2156..0095cb1505c 100644
--- a/addons/account/product_view.xml
+++ b/addons/account/product_view.xml
@@ -11,8 +11,8 @@
-
-
+
+
diff --git a/addons/account/report/account_journal.py b/addons/account/report/account_journal.py
index 830f8152120..5b8418be430 100644
--- a/addons/account/report/account_journal.py
+++ b/addons/account/report/account_journal.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,19 +15,19 @@
# 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 time
+
from report import report_sxw
#
# Use period and Journal for selection or resources
#
class journal_print(report_sxw.rml_parse):
- def __init__(self, cr, uid, name, context):
+ def __init__(self, cr, uid, name, context={}):
super(journal_print, self).__init__(cr, uid, name, context=context)
self.localcontext.update( {
'time': time,
@@ -37,11 +37,13 @@ class journal_print(report_sxw.rml_parse):
})
def lines(self, period_id, journal_id, sort_selection='date', *args):
- if type(period_id)==type([]):
+ obj_jperiod = self.pool.get('account.journal.period')
+ obj_mline = self.pool.get('account.move.line')
+ if type(period_id) == type([]):
ids_final = []
for journal in journal_id:
for period in period_id:
- ids_journal_period = self.pool.get('account.journal.period').search(self.cr,self.uid, [('journal_id','=',journal),('period_id','=',period)])
+ ids_journal_period = obj_jperiod.search(self.cr, self.uid, [('journal_id','=',journal), ('period_id','=',period)])
if ids_journal_period:
self.cr.execute('update account_journal_period set state=%s where journal_id=%s and period_id=%s and state=%s', ('printed',journal,period,'draft'))
self.cr.commit()
@@ -50,14 +52,14 @@ class journal_print(report_sxw.rml_parse):
ids_final.append(ids)
line_ids = []
for line_id in ids_final:
- a = self.pool.get('account.move.line').browse(self.cr, self.uid, line_id )
+ a = obj_mline.browse(self.cr, self.uid, line_id)
line_ids.append(a)
return line_ids
self.cr.execute('update account_journal_period set state=%s where journal_id=%s and period_id=%s and state=%s', ('printed',journal_id,period_id,'draft'))
self.cr.commit()
self.cr.execute('select id from account_move_line where period_id=%s and journal_id=%s and state<>\'draft\' order by date,id', (period_id, journal_id))
ids = map(lambda x: x[0], self.cr.fetchall())
- return self.pool.get('account.move.line').browse(self.cr, self.uid, ids )
+ return obj_mline.browse(self.cr, self.uid, ids)
def _sum_debit(self, period_id, journal_id):
self.cr.execute('select sum(debit) from account_move_line where period_id=%s and journal_id=%s and state<>\'draft\'', (period_id, journal_id))
@@ -66,8 +68,9 @@ class journal_print(report_sxw.rml_parse):
def _sum_credit(self, period_id, journal_id):
self.cr.execute('select sum(credit) from account_move_line where period_id=%s and journal_id=%s and state<>\'draft\'', (period_id, journal_id))
return self.cr.fetchone()[0] or 0.0
-report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print,header=False)
-report_sxw.report_sxw('report.account.journal.period.print.wiz', 'account.journal.period', 'addons/account/report/wizard_account_journal.rml', parser=journal_print,header=False)
+
+report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print, header=False)
+report_sxw.report_sxw('report.account.journal.period.print.wiz', 'account.journal.period', 'addons/account/report/wizard_account_journal.rml', parser=journal_print, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/central_journal.py b/addons/account/report/central_journal.py
index 9bc2cfdd1b9..36c61b877ff 100644
--- a/addons/account/report/central_journal.py
+++ b/addons/account/report/central_journal.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 .
#
##############################################################################
@@ -59,8 +59,8 @@ class journal_print(report_sxw.rml_parse):
def _sum_credit(self, period_id, journal_id):
self.cr.execute('select sum(credit) from account_move_line where period_id=%s and journal_id=%s and state<>\'draft\'', (period_id, journal_id))
return self.cr.fetchone()[0] or 0.0
-report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml',parser=journal_print, header=False)
-report_sxw.report_sxw('report.account.central.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_central_journal.rml',parser=journal_print, header=False)
+report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml', parser=journal_print, header=False)
+report_sxw.report_sxw('report.account.central.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_central_journal.rml', parser=journal_print, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/general_journal.py b/addons/account/report/general_journal.py
index 2da07e04cfd..112ce970694 100644
--- a/addons/account/report/general_journal.py
+++ b/addons/account/report/general_journal.py
@@ -122,8 +122,8 @@ class journal_print(report_sxw.rml_parse):
return 0.0
self.cr.execute('select sum(credit) from account_move_line where period_id =ANY(%s) and journal_id =ANY(%s) and state<>\'draft\'',(self.period_ids,self.journal_ids,))
return self.cr.fetchone()[0] or 0.0
-report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml',parser=journal_print)
-report_sxw.report_sxw('report.account.general.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_general_journal.rml',parser=journal_print, header=False)
+report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml', parser=journal_print)
+report_sxw.report_sxw('report.account.general.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_general_journal.rml', parser=journal_print, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/tax_report.py b/addons/account/report/tax_report.py
index 3910622ad68..daa010a0453 100644
--- a/addons/account/report/tax_report.py
+++ b/addons/account/report/tax_report.py
@@ -20,16 +20,15 @@
##############################################################################
import time
-import pooler
-import rml_parse
import copy
+
+import rml_parse
from report import report_sxw
-import pdb
-import re
class tax_report(rml_parse.rml_parse):
_name = 'report.account.vat.declaration'
- def __init__(self, cr, uid, name, context):
+ def __init__(self, cr, uid, name, context={}):
+ print "tax______init", name, context
super(tax_report, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
@@ -42,19 +41,19 @@ class tax_report(rml_parse.rml_parse):
})
- def _get_lines(self, based_on,period_list,company_id=False, parent=False, level=0):
- res = self._get_codes(based_on,company_id,parent,level,period_list)
+ def _get_lines(self, based_on, period_list, company_id=False, parent=False, level=0, context={}):
+ res = self._get_codes(based_on, company_id, parent, level, period_list, context=context)
- if period_list[0][2] :
- res = self._add_codes(based_on,res,period_list)
+ if period_list:
+ res = self._add_codes(based_on, res, period_list, context=context)
else :
self.cr.execute ("select id from account_fiscalyear")
fy = self.cr.fetchall()
self.cr.execute ("select id from account_period where fiscalyear_id = %s",(fy[0][0],))
periods = self.cr.fetchall()
for p in periods :
- period_list[0][2].append(p[0])
- res = self._add_codes(based_on,res,period_list)
+ period_list.append(p[0])
+ res = self._add_codes(based_on, res, period_list, context=context)
i = 0
top_result = []
@@ -71,7 +70,7 @@ class tax_report(rml_parse.rml_parse):
}
top_result.append(res_dict)
- res_general = self._get_general(res[i][1].id,period_list,company_id,based_on)
+ res_general = self._get_general(res[i][1].id, period_list, company_id, based_on, context=context)
ind_general = 0
while ind_general < len(res_general) :
res_general[ind_general]['type'] = 2
@@ -84,11 +83,12 @@ class tax_report(rml_parse.rml_parse):
return top_result
#return array_result
- def _get_period(self, period_id):
- return self.pool.get('account.period').browse(self.cr, self.uid, period_id).name
+ def _get_period(self, period_id, context={}):
+ return self.pool.get('account.period').browse(self.cr, self.uid, period_id, context=context).name
- def _get_general(self, tax_code_id,period_list ,company_id, based_on):
+ def _get_general(self, tax_code_id,period_list ,company_id, based_on, context={}):
res=[]
+ obj_account = self.pool.get('account.account')
if based_on == 'payments':
self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
SUM(line.debit) AS debit, \
@@ -110,8 +110,8 @@ class tax_report(rml_parse.rml_parse):
AND line.period_id =ANY(%s) \
AND ((invoice.state = %s) \
OR (invoice.id IS NULL)) \
- GROUP BY account.id,account.name,account.code', ('draft',tax_code_id,
- company_id, period_list[0][2],'paid',))
+ GROUP BY account.id,account.name,account.code', ('draft', tax_code_id,
+ company_id, period_list, 'paid',))
else :
self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
@@ -129,52 +129,54 @@ class tax_report(rml_parse.rml_parse):
AND account.company_id = %s \
AND line.period_id =ANY(%s)\
AND account.active \
- GROUP BY account.id,account.name,account.code', ('draft',tax_code_id,
- company_id,period_list[0][2],))
+ GROUP BY account.id,account.name,account.code', ('draft', tax_code_id,
+ company_id, period_list,))
res = self.cr.dictfetchall()
#AND line.period_id IN ('+ period_sql_list +') \
i = 0
while i= int(accounts[bcl_rup_ind]['level']) and bcl_rup_ind >= 0 ):
- tot_elem = copy.copy(accounts[bcl_rup_ind])
+ tot_elem = copy.copy(accounts[bcl_rup_ind], context=context)
res_tot = { 'code' : accounts[bcl_rup_ind]['code'],
'name' : '',
'debit' : 0,
@@ -218,6 +220,6 @@ class tax_report(rml_parse.rml_parse):
report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code',
- 'addons/account/report/tax_report.rml', parser=tax_report, header=False)
+ 'addons/account/report/tax_report.rml', parser=tax_report, header=True)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/sequence_view.xml b/addons/account/sequence_view.xml
index a2766af1ffa..2d4d159cb41 100644
--- a/addons/account/sequence_view.xml
+++ b/addons/account/sequence_view.xml
@@ -8,7 +8,7 @@
-
+
diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py
index f3a05ebe184..e9ca2487604 100644
--- a/addons/account/wizard/__init__.py
+++ b/addons/account/wizard/__init__.py
@@ -23,11 +23,11 @@ import wizard_automatic_reconcile
import account_move_line_reconcile_select
import account_move_line_unreconcile_select
import wizard_reconcile
-import wizard_unreconcile
+import account_unreconcile
import account_invoice_refund
-import wizard_pay_invoice
+import account_pay_invoice
import account_move_journal
-import wizard_journal_select
+import account_journal_select
import account_move_bank_reconcile
import account_subscription_generate
import wizard_aged_trial_balance
@@ -36,27 +36,27 @@ import wizard_third_party_ledger
import wizard_account_balance_report
import wizard_partner_balance_report
import account_period_close
-import wizard_fiscalyear_close
+import account_fiscalyear_close
import account_fiscalyear_close_state
-import wizard_open_closed_fiscalyear
+import account_vat
+import account_open_closed_fiscalyear
-import wizard_vat
import wizard_compare_account_balance_report
-import wizard_invoice_state
+import account_invoice_state
import wizard_account_duplicate
import account_chart
import wizard_move_line_select
-import wizard_validate_account_move
+import account_validate_account_move
import wizard_use_model
-import wizard_state_open
+import account_state_open
-import wizard_statement_from_invoice
-import wizard_print_journal
-import wizard_central_journal
-import wizard_general_journal
-import wizard_change_currency
+import account_statement_from_invoice
+import account_print_journal
+import account_central_journal
+import account_general_journal
+import account_change_currency
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_central_journal.py b/addons/account/wizard/account_central_journal.py
new file mode 100644
index 00000000000..08fe881c81a
--- /dev/null
+++ b/addons/account/wizard/account_central_journal.py
@@ -0,0 +1,62 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import osv, fields
+from tools.translate import _
+
+class account_central_journal(osv.osv_memory):
+ _name = 'account.central.journal'
+ _description = 'Account Central Journal'
+
+ _columns = {
+ 'journal_id': fields.many2many('account.journal', 'account_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
+ 'period_id': fields.many2many('account.period', 'account_period_rel', 'account_id', 'period_id', 'Periods', required=True),
+ }
+
+ def check_data(self, cr, uid, ids, context={}):
+ obj_jperiod = self.pool.get('account.journal.period')
+ datas = {}
+ datas['ids'] = []
+ datas['model'] = 'account.journal.period'
+ datas['form'] = self.read(cr, uid, ids)[0]
+ period_id = datas['form']['period_id']
+ journal_id = datas['form']['journal_id']
+
+ if type(period_id)==type([]):
+ ids_final = []
+ for journal in journal_id:
+ for period in period_id:
+ ids_journal_period = obj_jperiod.search(cr,uid, [('journal_id','=',journal),('period_id','=',period)], context=context)
+ if ids_journal_period:
+ ids_final.append(ids_journal_period)
+ if not ids_final:
+ raise osv.except_osv(_('No Data Available'), _('No records found for your selection!'))
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.central.journal',
+ 'datas': datas,
+ }
+
+account_central_journal()
+
+#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
+
diff --git a/addons/account/wizard/account_central_journal_view.xml b/addons/account/wizard/account_central_journal_view.xml
new file mode 100644
index 00000000000..ec3f0eabb5d
--- /dev/null
+++ b/addons/account/wizard/account_central_journal_view.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+ Account central Journal
+ account.central.journal
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Account Central Journal
+ ir.actions.act_window
+ account.central.journal
+ form
+ form
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/wizard/account_change_currency.py b/addons/account/wizard/account_change_currency.py
new file mode 100644
index 00000000000..707a182a2aa
--- /dev/null
+++ b/addons/account/wizard/account_change_currency.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+from osv import osv, fields
+from tools.translate import _
+
+class account_change_currency(osv.osv_memory):
+ _name = 'account.change.currency'
+ _description = 'Change Currency'
+ _columns = {
+ 'currency_id': fields.many2one('res.currency', 'New Currency', required=True),
+ }
+
+ def view_init(self, cr , uid , fields_list, context=None):
+ obj_inv = self.pool.get('account.invoice')
+ if context is None:
+ context = {}
+ state = obj_inv.browse(cr, uid, context['active_id']).state
+ if obj_inv.browse(cr, uid, context['active_id']).state != 'draft':
+ raise osv.except_osv(_('Error'), _('You can not change currency for Open Invoice !'))
+ pass
+
+ def change_currency(self, cr, uid, ids, context=None):
+ obj_inv = self.pool.get('account.invoice')
+ obj_inv_line = self.pool.get('account.invoice.line')
+ obj_currency = self.pool.get('res.currency')
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ new_currency = data['currency_id']
+
+ for invoice in obj_inv.browse(cr, uid, context['active_ids'], context=context):
+ if invoice.currency_id.id == new_currency:
+ continue
+
+ for line in invoice.invoice_line:
+ rate = obj_currency.browse(cr, uid, new_currency).rate
+ new_price = 0
+ if invoice.company_id.currency_id.id == invoice.currency_id.id:
+ new_price = line.price_unit * rate
+
+ if invoice.company_id.currency_id.id != invoice.currency_id.id and invoice.company_id.currency_id.id == new_currency:
+ old_rate = invoice.currency_id.rate
+ new_price = line.price_unit / old_rate
+
+ if invoice.company_id.currency_id.id != invoice.currency_id.id and invoice.company_id.currency_id.id != new_currency:
+ old_rate = invoice.currency_id.rate
+ new_price = (line.price_unit / old_rate ) * rate
+
+ obj_inv_line.write(cr, uid, [line.id], {'price_unit' : new_price})
+ obj_inv.write(cr, uid, [invoice.id], {'currency_id' : new_currency})
+ return {}
+
+account_change_currency()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_change_currency_view.xml b/addons/account/wizard/account_change_currency_view.xml
new file mode 100644
index 00000000000..33b351bb85c
--- /dev/null
+++ b/addons/account/wizard/account_change_currency_view.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+ Change Currency
+ account.change.currency
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Change Currency
+ ir.actions.act_window
+ account.change.currency
+ form
+ form
+
+ {'record_id' : active_id}
+ new
+
+
+
+
+
+ Change Currency
+ client_action_multi
+
+ action
+ account.invoice
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/wizard/account_chart.py b/addons/account/wizard/account_chart.py
index 7def37807c3..38f47114490 100644
--- a/addons/account/wizard/account_chart.py
+++ b/addons/account/wizard/account_chart.py
@@ -21,7 +21,6 @@
from osv import fields, osv
from tools.translate import _
-import tools
class account_chart(osv.osv_memory):
"""
diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py
new file mode 100644
index 00000000000..c71c85ea4a3
--- /dev/null
+++ b/addons/account/wizard/account_fiscalyear_close.py
@@ -0,0 +1,228 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+from osv import fields, osv
+from tools.translate import _
+import tools
+
+class account_fiscalyear_close(osv.osv_memory):
+ """
+ Closes Account Fiscalyear and Generate Opening entries for New Fiscalyear
+ """
+ _name = "account.fiscalyear.close"
+ _description = "Fiscalyear Close"
+ _columns = {
+ 'fy_id': fields.many2one('account.fiscalyear', \
+ 'Fiscal Year to close', required=True),
+ 'fy2_id': fields.many2one('account.fiscalyear', \
+ 'New Fiscal Year', required=True),
+ 'journal_id': fields.many2one('account.journal', \
+ 'Opening Entries Journal', required=True),
+ 'period_id': fields.many2one('account.period', \
+ 'Opening Entries Period', required=True),
+ 'report_name': fields.char('Name of new entries',size=64, required=True),
+ 'sure': fields.boolean('Check this box'),
+ }
+ _defaults = {
+ 'report_name':'End of Fiscal Year Entry',
+ }
+
+ def data_save(self, cr, uid, ids, context=None):
+ """
+ This function close account fiscalyear and create entries in new fiscalyear
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: List of Account fiscalyear close state’s IDs
+
+ """
+ obj_acc_period = self.pool.get('account.period')
+ obj_acc_fiscalyear = self.pool.get('account.fiscalyear')
+ obj_acc_journal = self.pool.get('account.journal')
+ obj_acc_move_line = self.pool.get('account.move.line')
+ obj_acc_account = self.pool.get('account.account')
+ obj_acc_journal_period = self.pool.get('account.journal.period')
+
+ data = self.read(cr, uid, ids, context=context)
+
+ if context is None:
+ context = {}
+ if not data[0]['sure']:
+ raise osv.except_osv(_('UserError'), _('Closing of fiscal year cancelled, please check the box !'))
+ fy_id = data[0]['fy_id']
+
+
+ period_ids = obj_acc_period.search(cr, uid, [('fiscalyear_id', '=', fy_id)])
+ periods_fy2 = obj_acc_period.search(cr, uid, [('fiscalyear_id', '=', data[0]['fy2_id'])])
+
+ period = obj_acc_period.browse(cr, uid, data[0]['period_id'], context=context)
+ new_fyear = obj_acc_fiscalyear.browse(cr, uid, data[0]['fy2_id'], context=context)
+ old_fyear = obj_acc_fiscalyear.browse(cr, uid, data[0]['fy_id'], context=context)
+
+ new_journal = data[0]['journal_id']
+ new_journal = obj_acc_journal.browse(cr, uid, new_journal, context=context)
+
+ if not new_journal.default_credit_account_id or not new_journal.default_debit_account_id:
+ raise osv.except_osv(_('UserError'),
+ _('The journal must have default credit and debit account'))
+ if not new_journal.centralisation:
+ raise osv.except_osv(_('UserError'),
+ _('The journal must have centralised counterpart'))
+
+ move_ids = obj_acc_move_line.search(cr, uid, [
+ ('journal_id','=',new_journal.id),('period_id.fiscalyear_id','=',new_fyear.id)])
+ if move_ids:
+ raise osv.except_osv(_('UserError'),
+ _('The opening journal must not have any entry in the new fiscal year !'))
+ query = "SELECT id FROM account_fiscalyear WHERE date_stop < '" + str(new_fyear.date_start) + "'"
+ cr.execute(query)
+ result = cr.dictfetchall()
+ fy_ids = ','.join([str(x['id']) for x in result])
+ query_line = obj_acc_move_line._query_get(cr, uid,
+ obj='account_move_line', context={'fiscalyear': fy_ids})
+ cr.execute('select id from account_account WHERE active')
+ ids = map(lambda x: x[0], cr.fetchall())
+ for account in obj_acc_account.browse(cr, uid, ids,
+ context={'fiscalyear': fy_id}):
+
+ accnt_type_data = account.user_type
+ if not accnt_type_data:
+ continue
+ if accnt_type_data.close_method=='none' or account.type == 'view':
+ continue
+ if accnt_type_data.close_method=='balance':
+ if abs(account.balance)>0.0001:
+ obj_acc_move_line.create(cr, uid, {
+ 'debit': account.balance>0 and account.balance,
+ 'credit': account.balance<0 and -account.balance,
+ 'name': data[0]['report_name'],
+ 'date': period.date_start,
+ 'journal_id': new_journal.id,
+ 'period_id': period.id,
+ 'account_id': account.id
+ }, {'journal_id': new_journal.id, 'period_id':period.id})
+ if accnt_type_data.close_method == 'unreconciled':
+ offset = 0
+ limit = 100
+ while True:
+ cr.execute('SELECT id, name, quantity, debit, credit, account_id, ref, ' \
+ 'amount_currency, currency_id, blocked, partner_id, ' \
+ 'date_maturity, date_created ' \
+ 'FROM account_move_line ' \
+ 'WHERE account_id = %s ' \
+ 'AND ' + query_line + ' ' \
+ 'AND reconcile_id is NULL ' \
+ 'ORDER BY id ' \
+ 'LIMIT %s OFFSET %s', (account.id, limit, offset))
+ result = cr.dictfetchall()
+ if not result:
+ break
+ for move in result:
+ move.pop('id')
+ move.update({
+ 'date': period.date_start,
+ 'journal_id': new_journal.id,
+ 'period_id': period.id,
+ })
+ obj_acc_move_line.create(cr, uid, move, {
+ 'journal_id': new_journal.id,
+ 'period_id': period.id,
+ })
+ offset += limit
+
+ #We have also to consider all move_lines that were reconciled
+ #on another fiscal year, and report them too
+ offset = 0
+ limit = 100
+ while True:
+ #TODO: this query could be improved in order to work if there is more than 2 open FY
+ # a.period_id IN ('+fy2_period_set+') is the problematic clause
+ cr.execute('SELECT b.id, b.name, b.quantity, b.debit, b.credit, b.account_id, b.ref, ' \
+ 'b.amount_currency, b.currency_id, b.blocked, b.partner_id, ' \
+ 'b.date_maturity, b.date_created ' \
+ 'FROM account_move_line a, account_move_line b ' \
+ 'WHERE b.account_id = %s ' \
+ 'AND b.reconcile_id is NOT NULL ' \
+ 'AND a.reconcile_id = b.reconcile_id ' \
+ 'AND b.period_id =ANY(%s)'\
+ 'AND a.period_id =ANY(%s)' \
+ 'ORDER BY id ' \
+ 'LIMIT %s OFFSET %s', (account.id,period_ids,periods_fy2,limit, offset))
+ result = cr.dictfetchall()
+ if not result:
+ break
+ for move in result:
+ move.pop('id')
+ move.update({
+ 'date': period.date_start,
+ 'journal_id': new_journal.id,
+ 'period_id': period.id,
+ })
+ obj_acc_move_line.create(cr, uid, move, {
+ 'journal_id': new_journal.id,
+ 'period_id': period.id,
+ })
+ offset += limit
+ if accnt_type_data.close_method=='detail':
+ offset = 0
+ limit = 100
+ while True:
+ cr.execute('SELECT id, name, quantity, debit, credit, account_id, ref, ' \
+ 'amount_currency, currency_id, blocked, partner_id, ' \
+ 'date_maturity, date_created ' \
+ 'FROM account_move_line ' \
+ 'WHERE account_id = %s ' \
+ 'AND ' + query_line + ' ' \
+ 'ORDER BY id ' \
+ 'LIMIT %s OFFSET %s', (account.id, limit, offset))
+
+ result = cr.dictfetchall()
+ if not result:
+ break
+ for move in result:
+ move.pop('id')
+ move.update({
+ 'date': period.date_start,
+ 'journal_id': new_journal.id,
+ 'period_id': period.id,
+ })
+ obj_acc_move_line.create(cr, uid, move)
+ offset += limit
+ ids = obj_acc_move_line.search(cr, uid, [('journal_id','=',new_journal.id),
+ ('period_id.fiscalyear_id','=',new_fyear.id)])
+ context['fy_closing'] = True
+
+ if ids:
+ obj_acc_move_line.reconcile(cr, uid, ids, context=context)
+ new_period = data[0]['period_id']
+ ids = obj_acc_journal_period.search(cr, uid, [('journal_id','=',new_journal.id),('period_id','=',new_period)])
+ if not ids:
+ ids = [obj_acc_journal_period.create(cr, uid, {
+ 'name': (new_journal.name or '')+':'+(period.code or ''),
+ 'journal_id': new_journal.id,
+ 'period_id': period.id
+ })]
+ cr.execute('UPDATE account_fiscalyear ' \
+ 'SET end_journal_period_id = %s ' \
+ 'WHERE id = %s', (ids[0], old_fyear.id))
+ return {}
+
+account_fiscalyear_close()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/wizard/account_fiscalyear_close_view.xml b/addons/account/wizard/account_fiscalyear_close_view.xml
new file mode 100644
index 00000000000..e8db5193275
--- /dev/null
+++ b/addons/account/wizard/account_fiscalyear_close_view.xml
@@ -0,0 +1,47 @@
+
+
+
+
+ account.fiscalyear.close.form
+ account.fiscalyear.close
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Generate Fiscal Year Opening Entries
+ account.fiscalyear.close
+ form
+ tree,form
+
+ new
+
+
+
+
+
+
diff --git a/addons/account/wizard/account_general_journal.py b/addons/account/wizard/account_general_journal.py
new file mode 100644
index 00000000000..56ad7375acf
--- /dev/null
+++ b/addons/account/wizard/account_general_journal.py
@@ -0,0 +1,60 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import osv, fields
+from tools.translate import _
+
+class account_general_journal(osv.osv_memory):
+ _name = 'account.general.journal'
+ _description = 'Account General Journal'
+
+ _columns = {
+ 'journal_id': fields.many2many('account.journal', 'account_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
+ 'period_id': fields.many2many('account.period', 'account_period_rel', 'account_id', 'period_id', 'Periods', required=True),
+ }
+
+ def check_data(self, cr, uid, ids, context={}):
+ obj_jperiod = self.pool.get('account.journal.period')
+ datas = {}
+ datas['ids'] = []
+ datas['model'] = 'account.journal.period'
+ datas['form'] = self.read(cr, uid, ids)[0]
+ period_id = datas['form']['period_id']
+ journal_id = datas['form']['journal_id']
+
+ if type(period_id)==type([]):
+ ids_final = []
+ for journal in journal_id:
+ for period in period_id:
+ ids_journal_period = obj_jperiod.search(cr,uid, [('journal_id','=',journal),('period_id','=',period)], context=context)
+ if ids_journal_period:
+ ids_final.append(ids_journal_period)
+ if not ids_final:
+ raise osv.except_osv(_('No Data Available'), _('No records found for your selection!'))
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.general.journal',
+ 'datas': datas,
+ }
+
+account_general_journal()
+
+#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_general_journal_view.xml b/addons/account/wizard/account_general_journal_view.xml
new file mode 100644
index 00000000000..425efbaf847
--- /dev/null
+++ b/addons/account/wizard/account_general_journal_view.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+ Account Genral Journal
+ account.general.journal
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Account General Journal
+ ir.actions.act_window
+ account.general.journal
+ form
+ form
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py
index cc69311b2f7..1942fd56e60 100644
--- a/addons/account/wizard/account_invoice_refund.py
+++ b/addons/account/wizard/account_invoice_refund.py
@@ -18,13 +18,10 @@
# along with this program. If not, see .
#
##############################################################################
-
from osv import fields, osv
from tools.translate import _
-import tools
import netsvc
-
class account_invoice_refund(osv.osv_memory):
"""Refunds invoice."""
diff --git a/addons/account/wizard/account_invoice_state.py b/addons/account/wizard/account_invoice_state.py
new file mode 100644
index 00000000000..6b1a41f49af
--- /dev/null
+++ b/addons/account/wizard/account_invoice_state.py
@@ -0,0 +1,62 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+from osv import fields, osv
+from tools.translate import _
+import netsvc
+
+class account_invoice_confirm(osv.osv_memory):
+ """
+ This wizard will confirm the all the selected draft invoices
+ """
+
+ _name = "account.invoice.confirm"
+ _description = "Confirm the selected invoices"
+
+ def invoice_confirm(self, cr, uid, ids, context=None):
+ wf_service = netsvc.LocalService('workflow')
+ if context is None:
+ context = {}
+ for id in context['active_ids']:
+ wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_open', cr)
+ return {}
+
+account_invoice_confirm()
+
+class account_invoice_cancel(osv.osv_memory):
+ """
+ This wizard will cancel the all the selected invoices.
+ If in the journal, the option allow cancelling entry is not selected then it will give warning message.
+ """
+
+ _name = "account.invoice.cancel"
+ _description = "Cancel the selected invoices"
+
+ def invoice_cancel(self, cr, uid, ids, context=None):
+ wf_service = netsvc.LocalService('workflow')
+ if context is None:
+ context = {}
+ for id in context['active_ids']:
+ wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr)
+ return {}
+
+account_invoice_cancel()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/wizard/account_invoice_state_view.xml b/addons/account/wizard/account_invoice_state_view.xml
new file mode 100644
index 00000000000..8748edbb688
--- /dev/null
+++ b/addons/account/wizard/account_invoice_state_view.xml
@@ -0,0 +1,73 @@
+
+
+
+
+ account.invoice.confirm.form
+ account.invoice.confirm
+ form
+
+
+
+
+
+
+ Cancel selected invoices
+ account.invoice.cancel
+ form
+ form
+
+ new
+
+
+
+
+
+ Cancel selected invoices
+ client_action_multi
+
+ action
+ account.invoice
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/wizard/account_journal_select.py b/addons/account/wizard/account_journal_select.py
new file mode 100644
index 00000000000..f13958ed90f
--- /dev/null
+++ b/addons/account/wizard/account_journal_select.py
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import fields, osv
+
+class account_journal_select(osv.osv_memory):
+ """
+ Account Journal Select
+ """
+ _name = "account.journal.select"
+ _description = "Account Journal Select"
+
+ def action_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')
+ if context is None:
+ context = {}
+
+ result = mod_obj._get_id(cr, uid, 'account', 'action_move_line_select')
+ id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
+ result = act_obj.read(cr, uid, [id])[0]
+ cr.execute('select journal_id, period_id from account_journal_period where id=%s', (context['active_id'],))
+ journal_id, period_id = cr.fetchone()
+
+ result['domain'] = str([('journal_id', '=', journal_id), ('period_id', '=', period_id)])
+ result['context'] = str({'journal_id': journal_id, 'period_id': period_id})
+ return result
+
+
+account_journal_select()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account/wizard/account_journal_select_view.xml b/addons/account/wizard/account_journal_select_view.xml
new file mode 100644
index 00000000000..71a0d591768
--- /dev/null
+++ b/addons/account/wizard/account_journal_select_view.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+ Open Journal Button
+ account.journal.select
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Open Journal
+ account.journal.select
+ form
+ form
+
+ new
+
+
+
+ tree_but_open
+ account.journal.period
+ Open Journal
+
+
+
+
+
diff --git a/addons/account/wizard/account_move_line_reconcile_select.py b/addons/account/wizard/account_move_line_reconcile_select.py
index db0ddb10108..d089db01f5e 100644
--- a/addons/account/wizard/account_move_line_reconcile_select.py
+++ b/addons/account/wizard/account_move_line_reconcile_select.py
@@ -18,11 +18,8 @@
# along with this program. If not, see .
#
##############################################################################
-
from osv import fields, osv
from tools.translate import _
-import tools
-
class account_move_line_reconcile_select(osv.osv_memory):
_name = "account.move.line.reconcile.select"
@@ -41,17 +38,16 @@ class account_move_line_reconcile_select(osv.osv_memory):
@return: dictionary of Open account move line window for reconcile on given account id
"""
- for data in self.read(cr, uid, ids,context=context):
-
- return {
- 'domain': "[('account_id','=',%d),('reconcile_id','=',False),('state','<>','draft')]" % data['account_id'],
- 'name': _('Reconciliation'),
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'view_id': False,
- 'res_model': 'account.move.line',
- 'type': 'ir.actions.act_window'
- }
+ data = self.read(cr, uid, ids, context=context)[0]
+ return {
+ 'domain': "[('account_id','=',%d),('reconcile_id','=',False),('state','<>','draft')]" % data['account_id'],
+ 'name': _('Reconciliation'),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'view_id': False,
+ 'res_model': 'account.move.line',
+ 'type': 'ir.actions.act_window'
+ }
account_move_line_reconcile_select()
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 f7fcccddc4c..ae7f9567748 100644
--- a/addons/account/wizard/account_move_line_reconcile_select_view.xml
+++ b/addons/account/wizard/account_move_line_reconcile_select_view.xml
@@ -15,7 +15,7 @@
@@ -23,7 +23,7 @@
- Unreconcile entries
+ Unreconcile Entriesaccount.move.line.unreconcile.selectformtree,form
diff --git a/addons/account/wizard/account_open_closed_fiscalyear.py b/addons/account/wizard/account_open_closed_fiscalyear.py
new file mode 100644
index 00000000000..b4f0f12b4b8
--- /dev/null
+++ b/addons/account/wizard/account_open_closed_fiscalyear.py
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import fields, osv
+from tools.translate import _
+
+class account_open_closed_fiscalyear(osv.osv_memory):
+
+ _name = "account.open.closed.fiscalyear"
+ _description = "Choose Fiscal Year"
+ _columns = {
+ 'fyear_id': fields.many2one('account.fiscalyear', \
+ 'Fiscal Year to Open', required=True, help='Select Fiscal Year which you want to remove entries for its End of year entries journal'),
+ }
+
+ def remove_entries(self, cr, uid, ids, context={}):
+ data = self.read(cr, uid, ids, [])[0]
+ data_fyear = self.pool.get('account.fiscalyear').browse(cr, uid, data['fyear_id'])
+ if not data_fyear.end_journal_period_id:
+ raise osv.except_osv(_('Error'), _('No journal for ending writing has been defined for the fiscal year'))
+ period_journal = data_fyear.end_journal_period_id
+ ids_move = self.pool.get('account.move').search(cr,uid,[('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)])
+ if ids_move:
+ cr.execute('delete from account_move where id =ANY(%s)',(ids_move,))
+ #cr.execute('UPDATE account_journal_period ' \
+ # 'SET state = %s ' \
+ # 'WHERE period_id IN (SELECT id FROM account_period WHERE fiscalyear_id = %s)',
+ # ('draft',data_fyear))
+ #cr.execute('UPDATE account_period SET state = %s ' \
+ # 'WHERE fiscalyear_id = %s', ('draft',data_fyear))
+ #cr.execute('UPDATE account_fiscalyear ' \
+ # 'SET state = %s, end_journal_period_id = null '\
+ # 'WHERE id = %s', ('draft',data_fyear))
+ return {}
+
+account_open_closed_fiscalyear()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_open_closed_fiscalyear_view.xml b/addons/account/wizard/account_open_closed_fiscalyear_view.xml
new file mode 100644
index 00000000000..c5269939e0c
--- /dev/null
+++ b/addons/account/wizard/account_open_closed_fiscalyear_view.xml
@@ -0,0 +1,37 @@
+
+
+
+
+ account.open.closed.fiscalyear.form
+ account.open.closed.fiscalyear
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cancel Opening Entries
+ account.open.closed.fiscalyear
+ form
+ tree,form
+
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/wizard/account_pay_invoice.py b/addons/account/wizard/account_pay_invoice.py
new file mode 100644
index 00000000000..0b71055409f
--- /dev/null
+++ b/addons/account/wizard/account_pay_invoice.py
@@ -0,0 +1,191 @@
+# -*- 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 decimal_precision as dp
+
+class account_invoice_pay_writeoff(osv.osv_memory):
+ """
+ Opens the write off amount pay form.
+ """
+ _name = "account.invoice.pay.writeoff"
+ _description = "Pay Invoice "
+ _columns = {
+ 'writeoff_acc_id': fields.many2one('account.account', 'Write-Off account', required=True),
+ 'writeoff_journal_id': fields.many2one('account.journal', 'Write-Off journal', required=True),
+ 'comment': fields.char('Comment', size=64, required=True),
+ 'analytic_id': fields.many2one('account.analytic.account','Analytic Account'),
+ }
+ _defaults = {
+ 'comment': 'Write-Off',
+ }
+
+ def pay_and_reconcile_writeoff(self, cr, uid, ids, context=None):
+ data = self.read(cr, uid, ids,context=context)[0]
+ context.update({'write_off':data})
+ self.pool.get('account.invoice.pay').pay_and_reconcile(cr, uid, ids, context=context)
+ return {}
+
+account_invoice_pay_writeoff()
+
+class account_invoice_pay(osv.osv_memory):
+ """
+ Generate pay invoice wizard, user can make partial or full payment for invoice.
+ """
+ _name = "account.invoice.pay"
+ _description = "Pay Invoice "
+ _columns = {
+ 'amount': fields.float('Amount paid', required=True, digits_compute = dp.get_precision('Account')),
+ 'name': fields.char('Entry Name', size=64, required=True),
+ 'date': fields.date('Date payment', required=True),
+ 'journal_id': fields.many2one('account.journal', 'Journal/Payment Mode', required=True),
+ 'period_id': fields.many2one('account.period', 'Period', required=True),
+ }
+
+ def view_init(self, cr, uid, ids, context=None):
+ invoice = self.pool.get('account.invoice').browse(cr, uid, context['active_id'], context=context)
+ if invoice.state in ['draft', 'proforma2', 'cancel']:
+ raise osv.except_osv(_('Error !'), _('Can not pay draft/proforma/cancel invoice.'))
+ pass
+
+ def _get_period(self, cr, uid, context=None):
+ ids = self.pool.get('account.period').find(cr, uid, context=context)
+ period_id = False
+ if len(ids):
+ period_id = ids[0]
+ return period_id
+
+ def _get_amount(self, cr, uid, context=None):
+ return self.pool.get('account.invoice').browse(cr, uid, context['active_id'], context=context).residual
+
+ _defaults = {
+ 'date': lambda *a: time.strftime('%Y-%m-%d'),
+ 'period_id': _get_period,
+ 'amount': _get_amount,
+ }
+
+ def wo_check(self, cr, uid, ids, context=None):
+ cur_obj = self.pool.get('res.currency')
+ mod_obj = self.pool.get('ir.model.data')
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids,context=context)[0]
+ invoice = self.pool.get('account.invoice').browse(cr, uid, context['active_id'], context)
+ journal = self.pool.get('account.journal').browse(cr, uid, data['journal_id'], context)
+
+ # Here we need that:
+ # The invoice total amount in company's currency <> paid amount in company currency
+ # (according to the correct day rate, invoicing rate and payment rate are may be different)
+ # => Ask to a write-off of the difference. This could happen even if both amount are equal,
+ # because if the currency rate
+ # Get the amount in company currency for the invoice (according to move lines)
+ inv_amount_company_currency = 0
+ for aml in invoice.move_id.line_id:
+ if aml.account_id.id == invoice.account_id.id or aml.account_id.type in ('receivable', 'payable'):
+ inv_amount_company_currency += aml.debit
+ inv_amount_company_currency -= aml.credit
+ inv_amount_company_currency = abs(inv_amount_company_currency)
+
+ # Get the current amount paid in company currency
+ if journal.currency and invoice.company_id.currency_id.id<>journal.currency.id:
+ ctx = {'date':data['date']}
+ amount_paid = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, data['amount'], round=True, context=ctx)
+ else:
+ amount_paid = data['amount']
+ # Get the old payment if there are some
+ if invoice.payment_ids:
+ debit=credit=0.0
+ for payment in invoice.payment_ids:
+ debit+=payment.debit
+ credit+=payment.credit
+ amount_paid+=abs(debit-credit)
+
+ # Test if there is a difference according to currency rouding setting
+ if self.pool.get('res.currency').is_zero(cr, uid, invoice.company_id.currency_id,
+ (amount_paid - inv_amount_company_currency)):
+ return self.pay_and_reconcile(cr, uid, ids, context=context)
+ else:
+ model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_account_invoice_pay_writeoff')], context=context)
+ resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+ return {
+ 'name': _('Information addendum'),
+ 'context': context,
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'account.invoice.pay.writeoff',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ }
+
+ def pay_and_reconcile(self, cr, uid, ids, context=None):
+ cur_obj = self.pool.get('res.currency')
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids,context=context)[0]
+ writeoff_account_id = False
+ writeoff_journal_id = False
+ comment = False
+
+ if 'write_off' in context and context['write_off'] :
+ writeoff_account_id = context['write_off']['writeoff_acc_id']
+ writeoff_journal_id = context['write_off']['writeoff_journal_id']
+ comment = context['write_off']['comment']
+
+ amount = data['amount']
+
+ invoice = self.pool.get('account.invoice').browse(cr, uid, context['active_id'], context)
+ journal = self.pool.get('account.journal').browse(cr, uid, data['journal_id'], context)
+ # Compute the amount in company's currency, with the journal currency (which is equal to payment currency)
+ # when it is needed : If payment currency (according to selected journal.currency) is <> from company currency
+ if journal.currency and invoice.company_id.currency_id.id<>journal.currency.id:
+ ctx = {'date':data['date']}
+ amount = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, amount, context=ctx)
+ currency_id = journal.currency.id
+ # Put the paid amount in currency, and the currency, in the context if currency is different from company's currency
+ context.update({'amount_currency':data['amount'],'currency_id':currency_id})
+
+ if invoice.company_id.currency_id.id<>invoice.currency_id.id:
+ ctx = {'date':data['date']}
+ amount = cur_obj.compute(cr, uid, invoice.currency_id.id, invoice.company_id.currency_id.id, amount, context=ctx)
+ currency_id = invoice.currency_id.id
+ # Put the paid amount in currency, and the currency, in the context if currency is different from company's currency
+ context.update({'amount_currency':data['amount'],'currency_id':currency_id})
+
+ # Take the choosen date
+ if comment:
+ context.update({'date_p':data['date'],'comment':comment})
+ else:
+ context.update({'date_p':data['date'],'comment':False})
+
+ acc_id = journal.default_credit_account_id and journal.default_credit_account_id.id
+ if not acc_id:
+ raise osv.except_osv(_('Error !'), _('Your journal must have a default credit and debit account.'))
+ self.pool.get('account.invoice').pay_and_reconcile(cr, uid, [context['active_id']],
+ amount, acc_id, data['period_id'], data['journal_id'], writeoff_account_id,
+ data['period_id'], writeoff_journal_id, context, data['name'])
+ return {}
+
+account_invoice_pay()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/wizard/account_pay_invoice_view.xml b/addons/account/wizard/account_pay_invoice_view.xml
new file mode 100644
index 00000000000..0a8e64d299f
--- /dev/null
+++ b/addons/account/wizard/account_pay_invoice_view.xml
@@ -0,0 +1,62 @@
+
+
+
+
+ account.invoice.pay.form
+ account.invoice.pay
+ form
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/wizard/account_period_close.py b/addons/account/wizard/account_period_close.py
index f4c54263f9a..6e71b079dc0 100644
--- a/addons/account/wizard/account_period_close.py
+++ b/addons/account/wizard/account_period_close.py
@@ -21,7 +21,6 @@
from osv import fields, osv
from tools.translate import _
-import tools
class account_period_close(osv.osv_memory):
"""
@@ -30,7 +29,7 @@ class account_period_close(osv.osv_memory):
_name = "account.period.close"
_description = "period close"
_columns = {
- 'sure': fields.boolean('Check this box', required=False),
+ 'sure': fields.boolean('Check this box'),
}
def data_save(self, cr, uid, ids, context={}):
@@ -47,8 +46,8 @@ class account_period_close(osv.osv_memory):
for id in context['active_ids']:
cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id))
cr.execute('update account_period set state=%s where id=%s', (mode, id))
- return {}
+ return {}
account_period_close()
-# 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/account/wizard/account_print_journal.py b/addons/account/wizard/account_print_journal.py
new file mode 100644
index 00000000000..89de9a643f9
--- /dev/null
+++ b/addons/account/wizard/account_print_journal.py
@@ -0,0 +1,66 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+from osv import osv, fields
+from tools.translate import _
+
+class account_print_journal(osv.osv_memory):
+ _name = 'account.print.journal'
+ _description = 'Account Print Journal'
+
+ _columns = {
+ 'journal_id': fields.many2many('account.journal', 'account_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
+ 'period_id': fields.many2many('account.period', 'account_period_rel', 'account_id', 'period_id', 'Periods', required=True),
+ 'sort_selection': fields.selection([('date','By date'),
+ ('ref','Reference Number'),],
+ 'Entries Sorted By', required=True),
+ }
+
+ _defaults = {
+ 'sort_selection': lambda *a: 'date',
+ }
+
+ def check_data(self, cr, uid, ids, context={}):
+ obj_jperiod = self.pool.get('account.journal.period')
+ datas = {}
+ datas['ids'] = []
+ datas['model'] = 'account.journal.period'
+ datas['form'] = self.read(cr, uid, ids)[0]
+ period_id = datas['form']['period_id']
+ journal_id = datas['form']['journal_id']
+
+ if type(period_id)==type([]):
+ ids_final = []
+ for journal in journal_id:
+ for period in period_id:
+ ids_journal_period = obj_jperiod.search(cr,uid, [('journal_id','=',journal),('period_id','=',period)], context=context)
+ if ids_journal_period:
+ ids_final.append(ids_journal_period)
+ if not ids_final:
+ raise osv.except_osv(_('No Data Available'), _('No records found for your selection!'))
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.journal.period.print',
+ 'datas': datas,
+ }
+
+account_print_journal()
+
+#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_print_journal_view.xml b/addons/account/wizard/account_print_journal_view.xml
new file mode 100644
index 00000000000..078db421b19
--- /dev/null
+++ b/addons/account/wizard/account_print_journal_view.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+ Account Print Journal
+ account.print.journal
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Account Print Journal
+ ir.actions.act_window
+ account.print.journal
+ form
+ form
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/wizard/account_state_open.py b/addons/account/wizard/account_state_open.py
new file mode 100644
index 00000000000..4703ea18c61
--- /dev/null
+++ b/addons/account/wizard/account_state_open.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+from osv import osv, fields
+
+import netsvc
+from tools.translate import _
+
+class account_state_open(osv.osv_memory):
+ _name = 'account.state.open'
+ _description = 'Account State Open'
+
+ def change_inv_state(self, cr, uid, ids, context=None):
+ obj_invoice = self.pool.get('account.invoice')
+ if context is None:
+ context = {}
+ if 'active_ids' in context:
+ data_inv = obj_invoice.browse(cr, uid, context['active_ids'][0], context=context)
+ if data_inv.reconciled:
+ raise osv.except_osv(_('Warning'), _('Invoice is already reconciled'))
+ wf_service = netsvc.LocalService("workflow")
+ res = wf_service.trg_validate(uid, 'account.invoice', context['active_ids'][0], 'open_test', cr)
+ return {}
+
+account_state_open()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/wizard/account_state_open_view.xml b/addons/account/wizard/account_state_open_view.xml
new file mode 100644
index 00000000000..3ed71949b2a
--- /dev/null
+++ b/addons/account/wizard/account_state_open_view.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+ Account State Open
+ account.state.open
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Account State Open
+ ir.actions.act_window
+ account.state.open
+ form
+ form
+
+ {'record_id' : active_id}
+ new
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/wizard/account_statement_from_invoice.py b/addons/account/wizard/account_statement_from_invoice.py
new file mode 100644
index 00000000000..097d11c1b83
--- /dev/null
+++ b/addons/account/wizard/account_statement_from_invoice.py
@@ -0,0 +1,163 @@
+# -*- 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 _
+
+class account_statement_from_invoice_lines(osv.osv_memory):
+ """
+ Generate Entries by Statement from Invoices
+ """
+ _name = "account.statement.from.invoice.lines"
+ _description = "Entries by Statement from Invoices"
+ _columns = {
+ 'line_ids': fields.many2many('account.move.line', 'account_move_line_relation', 'move_id', 'line_id', 'Invoices'),
+ }
+
+ def populate_statement(self, cr, uid, ids, context=None):
+
+ line_obj = self.pool.get('account.move.line')
+ statement_obj = self.pool.get('account.bank.statement')
+ statement_line_obj = self.pool.get('account.bank.statement.line')
+ currency_obj = self.pool.get('res.currency')
+ statement_reconcile_obj = self.pool.get('account.bank.statement.reconcile')
+
+ data = self.read(cr, uid, ids,context=context)[0]
+ line_ids = data['line_ids']
+ line_date = time.strftime('%Y-%m-%d')
+
+ if not line_ids:
+ return {}
+ statement_id = 'statement_id' in context and context['statement_id']
+ statement = statement_obj.browse(cr, uid, statement_id, context=context)
+ # for each selected move lines
+ for line in line_obj.browse(cr, uid, line_ids, context=context):
+ ctx = context.copy()
+ # take the date for computation of currency => use payment date
+ # if line.date_maturity:
+ # ctx['date'] = line.date_maturity
+ # else:
+ ctx['date'] = line_date
+ amount = 0.0
+ if line.amount_currency:
+ amount = currency_obj.compute(cr, uid, line.currency_id.id,
+ statement.currency.id, line.amount_currency, context=ctx)
+ else:
+ if line.debit > 0:
+ amount=line.debit
+ elif line.credit > 0:
+ amount=-line.credit
+ reconcile_id = statement_reconcile_obj.create(cr, uid, {
+ 'line_ids': [(6, 0, [line.id])]
+ }, context=context)
+ if line.journal_id.type == 'sale':
+ type = 'customer'
+ elif line.journal_id.type == 'purchase':
+ type = 'supplier'
+ else:
+ type = 'general'
+ statement_line_obj.create(cr, uid, {
+ 'name': line.name or '?',
+ 'amount': amount,
+ 'type': type,
+ 'partner_id': line.partner_id.id,
+ 'account_id': line.account_id.id,
+ 'statement_id': statement_id,
+ 'ref': line.ref,
+ 'reconcile_id': reconcile_id,
+ 'date': time.strftime('%Y-%m-%d'), #time.strftime('%Y-%m-%d'), #line.date_maturity or,
+ }, context=context)
+ return {}
+
+account_statement_from_invoice_lines()
+
+class account_statement_from_invoice(osv.osv_memory):
+ """
+ Generate Entries by Statement from Invoices
+ """
+ _name = "account.statement.from.invoice"
+ _description = "Entries by Statement from Invoices"
+ _columns = {
+ 'date': fields.date('Date payment',required=True),
+ 'journal_ids': fields.many2many('account.journal','account_journal_relation','account_id','journal_id','Journal'),
+ 'line_ids': fields.many2many('account.move.line','account_move_line_relation','move_id','line_id','Invoices'),
+ }
+ _defaults = {
+ 'date':lambda *a: time.strftime('%Y-%m-%d'),
+ }
+
+ def search_invoices(self, cr, uid, ids, context=None):
+
+ line_obj = self.pool.get('account.move.line')
+ statement_obj = self.pool.get('account.bank.statement')
+ journal_obj = self.pool.get('account.journal')
+ mod_obj = self.pool.get('ir.model.data')
+ statement_id = 'statement_id' in context and context['statement_id']
+
+ data = self.read(cr, uid, ids,context=context)[0]
+ statement = statement_obj.browse(cr, uid, statement_id, context=context)
+ args_move_line = []
+ repeated_move_line_ids = []
+ # Creating a group that is unique for importing move lines(move lines, once imported into statement lines, should not appear again)
+ for st_line in statement.line_ids:
+ args_move_line = []
+ args_move_line.append(('name','=', st_line.name))
+ args_move_line.append(('ref','=',st_line.ref))
+ if st_line.partner_id:
+ args_move_line.append(('partner_id','=',st_line.partner_id.id))
+ args_move_line.append(('account_id','=',st_line.account_id.id))
+
+ move_line_id = line_obj.search(cr, uid, args_move_line,context=context)
+ if move_line_id:
+ repeated_move_line_ids += move_line_id
+
+ journal_ids = data['journal_ids']
+ if journal_ids == []:
+ journal_ids = journal_obj.search(cr, uid, [('type', 'in', ('sale','cash','purchase'))], context=context)
+
+ args = [
+ ('reconcile_id', '=', False),
+ ('journal_id', 'in', journal_ids),
+ ('account_id.reconcile', '=', True)]
+
+ if repeated_move_line_ids:
+ args.append(('id','not in',repeated_move_line_ids))
+
+ line_ids = line_obj.search(cr, uid, args,
+ #order='date DESC, id DESC', #doesn't work
+ context=context)
+ model_data_ids = mod_obj.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_account_statement_from_invoice_lines')], context=context)
+ resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+ return {
+ 'domain': "[('id','in', ["+','.join([str(x) for x in line_ids])+"])]",
+ 'name': _('Import Entries'),
+ 'context': context,
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'account.statement.from.invoice.lines',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ }
+
+account_statement_from_invoice()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/wizard/account_statement_from_invoice_view.xml b/addons/account/wizard/account_statement_from_invoice_view.xml
new file mode 100644
index 00000000000..6f17279888c
--- /dev/null
+++ b/addons/account/wizard/account_statement_from_invoice_view.xml
@@ -0,0 +1,61 @@
+
+
+
+
+ account.statement.from.invoice.form
+ account.statement.from.invoice
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Import Invoices in Statement
+ account.statement.from.invoice
+ form
+ tree,form
+
+ new
+
+
+
+ account.statement.from.invoice.lines.form
+ account.statement.from.invoice.lines
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Import Entries
+ account.statement.from.invoice.lines
+ form
+ tree,form
+
+ new
+
+
+
+
+
diff --git a/addons/account/wizard/account_unreconcile.py b/addons/account/wizard/account_unreconcile.py
new file mode 100644
index 00000000000..d50994a6f28
--- /dev/null
+++ b/addons/account/wizard/account_unreconcile.py
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+from osv import fields, osv
+
+class account_unreconcile(osv.osv_memory):
+ _name = "account.unreconcile"
+ _description = "Account Unreconcile"
+
+ def trans_unrec(self, cr, uid, ids, context=None):
+ obj_move_line = self.pool.get('account.move.line')
+ obj_move_reconcile = self.pool.get('account.move.reconcile')
+ if context is None:
+ context = {}
+ recs = obj_move_line.read(cr, uid, context['active_ids'], ['reconcile_id',])
+ recs = filter(lambda x: x['reconcile_id'], recs)
+ rec_ids = [rec['reconcile_id'][0] for rec in recs]
+ if len(rec_ids):
+ obj_move_reconcile.unlink(cr, uid, rec_ids)
+ return {}
+
+account_unreconcile()
+
+class account_unreconcile_reconcile(osv.osv_memory):
+ _name = "account.unreconcile.reconcile"
+ _description = "Account Unreconcile Reconcile"
+
+ def trans_unrec_reconcile(self, cr, uid, ids, context=None):
+ obj_move_reconcile = self.pool.get('account.move.reconcile')
+ if context is None:
+ context = {}
+ if len(rec_ids):
+ obj_move_reconcile.unlink(cr, uid, context['active_ids'])
+ return {}
+
+account_unreconcile_reconcile()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/wizard/account_unreconcile_view.xml b/addons/account/wizard/account_unreconcile_view.xml
new file mode 100644
index 00000000000..3ac038329d9
--- /dev/null
+++ b/addons/account/wizard/account_unreconcile_view.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+ Unreconcile Entries
+ account.unreconcile
+ form
+
+
+
+
+
+
+ Unreconcile Entries
+ ir.actions.act_window
+ account.unreconcile.reconcile
+ form
+ form
+
+ {'record_id' : active_id}
+ new
+
+
+
+
+
+ Unreconcile Entries
+ client_action_multi
+
+ action
+ account.move.reconcile
+
+
+
+
+
diff --git a/addons/account/wizard/account_validate_account_move.py b/addons/account/wizard/account_validate_account_move.py
new file mode 100644
index 00000000000..e3d9e494da6
--- /dev/null
+++ b/addons/account/wizard/account_validate_account_move.py
@@ -0,0 +1,67 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+from osv import fields, osv
+from tools.translate import _
+
+class validate_account_move(osv.osv_memory):
+ _name = "validate.account.move"
+ _description = "Validate Account Move"
+ _columns = {
+ 'journal_id': fields.many2one('account.journal', 'Journal', required=True),
+ 'period_id': fields.many2one('account.period', 'Period', required=True, domain=[('state','<>','done')]),
+ }
+
+ def validate_move(self, cr, uid, ids, context=None):
+ obj_move = self.pool.get('account.move')
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ ids_move = obj_move.search(cr, uid, [('state','=','draft'),('journal_id','=',data['journal_id']),('period_id','=',data['period_id'])])
+ if not ids_move:
+ raise osv.except_osv(_('Warning'), _('Specified Journal does not have any account move entries in draft state for this period'))
+ obj_move.button_validate(cr, uid, ids_move, context)
+ return {}
+
+validate_account_move()
+
+class validate_account_move_lines(osv.osv_memory):
+ _name = "validate.account.move.lines"
+ _description = "Validate Account Move Lines"
+
+ def validate_move_lines(self, cr, uid, ids, context=None):
+ obj_move_line = self.pool.get('account.move.line')
+ obj_move = self.pool.get('account.move')
+ move_ids = []
+ if context is None:
+ context = {}
+ data_line = obj_move_line.browse(cr, uid, context['active_ids'], context)
+ for line in data_line:
+ if line.move_id.state=='draft':
+ move_ids.append(line.move_id.id)
+ move_ids = list(set(move_ids))
+ if not move_ids:
+ raise osv.except_osv(_('Warning'), _('Selected Entry Lines does not have any account move enties in draft state'))
+ obj_move.button_validate(cr, uid, move_ids, context)
+ return {}
+validate_account_move_lines()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account/wizard/account_validate_move_view.xml b/addons/account/wizard/account_validate_move_view.xml
new file mode 100644
index 00000000000..27ca48662bc
--- /dev/null
+++ b/addons/account/wizard/account_validate_move_view.xml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+ Validate Account Move
+ validate.account.move
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Open Journal
+ validate.account.move
+ form
+ form
+
+ new
+
+
+
+
+
+
+ Validate Ledger Postings
+ validate.account.move.lines
+ form
+
+
+
+
+
+
+
+
+
+
+ Validate Ledger Postings
+ ir.actions.act_window
+ validate.account.move.lines
+ form
+ form
+
+ {'record_id' : active_id}
+ new
+
+
+
+
+
+ Validate Ledger Postings
+ client_action_multi
+
+ action
+ account.move.line
+
+
+
+
diff --git a/addons/account/wizard/account_vat.py b/addons/account/wizard/account_vat.py
new file mode 100755
index 00000000000..7e641628daf
--- /dev/null
+++ b/addons/account/wizard/account_vat.py
@@ -0,0 +1,64 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import osv, fields
+
+class account_vat_declaration(osv.osv_memory):
+ _name = 'account.vat.declaration'
+ _description = 'Account Vat Declaration'
+
+ _columns = {
+ 'based_on': fields.selection([('invoices','Invoices'),
+ ('payments','Payments'),],
+ 'Based On', required=True),
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'periods': fields.many2many('account.period', 'vat_period_rel', 'vat_id', 'period_id', 'Periods', help="All periods if empty"),
+ }
+
+ def _get_company(self, cr, uid, ids, context={}):
+ 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 = {
+ 'based_on': lambda *a: 'invoices',
+ 'company_id': _get_company
+ }
+
+ def create_vat(self, cr, uid, ids, context={}):
+ if context is None:
+ context = {}
+ datas = {'ids': context.get('active_ids', [])}
+ datas['model'] = 'account.tax.code'
+ datas['form'] = self.read(cr, uid, ids)[0]
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.vat.declaration',
+ 'datas': datas,
+ }
+
+account_vat_declaration()
+
+#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_vat_view.xml b/addons/account/wizard/account_vat_view.xml
new file mode 100644
index 00000000000..edd6eaf7874
--- /dev/null
+++ b/addons/account/wizard/account_vat_view.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+ Account Vat Declaration
+ account.vat.declaration
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Account Vat Declaration
+ ir.actions.act_window
+ account.vat.declaration
+ form
+ form
+ new
+
+
+
+
+
+
diff --git a/addons/account/wizard/wizard_central_journal.py b/addons/account/wizard/wizard_central_journal.py
deleted file mode 100644
index 32fb02f3230..00000000000
--- a/addons/account/wizard/wizard_central_journal.py
+++ /dev/null
@@ -1,72 +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
-from tools.translate import _
-
-form = '''
-
-
-
-
'''
-
-fields = {
- 'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
- 'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
-}
-
-
-def _check_data(self, cr, uid, data, *args):
- period_id = data['form']['period_id'][0][2]
- journal_id=data['form']['journal_id'][0][2]
-
- if type(period_id)==type([]):
-
- ids_final = []
-
- for journal in journal_id:
- for period in period_id:
- ids_journal_period = pooler.get_pool(cr.dbname).get('account.journal.period').search(cr,uid, [('journal_id','=',journal),('period_id','=',period)])
-
- if ids_journal_period:
- ids_final.append(ids_journal_period)
-
- if not ids_final:
- raise wizard.except_wizard(_('No Data Available'), _('No records found for your selection!'))
- return data['form']
-
-
-class wizard_print_journal(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel', 'gtk-cancel'), ('print', 'Print', 'gtk-ok'))},
- },
- 'print': {
- 'actions': [_check_data],
- 'result': {'type':'print', 'report':'account.central.journal.wiz', 'state':'end'},
- },
- }
-wizard_print_journal('account.central.journal.report')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/wizard/wizard_change_currency.py b/addons/account/wizard/wizard_change_currency.py
deleted file mode 100644
index 45b23e49022..00000000000
--- a/addons/account/wizard/wizard_change_currency.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/env python
-# -*- encoding: 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
-
-class wizard_change_currency(wizard.interface):
- '''
- OpenERP Wizard
- '''
- form = '''
-
-
-
'''
-
- message = '''
-
-
-
'''
-
- fields = {
- 'currency_id': {'string': 'New Currency', 'type': 'many2one', 'relation': 'res.currency', 'required':True},
- }
-
- def _get_defaults(self, cr, user, data, context):
- #TODO : initlize required data
-
- return data['form']
-
- def _change_currency(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
-
- inv_obj = pool.get('account.invoice')
- inv_line_obj = pool.get('account.invoice.line')
- curr_obj = pool.get('res.currency')
-
- invoice_ids = data['ids']
- new_currency = data['form']['currency_id']
-
- for invoice in inv_obj.browse(cr, uid, invoice_ids, context=context):
- if invoice.currency_id.id == new_currency:
- continue
-
- for line in invoice.invoice_line:
- rate = curr_obj.browse(cr, uid, new_currency).rate
- new_price = 0
- if invoice.company_id.currency_id.id == invoice.currency_id.id:
- new_price = line.price_unit * rate
-
- if invoice.company_id.currency_id.id != invoice.currency_id.id and invoice.company_id.currency_id.id == new_currency:
- old_rate = invoice.currency_id.rate
- new_price = line.price_unit / old_rate
-
- if invoice.company_id.currency_id.id != invoice.currency_id.id and invoice.company_id.currency_id.id != new_currency:
- old_rate = invoice.currency_id.rate
- new_price = (line.price_unit / old_rate ) * rate
-
- inv_line_obj.write(cr, uid, [line.id], {'price_unit':new_price})
- inv_obj.write(cr, uid, [invoice.id], {'currency_id':new_currency})
- return {}
-
- def _check_what_next(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- inv_obj = pool.get('account.invoice')
- if inv_obj.browse(cr, uid, data['id']).state != 'draft':
- return 'message'
-
- return 'change'
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'choice', 'next_state': _check_what_next},
- },
- 'change': {
- 'actions': [],
- 'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel', 'gtk-cancel'), ('next', 'Change Currency', 'gtk-go-forward'))},
- },
- 'next': {
- 'actions': [_change_currency],
- 'result': {'type': 'state', 'state': 'end'},
- },
- 'message': {
- 'actions': [],
- 'result': {'type': 'form', 'arch': message, 'fields': {}, 'state': [('end', 'Ok', 'gtk-cancel')]},
- },
- }
-wizard_change_currency('account.invoice.currency_change')
diff --git a/addons/account/wizard/wizard_fiscalyear_close.py b/addons/account/wizard/wizard_fiscalyear_close.py
deleted file mode 100644
index cbf4b8d0529..00000000000
--- a/addons/account/wizard/wizard_fiscalyear_close.py
+++ /dev/null
@@ -1,228 +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 osv
-import pooler
-from tools.translate import _
-
-_transaction_form = '''
-
-
-
-
-
-
-
-
-
-
'''
-
-_transaction_fields = {
- 'fy_id': {'string':'Fiscal Year to close', 'type':'many2one', 'relation': 'account.fiscalyear','required':True, 'domain':[('state','=','draft')]},
- 'journal_id': {'string':'Opening Entries Journal', 'type':'many2one', 'relation': 'account.journal','required':True},
- 'period_id': {'string':'Opening Entries Period', 'type':'many2one', 'relation': 'account.period','required':True, 'domain':"[('fiscalyear_id','=',fy2_id)]"},
- 'fy2_id': {'string':'New Fiscal Year', 'type':'many2one', 'relation': 'account.fiscalyear', 'domain':[('state','=','draft')], 'required':True},
- 'report_name': {'string':'Name of new entries', 'type':'char', 'size': 64, 'required':True},
- 'sure': {'string':'Check this box', 'type':'boolean'},
-}
-
-def _data_load(self, cr, uid, data, context):
- data['form']['report_name'] = _('End of Fiscal Year Entry')
- return data['form']
-
-def _data_save(self, cr, uid, data, context):
- if not data['form']['sure']:
- raise wizard.except_wizard(_('UserError'), _('Closing of fiscal year cancelled, please check the box !'))
- pool = pooler.get_pool(cr.dbname)
-
- fy_id = data['form']['fy_id']
- period_ids = pool.get('account.period').search(cr, uid, [('fiscalyear_id', '=', fy_id)])
- periods_fy2 = pool.get('account.period').search(cr, uid, [('fiscalyear_id', '=', data['form']['fy2_id'])])
-
- period = pool.get('account.period').browse(cr, uid, data['form']['period_id'], context=context)
- new_fyear = pool.get('account.fiscalyear').browse(cr, uid, data['form']['fy2_id'], context=context)
- old_fyear = pool.get('account.fiscalyear').browse(cr, uid, data['form']['fy_id'], context=context)
-
- new_journal = data['form']['journal_id']
- new_journal = pool.get('account.journal').browse(cr, uid, new_journal, context=context)
-
- if not new_journal.default_credit_account_id or not new_journal.default_debit_account_id:
- raise wizard.except_wizard(_('UserError'),
- _('The journal must have default credit and debit account'))
- if not new_journal.centralisation:
- raise wizard.except_wizard(_('UserError'),
- _('The journal must have centralised counterpart'))
-
- move_ids = pool.get('account.move.line').search(cr, uid, [
- ('journal_id','=',new_journal.id),('period_id.fiscalyear_id','=',new_fyear.id)])
- if move_ids:
- raise wizard.except_wizard(_('UserError'),
- _('The opening journal must not have any entry in the new fiscal year !'))
- query = "SELECT id FROM account_fiscalyear WHERE date_stop < '" + str(new_fyear.date_start) + "'"
- cr.execute(query)
- result = cr.dictfetchall()
- fy_ids = ','.join([str(x['id']) for x in result])
- query_line = pool.get('account.move.line')._query_get(cr, uid,
- obj='account_move_line', context={'fiscalyear': fy_ids})
- cr.execute('select id from account_account WHERE active')
- ids = map(lambda x: x[0], cr.fetchall())
- for account in pool.get('account.account').browse(cr, uid, ids,
- context={'fiscalyear': fy_id}):
-
- accnt_type_data = account.user_type
- if not accnt_type_data:
- continue
- if accnt_type_data.close_method=='none' or account.type == 'view':
- continue
- if accnt_type_data.close_method=='balance':
- if abs(account.balance)>0.0001:
- pool.get('account.move.line').create(cr, uid, {
- 'debit': account.balance>0 and account.balance,
- 'credit': account.balance<0 and -account.balance,
- 'name': data['form']['report_name'],
- 'date': period.date_start,
- 'journal_id': new_journal.id,
- 'period_id': period.id,
- 'account_id': account.id
- }, {'journal_id': new_journal.id, 'period_id':period.id})
- if accnt_type_data.close_method == 'unreconciled':
- offset = 0
- limit = 100
- while True:
- cr.execute('SELECT id, name, quantity, debit, credit, account_id, ref, ' \
- 'amount_currency, currency_id, blocked, partner_id, ' \
- 'date_maturity, date_created ' \
- 'FROM account_move_line ' \
- 'WHERE account_id = %s ' \
- 'AND ' + query_line + ' ' \
- 'AND reconcile_id is NULL ' \
- 'ORDER BY id ' \
- 'LIMIT %s OFFSET %s', (account.id, limit, offset))
- result = cr.dictfetchall()
- if not result:
- break
- for move in result:
- move.pop('id')
- move.update({
- 'date': period.date_start,
- 'journal_id': new_journal.id,
- 'period_id': period.id,
- })
- pool.get('account.move.line').create(cr, uid, move, {
- 'journal_id': new_journal.id,
- 'period_id': period.id,
- })
- offset += limit
-
- #We have also to consider all move_lines that were reconciled
- #on another fiscal year, and report them too
- offset = 0
- limit = 100
- while True:
- #TODO: this query could be improved in order to work if there is more than 2 open FY
- # a.period_id IN ('+fy2_period_set+') is the problematic clause
- cr.execute('SELECT b.id, b.name, b.quantity, b.debit, b.credit, b.account_id, b.ref, ' \
- 'b.amount_currency, b.currency_id, b.blocked, b.partner_id, ' \
- 'b.date_maturity, b.date_created ' \
- 'FROM account_move_line a, account_move_line b ' \
- 'WHERE b.account_id = %s ' \
- 'AND b.reconcile_id is NOT NULL ' \
- 'AND a.reconcile_id = b.reconcile_id ' \
- 'AND b.period_id =ANY(%s)'\
- 'AND a.period_id =ANY(%s)' \
- 'ORDER BY id ' \
- 'LIMIT %s OFFSET %s', (account.id,period_ids,periods_fy2,limit, offset))
- result = cr.dictfetchall()
- if not result:
- break
- for move in result:
- move.pop('id')
- move.update({
- 'date': period.date_start,
- 'journal_id': new_journal.id,
- 'period_id': period.id,
- })
- pool.get('account.move.line').create(cr, uid, move, {
- 'journal_id': new_journal.id,
- 'period_id': period.id,
- })
- offset += limit
- if accnt_type_data.close_method=='detail':
- offset = 0
- limit = 100
- while True:
- cr.execute('SELECT id, name, quantity, debit, credit, account_id, ref, ' \
- 'amount_currency, currency_id, blocked, partner_id, ' \
- 'date_maturity, date_created ' \
- 'FROM account_move_line ' \
- 'WHERE account_id = %s ' \
- 'AND ' + query_line + ' ' \
- 'ORDER BY id ' \
- 'LIMIT %s OFFSET %s', (account.id, limit, offset))
-
- result = cr.dictfetchall()
- if not result:
- break
- for move in result:
- move.pop('id')
- move.update({
- 'date': period.date_start,
- 'journal_id': new_journal.id,
- 'period_id': period.id,
- })
- pool.get('account.move.line').create(cr, uid, move)
- offset += limit
- ids = pool.get('account.move.line').search(cr, uid, [('journal_id','=',new_journal.id),
- ('period_id.fiscalyear_id','=',new_fyear.id)])
- context['fy_closing'] = True
-
- if ids:
- pool.get('account.move.line').reconcile(cr, uid, ids, context=context)
- new_period = data['form']['period_id']
- ids = pool.get('account.journal.period').search(cr, uid, [('journal_id','=',new_journal.id),('period_id','=',new_period)])
- if not ids:
- ids = [pool.get('account.journal.period').create(cr, uid, {
- 'name': (new_journal.name or '')+':'+(period.code or ''),
- 'journal_id': new_journal.id,
- 'period_id': period.id
- })]
- cr.execute('UPDATE account_fiscalyear ' \
- 'SET end_journal_period_id = %s ' \
- 'WHERE id = %s', (ids[0], old_fyear.id))
- return {}
-
-class wiz_journal_close(wizard.interface):
- states = {
- 'init': {
- 'actions': [_data_load],
- 'result': {'type': 'form', 'arch':_transaction_form, 'fields':_transaction_fields, 'state':[('end','Cancel', 'gtk-cancel'),('close','Create', 'gtk-ok')]}
- },
- 'close': {
- 'actions': [_data_save],
- 'result': {'type': 'state', 'state':'end'}
- }
- }
-wiz_journal_close('account.fiscalyear.close')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/wizard/wizard_general_journal.py b/addons/account/wizard/wizard_general_journal.py
deleted file mode 100644
index 26935aa80d6..00000000000
--- a/addons/account/wizard/wizard_general_journal.py
+++ /dev/null
@@ -1,70 +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
-from tools.translate import _
-
-form = '''
-
-
-
-
'''
-
-fields = {
- 'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
- 'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
-}
-
-def _check_data(self, cr, uid, data, *args):
- period_id = data['form']['period_id'][0][2]
- journal_id=data['form']['journal_id'][0][2]
-
- if type(period_id)==type([]):
-
- ids_final = []
-
- for journal in journal_id:
- for period in period_id:
- ids_journal_period = pooler.get_pool(cr.dbname).get('account.journal.period').search(cr,uid, [('journal_id','=',journal),('period_id','=',period)])
-
- if ids_journal_period:
- ids_final.append(ids_journal_period)
-
- if not ids_final:
- raise wizard.except_wizard(_('No Data Available'), _('No records found for your selection!'))
- return data['form']
-
-class wizard_print_journal(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel', 'gtk-cancel'), ('print', 'Print', 'gtk-ok'))},
- },
- 'print': {
- 'actions': [_check_data],
- 'result': {'type':'print', 'report':'account.general.journal.wiz', 'state':'end'},
- },
- }
-wizard_print_journal('account.general.journal.report')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/wizard/wizard_invoice_state.py b/addons/account/wizard/wizard_invoice_state.py
deleted file mode 100644
index 342ce5a97be..00000000000
--- a/addons/account/wizard/wizard_invoice_state.py
+++ /dev/null
@@ -1,59 +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
-
-def _invoice_confirm(self, cr, uid, data, context):
- wf_service = netsvc.LocalService('workflow')
- for id in data['ids']:
- wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_open', cr)
- return {}
-
-class wizard_invoice_confirm(wizard.interface):
- states = {
- 'init': {
- 'actions': [_invoice_confirm],
- 'result': {'type':'state', 'state':'end'}
- }
- }
-wizard_invoice_confirm('account.invoice.state.confirm')
-
-
-def _invoice_cancel(self, cr, uid, data, context):
- wf_service = netsvc.LocalService('workflow')
- for id in data['ids']:
- wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr)
- return {}
-
-class wizard_invoice_cancel(wizard.interface):
- states = {
- 'init': {
- 'actions': [_invoice_cancel],
- 'result': {'type':'state', 'state':'end'}
- }
- }
-wizard_invoice_cancel('account.invoice.state.cancel')
-
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/wizard/wizard_journal_select.py b/addons/account/wizard/wizard_journal_select.py
deleted file mode 100644
index 123a07fb627..00000000000
--- a/addons/account/wizard/wizard_journal_select.py
+++ /dev/null
@@ -1,51 +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
-
-def _action_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')
-
- result = mod_obj._get_id(cr, uid, 'account', 'action_move_line_select')
- id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
- result = act_obj.read(cr, uid, [id])[0]
-
- cr.execute('select journal_id,period_id from account_journal_period where id=%s', (data['id'],))
- journal_id,period_id = cr.fetchone()
-
- result['domain'] = str([('journal_id', '=', journal_id), ('period_id', '=', period_id)])
- result['context'] = str({'journal_id': journal_id, 'period_id': period_id})
- return result
-
-class wiz_journal(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
- }
- }
-wiz_journal('account.move.journal.select')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/wizard/wizard_open_closed_fiscalyear.py b/addons/account/wizard/wizard_open_closed_fiscalyear.py
deleted file mode 100644
index 18ac86c8107..00000000000
--- a/addons/account/wizard/wizard_open_closed_fiscalyear.py
+++ /dev/null
@@ -1,81 +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 pooler
-from osv import fields, osv
-from tools.translate import _
-
-form = """
-
-
-
-"""
-
-fields = {
- 'fyear_id': {'string': 'Fiscal Year to Open', 'type': 'many2one', 'relation': 'account.fiscalyear', 'required': True},
-}
-
-def _remove_entries(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- data_fyear = pool.get('account.fiscalyear').browse(cr,uid,data['form']['fyear_id'])
- if not data_fyear.end_journal_period_id:
- raise wizard.except_wizard(_('Error'), _('No journal for ending writing has been defined for the fiscal year'))
- period_journal = data_fyear.end_journal_period_id
- ids_move = pool.get('account.move').search(cr,uid,[('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)])
- if ids_move:
- cr.execute('delete from account_move where id =ANY(%s)',(ids_move,))
- #cr.execute('UPDATE account_journal_period ' \
- # 'SET state = %s ' \
- # 'WHERE period_id IN (SELECT id FROM account_period WHERE fiscalyear_id = %s)',
- # ('draft',data_fyear))
- #cr.execute('UPDATE account_period SET state = %s ' \
- # 'WHERE fiscalyear_id = %s', ('draft',data_fyear))
- #cr.execute('UPDATE account_fiscalyear ' \
- # 'SET state = %s, end_journal_period_id = null '\
- # 'WHERE id = %s', ('draft',data_fyear))
- return {}
-
-class open_closed_fiscal(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [],
- 'result': {
- 'type': 'form',
- 'arch': form,
- 'fields': fields,
- 'state':[('end','Cancel', 'gtk-cancel'),('open','Open', 'gtk-ok')]
- }
- },
- 'open': {
- 'actions': [],
- 'result': {
- 'type':'action',
- 'action':_remove_entries,
- 'state':'end'
- },
- },
- }
-open_closed_fiscal("account.open_closed_fiscalyear")
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/wizard/wizard_pay_invoice.py b/addons/account/wizard/wizard_pay_invoice.py
deleted file mode 100644
index f534a72a77f..00000000000
--- a/addons/account/wizard/wizard_pay_invoice.py
+++ /dev/null
@@ -1,188 +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 pooler
-import time
-from tools.translate import _
-import tools
-import decimal_precision as dp
-
-
-pay_form = '''
-
-
-
-
-
-
-
-
'''
-
-pay_fields = {
- 'amount': {'string': 'Amount paid', 'type':'float', 'required':True, 'digits': (16,dp.get_precision('Account'))},
- 'name': {'string': 'Entry Name', 'type':'char', 'size': 64, 'required':True},
- 'date': {'string': 'Payment date', 'type':'date', 'required':True, 'default':lambda *args: time.strftime('%Y-%m-%d')},
- 'journal_id': {'string': 'Journal/Payment Mode', 'type': 'many2one', 'relation':'account.journal', 'required':True, 'domain':[('type','=','cash')]},
- 'period_id': {'string': 'Period', 'type': 'many2one', 'relation':'account.period', 'required':True},
-}
-
-def _pay_and_reconcile(self, cr, uid, data, context):
- form = data['form']
- period_id = form.get('period_id', False)
- journal_id = form.get('journal_id', False)
- writeoff_account_id = form.get('writeoff_acc_id', False)
- writeoff_journal_id = form.get('writeoff_journal_id', False)
- pool = pooler.get_pool(cr.dbname)
- cur_obj = pool.get('res.currency')
- amount = form['amount']
- context['analytic_id'] = form.get('analytic_id', False)
-
- invoice = pool.get('account.invoice').browse(cr, uid, data['id'], context)
- journal = pool.get('account.journal').browse(cr, uid, data['form']['journal_id'], context)
- # Compute the amount in company's currency, with the journal currency (which is equal to payment currency)
- # when it is needed : If payment currency (according to selected journal.currency) is <> from company currency
- if journal.currency and invoice.company_id.currency_id.id<>journal.currency.id:
- ctx = {'date':data['form']['date']}
- amount = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, amount, context=ctx)
- currency_id = journal.currency.id
- # Put the paid amount in currency, and the currency, in the context if currency is different from company's currency
- context.update({'amount_currency':form['amount'],'currency_id':currency_id})
-
- if invoice.company_id.currency_id.id<>invoice.currency_id.id:
- ctx = {'date':data['form']['date']}
- amount = cur_obj.compute(cr, uid, invoice.currency_id.id, invoice.company_id.currency_id.id, amount, context=ctx)
- currency_id = invoice.currency_id.id
- # Put the paid amount in currency, and the currency, in the context if currency is different from company's currency
- context.update({'amount_currency':form['amount'],'currency_id':currency_id})
-
- # Take the choosen date
- if form.has_key('comment'):
- context.update({'date_p':form['date'],'comment':form['comment']})
- else:
- context.update({'date_p':form['date'],'comment':False})
-
- acc_id = journal.default_credit_account_id and journal.default_credit_account_id.id
- if not acc_id:
- raise wizard.except_wizard(_('Error !'), _('Your journal must have a default credit and debit account.'))
- pool.get('account.invoice').pay_and_reconcile(cr, uid, [data['id']],
- amount, acc_id, period_id, journal_id, writeoff_account_id,
- period_id, writeoff_journal_id, context, data['form']['name'])
- return {}
-
-def _wo_check(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- invoice = pool.get('account.invoice').browse(cr, uid, data['id'], context)
- journal = pool.get('account.journal').browse(cr, uid, data['form']['journal_id'], context)
- cur_obj = pool.get('res.currency')
- # Here we need that:
- # The invoice total amount in company's currency <> paid amount in company currency
- # (according to the correct day rate, invoicing rate and payment rate are may be different)
- # => Ask to a write-off of the difference. This could happen even if both amount are equal,
- # because if the currency rate
- # Get the amount in company currency for the invoice (according to move lines)
- inv_amount_company_currency = 0
- for aml in invoice.move_id.line_id:
- if aml.account_id.id == invoice.account_id.id or aml.account_id.type in ('receivable', 'payable'):
- inv_amount_company_currency += aml.debit
- inv_amount_company_currency -= aml.credit
- inv_amount_company_currency = abs(inv_amount_company_currency)
-
- # Get the current amount paid in company currency
- if journal.currency and invoice.company_id.currency_id.id<>journal.currency.id:
- ctx = {'date':data['form']['date']}
- amount_paid = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, data['form']['amount'], round=True, context=ctx)
- else:
- amount_paid = data['form']['amount']
- # Get the old payment if there are some
- if invoice.payment_ids:
- debit=credit=0.0
- for payment in invoice.payment_ids:
- debit+=payment.debit
- credit+=payment.credit
- amount_paid+=abs(debit-credit)
-
- # Test if there is a difference according to currency rouding setting
- if pool.get('res.currency').is_zero(cr, uid, invoice.company_id.currency_id,
- (amount_paid - inv_amount_company_currency)):
- return 'reconcile'
- return 'addendum'
-
-_transaction_add_form = '''
-
-
-
-
-
-
-
-
'''
-
-_transaction_add_fields = {
- 'writeoff_acc_id': {'string':'Write-Off account', 'type':'many2one', 'relation':'account.account', 'required':True},
- 'writeoff_journal_id': {'string': 'Write-Off journal', 'type': 'many2one', 'relation':'account.journal', 'required':True},
- 'comment': {'string': 'Comment', 'type':'char', 'size': 64 , 'required':True},
- 'analytic_id': {'string':'Analytic Account', 'type': 'many2one', 'relation':'account.analytic.account'},
-}
-
-def _get_value_addendum(self, cr, uid, data, context={}):
- return {'comment': _('Write-Off')}
-
-def _get_period(self, cr, uid, data, context={}):
- pool = pooler.get_pool(cr.dbname)
- ids = pool.get('account.period').find(cr, uid, context=context)
- period_id = False
- if len(ids):
- period_id = ids[0]
- invoice = pool.get('account.invoice').browse(cr, uid, data['id'], context)
- if invoice.state in ['draft', 'proforma2', 'cancel']:
- raise wizard.except_wizard(_('Error !'), _('Can not pay draft/proforma/cancel invoice.'))
- return {
- 'period_id': period_id,
- 'amount': invoice.residual,
- 'date': time.strftime('%Y-%m-%d')
- }
-
-class wizard_pay_invoice(wizard.interface):
- states = {
- 'init': {
- 'actions': [_get_period],
- 'result': {'type':'form', 'arch':pay_form, 'fields':pay_fields, 'state':[('end','Cancel'),('reconcile','Partial Payment'),('writeoff_check','Full Payment')]}
- },
- 'writeoff_check': {
- 'actions': [],
- 'result' : {'type': 'choice', 'next_state': _wo_check }
- },
- 'addendum': {
- 'actions': [_get_value_addendum],
- 'result': {'type': 'form', 'arch':_transaction_add_form, 'fields':_transaction_add_fields, 'state':[('end','Cancel'),('reconcile','Pay and reconcile')]}
- },
- 'reconcile': {
- 'actions': [_pay_and_reconcile],
- 'result': {'type':'state', 'state':'end'}
- }
- }
-wizard_pay_invoice('account.invoice.pay')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/wizard/wizard_print_journal.py b/addons/account/wizard/wizard_print_journal.py
deleted file mode 100644
index 8cd95608256..00000000000
--- a/addons/account/wizard/wizard_print_journal.py
+++ /dev/null
@@ -1,79 +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
-from tools.translate import _
-
-form = '''
-
-
-
-
-
'''
-
-fields = {
- 'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
- 'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
- 'sort_selection':{
- 'string':"Entries Sorted By",
- 'type':'selection',
- 'selection':[('date','By date'),('ref','Reference Number')],
- 'required':True,
- 'default': lambda *a: 'date',
- },
-
-}
-
-def _check_data(self, cr, uid, data, *args):
- period_id = data['form']['period_id'][0][2]
- journal_id=data['form']['journal_id'][0][2]
-
- if type(period_id)==type([]):
-
- ids_final = []
-
- for journal in journal_id:
- for period in period_id:
- ids_journal_period = pooler.get_pool(cr.dbname).get('account.journal.period').search(cr,uid, [('journal_id','=',journal),('period_id','=',period)])
-
- if ids_journal_period:
- ids_final.append(ids_journal_period)
-
- if not ids_final:
- raise wizard.except_wizard(_('No Data Available'), _('No records found for your selection!'))
- return data['form']
-
-class wizard_print_journal(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel', 'gtk-cancel'), ('print', 'Print', 'gtk-ok'))},
- },
- 'print': {
- 'actions': [_check_data],
- 'result': {'type':'print', 'report':'account.journal.period.print.wiz', 'state':'end'},
- },
- }
-wizard_print_journal('account.print.journal.report')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/wizard/wizard_statement_from_invoice.py b/addons/account/wizard/wizard_statement_from_invoice.py
deleted file mode 100644
index 6e9f912380f..00000000000
--- a/addons/account/wizard/wizard_statement_from_invoice.py
+++ /dev/null
@@ -1,195 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# Copyright (c) 2008 Camptocamp SA All Rights Reserved. (JGG)
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-import wizard
-import pooler
-from tools.misc import UpdateableStr
-import time
-
-FORM = UpdateableStr()
-
-FIELDS = {
- 'lines': {'string': 'Invoices', 'type': 'many2many',
- 'relation': 'account.move.line'},
-
-}
-
-START_FIELD = {
- 'date': {'string': 'Date payment', 'type': 'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'domain': '[("type","in",["sale","purchase","cash"])]', 'help': 'This field allows you to choose the accounting journals you want for filtering the invoices. If you left this field empty, it will search on all sale, purchase and cash journals.'},
-}
-
-START_FORM = '''
-
-
-
-
-
'''
-
-def _search_invoices(obj, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- line_obj = pool.get('account.move.line')
- statement_obj = pool.get('account.bank.statement')
- journal_obj = pool.get('account.journal')
-
- statement = statement_obj.browse(cr, uid, data['id'], context=context)
- args_move_line = []
- repeated_move_line_ids = []
- # Creating a group that is unique for importing move lines(move lines, once imported into statement lines, should not appear again)
- for st_line in statement.line_ids:
- args_move_line = []
- args_move_line.append(('name','=', st_line.name))
- args_move_line.append(('ref','=',st_line.ref))
- if st_line.partner_id:
- args_move_line.append(('partner_id','=',st_line.partner_id.id))
- args_move_line.append(('account_id','=',st_line.account_id.id))
-
- move_line_id = line_obj.search(cr, uid, args_move_line,context=context)
- if move_line_id:
- repeated_move_line_ids += move_line_id
-
- journal_ids = data['form']['journal_id'][0][2]
-
- if journal_ids == []:
- journal_ids = journal_obj.search(cr, uid, [('type', 'in', ('sale','cash','purchase'))], context=context)
-
- args = [
- ('reconcile_id', '=', False),
- ('journal_id', 'in', journal_ids),
- ('account_id.reconcile', '=', True)]
-
- if repeated_move_line_ids:
- args.append(('id','not in',repeated_move_line_ids))
-
- line_ids = line_obj.search(cr, uid, args,
- #order='date DESC, id DESC', #doesn't work
- context=context)
-
- FORM.string = '''
-
-
-
''' % (','.join([str(x) for x in line_ids]))
- return {}
-
-def _populate_statement(obj, cursor, user, data, context):
- line_ids = data['form']['lines'][0][2]
- line_date=data['form']['date']
- if not line_ids:
- return {}
-
- pool = pooler.get_pool(cursor.dbname)
- line_obj = pool.get('account.move.line')
- statement_obj = pool.get('account.bank.statement')
- statement_line_obj = pool.get('account.bank.statement.line')
- currency_obj = pool.get('res.currency')
- statement_reconcile_obj = pool.get('account.bank.statement.reconcile')
-
- statement = statement_obj.browse(cursor, user, data['id'], context=context)
- # for each selected move lines
- for line in line_obj.browse(cursor, user, line_ids, context=context):
- ctx = context.copy()
- # take the date for computation of currency => use payment date
- # if line.date_maturity:
- # ctx['date'] = line.date_maturity
- # else:
- ctx['date'] = line_date
- amount = 0.0
- if line.amount_currency:
- amount = currency_obj.compute(cursor, user, line.currency_id.id,
- statement.currency.id, line.amount_currency, context=ctx)
- else:
- if line.debit > 0:
- amount=line.debit
- elif line.credit > 0:
- amount=-line.credit
- reconcile_id = statement_reconcile_obj.create(cursor, user, {
- 'line_ids': [(6, 0, [line.id])]
- }, context=context)
- if line.journal_id.type == 'sale':
- type = 'customer'
- elif line.journal_id.type == 'purchase':
- type = 'supplier'
- else:
- type = 'general'
-
- statement_line_obj.create(cursor, user, {
- 'name': line.name or '?',
- 'amount': amount,
- 'type': type,
- 'partner_id': line.partner_id.id,
- 'account_id': line.account_id.id,
- 'statement_id': statement.id,
- 'ref': line.ref,
- 'reconcile_id': reconcile_id,
- 'date':line_date, #time.strftime('%Y-%m-%d'), #line.date_maturity or,
- }, context=context)
- return {}
-
-
-class PopulateStatementFromInv(wizard.interface):
- """
- Populate the current statement with selected invoices
- """
- states = {
- 'init': {
- 'actions': [],
- 'result': {
- 'type': 'form',
- 'arch': START_FORM,
- 'fields':START_FIELD,
- 'state': [
- ('end', '_Cancel'),
- ('go', '_Go', '', True),
- ]
- },
- },
- 'go': {
- 'actions': [_search_invoices],
- 'result': {
- 'type': 'form',
- 'arch': FORM,
- 'fields': FIELDS,
- 'state': [
- ('end', '_Cancel','', True, 'gtk-cancel'),
- ('finish', 'O_k','', True, 'gtk-ok')
- ]
- },
- },
-
- 'finish': {
- 'actions': [],
- 'result': {
- 'type': 'action',
- 'action': _populate_statement,
- 'state': 'end'
- },
- },
- }
-PopulateStatementFromInv('populate_statement_from_inv')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/wizard_unreconcile.py b/addons/account/wizard/wizard_unreconcile.py
deleted file mode 100644
index e42a1bc080b..00000000000
--- a/addons/account/wizard/wizard_unreconcile.py
+++ /dev/null
@@ -1,76 +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
-
-_info_form = '''
-
-
-
-
-
'''
-
-def _trans_unrec(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- recs = pool.get('account.move.line').read(cr, uid, data['ids'], ['reconcile_id',])
- recs = filter(lambda x: x['reconcile_id'], recs)
- rec_ids = [rec['reconcile_id'][0] for rec in recs]
- if len(rec_ids):
- pooler.get_pool(cr.dbname).get('account.move.reconcile').unlink(cr, uid, rec_ids)
- return {}
-
-class wiz_unreconcile(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch': _info_form, 'fields': {}, 'state':[('end', 'Cancel', 'gtk-cancel'), ('unrec', 'Unreconcile', 'gtk-ok')]}
- },
- 'unrec': {
- 'actions': [_trans_unrec],
- 'result': {'type': 'state', 'state':'end'}
- }
- }
-wiz_unreconcile('account.move.line.unreconcile')
-
-
-def _trans_unrec_reconcile(self, cr, uid, data, context):
- rec_ids = data['ids']
- if len(rec_ids):
- pooler.get_pool(cr.dbname).get('account.move.reconcile').unlink(cr, uid, rec_ids)
- return {}
-
-class wiz_unreconcile_reconcile(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch': _info_form, 'fields': {}, 'state':[('end', 'Cancel', 'gtk-cancel'), ('unrec', 'Unreconcile', 'gtk-ok')]}
- },
- 'unrec': {
- 'actions': [_trans_unrec_reconcile],
- 'result': {'type': 'state', 'state':'end'}
- }
- }
-wiz_unreconcile_reconcile('account.reconcile.unreconcile')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/wizard/wizard_validate_account_move.py b/addons/account/wizard/wizard_validate_account_move.py
deleted file mode 100644
index 1b56431b4b9..00000000000
--- a/addons/account/wizard/wizard_validate_account_move.py
+++ /dev/null
@@ -1,89 +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
-from osv import osv
-import pooler
-from tools.translate import _
-
-_journal_form = '''
-
-
-
-
-
-
-
-
'''
-
-_journal_fields = {
- 'journal_id': {'string':'Journal', 'type':'many2one', 'relation':'account.journal', 'required':True},
- 'period_id': {'string':'Period', 'type':'many2one', 'relation':'account.period', 'required':True, 'domain':"[('state','<>','done')]"},
-}
-
-def _validate_move(self, cr, uid, data, context={}):
- pool = pooler.get_pool(cr.dbname)
- move_obj = pool.get('account.move')
- ids_move = move_obj.search(cr,uid,[('state','=','draft'),('journal_id','=',data['form']['journal_id']),('period_id','=',data['form']['period_id'])])
- if not ids_move:
- raise wizard.except_wizard(_('Warning'), _('Specified Journal does not have any account move entries in draft state for this period'))
- res = move_obj.button_validate(cr, uid, ids_move, context)
- return {}
-
-class validate_account_move(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':_journal_form, 'fields':_journal_fields, 'state':[('end','Cancel', 'gtk-cancel'),('validate','Validate', 'gtk-ok')]}
- },
- 'validate': {
- 'actions': [_validate_move],
- 'result': {'type': 'state', 'state':'end'}
- },
- }
-validate_account_move('account.move.validate')
-
-def _validate_move_lines(self, cr, uid, data, context={}):
- move_ids = []
- pool = pooler.get_pool(cr.dbname)
- move_line_obj = pool.get('account.move.line')
- move_obj = pool.get('account.move')
- data_line = move_line_obj.browse(cr,uid,data['ids'],context)
- for line in data_line:
- if line.move_id.state=='draft':
- move_ids.append(line.move_id.id)
- move_ids = list(set(move_ids))
- if not move_ids:
- raise wizard.except_wizard(_('Warning'), _('Selected Entry Lines does not have any account move enties in draft state'))
- res = move_obj.button_validate(cr, uid, move_ids, context)
- return {}
-
-class validate_account_move_lines(wizard.interface):
- states = {
- 'init': {
- 'actions': [_validate_move_lines],
- 'result': {'type': 'state', 'state':'end'}
- },
- }
-validate_account_move_lines('account.move_line.validate')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/wizard/wizard_vat.py b/addons/account/wizard/wizard_vat.py
deleted file mode 100755
index 6c14402c701..00000000000
--- a/addons/account/wizard/wizard_vat.py
+++ /dev/null
@@ -1,90 +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
-
-dates_form = '''
-
','**')
+ html = html.replace('','/').replace('','/')
+
+ # the only line breaks we respect is those of ending tags and
+ # breaks
+
+ html = html.replace('\n',' ')
+ html = html.replace(' ', '\n')
+ html = html.replace('
', '\n')
+ html = html.replace('', '\n\n')
+ html = re.sub(' ', '\n', html)
+ html = html.replace(' ' * 2, ' ')
+
+ # for all other tags we failed to clean up, just remove then and
+ # complain about them on the stderr
+ def desperate_fixer(g):
+ #print >>sys.stderr, "failed to clean up %s" % str(g.group())
+ return ' '
+
+ html = re.sub('<.*?>', desperate_fixer, html)
+
+ # lstrip all lines
+ html = '\n'.join([x.lstrip() for x in html.splitlines()])
+
+ for i, url in enumerate(url_index):
+ if i == 0:
+ html += '\n\n'
+ html += '[%s] %s\n' % (i+1, url)
+ return html
+
+class mail_server(osv.osv):
+
+ _name = 'email.server'
+ _description = "POP/IMAP Server"
+
+ _columns = {
+ 'name':fields.char('Name', size=256, required=True, readonly=False),
+ 'active':fields.boolean('Active', required=False),
+ 'state':fields.selection([
+ ('draft','Not Confirme'),
+ ('wating','Waiting for Verification'),
+ ('done','Confirmed'),
+ ],'State', select=True, readonly=True),
+ 'server' : fields.char('Server', size=256, required=True, readonly=True, states={'draft':[('readonly',False)]}),
+ 'port' : fields.integer('Port', required=True, readonly=True, states={'draft':[('readonly',False)]}),
+ 'type':fields.selection([
+ ('pop','POP Server'),
+ ('imap','IMAP Server'),
+ ],'State', select=True, readonly=False),
+ 'is_ssl':fields.boolean('SSL ?', required=False),
+ 'date': fields.date('Date'),
+ 'user' : fields.char('User Name', size=256, required=True, readonly=True, states={'draft':[('readonly',False)]}),
+ 'password' : fields.char('Password', size=1024, invisible=True, required=True, readonly=True, states={'draft':[('readonly',False)]}),
+ 'note': fields.text('Description'),
+ 'action_id':fields.many2one('ir.actions.server', 'Reply Email', required=False, domain="[('state','=','email')]"),
+ 'object_id': fields.many2one('ir.model',"Model", required=True),
+ 'priority': fields.integer('Server Priority', readonly=True, states={'draft':[('readonly',False)]}, help="Priority between 0 to 10, select define the order of Processing"),
+ }
+ _defaults = {
+# 'type': lambda *a: "imap",
+ 'state': lambda *a: "draft",
+ 'active': lambda *a: True,
+ 'priority': lambda *a: 5,
+ 'date': lambda *a: time.strftime('%Y-%m-%d'),
+ }
+
+ def check_duplicate(self, cr, uid, ids):
+ vals = self.read(cr, uid, ids, ['user', 'password'])[0]
+ cr.execute("select count(id) from email_server where user='%s' and password='%s'" % (vals['user'], vals['password']))
+ res = cr.fetchone()
+ if res:
+ if res[0] > 1:
+ return False
+ return True
+
+ _constraints = [
+ (check_duplicate, 'Warning! Can\'t have duplicate server configuration!', ['user', 'password'])
+ ]
+
+ def onchange_server_type(self, cr, uid, ids, server_type=False, ssl=False):
+ port = 0
+ if server_type == 'pop':
+ port = ssl and 995 or 110
+ elif server_type == 'imap':
+ port = ssl and 993 or 143
+
+ return {'value':{'port':port}}
+
+ def _process_email(self, cr, uid, server, message, context={}):
+ history_pool = self.pool.get('mail.server.history')
+ msg_txt = email.message_from_string(message)
+ message_id = msg_txt.get('Message-ID', False)
+
+ msg = {}
+ if not message_id:
+ return False
+
+ fields = msg_txt.keys()
+
+ msg['id'] = message_id
+ msg['message-id'] = message_id
+
+ if 'Subject' in fields:
+ msg['subject'] = msg_txt.get('Subject')
+
+ if 'Content-Type' in fields:
+ msg['content-type'] = msg_txt.get('Content-Type')
+
+ if 'From' in fields:
+ msg['from'] = msg_txt.get('From')
+
+ if 'Delivered-To' in fields:
+ msg['to'] = msg_txt.get('Delivered-To')
+
+ if 'Cc' in fields:
+ msg['cc'] = msg_txt.get('Cc')
+
+ if 'Reply-To' in fields:
+ msg['reply'] = msg_txt.get('Reply-To')
+
+ if 'Date' in fields:
+ msg['date'] = msg_txt.get('Date')
+
+ if 'Content-Transfer-Encoding' in fields:
+ msg['encoding'] = msg_txt.get('Content-Transfer-Encoding')
+
+ if 'References' in fields:
+ msg['references'] = msg_txt.get('References')
+
+ if 'X-openerp-caseid' in fields:
+ msg['caseid'] = msg_txt.get('X-openerp-caseid')
+
+ if 'X-Priority' in fields:
+ msg['priority'] = msg_txt.get('X-priority', '3 (Normal)').split(' ')[0]
+
+ if not msg_txt.is_multipart() or 'text/plain' in msg.get('content-type', None):
+ msg['body'] = msg_txt.get_payload(decode=True)
+
+ attachents = {}
+ if msg_txt.is_multipart() or 'multipart/alternative' in msg.get('content-type', None):
+ body = ""
+ counter = 1
+ for part in msg_txt.walk():
+ if part.get_content_maintype() == 'multipart':
+ continue
+
+ if part.get_content_maintype()=='text':
+ content = part.get_payload(decode=True)
+ if part.get_content_subtype() == 'html':
+ body = html2plaintext(content)
+ elif part.get_content_subtype() == 'plain':
+ body = content
+
+ filename = part.get_filename()
+ if filename :
+ attachents[filename] = part.get_payload(decode=True)
+
+ elif part.get_content_maintype()=='application' or part.get_content_maintype()=='image' or part.get_content_maintype()=='text':
+ filename = part.get_filename();
+ if filename :
+ attachents[filename] = part.get_payload(decode=True)
+ else:
+ body += part.get_payload(decode=True)
+
+ msg['body'] = body
+ msg['attachments'] = attachents
+
+ res_id = False
+ if msg.get('references', False):
+ id = False
+ ref = msg.get('references')
+ if '\r\n' in ref:
+ ref = msg.get('references').split('\r\n')
+ else:
+ ref = msg.get('references').split(' ')
+
+ if ref:
+ hids = history_pool.search(cr, uid, [('name','=',ref[0].strip())])
+ if hids:
+ id = hids[0]
+ history = history_pool.browse(cr, uid, id)
+ model_pool = self.pool.get(server.object_id.model)
+ context.update({
+ 'references_id':ref[0]
+ })
+ vals = {
+
+ }
+ if hasattr(model_pool, 'message_update'):
+ model_pool.message_update(cr, uid, [history.res_id], vals, msg, context=context)
+ else:
+ logger.notifyChannel('imap', netsvc.LOG_WARNING, 'method def message_update is not define in model %s' % (model_pool._name))
+ return False
+ res_id = id
+ else:
+ model_pool = self.pool.get(server.object_id.model)
+ if hasattr(model_pool, 'message_new'):
+ res_id = model_pool.message_new(cr, uid, msg, context)
+ else:
+ logger.notifyChannel('imap', netsvc.LOG_WARNING, 'method def message_new is not define in model %s' % (model_pool._name))
+ return False
+
+ for attactment in attachents or []:
+ data_attach = {
+ 'name': attactment,
+ 'datas':binascii.b2a_base64(str(attachents.get(attactment))),
+ 'datas_fname': attactment,
+ 'description': 'Mail attachment',
+ 'res_model': server.object_id.model,
+ 'res_id': res_id,
+ }
+ self.pool.get('ir.attachment').create(cr, uid, data_attach)
+
+ if server.action_id:
+ action_pool = self.pool.get('ir.actions.server')
+ action_pool.run(cr, uid, [server.action_id.id], {'active_id':res_id, 'active_ids':[res_id]})
+
+ res = {
+ 'name': message_id,
+ 'res_id': res_id,
+ 'server_id': server.id,
+ 'note': msg.get('body', msg.get('from')),
+ 'ref_id':msg.get('references', msg.get('id')),
+ 'type':server.type
+ }
+ his_id = history_pool.create(cr, uid, res)
+
+ return res_id
+
+ 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, 'No address associated with hostname !')
+
+ 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))
+
+ try:
+ if server.type == 'imap':
+ imap_server = None
+ if server.is_ssl:
+ imap_server = IMAP4_SSL(server.server, int(server.port))
+ else:
+ imap_server = IMAP4(server.server, int(server.port))
+
+ imap_server.login(server.user, server.password)
+ imap_server.select()
+ result, data = imap_server.search(None, '(UNSEEN)')
+ for num in data[0].split():
+ result, data = imap_server.fetch(num, '(RFC822)')
+ if self._process_email(cr, uid, server, data[0][1], context):
+ imap_server.store(num, '+FLAGS', '\\Seen')
+ count += 1
+ logger.notifyChannel('imap', netsvc.LOG_INFO, 'fetchmail fetch/process %s email(s) from %s' % (count, server.name))
+
+ imap_server.close()
+ imap_server.logout()
+ elif server.type == 'pop':
+ pop_server = None
+ if server.is_ssl:
+ 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)
+ pop_server.pass_(server.password)
+ pop_server.list()
+
+ (numMsgs, totalSize) = pop_server.stat()
+ count = 0
+ for num in range(1, numMsgs + 1):
+ (header, msges, octets) = pop_server.retr(num)
+ msg = '\n'.join(msges)
+ self._process_email(cr, uid, server, msg, context)
+ pop_server.dele(num)
+
+ pop_server.quit()
+
+ logger.notifyChannel('imap', netsvc.LOG_INFO, 'fetchmail fetch %s email(s) from %s' % (numMsgs, server.name))
+
+ except Exception, e:
+ logger.notifyChannel('IMAP', netsvc.LOG_WARNING, '%s' % (e))
+
+ return True
+
+mail_server()
+
+class mail_server_history(osv.osv):
+
+ _name = "mail.server.history"
+ _description = "Mail Server History"
+
+ _columns = {
+ 'name': fields.char('Message Id', size=256, readonly=True, help="Message Id in Email Server.", select=True),
+ 'ref_id': fields.char('Referance Id', size=256, readonly=True, help="Message Id in Email Server.", select=True),
+ 'res_id': fields.integer("Resource ID", readonly=True, select=True),
+ 'server_id': fields.many2one('email.server',"Mail Server", readonly=True, select=True),
+ 'model_id':fields.related('server_id', 'object_id', type='many2one', relation='ir.model', string='Model', readonly=True, select=True),
+ 'note': fields.text('Notes', readonly=True),
+ 'create_date': fields.datetime('Created Date', readonly=True),
+ 'type':fields.selection([
+ ('pop','POP Server'),
+ ('imap','IMAP Server'),
+ ],'State', select=True, readonly=True),
+ }
+ _order = 'id desc'
+
+mail_server_history()
+
+class fetchmail_tool(osv.osv):
+ """
+ OpenERP Model : fetchmail_tool
+ """
+
+ _name = 'email.server.tools'
+ _description = "Email Tools"
+ _auto = False
+
+ def to_email(self, text):
+ _email = re.compile(r'.*<.*@.*\..*>', re.UNICODE)
+ def record(path):
+ eml = path.group()
+ index = eml.index('<')
+ eml = eml[index:-1].replace('<','').replace('>','')
+ return eml
+
+ bits = _email.sub(record, text)
+ return bits
+
+ def get_partner(self, cr, uid, from_email, context=None):
+ """
+ @param self: The object pointer
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks
+ @param from_email: email address based on that function will search for the correct
+ """
+
+ res = {
+ 'partner_address_id': False,
+ 'partner_id': False
+ }
+ from_email = self.to_email(from_email)
+ address_ids = self.pool.get('res.partner.address').search(cr, uid, [('email', '=', from_email)])
+ if address_ids:
+ address = self.pool.get('res.partner.address').browse(cr, uid, address_ids[0])
+ res['partner_address_id'] = address_ids[0]
+ res['partner_id'] = address.partner_id.id
+
+ return res
+
+fetchmail_tool()
diff --git a/addons/mail_gateway/mail_gateway_data.xml b/addons/fetchmail/fetchmail_data.xml
similarity index 77%
rename from addons/mail_gateway/mail_gateway_data.xml
rename to addons/fetchmail/fetchmail_data.xml
index e13a7a845a5..ef40a76489f 100644
--- a/addons/mail_gateway/mail_gateway_data.xml
+++ b/addons/fetchmail/fetchmail_data.xml
@@ -1,13 +1,13 @@
-
+
- Check Email (Fetchmail)
+ Fetchmail Service5minutes-1
-
+
diff --git a/addons/fetchmail/fetchmail_view.xml b/addons/fetchmail/fetchmail_view.xml
new file mode 100644
index 00000000000..80d0b60a74f
--- /dev/null
+++ b/addons/fetchmail/fetchmail_view.xml
@@ -0,0 +1,177 @@
+
+
+
+
+
+ email.server.tree
+ email.server
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+ email.server.form
+ email.server
+ form
+
+
+
+
+
+
+ Print Timesheet by month
+ ir.actions.act_window
+ hr.attendance.month
+ form
+ form
+ new
+
+
+
+
+
+ Print Timesheet by month
+ client_print_multi
+
+ action
+ hr.employee
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_attendance/wizard/hr_attendance_byweek.py b/addons/hr_attendance/wizard/hr_attendance_byweek.py
new file mode 100644
index 00000000000..30c63d69f2b
--- /dev/null
+++ b/addons/hr_attendance/wizard/hr_attendance_byweek.py
@@ -0,0 +1,50 @@
+# -*- 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
+
+class hr_attendance_byweek(osv.osv_memory):
+ _name = 'hr.attendance.week'
+ _description = 'Print Week Attendance Report'
+ _columns = {
+ 'init_date': fields.date('Starting Date', required=True),
+ 'end_date': fields.date('Ending Date', required=True)
+ }
+ _defaults = {
+ 'init_date': lambda *a: time.strftime('%Y-%m-%d'),
+ 'end_date': lambda *a: time.strftime('%Y-%m-%d'),
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ datas = {
+ 'ids': [],
+ 'model': 'hr.employee',
+ 'form': self.read(cr, uid, ids)[0]
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'hr.attendance.allweeks',
+ 'datas': datas,
+ }
+hr_attendance_byweek()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_attendance/wizard/hr_attendance_byweek_view.xml b/addons/hr_attendance/wizard/hr_attendance_byweek_view.xml
new file mode 100644
index 00000000000..618217a1a66
--- /dev/null
+++ b/addons/hr_attendance/wizard/hr_attendance_byweek_view.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+ Attendance Report Week
+ hr.attendance.week
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Print Timesheet by week
+ ir.actions.act_window
+ hr.attendance.week
+ form
+ form
+ new
+
+
+
+
+
+ Print Timesheet by week
+ client_print_multi
+
+ action
+ hr.employee
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_attendance/wizard/hr_attendance_error.py b/addons/hr_attendance/wizard/hr_attendance_error.py
new file mode 100644
index 00000000000..c14ddcd9032
--- /dev/null
+++ b/addons/hr_attendance/wizard/hr_attendance_error.py
@@ -0,0 +1,70 @@
+# -*- 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 hr_attendance_error(osv.osv_memory):
+
+ _name = 'hr.attendance.error'
+ _description = 'Print Error Attendance Report'
+ _columns = {
+ 'init_date': fields.date('Starting Date', required=True),
+ 'end_date': fields.date('Ending Date', required=True),
+ 'max_delay': fields.integer('Max. Delay (Min)', required=True)
+
+ }
+ _defaults = {
+ 'init_date': lambda *a: time.strftime('%Y-%m-%d'),
+ 'end_date': lambda *a: time.strftime('%Y-%m-%d'),
+ 'max_delay': 120,
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ emp_ids = []
+ data_error = self.read(cr, uid, ids)[0]
+ date_from = data_error['init_date']
+ date_to = data_error['end_date']
+ cr.execute("select id from hr_attendance where employee_id =ANY(%s) and to_char(name,'YYYY-mm-dd')<=%s and to_char(name,'YYYY-mm-dd')>=%s and action =ANY(%s) order by name" ,(context['active_ids'], date_to, date_from, ['sign_in','sign_out']))
+ attendance_ids = [x[0] for x in cr.fetchall()]
+ if not attendance_ids:
+ raise osv.except_osv(_('No Data Available'), _('No records found for your selection!'))
+ attendance_records = self.pool.get('hr.attendance').browse(cr, uid, attendance_ids)
+
+ for rec in attendance_records:
+ if rec.employee_id.id not in emp_ids:
+ emp_ids.append(rec.employee_id.id)
+ data_error['emp_ids'] = emp_ids
+ datas = {
+ 'ids': [],
+ 'model': 'hr.employee',
+ 'form': data_error
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'hr.attendance.error',
+ 'datas': datas,
+ }
+
+hr_attendance_error()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_attendance/wizard/hr_attendance_error_view.xml b/addons/hr_attendance/wizard/hr_attendance_error_view.xml
new file mode 100644
index 00000000000..16769f66df0
--- /dev/null
+++ b/addons/hr_attendance/wizard/hr_attendance_error_view.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+ Attendance Report Error
+ hr.attendance.error
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Print Attendance Error Report
+ ir.actions.act_window
+ hr.attendance.error
+ form
+ form
+ new
+
+
+
+
+
+ Print Attendance Error Report
+ client_print_multi
+
+ action
+ hr.employee
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py b/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py
new file mode 100644
index 00000000000..9ad27298159
--- /dev/null
+++ b/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py
@@ -0,0 +1,185 @@
+# -*- 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 netsvc
+from osv import osv, fields
+from tools.translate import _
+
+class hr_si_so_ask(osv.osv_memory):
+ _name = 'hr.sign.in.out.ask'
+ _description = 'Ask for Sign In Out'
+ _columns = {
+ 'name': fields.char('Employees name', size=32, required=True, readonly=True),
+ 'last_time': fields.datetime('Your last sign out', required=True),
+ 'emp_id': fields.char('Empoyee ID', size=32, required=True, readonly=True),
+ }
+ def _get_empname(self, cr, uid, context=None):
+ service = netsvc.LocalService('object_proxy')
+ emp_id = service.execute(cr.dbname, uid, 'hr.employee', 'search', [('user_id', '=', uid)])
+ if emp_id:
+ employee = service.execute(cr.dbname, uid, 'hr.employee', 'read', emp_id)[0]
+ return employee['name']
+ return ''
+
+ def _get_empid(self, cr, uid, context=None):
+ service = netsvc.LocalService('object_proxy')
+ emp_id = service.execute(cr.dbname, uid, 'hr.employee', 'search', [('user_id', '=', uid)])
+ if emp_id:
+ return emp_id[0]
+ return False
+
+ _defaults = {
+ 'name': _get_empname,
+ 'emp_id': _get_empid,
+ }
+
+ def sign_in(self, cr, uid, ids, context=None):
+ data = self.read(cr, uid, ids, [])[0]
+ return self.pool.get('hr.sign.in.out').sign_in(cr, uid, data, context)
+
+ def sign_out(self, cr, uid, ids, context=None):
+ data = self.read(cr, uid, ids, [])[0]
+ return self.pool.get('hr.sign.in.out').sign_out(cr, uid, data, context)
+
+hr_si_so_ask()
+
+class hr_sign_in_out(osv.osv_memory):
+
+ _name = 'hr.sign.in.out'
+ _description = 'Sign In Sign Out'
+
+ _columns = {
+ 'name': fields.char('Employees name', size=32, required=True, readonly=True),
+ 'state': fields.char('Current state', size=32, required=True, readonly=True),
+ 'emp_id': fields.char('Empoyee ID', size=32, required=True, readonly=True),
+ }
+
+ def _get_empid(self, cr, uid, context=None):
+ service = netsvc.LocalService('object_proxy')
+ emp_id = service.execute(cr.dbname, uid, 'hr.employee', 'search', [('user_id', '=', uid)])
+ if emp_id:
+ employee = service.execute(cr.dbname, uid, 'hr.employee', 'read', emp_id)[0]
+ return {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0]}
+ return {}
+
+ def default_get(self, cr, uid, fields_list, context=None):
+ res = super(hr_sign_in_out, self).default_get(cr, uid, fields_list, context=context)
+ res_emp = self._get_empid(cr, uid, context=context)
+ res.update(res_emp)
+ return res
+
+ def si_check(self, cr, uid, ids, context=None):
+ service = netsvc.LocalService('object_proxy')
+ obj_model = self.pool.get('ir.model.data')
+ data = self.read(cr, uid, ids, [])[0]
+ emp_id = data['emp_id']
+ att_id = service.execute(cr.dbname, uid, 'hr.attendance', 'search', [('employee_id', '=', emp_id)], limit=1, order='name desc')
+ last_att = service.execute(cr.dbname, uid, 'hr.attendance', 'read', att_id)
+ if last_att:
+ last_att = last_att[0]
+ cond = not last_att or last_att['action'] == 'sign_out'
+ if cond:
+ return self.sign_in(cr, uid, data, context)
+ else:
+ model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_hr_attendance_so_ask')], context=context)
+ resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+ return {
+ 'name': _('Sign in / Sign out'),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'hr.sign.in.out.ask',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ }
+
+ def so_check(self, cr, uid, ids, context=None):
+ service = netsvc.LocalService('object_proxy')
+ obj_model = self.pool.get('ir.model.data')
+ data = self.read(cr, uid, ids, [])[0]
+ emp_id = data['emp_id']
+ att_id = service.execute(cr.dbname, uid, 'hr.attendance', 'search', [('employee_id', '=', emp_id),('action','!=','action')], limit=1, order='name desc')
+ last_att = service.execute(cr.dbname, uid, 'hr.attendance', 'read', att_id)
+ if last_att:
+ last_att = last_att[0]
+ if not att_id and not last_att:
+ model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_hr_attendance_message')], context=context)
+ resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+ return {
+ 'name': _('Sign in / Sign out'),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'hr.sign.in.out',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ }
+
+ cond = last_att and last_att['action'] == 'sign_in'
+ if cond:
+ return self.sign_out(cr, uid, data, context)
+ else:
+ model_data_ids = self.pool.get('ir.model.data').search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_hr_attendance_si_ask')], context=context)
+ resource_id = self.pool.get('ir.model.data').read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+ return {
+ 'name': _('Sign in / Sign out'),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'hr.sign.in.out.ask',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ }
+
+ def sign_in(self, cr, uid, data, context=None):
+ service = netsvc.LocalService('object_proxy')
+ emp_id = data['emp_id']
+ if 'last_time' in data:
+ if data['last_time'] > time.strftime('%Y-%m-%d %H:%M:%S'):
+ raise osv.except_osv(_('UserError'), _('The sign-out date must be in the past'))
+ service.execute(cr.dbname, uid, 'hr.attendance', 'create', {
+ 'name': data['last_time'],
+ 'action': 'sign_out',
+ 'employee_id': emp_id
+ })
+ try:
+ success = service.execute(cr.dbname, uid, 'hr.employee', 'attendance_action_change', [emp_id], 'sign_in')
+ except:
+ raise osv.except_osv(_('UserError'), _('A sign-in must be right after a sign-out !'))
+ return {} # To do: Return Success message
+
+ def sign_out(self, cr, uid, data, context=None):
+ service = netsvc.LocalService('object_proxy')
+ emp_id = data['emp_id']
+ if 'last_time' in data:
+ if data['last_time'] > time.strftime('%Y-%m-%d %H:%M:%S'):
+ raise osv.except_osv(_('UserError'), _('The Sign-in date must be in the past'))
+ service.execute(cr.dbname, uid, 'hr.attendance', 'create', {'name':data['last_time'], 'action':'sign_in', 'employee_id':emp_id})
+ try:
+ success = service.execute(cr.dbname, uid, 'hr.employee', 'attendance_action_change', [emp_id], 'sign_out')
+ except:
+ raise osv.except_osv(_('UserError'), _('A sign-out must be right after a sign-in !'))
+ return {} # To do: Return Success message
+
+hr_sign_in_out()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_attendance/wizard/hr_attendance_sign_in_out_view.xml b/addons/hr_attendance/wizard/hr_attendance_sign_in_out_view.xml
new file mode 100644
index 00000000000..62cffa720a9
--- /dev/null
+++ b/addons/hr_attendance/wizard/hr_attendance_sign_in_out_view.xml
@@ -0,0 +1,91 @@
+
+
+
+
+ hr.sign.in.out.form
+ hr.sign.in.out
+ form
+
+
+
+
+
+
+
+
diff --git a/addons/hr_attendance/wizard/print_attendance_error.py b/addons/hr_attendance/wizard/print_attendance_error.py
deleted file mode 100644
index c7c9ab18068..00000000000
--- a/addons/hr_attendance/wizard/print_attendance_error.py
+++ /dev/null
@@ -1,76 +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 pooler
-from tools.translate import _
-
-_date_form = '''
-
-
-
-
-
-
-
'''
-
-_date_fields = {
- 'init_date': {'string':'Starting Date', 'type':'date', 'default':lambda *a: time.strftime('%Y-%m-%d'), 'required':True},
- 'end_date': {'string':'Ending Date', 'type':'date', 'default':lambda *a: time.strftime('%Y-%m-%d'), 'required':True},
- 'max_delay': {'string':'Max. Delay (Min)', 'type':'integer', 'default':lambda *a: 120, 'required':True},
-}
-
-def _check_data(self, cr, uid, data, *args):
- date_from = data['form']['init_date']
- date_to = data['form']['end_date']
- cr.execute("select id from hr_attendance where employee_id =ANY(%s) and to_char(name,'YYYY-mm-dd')<=%s and to_char(name,'YYYY-mm-dd')>=%s and action =ANY(%s) order by name" ,(data['ids'], date_to, date_from, ['sign_in','sign_out']))
- attendance_ids = [x[0] for x in cr.fetchall()]
- if not attendance_ids:
- raise wizard.except_wizard(_('No Data Available'), _('No records found for your selection!'))
-
- attendance_records = pooler.get_pool(cr.dbname).get('hr.attendance').browse(cr,uid,attendance_ids)
- emp_ids = []
- for rec in attendance_records:
- if rec.employee_id.id not in emp_ids:
- emp_ids.append(rec.employee_id.id)
-
- data['form']['emp_ids'] = emp_ids
-
- return data['form']
-
-
-class wiz_attendance(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':_date_form, 'fields':_date_fields, 'state':[('end','Cancel', 'gtk-cancel'),('print','Print', 'gtk-ok') ]}
- },
- 'print': {
- 'actions': [_check_data],
- 'result': {'type': 'print', 'report': 'hr.attendance.error', 'state':'end'}
- }
- }
-wiz_attendance('hr.attendance.report')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/hr_attendance/wizard/print_bymonth.py b/addons/hr_attendance/wizard/print_bymonth.py
deleted file mode 100644
index ae2d5df937b..00000000000
--- a/addons/hr_attendance/wizard/print_bymonth.py
+++ /dev/null
@@ -1,63 +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
-
-_date_form = '''
-
-
-
-
-
'''
-
-_date_fields = {
- 'month' : {
- 'string' : 'Month',
- 'type' : 'selection',
- 'selection' : [(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')],
- 'required':True,
- 'default' : lambda * a: time.gmtime()[1]
- },
- 'year' : {
- 'string' : 'Year',
- 'type' : 'integer',
- 'required':True,
- 'default' : lambda * a: time.gmtime()[0]
- },
-}
-
-class wiz_bymonth(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':_date_form, 'fields':_date_fields, 'state':[ ('end', 'Cancel', 'gtk-cancel'),('print', 'Print', 'gtk-ok')] }
- },
- 'print': {
- 'actions': [],
- 'result': {'type': 'print', 'report': 'hr.attendance.bymonth', 'state': 'end' }
- }
- }
-wiz_bymonth('hr.attendance.print_month')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/hr_attendance/wizard/print_byweek.py b/addons/hr_attendance/wizard/print_byweek.py
deleted file mode 100644
index d859e81aea5..00000000000
--- a/addons/hr_attendance/wizard/print_byweek.py
+++ /dev/null
@@ -1,53 +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
-
-_date_form = '''
-
-
-
-
-
-
'''
-
-_date_fields = {
- 'init_date': {'string':'Starting Date', 'type':'date', 'default':lambda *a: time.strftime('%Y-%m-%d'), 'required':True},
- 'end_date': {'string':'Ending Date', 'type':'date', 'default':lambda *a: time.strftime('%Y-%m-%d'), 'required':True}
-}
-
-class wiz_byweek(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':_date_form, 'fields':_date_fields, 'state':[('end','Cancel', 'gtk-cancel'), ('print','Print', 'gtk-ok')]}
- },
- 'print': {
- 'actions': [],
- 'result': {'type': 'print', 'report': 'hr.attendance.allweeks', 'state':'end'}
- }
- }
-wiz_byweek('hr.attendance.print_week')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/hr_attendance/wizard/sign_in_out.py b/addons/hr_attendance/wizard/sign_in_out.py
deleted file mode 100644
index 8e022a3c44f..00000000000
--- a/addons/hr_attendance/wizard/sign_in_out.py
+++ /dev/null
@@ -1,197 +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
-from tools.translate import _
-
-si_so_form ='''
-
diff --git a/addons/hr_holidays/hr_holidays_wizard.xml b/addons/hr_holidays/hr_holidays_wizard.xml
index a747571c943..244668ec719 100644
--- a/addons/hr_holidays/hr_holidays_wizard.xml
+++ b/addons/hr_holidays/hr_holidays_wizard.xml
@@ -11,22 +11,21 @@
name="Holidays"
parent="hr.menu_hr_reporting"
sequence="3" />
-
- -->
+
+-->
-
+ keyword="client_print_multi" id="wizard_holidays_summary" />-->
diff --git a/addons/hr_holidays/i18n/ar.po b/addons/hr_holidays/i18n/ar.po
index a4c8c82fa99..5f26cc4cce9 100644
--- a/addons/hr_holidays/i18n/ar.po
+++ b/addons/hr_holidays/i18n/ar.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/bg.po b/addons/hr_holidays/i18n/bg.po
index ab515d9d8a9..059d3f2ec9b 100644
--- a/addons/hr_holidays/i18n/bg.po
+++ b/addons/hr_holidays/i18n/bg.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/bs.po b/addons/hr_holidays/i18n/bs.po
index ebc0e7f6380..1e8967fa4f2 100644
--- a/addons/hr_holidays/i18n/bs.po
+++ b/addons/hr_holidays/i18n/bs.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/ca.po b/addons/hr_holidays/i18n/ca.po
index 5f4656cbd36..9d4eb411501 100644
--- a/addons/hr_holidays/i18n/ca.po
+++ b/addons/hr_holidays/i18n/ca.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/cs.po b/addons/hr_holidays/i18n/cs.po
index 5c8c25fc49c..0bf885221a5 100644
--- a/addons/hr_holidays/i18n/cs.po
+++ b/addons/hr_holidays/i18n/cs.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/de.po b/addons/hr_holidays/i18n/de.po
index 65f273fbc50..844e6dc1f92 100644
--- a/addons/hr_holidays/i18n/de.po
+++ b/addons/hr_holidays/i18n/de.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/el.po b/addons/hr_holidays/i18n/el.po
index 303a6a5104d..e9a8298392e 100644
--- a/addons/hr_holidays/i18n/el.po
+++ b/addons/hr_holidays/i18n/el.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"X-Poedit-Country: GREECE\n"
"X-Poedit-Language: Greek\n"
diff --git a/addons/hr_holidays/i18n/es.po b/addons/hr_holidays/i18n/es.po
index 9ade226f6ac..60a661a9717 100644
--- a/addons/hr_holidays/i18n/es.po
+++ b/addons/hr_holidays/i18n/es.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/es_AR.po b/addons/hr_holidays/i18n/es_AR.po
index 5976f6fe3c6..0be2a743702 100644
--- a/addons/hr_holidays/i18n/es_AR.po
+++ b/addons/hr_holidays/i18n/es_AR.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/es_EC.po b/addons/hr_holidays/i18n/es_EC.po
index eef43f8b95d..4da9792e518 100644
--- a/addons/hr_holidays/i18n/es_EC.po
+++ b/addons/hr_holidays/i18n/es_EC.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/et.po b/addons/hr_holidays/i18n/et.po
index e727c747f7c..525dc107a0a 100644
--- a/addons/hr_holidays/i18n/et.po
+++ b/addons/hr_holidays/i18n/et.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/fi.po b/addons/hr_holidays/i18n/fi.po
index 8aa97a2cf68..98cc3cf88bb 100644
--- a/addons/hr_holidays/i18n/fi.po
+++ b/addons/hr_holidays/i18n/fi.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/fr.po b/addons/hr_holidays/i18n/fr.po
index bbd0f5ae965..8f62504f964 100644
--- a/addons/hr_holidays/i18n/fr.po
+++ b/addons/hr_holidays/i18n/fr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/hr.po b/addons/hr_holidays/i18n/hr.po
index 453b1726454..e9464d15726 100644
--- a/addons/hr_holidays/i18n/hr.po
+++ b/addons/hr_holidays/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/hu.po b/addons/hr_holidays/i18n/hu.po
index c447222196a..59f2b4b30db 100644
--- a/addons/hr_holidays/i18n/hu.po
+++ b/addons/hr_holidays/i18n/hu.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/id.po b/addons/hr_holidays/i18n/id.po
index 593de018bfb..eda0c0e6363 100644
--- a/addons/hr_holidays/i18n/id.po
+++ b/addons/hr_holidays/i18n/id.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/it.po b/addons/hr_holidays/i18n/it.po
index 1796d82c133..2a19ca68dcb 100644
--- a/addons/hr_holidays/i18n/it.po
+++ b/addons/hr_holidays/i18n/it.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/ko.po b/addons/hr_holidays/i18n/ko.po
index b93d36bb933..7bab4f39054 100644
--- a/addons/hr_holidays/i18n/ko.po
+++ b/addons/hr_holidays/i18n/ko.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/lt.po b/addons/hr_holidays/i18n/lt.po
index b5f593d4b33..dff11197da4 100644
--- a/addons/hr_holidays/i18n/lt.po
+++ b/addons/hr_holidays/i18n/lt.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/lv.po b/addons/hr_holidays/i18n/lv.po
index 27657fd6b3e..bd3d56a4a54 100644
--- a/addons/hr_holidays/i18n/lv.po
+++ b/addons/hr_holidays/i18n/lv.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/nl.po b/addons/hr_holidays/i18n/nl.po
index 54309e484e8..02819b8cfe7 100644
--- a/addons/hr_holidays/i18n/nl.po
+++ b/addons/hr_holidays/i18n/nl.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/nl_BE.po b/addons/hr_holidays/i18n/nl_BE.po
index fac83d8864d..e7dff159671 100644
--- a/addons/hr_holidays/i18n/nl_BE.po
+++ b/addons/hr_holidays/i18n/nl_BE.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/pl.po b/addons/hr_holidays/i18n/pl.po
index 23c5f27fc59..19df489b338 100644
--- a/addons/hr_holidays/i18n/pl.po
+++ b/addons/hr_holidays/i18n/pl.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/pt.po b/addons/hr_holidays/i18n/pt.po
index 96f4f84121c..2d194cfee64 100644
--- a/addons/hr_holidays/i18n/pt.po
+++ b/addons/hr_holidays/i18n/pt.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/pt_BR.po b/addons/hr_holidays/i18n/pt_BR.po
index 5a7585e11b4..f7f6fc8cbb6 100644
--- a/addons/hr_holidays/i18n/pt_BR.po
+++ b/addons/hr_holidays/i18n/pt_BR.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/ro.po b/addons/hr_holidays/i18n/ro.po
index 7ec310081f6..e3465d4cab2 100644
--- a/addons/hr_holidays/i18n/ro.po
+++ b/addons/hr_holidays/i18n/ro.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/ru.po b/addons/hr_holidays/i18n/ru.po
index 56efed4f8a5..256b3f212f6 100644
--- a/addons/hr_holidays/i18n/ru.po
+++ b/addons/hr_holidays/i18n/ru.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/sl.po b/addons/hr_holidays/i18n/sl.po
index d5d0d83c74d..dc9ac5e3168 100644
--- a/addons/hr_holidays/i18n/sl.po
+++ b/addons/hr_holidays/i18n/sl.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/sr.po b/addons/hr_holidays/i18n/sr.po
index 1f3d8b08bf3..1586b7046bd 100644
--- a/addons/hr_holidays/i18n/sr.po
+++ b/addons/hr_holidays/i18n/sr.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/sv.po b/addons/hr_holidays/i18n/sv.po
index 740e8e4d16f..b873cb18c17 100644
--- a/addons/hr_holidays/i18n/sv.po
+++ b/addons/hr_holidays/i18n/sv.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/th.po b/addons/hr_holidays/i18n/th.po
index 4417ac76370..16369b963fe 100644
--- a/addons/hr_holidays/i18n/th.po
+++ b/addons/hr_holidays/i18n/th.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/tlh.po b/addons/hr_holidays/i18n/tlh.po
index c785a5ee37e..2a4fa579e70 100644
--- a/addons/hr_holidays/i18n/tlh.po
+++ b/addons/hr_holidays/i18n/tlh.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/tr.po b/addons/hr_holidays/i18n/tr.po
index ce6efce9df8..3679cef9d32 100644
--- a/addons/hr_holidays/i18n/tr.po
+++ b/addons/hr_holidays/i18n/tr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/uk.po b/addons/hr_holidays/i18n/uk.po
index 9e35879f3bf..3e9d43818e4 100644
--- a/addons/hr_holidays/i18n/uk.po
+++ b/addons/hr_holidays/i18n/uk.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/zh_CN.po b/addons/hr_holidays/i18n/zh_CN.po
index abe62d19b0d..b4242f47b23 100644
--- a/addons/hr_holidays/i18n/zh_CN.po
+++ b/addons/hr_holidays/i18n/zh_CN.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/i18n/zh_TW.po b/addons/hr_holidays/i18n/zh_TW.po
index a4c8c82fa99..5f26cc4cce9 100644
--- a/addons/hr_holidays/i18n/zh_TW.po
+++ b/addons/hr_holidays/i18n/zh_TW.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
diff --git a/addons/hr_holidays/report/holidays_summary_report.py b/addons/hr_holidays/report/holidays_summary_report.py
index c61e8f733b4..77dde5b4575 100644
--- a/addons/hr_holidays/report/holidays_summary_report.py
+++ b/addons/hr_holidays/report/holidays_summary_report.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 .
#
##############################################################################
@@ -39,8 +39,8 @@ def strToDate(dt):
dt_date=datetime.date(int(dt[0:4]),int(dt[5:7]),int(dt[8:10]))
return dt_date
else:
- return
-
+ return
+
def emp_create_xml(self,cr,uid,dept,holiday_type,row_id,empid,name,som,eom):
display={}
@@ -48,11 +48,11 @@ def emp_create_xml(self,cr,uid,dept,holiday_type,row_id,empid,name,som,eom):
count=0
p_id=pooler.get_pool(cr.dbname).get('hr.holidays').search(cr,uid,[('employee_id','in',[empid,False]), ('type', '=', 'remove')])
ids_date = pooler.get_pool(cr.dbname).get('hr.holidays').read(cr,uid,p_id,['date_from','date_to','holiday_status_id','state'])
-
+
for index in range(1,61):
diff=index-1
current=som+datetime.timedelta(diff)
-
+
for item in ids_date:
if current >= strToDate(item['date_from']) and current <= strToDate(item['date_to']):
if item['state'] in holiday_type:
@@ -210,19 +210,18 @@ class report_custom(report_rml):
row_id=1
if data['model']=='hr.employee':
-
- for id in data['form']['emp'][0][2]:
+ for id in data['form']['emp']:
items = pooler.get_pool(cr.dbname).get('hr.employee').read(cr,uid,id,['id','name'])
emp_xml += emp_create_xml(self,cr,uid,0,holiday_type,row_id,items['id'],items['name'],som, eom)
row_id = row_id +1
-
+
elif data['model']=='ir.ui.menu':
- for id in data['form']['depts'][0][2]:
+ for id in data['form']['depts']:
dept = pooler.get_pool(cr.dbname).get('hr.department').browse(cr, uid, id, context.copy())
depts.append(dept)
- dept_ids = tuple(data['form']['depts'][0][2])
-
+ dept_ids = tuple(data['form']['depts'])
+
cr.execute("""select dept_user.user_id \
from hr_department_user_rel dept_user \
where dept_user.department_id = %s\
@@ -258,7 +257,7 @@ class report_custom(report_rml):
%s
''' % (months_xml,date_xml, emp_xml)
-
+
return xml
report_custom('report.holidays.summary', 'hr.holidays', '', 'addons/hr_holidays/report/holidays_summary.xsl')
diff --git a/addons/hr_holidays/wizard/__init__.py b/addons/hr_holidays/wizard/__init__.py
index 310328a15c1..19228a07fac 100644
--- a/addons/hr_holidays/wizard/__init__.py
+++ b/addons/hr_holidays/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,11 +15,12 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
-import holidays_summary
-import holidays_summary_employees
+import hr_holidays_summary_department
+import hr_holidays_summary_employees
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_holidays/wizard/holidays_summary.py b/addons/hr_holidays/wizard/holidays_summary.py
deleted file mode 100644
index 0b6a05247f0..00000000000
--- a/addons/hr_holidays/wizard/holidays_summary.py
+++ /dev/null
@@ -1,97 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-# $Id: account.py 1005 2005-07-25 08:41:42Z nicoe $
-#
-# 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 time
-import pooler
-
-form='''
-
-
-
-
-
-
'''
-
-zero_form='''
-
-
-
'''
-
-zero_fields={
-}
-
-class wizard_report(wizard.interface):
- def _check(self, cr, uid, data, context):
- data['form']['date_from']=time.strftime('%Y-%m-%d')
- data['form']['holiday_type']='Validated'
-
- return data['form']
-
- def _checkdepts(self, cr, uid, data, context):
-
- if len(data['form']['depts'][0][2])==0:
- return 'notify'
- else:
- return 'report'
-
- fields={
- 'date_from':{
- 'string':'From',
- 'type':'date',
- 'required':True,
- },
- 'depts': {
- 'string': 'Department(s)',
- 'type': 'many2many',
- 'relation': 'hr.department'
- },
- 'holiday_type':{
- 'string':"Select Holiday Type",
- 'required':True,
- 'type':'selection',
- 'selection':[('Validated','Validated'),('Confirmed','Confirmed'),('both','Both Validated and Confirmed')]
- },
- }
-
- states={
- 'init':{
- 'actions':[_check],
- 'result':{'type':'form', 'arch':form, 'fields':fields, 'state':[('end', 'Cancel', 'gtk-cancel'), ('checkdept', 'Print', 'gtk-print')]}
- },
- 'checkdept': {
- 'actions': [],
- 'result': {'type':'choice','next_state':_checkdepts}
- },
- 'notify': {
- 'actions': [],
- 'result': {'type':'form','arch':zero_form,'fields':zero_fields,'state':[('end','Ok', 'gtk-ok')]}
- },
- 'report':{
- 'actions':[],
- 'result':{'type':'print', 'report':'holidays.summary', 'state':'end'}
- }
- }
-wizard_report('hr.holidays.summary')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/hr_holidays/wizard/holidays_summary_employees.py b/addons/hr_holidays/wizard/holidays_summary_employees.py
deleted file mode 100644
index bdc5664abfb..00000000000
--- a/addons/hr_holidays/wizard/holidays_summary_employees.py
+++ /dev/null
@@ -1,87 +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 time
-import pooler
-
-
-form='''
-
-
-
-
-
'''
-
-zero_form='''
-
-
-
'''
-
-zero_fields={
-}
-
-class wizard_report(wizard.interface):
- def _check(self, cr, uid, data, context):
- data['form']['date_from']=time.strftime('%Y-%m-%d')
- data['form']['holiday_type']='Validated'
- data['form']['emp'] = data['ids']
- return data['form']
-
- def _checkemps(self, cr, uid, data, context):
-
- if len(data['form']['emp'][0][2])==0:
- return 'notify'
- else:
- return 'report'
-
- fields={
- 'date_from':{
- 'string':'From',
- 'type':'date',
- 'required':True,
- },
- 'holiday_type':{'string':"Select Holiday Type",'type':'selection','selection':[('Validated','Validated'),('Confirmed','Confirmed'),('both','Both')]},
- 'emp': {'string': 'Employee(s)', 'type': 'many2many', 'relation': 'hr.employee'},
- }
-
- states={
- 'init':{
- 'actions':[_check],
- 'result':{'type':'form', 'arch':form, 'fields':fields, 'state':[('end', 'Cancel','gtk-cancel'), ('checkemp', 'Print', 'gtk-print')]}
- },
- 'checkemp': {
- 'actions': [],
- 'result': {'type':'choice','next_state':_checkemps}
- },
- 'notify': {
- 'actions': [],
- 'result': {'type':'form','arch':zero_form,'fields':zero_fields,'state':[('end','Ok', 'gtk-ok')]}
- },
- 'report':{
- 'actions':[],
- 'result':{'type':'print', 'report':'holidays.summary', 'state':'end'}
- }
- }
-wizard_report('hr.holidays.summary.employee')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_department.py b/addons/hr_holidays/wizard/hr_holidays_summary_department.py
new file mode 100644
index 00000000000..5e35bbdb916
--- /dev/null
+++ b/addons/hr_holidays/wizard/hr_holidays_summary_department.py
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+# $Id: account.py 1005 2005-07-25 08:41:42Z nicoe $
+#
+# 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 hr_holidays_summary_dept(osv.osv_memory):
+ _name = 'hr.holidays.summary.dept'
+ _description = 'HR Holidays Summary Report By Department'
+ _columns = {
+ 'date_from': fields.date('From', required=True),
+ 'depts': fields.many2many('hr.department', 'summary_dept_rel', 'sum_id', 'dept_id', 'Department(s)'),
+ 'holiday_type': fields.selection([('Validated','Validated'),('Confirmed','Confirmed'),('both','Both Validated and Confirmed')], 'Select Holiday Type', required=True)
+ }
+
+ _defaults = {
+ 'date_from': time.strftime('%Y-%m-%d'),
+ 'holiday_type': 'Validated'
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ data = self.read(cr, uid, ids, [])[0]
+ if not data['depts']:
+ raise osv.except_osv(_('Error'), _('You have to select at least 1 Department. And try again'))
+ datas = {
+ 'ids': [],
+ 'model': 'ir.ui.menu',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'holidays.summary',
+ 'datas': datas,
+ }
+
+hr_holidays_summary_dept()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_department_view.xml b/addons/hr_holidays/wizard/hr_holidays_summary_department_view.xml
new file mode 100644
index 00000000000..fabc11d6021
--- /dev/null
+++ b/addons/hr_holidays/wizard/hr_holidays_summary_department_view.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+ hr.holidays.summary.dept.form
+ hr.holidays.summary.dept
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Holidays by Departement
+ ir.actions.act_window
+ hr.holidays.summary.dept
+ form
+ form
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_employees.py b/addons/hr_holidays/wizard/hr_holidays_summary_employees.py
new file mode 100644
index 00000000000..1452c864c7f
--- /dev/null
+++ b/addons/hr_holidays/wizard/hr_holidays_summary_employees.py
@@ -0,0 +1,56 @@
+# -*- 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 hr_holidays_summary_employee(osv.osv_memory):
+ _name = 'hr.holidays.summary.employee'
+ _description = 'HR Holidays Summary Report By Employee'
+ _columns = {
+ 'date_from': fields.date('From', required=True),
+ 'emp': fields.many2many('hr.employee', 'summary_emp_rel', 'sum_id', 'emp_id', 'Employee(s)'),
+ 'holiday_type': fields.selection([('Validated','Validated'),('Confirmed','Confirmed'),('both','Both Validated and Confirmed')], 'Select Holiday Type', required=True)
+ }
+
+ _defaults = {
+ 'date_from': time.strftime('%Y-%m-%d'),
+ 'holiday_type': 'Validated',
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ data = self.read(cr, uid, ids, [])[0]
+ data['emp'] = context['active_ids']
+ datas = {
+ 'ids': [],
+ 'model': 'hr.employee',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'holidays.summary',
+ 'datas': datas,
+ }
+
+hr_holidays_summary_employee()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_employees_view.xml b/addons/hr_holidays/wizard/hr_holidays_summary_employees_view.xml
new file mode 100644
index 00000000000..0957083a136
--- /dev/null
+++ b/addons/hr_holidays/wizard/hr_holidays_summary_employees_view.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+ hr.holidays.summary.employee.form
+ hr.holidays.summary.employee
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Employee's Holidays
+ ir.actions.act_window
+ hr.holidays.summary.employee
+ form
+ form
+ new
+
+
+
+
+
+ Employee's Holidays
+ client_print_multi
+
+ action
+ hr.employee
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_recruitment/__terp__.py b/addons/hr_recruitment/__openerp__.py
similarity index 100%
rename from addons/hr_recruitment/__terp__.py
rename to addons/hr_recruitment/__openerp__.py
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py
index 8cb7dd0924b..6fe8b91aa3e 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -163,7 +163,6 @@ class hr_applicant(osv.osv):
"""
if not context:
context = {}
-
record = self.browse(cr, uid, ids, context)
record = record and record[0]
context.update({'survey_id': record.survey.id, 'response_id' : [record.response], 'response_no':0,})
@@ -179,4 +178,4 @@ class hr_job(osv.osv):
'survey_id': fields.many2one('survey', 'Survey'),
}
-hr_job()
+hr_job()
\ No newline at end of file
diff --git a/addons/hr_recruitment/hr_recruitment_menu.xml b/addons/hr_recruitment/hr_recruitment_menu.xml
index 88011aa817c..bbf32cf0501 100644
--- a/addons/hr_recruitment/hr_recruitment_menu.xml
+++ b/addons/hr_recruitment/hr_recruitment_menu.xml
@@ -9,7 +9,7 @@
hr.applicanttree,form,graph
- {"search_default_Current":1,"search_default_My Recrui":1}
+ {"search_default_current":1,"search_default_my_recrui":1}
diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml
index 96f8718bf9a..2367603502c 100644
--- a/addons/hr_recruitment/hr_recruitment_view.xml
+++ b/addons/hr_recruitment/hr_recruitment_view.xml
@@ -73,7 +73,7 @@
-
+
@@ -87,9 +87,9 @@
-
-
+
+
@@ -202,7 +202,7 @@
-
@@ -224,7 +224,7 @@
-
+
diff --git a/addons/hr_recruitment/report/hr_recruitment_report_view.xml b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
index 2b8c451949c..286499e0ae8 100644
--- a/addons/hr_recruitment/report/hr_recruitment_report_view.xml
+++ b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
@@ -39,7 +39,6 @@
search
-
-
-
+
@@ -78,9 +76,10 @@
string="Excellent"
domain="[('priority','=','1')]"/>
+
-
-
+
+
@@ -101,7 +100,7 @@
hr.recruitment.reportformtree,graph
- {"search_default_User":1}
+ {"search_default_user_id":1,"search_default_by_user":1}
diff --git a/addons/hr_timesheet/__terp__.py b/addons/hr_timesheet/__openerp__.py
similarity index 93%
rename from addons/hr_timesheet/__terp__.py
rename to addons/hr_timesheet/__openerp__.py
index 976242edc0c..a917ed2df4c 100644
--- a/addons/hr_timesheet/__terp__.py
+++ b/addons/hr_timesheet/__openerp__.py
@@ -44,7 +44,9 @@ to set up a management by affair.
'hr_timesheet_view.xml',
'hr_timesheet_report.xml',
'hr_timesheet_wizard.xml',
- 'process/hr_timesheet_process.xml'
+ 'process/hr_timesheet_process.xml',
+ 'wizard/hr_timesheet_print_employee_view.xml',
+ 'wizard/hr_timesheet_print_users_view.xml'
],
'demo_xml': ['hr_timesheet_demo.xml'],
'installable': True,
diff --git a/addons/hr_timesheet/hr_timesheet_report.xml b/addons/hr_timesheet/hr_timesheet_report.xml
index 9b7c527fea9..6fa7185c7e9 100644
--- a/addons/hr_timesheet/hr_timesheet_report.xml
+++ b/addons/hr_timesheet/hr_timesheet_report.xml
@@ -13,32 +13,32 @@
sequence="1" />
-
-
+
-
-
+ />-->
+
-
-
+-->
diff --git a/addons/hr_timesheet/hr_timesheet_view.xml b/addons/hr_timesheet/hr_timesheet_view.xml
index d8f318d148b..6c52c99d081 100644
--- a/addons/hr_timesheet/hr_timesheet_view.xml
+++ b/addons/hr_timesheet/hr_timesheet_view.xml
@@ -27,7 +27,7 @@
form
-
+
@@ -36,8 +36,8 @@
-
-
+
+
diff --git a/addons/hr_timesheet/hr_timesheet_wizard.xml b/addons/hr_timesheet/hr_timesheet_wizard.xml
index b5f270fe0e8..f0a2d7175b3 100644
--- a/addons/hr_timesheet/hr_timesheet_wizard.xml
+++ b/addons/hr_timesheet/hr_timesheet_wizard.xml
@@ -1,8 +1,8 @@
-
-
+
+
diff --git a/addons/hr_timesheet/i18n/ar.po b/addons/hr_timesheet/i18n/ar.po
index 592d9289a7c..b86674b1aa8 100644
--- a/addons/hr_timesheet/i18n/ar.po
+++ b/addons/hr_timesheet/i18n/ar.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/bg.po b/addons/hr_timesheet/i18n/bg.po
index 36bb157a6cb..e0e34df38a5 100644
--- a/addons/hr_timesheet/i18n/bg.po
+++ b/addons/hr_timesheet/i18n/bg.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/bs.po b/addons/hr_timesheet/i18n/bs.po
index e77637bde04..4cf3b407187 100644
--- a/addons/hr_timesheet/i18n/bs.po
+++ b/addons/hr_timesheet/i18n/bs.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/ca.po b/addons/hr_timesheet/i18n/ca.po
index 5bc758263ff..a8737b0bb3d 100644
--- a/addons/hr_timesheet/i18n/ca.po
+++ b/addons/hr_timesheet/i18n/ca.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/cs.po b/addons/hr_timesheet/i18n/cs.po
index 7ace8c6aabc..2a631ad72b5 100644
--- a/addons/hr_timesheet/i18n/cs.po
+++ b/addons/hr_timesheet/i18n/cs.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/de.po b/addons/hr_timesheet/i18n/de.po
index d1c900449bc..c0dc16b4145 100644
--- a/addons/hr_timesheet/i18n/de.po
+++ b/addons/hr_timesheet/i18n/de.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-08 07:18+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/el.po b/addons/hr_timesheet/i18n/el.po
index 072ca98bbee..21875e550b8 100644
--- a/addons/hr_timesheet/i18n/el.po
+++ b/addons/hr_timesheet/i18n/el.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"X-Poedit-Country: GREECE\n"
"X-Poedit-Language: Greek\n"
diff --git a/addons/hr_timesheet/i18n/es.po b/addons/hr_timesheet/i18n/es.po
index 26f74ab60e5..ea3c1e6a1a3 100644
--- a/addons/hr_timesheet/i18n/es.po
+++ b/addons/hr_timesheet/i18n/es.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/es_AR.po b/addons/hr_timesheet/i18n/es_AR.po
index dc2dc025ef8..975b6c8a856 100644
--- a/addons/hr_timesheet/i18n/es_AR.po
+++ b/addons/hr_timesheet/i18n/es_AR.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:07+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/et.po b/addons/hr_timesheet/i18n/et.po
index daf8b9b2c1b..a6e418bbc2a 100644
--- a/addons/hr_timesheet/i18n/et.po
+++ b/addons/hr_timesheet/i18n/et.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/fi.po b/addons/hr_timesheet/i18n/fi.po
index 96ae92ba6a9..be5ffd952c4 100644
--- a/addons/hr_timesheet/i18n/fi.po
+++ b/addons/hr_timesheet/i18n/fi.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/fr.po b/addons/hr_timesheet/i18n/fr.po
index 0beab6826ab..a004b08089b 100644
--- a/addons/hr_timesheet/i18n/fr.po
+++ b/addons/hr_timesheet/i18n/fr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/hr.po b/addons/hr_timesheet/i18n/hr.po
index 592d9289a7c..b86674b1aa8 100644
--- a/addons/hr_timesheet/i18n/hr.po
+++ b/addons/hr_timesheet/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/hu.po b/addons/hr_timesheet/i18n/hu.po
index 592d9289a7c..b86674b1aa8 100644
--- a/addons/hr_timesheet/i18n/hu.po
+++ b/addons/hr_timesheet/i18n/hu.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/id.po b/addons/hr_timesheet/i18n/id.po
index 2293c74843f..9a04c0781fc 100644
--- a/addons/hr_timesheet/i18n/id.po
+++ b/addons/hr_timesheet/i18n/id.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/it.po b/addons/hr_timesheet/i18n/it.po
index f6605404be1..27558ec8de0 100644
--- a/addons/hr_timesheet/i18n/it.po
+++ b/addons/hr_timesheet/i18n/it.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/ko.po b/addons/hr_timesheet/i18n/ko.po
index 4f39888143a..3c03099fc42 100644
--- a/addons/hr_timesheet/i18n/ko.po
+++ b/addons/hr_timesheet/i18n/ko.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/lt.po b/addons/hr_timesheet/i18n/lt.po
index 592d9289a7c..b86674b1aa8 100644
--- a/addons/hr_timesheet/i18n/lt.po
+++ b/addons/hr_timesheet/i18n/lt.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/lv.po b/addons/hr_timesheet/i18n/lv.po
index ce81bf81ba9..c42405715ec 100644
--- a/addons/hr_timesheet/i18n/lv.po
+++ b/addons/hr_timesheet/i18n/lv.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/nl.po b/addons/hr_timesheet/i18n/nl.po
index cf31544f772..eacf58bd10a 100644
--- a/addons/hr_timesheet/i18n/nl.po
+++ b/addons/hr_timesheet/i18n/nl.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/pl.po b/addons/hr_timesheet/i18n/pl.po
index a8d7792f50c..25e13552267 100644
--- a/addons/hr_timesheet/i18n/pl.po
+++ b/addons/hr_timesheet/i18n/pl.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/pt.po b/addons/hr_timesheet/i18n/pt.po
index 1cd88a0726b..dfde1e03082 100644
--- a/addons/hr_timesheet/i18n/pt.po
+++ b/addons/hr_timesheet/i18n/pt.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/pt_BR.po b/addons/hr_timesheet/i18n/pt_BR.po
index 0a9b8106e77..28cb7603766 100644
--- a/addons/hr_timesheet/i18n/pt_BR.po
+++ b/addons/hr_timesheet/i18n/pt_BR.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:07+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/ro.po b/addons/hr_timesheet/i18n/ro.po
index 2d8cabd7a14..aa4b592ec66 100644
--- a/addons/hr_timesheet/i18n/ro.po
+++ b/addons/hr_timesheet/i18n/ro.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/ru.po b/addons/hr_timesheet/i18n/ru.po
index faf48091f94..0b75ea226e4 100644
--- a/addons/hr_timesheet/i18n/ru.po
+++ b/addons/hr_timesheet/i18n/ru.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/sl.po b/addons/hr_timesheet/i18n/sl.po
index a3f250bc9b5..3ee0d79f7cd 100644
--- a/addons/hr_timesheet/i18n/sl.po
+++ b/addons/hr_timesheet/i18n/sl.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/sq.po b/addons/hr_timesheet/i18n/sq.po
index 702f6d51f73..1c63e5b5005 100644
--- a/addons/hr_timesheet/i18n/sq.po
+++ b/addons/hr_timesheet/i18n/sq.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/sv.po b/addons/hr_timesheet/i18n/sv.po
index bd2056af036..79db1137442 100644
--- a/addons/hr_timesheet/i18n/sv.po
+++ b/addons/hr_timesheet/i18n/sv.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:07+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/tlh.po b/addons/hr_timesheet/i18n/tlh.po
index b3da130ba35..a05880de063 100644
--- a/addons/hr_timesheet/i18n/tlh.po
+++ b/addons/hr_timesheet/i18n/tlh.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:07+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/tr.po b/addons/hr_timesheet/i18n/tr.po
index e4dedef8226..3c076d12e8d 100644
--- a/addons/hr_timesheet/i18n/tr.po
+++ b/addons/hr_timesheet/i18n/tr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:07+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/uk.po b/addons/hr_timesheet/i18n/uk.po
index fa249ad2950..e17cea7b6a5 100644
--- a/addons/hr_timesheet/i18n/uk.po
+++ b/addons/hr_timesheet/i18n/uk.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:07+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/zh_CN.po b/addons/hr_timesheet/i18n/zh_CN.po
index af8968206f2..357439bd377 100644
--- a/addons/hr_timesheet/i18n/zh_CN.po
+++ b/addons/hr_timesheet/i18n/zh_CN.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:07+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/i18n/zh_TW.po b/addons/hr_timesheet/i18n/zh_TW.po
index 9272aa6d7f5..1ee6a76c4ef 100644
--- a/addons/hr_timesheet/i18n/zh_TW.po
+++ b/addons/hr_timesheet/i18n/zh_TW.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:07+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/report/users_timesheet.py b/addons/hr_timesheet/report/users_timesheet.py
index c179c3d3fff..9755d2d5871 100644
--- a/addons/hr_timesheet/report/users_timesheet.py
+++ b/addons/hr_timesheet/report/users_timesheet.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 .
#
##############################################################################
@@ -42,24 +42,24 @@ def emp_create_xml(cr, id, som, eom):
"and line.user_id=%s and line.date >= %s and line.date < %s "
"order by line.date",
(id, som.strftime('%Y-%m-%d'), eom.strftime('%Y-%m-%d')))
-
+
# Sum by day
month = {}
for presence in cr.dictfetchall():
day = int(presence['date'][-2:])
month[day] = month.get(day, 0.0) + presence['amount']
-
+
xml = '''
%.2f
'''
time_xml = ([xml % (day, amount) for day, amount in month.iteritems()])
-
+
# Computing the employee
cr.execute("select name from res_users where id=%s", (id,))
emp = cr.fetchone()[0]
-
+
# Computing the xml
xml = '''
@@ -73,13 +73,13 @@ class report_custom(report_rml):
def get_month_name(self, cr, uid, month):
_months = {1:_("January"), 2:_("February"), 3:_("March"), 4:_("April"), 5:_("May"), 6:_("June"), 7:_("July"), 8:_("August"), 9:_("September"), 10:_("October"), 11:_("November"), 12:_("December")}
return _months[month]
-
+
def get_weekday_name(self, cr, uid, weekday):
_weekdays = {1:_('Mon'), 2:_('Tue'), 3:_('Wed'), 4:_('Thu'), 5:_('Fri'), 6:_('Sat'), 7:_('Sun')}
return _weekdays[weekday]
def create_xml(self, cr, uid, ids, data, context):
-
+
# Computing the dates (start of month: som, and end of month: eom)
som = datetime.date(data['form']['year'], data['form']['month'], 1)
eom = som + datetime.timedelta(lengthmonth(som.year, som.month))
@@ -87,9 +87,9 @@ class report_custom(report_rml):
date_xml += ['' % (x, self.get_weekday_name(cr, uid, som.replace(day=x).weekday()+1), som.replace(day=x).weekday()+1) for x in range(1, lengthmonth(som.year, som.month)+1)]
date_xml.append('')
date_xml.append('2.5cm%s,2cm\n' % (',0.7cm' * lengthmonth(som.year, som.month)))
-
+
emp_xml=''
- for id in data['form']['user_ids'][0][2]:
+ for id in data['form']['user_ids']:
emp_xml += emp_create_xml(cr, id, som, eom)
# Computing the xml
diff --git a/addons/hr_timesheet/wizard/__init__.py b/addons/hr_timesheet/wizard/__init__.py
index 88b1cb40415..8619dcbcfea 100644
--- a/addons/hr_timesheet/wizard/__init__.py
+++ b/addons/hr_timesheet/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,13 +15,13 @@
# 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 sign_in_out
-import wizard_print_timesheet
-import wizard_print_timesheet_users
+import hr_timesheet_print_employee
+import hr_timesheet_print_users
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py b/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py
new file mode 100644
index 00000000000..d2e9a54f836
--- /dev/null
+++ b/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py
@@ -0,0 +1,57 @@
+# -*- 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
+
+class analytical_timesheet_employee(osv.osv_memory):
+ _name = 'hr.analytical.timesheet.employee'
+ _description = 'Print Employee Timesheet & Print My Timesheet'
+ _columns = {
+ 'month': fields.selection([(x, datetime.date(2000, x, 1).strftime('%B')) for x in range(1, 13)],
+ 'Month', required=True),
+ 'year': fields.integer('Year', required=True),
+ 'user_id': fields.many2one('res.users', 'User', required=True)
+ }
+
+ def _get_user(self, cr, uid, context=None):
+ return uid
+
+ _defaults = {
+ 'month': datetime.date.today().month,
+ 'year': datetime.date.today().year,
+ 'user_id': _get_user
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ data = self.read(cr, uid, ids, context=context)[0]
+ datas = {
+ 'ids': [],
+ 'model': 'hr.employee',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'hr.analytical.timesheet',
+ 'datas': datas,
+ }
+analytical_timesheet_employee()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_print_employee_view.xml b/addons/hr_timesheet/wizard/hr_timesheet_print_employee_view.xml
new file mode 100644
index 00000000000..a3b53a05d22
--- /dev/null
+++ b/addons/hr_timesheet/wizard/hr_timesheet_print_employee_view.xml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+ hr.analytical.timesheet.employee.form
+ hr.analytical.timesheet.employee
+ form
+
+
+
+
+
+
+ Print My Timesheet
+ hr.analytical.timesheet.employee
+ form
+ tree,form
+
+ new
+
+
+
+
+
+
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_print_users.py b/addons/hr_timesheet/wizard/hr_timesheet_print_users.py
new file mode 100644
index 00000000000..3931e41e185
--- /dev/null
+++ b/addons/hr_timesheet/wizard/hr_timesheet_print_users.py
@@ -0,0 +1,56 @@
+# -*- 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
+
+class analytical_timesheet_employees(osv.osv_memory):
+ _name = 'hr.analytical.timesheet.users'
+ _description = 'Print Employees Timesheet'
+ _columns = {
+ 'month': fields.selection([(x, datetime.date(2000, x, 1).strftime('%B')) for x in range(1, 13)],
+ 'Month', required=True),
+ 'year': fields.integer('Year', required=True),
+ 'user_ids': fields.many2many('res.users', 'timesheet_users_rel', 'timesheet_id', 'user_id', 'Users', required=True)
+ }
+
+ _defaults = {
+ 'month': datetime.date.today().month,
+ 'year': datetime.date.today().year,
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ data = self.read(cr, uid, ids, context=context)[0]
+ datas = {
+ 'ids': [],
+ 'model': 'hr.employee',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'hr.analytical.timesheet_users',
+ 'datas': datas,
+ }
+
+analytical_timesheet_employees()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_print_users_view.xml b/addons/hr_timesheet/wizard/hr_timesheet_print_users_view.xml
new file mode 100644
index 00000000000..4e12f4f2333
--- /dev/null
+++ b/addons/hr_timesheet/wizard/hr_timesheet_print_users_view.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+ hr.analytical.timesheet.users.form
+ hr.analytical.timesheet.users
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Employees Timesheet
+ hr.analytical.timesheet.users
+ form
+ tree,form
+
+ new
+
+
+
+
+
+
+
diff --git a/addons/hr_timesheet/wizard/sign_in_out.py b/addons/hr_timesheet/wizard/sign_in_out.py
index 4aea035f829..ff532afc260 100644
--- a/addons/hr_timesheet/wizard/sign_in_out.py
+++ b/addons/hr_timesheet/wizard/sign_in_out.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 .
#
##############################################################################
@@ -25,7 +25,7 @@ import time
import pooler
from tools.translate import _
-si_form ='''
+si_form ='''
@@ -98,6 +98,7 @@ def _sign_in_result(self, cr, uid, data, context):
def _write(self, cr, uid, data, emp_id, context):
timesheet_obj = pooler.get_pool(cr.dbname).get('hr.analytic.timesheet')
+ emp_obj = pooler.get_pool(cr.dbname).get('hr.employee')
hour = (time.mktime(time.strptime(data['form']['date'] or time.strftime('%Y-%m-%d %H:%M:%S'), '%Y-%m-%d %H:%M:%S')) -
time.mktime(time.strptime(data['form']['date_start'], '%Y-%m-%d %H:%M:%S'))) / 3600.0
minimum = data['form']['analytic_amount']
@@ -110,6 +111,8 @@ def _write(self, cr, uid, data, emp_id, context):
res['name'] = data['form']['info']
res['account_id'] = data['form']['account_id']
res['unit_amount'] = hour
+ emp_journal = emp_obj.browse(cr, uid, emp_id, context).journal_id
+ res['journal_id'] = emp_journal and emp_journal.id or False
res.update(up)
up = timesheet_obj.on_change_account_id(cr, uid, [], res['account_id']).get('value', {})
res.update(up)
diff --git a/addons/hr_timesheet/wizard/wizard_print_timesheet.py b/addons/hr_timesheet/wizard/wizard_print_timesheet.py
deleted file mode 100644
index ba11d301762..00000000000
--- a/addons/hr_timesheet/wizard/wizard_print_timesheet.py
+++ /dev/null
@@ -1,80 +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 datetime
-
-import wizard
-import netsvc
-
-dates_form = '''
-
-
-
-
-
'''
-
-
-dates_form_ro = '''
-
-
-
-
-
'''
-
-dates_fields = {
- 'month': dict(string=u'Month', type='selection', required=True, selection=[(x, datetime.date(2000, x, 1).strftime('%B')) for x in range(1, 13)]),
- 'year': dict(string=u'Year', type=u'integer', required=True),
- 'user_id' : dict(string=u'User', type='many2one', relation='res.users', required=True),
-}
-
-def _get_value(self, cr, uid, data, context):
- today = datetime.date.today()
- return dict(month=today.month, year=today.year, user_id=uid)
-
-class wizard_report(wizard.interface):
- states = {
- 'init': {
- 'actions': [_get_value],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[ ('end','Cancel','gtk-cancel'),('report','Print','gtk-print')]}
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'hr.analytical.timesheet', 'state':'end'}
- }
- }
-wizard_report('hr.analytical.timesheet')
-
-class wizard_report_my(wizard.interface):
- states = {
- 'init': {
- 'actions': [_get_value],
- 'result': {'type':'form', 'arch':dates_form_ro, 'fields':dates_fields, 'state':[ ('end','Cancel','gtk-cancel'),('report','Print','gtk-print')]}
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'hr.analytical.timesheet', 'state':'end'}
- }
- }
-wizard_report_my('hr.analytical.timesheet.my')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/hr_timesheet/wizard/wizard_print_timesheet_users.py b/addons/hr_timesheet/wizard/wizard_print_timesheet_users.py
deleted file mode 100644
index a00ddd00084..00000000000
--- a/addons/hr_timesheet/wizard/wizard_print_timesheet_users.py
+++ /dev/null
@@ -1,56 +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
-
-form='''
-
-
-
-
-
- mail.gateway.server.tree
- mail.gateway.server
- tree
-
-
-
-
-
-
-
-
-
-
-
- Email Gateway Server
- mail.gateway.server
- form
- tree,form
-
-
-
-
-
-
-
-
diff --git a/addons/mail_gateway/mail_gateway_wizard.xml b/addons/mail_gateway/mail_gateway_wizard.xml
deleted file mode 100644
index 3c90868fac1..00000000000
--- a/addons/mail_gateway/mail_gateway_wizard.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/addons/mail_gateway/security/ir.model.access.csv b/addons/mail_gateway/security/ir.model.access.csv
deleted file mode 100644
index 864db00acb0..00000000000
--- a/addons/mail_gateway/security/ir.model.access.csv
+++ /dev/null
@@ -1,7 +0,0 @@
-"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_mail_gateway_server","mail.gateway.server","model_mail_gateway_server","base.group_user",1,0,0,0
-"access_mail_gateway","mail.gateway","model_mail_gateway","base.group_user",1,0,0,0
-"access_mail_gateway_history","mail.gateway.history","model_mail_gateway_history","base.group_user",1,0,0,0
-
-
-
diff --git a/addons/mail_gateway/wizard/wizard_fetch_mail.py b/addons/mail_gateway/wizard/wizard_fetch_mail.py
deleted file mode 100644
index 10922835fe0..00000000000
--- a/addons/mail_gateway/wizard/wizard_fetch_mail.py
+++ /dev/null
@@ -1,82 +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 pooler
-import tools
-import os
-_email_form = '''
-
-
-
-
- Load database Structure
- bi.load.db.wizard
- olap.schema
- ir.actions.act_window
- form
- form
-
- new
-
-
-
-
-
-
- Olap Warehouse
- olap.warehouse.wizard
- form
-
-
-
-
-
-
-
-
-
-
-
- Olap Warehouse
- ir.actions.act_window
- olap.warehouse.wizard
- form
- form
- new
-
-
-
-
-
-
- Parameters Configuration
- olap.parameters.config.wizard
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameters Configuration
- ir.actions.act_window
- olap.parameters.config.wizard
- form
- form
- new
-
-
-
- Server Parameters Configuration
- This wizard will configure the URL of the web client
-
-
-
-
-
-
-
- bi.auto.configure.form
- bi.auto.configure.wizard
- form
-
-
-
-
-
-
-
-
-
-
-
- Auto Configuration
- bi.auto.configure.wizard
- olap.schema
- ir.actions.act_window
- form
- form
-
- new
-
-
-
-
- # ------------------------------------------------------------------
- # Olap Schema
- # ------------------------------------------------------------------
-
-
- olap.schema.tree
- olap.schema
- tree
-
-
-
-
-
-
-
-
-
- olap.schema.form
- olap.schema
- form
-
-
+
+
+
+
+ Load database Structure
+ bi.load.db.wizard
+ olap.schema
+ ir.actions.act_window
+ form
+ form
+
+ new
+
+
+
+
+
+
+ Olap Warehouse
+ olap.warehouse.wizard
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+ Olap Warehouse
+ ir.actions.act_window
+ olap.warehouse.wizard
+ form
+ form
+ new
+
+
+
+
+
+
+
+ Parameters Configuration
+ olap.parameters.config.wizard
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Parameters Configuration
+ ir.actions.act_window
+ olap.parameters.config.wizard
+ form
+ form
+ new
+
+
+
+
+
+ Server Parameters Configuration
+ This wizard will configure the URL of the web client
+
+
+
+
+
+
+
+ bi.auto.configure.form
+ bi.auto.configure.wizard
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+ Auto Configuration
+ bi.auto.configure.wizard
+ olap.schema
+ ir.actions.act_window
+ form
+ form
+
+ new
+
+
+
+
+ # ------------------------------------------------------------------
+ # Olap Schema
+ # ------------------------------------------------------------------
+
+
+ olap.schema.tree
+ olap.schema
+ tree
+
+
+
+
+
+
+
+
+
+ olap.schema.form
+ olap.schema
+ form
+
+
-
+ product.price.type.form
@@ -169,9 +173,6 @@
formtree,form
-
-
-
product.pricelist.type.formproduct.pricelist.type
@@ -190,7 +191,5 @@
formtree,form
-
-
diff --git a/addons/product/product.py b/addons/product/product.py
index 72fcfa5afd2..b21ebe5ee3a 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -256,11 +256,11 @@ class product_template(osv.osv):
'description': fields.text('Description',translate=True),
'description_purchase': fields.text('Purchase Description',translate=True),
'description_sale': fields.text('Sale Description',translate=True),
- 'type': fields.selection([('product','Stockable Product'),('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Will change the way requisitions are processed. Consumables are stockable products with infinite stock, or for use when you have no inventory management in the system."),
+ 'type': fields.selection([('product','Stockable Product'),('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Will change the way procurements are processed. Consumables are stockable products with infinite stock, or for use when you have no inventory management in the system."),
'supply_method': fields.selection([('produce','Produce'),('buy','Buy')], 'Supply method', required=True, help="Produce will generate production order or tasks, according to the product type. Purchase will trigger purchase orders when requested."),
'sale_delay': fields.float('Customer Lead Time', help="This is the average time between the confirmation of the customer order and the delivery of the finished products. It's the time you promise to your customers."),
'produce_delay': fields.float('Manufacturing Lead Time', help="Average time to produce this product. This is only for the production order and, if it is a multi-level bill of material, it's only for the level of this product. Different lead times will be summed for all levels and purchase orders."),
- 'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Requisition Method', required=True, help="'Make to Stock': When needed, take from the stock or wait until re-supplying. 'Make to Order': When needed, purchase or produce for the requisition request."),
+ 'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Procurement Method', required=True, help="'Make to Stock': When needed, take from the stock or wait until re-supplying. 'Make to Order': When needed, purchase or produce for the procurement request."),
'rental': fields.boolean('Can be Rent'),
'categ_id': fields.many2one('product.category','Category', required=True, change_default=True, domain="[('type','=','normal')]"),
'list_price': fields.float('Sale Price', digits_compute=dp.get_precision('Sale Price'), help="Base price for computing the customer price. Sometimes called the catalog price."),
@@ -271,7 +271,7 @@ class product_template(osv.osv):
'cost_method': fields.selection([('standard','Standard Price'), ('average','Average Price')], 'Costing Method', required=True,
help="Standard Price: the cost price is fixed and recomputed periodically (usually at the end of the year), Average Price: the cost price is recomputed at each reception of products."),
'warranty': fields.float('Warranty (months)'),
- 'sale_ok': fields.boolean('Can be sold', help="Determines if the product can be visible in the list of product within a selection from a sale order line."),
+ 'sale_ok': fields.boolean('Can be Sold', help="Determines if the product can be visible in the list of product within a selection from a sale order line."),
'purchase_ok': fields.boolean('Can be Purchased', help="Determine if the product is visible in the list of products within a selection from a purchase order line."),
'state': fields.selection([('',''),('draft', 'In Development'),('sellable','In Production'),('end','End of Lifecycle'),('obsolete','Obsolete')], 'State', help="Tells the user if he can use the product or not."),
'uom_id': fields.many2one('product.uom', 'Default UoM', required=True, help="Default Unit of Measure used for all stock operation."),
@@ -648,7 +648,7 @@ class product_supplierinfo(osv.osv):
'name' : fields.many2one('res.partner', 'Partner', required=True, ondelete='cascade', help="Supplier of this product"),
'product_name': fields.char('Partner Product Name', size=128, help="This partner's product name will be used when printing a request for quotation. Keep empty to use the internal one."),
'product_code': fields.char('Partner Product Code', size=64, help="This partner's product code will be used when printing a request for quotation. Keep empty to use the internal one."),
- 'sequence' : fields.integer('Priority', help="Assigns the priority to the list of product supplier."),
+ 'sequence' : fields.integer('Sequence', help="Assigns the priority to the list of product supplier."),
'qty' : fields.float('Minimal Quantity', required=True, help="The minimal quantity to purchase to this supplier, expressed in the default unit of measure."),
'product_id' : fields.many2one('product.template', 'Product', required=True, ondelete='cascade', select=True),
'delay' : fields.integer('Delivery Lead Time', required=True, help="Lead time in days between the confirmation of the purchase order and the reception of the products in your warehouse. Used by the scheduler for automatic computation of the purchase order planning."),
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index a01649850c7..b9858e19eaf 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -42,7 +42,7 @@
-
+
@@ -66,26 +66,26 @@
-
+
-
+
-
-
-
+
+
+
-
-
+
+
@@ -100,14 +100,14 @@
-
-
+
+
-
-
+
+
@@ -118,7 +118,7 @@
-
+
@@ -132,10 +132,10 @@
-
+
-
-
+
+
@@ -144,8 +144,8 @@
-
-
+
+
@@ -163,7 +163,7 @@
+
+
+
+ Message Queue
+ email.smtpclient.queue
+ form
+ tree,form
+
+
+
+
+
+
+
diff --git a/addons/smtpclient/smtpclient_wizard.xml b/addons/smtpclient/smtpclient_wizard.xml
new file mode 100644
index 00000000000..297fd4ae3ec
--- /dev/null
+++ b/addons/smtpclient/smtpclient_wizard.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/purchase_manual/wizard/__init__.py b/addons/smtpclient/wizard/__init__.py
similarity index 82%
rename from addons/purchase_manual/wizard/__init__.py
rename to addons/smtpclient/wizard/__init__.py
index 9f53e1a75ad..313d0f737a2 100644
--- a/addons/purchase_manual/wizard/__init__.py
+++ b/addons/smtpclient/wizard/__init__.py
@@ -1,8 +1,7 @@
-# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
+# Copyright (C) 2004-2009 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
@@ -19,5 +18,9 @@
#
##############################################################################
+import sendcode
+import verifycode
+import testemail
+import wizard_spam
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-import purchase_line_invoice
diff --git a/addons/smtpclient/wizard/sendcode.py b/addons/smtpclient/wizard/sendcode.py
new file mode 100644
index 00000000000..632b00265bf
--- /dev/null
+++ b/addons/smtpclient/wizard/sendcode.py
@@ -0,0 +1,67 @@
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 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
+from osv import osv
+import time
+import sys
+from tools.translate import _
+
+form = '''
+
+
+
'''
+
+fields = {
+ 'emailto': {'string': 'Email Address', 'required':True, 'size': 255 , 'type': 'char', 'help': 'Enter the address Email where you want to get the Verification Code'}
+}
+
+class sendcode(wizard.interface):
+
+ def check_code(self, cr, uid, data, context):
+ code = pooler.get_pool(cr.dbname).get('email.smtpclient').browse(cr, uid, [data['id']])[0].code
+ if code:
+ raise osv.except_osv(_('Error'), _('Verification Code Already Generated !'))
+ return {}
+
+
+ def send_code(self, cr, uid, data, context):
+ state = pooler.get_pool(cr.dbname).get('email.smtpclient').test_verify_email(cr, uid, [data['id']], data['form']['emailto'])
+ if not state:
+ raise osv.except_osv(_('Error'), _('Verification Failed. Please check the Server Configuration!'))
+
+ return {}
+
+ states = {
+ 'init': {
+ 'actions': [check_code],
+ 'result': {'type':'form', 'arch':form, 'fields':fields, 'state':[('end','Cancel'),('send','Send Code')]}
+ },
+ 'send': {
+ 'actions': [send_code],
+ 'result': {'type':'state', 'state':'end'}
+ }
+ }
+sendcode('email.sendcode')
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account/wizard/wizard_state_open.py b/addons/smtpclient/wizard/testemail.py
similarity index 58%
rename from addons/account/wizard/wizard_state_open.py
rename to addons/smtpclient/wizard/testemail.py
index 9720f48e25e..5cd03db74ca 100644
--- a/addons/account/wizard/wizard_state_open.py
+++ b/addons/smtpclient/wizard/testemail.py
@@ -1,8 +1,7 @@
-# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
+# Copyright (C) 2004-2009 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
@@ -21,38 +20,38 @@
import wizard
import pooler
-import netsvc
+from osv import osv
from tools.translate import _
form = '''
-
-
-
-
+
+
'''
fields = {
+ 'emailto': {'string': 'Email Address', 'required':True, 'size': 255 , 'type': 'char', 'help': 'Enter the address Email where you want to get the Test Email'}
}
-def _change_inv_state(self, cr, uid, data, context):
- pool_obj = pooler.get_pool(cr.dbname)
- data_inv = pool_obj.get('account.invoice').browse(cr, uid, data['ids'][0])
- if data_inv.reconciled:
- raise wizard.except_wizard(_('Warning'), _('Invoice is already reconciled'))
- wf_service = netsvc.LocalService("workflow")
- res = wf_service.trg_validate(uid, 'account.invoice', data['ids'][0], 'open_test', cr)
- return {}
+class testemail(wizard.interface):
+
+ def send_code(self, cr, uid, data, context):
+ state = pooler.get_pool(cr.dbname).get('email.smtpclient').test_verify_email(cr, uid, [data['id']], data['form']['emailto'], test=True)
+ if not state:
+ raise osv.except_osv(_('Error'), _('Verification Failed. Please check the Server Configuration!'))
+ return {}
-class wiz_state_open(wizard.interface):
states = {
'init': {
'actions': [],
- 'result': {'type':'form', 'arch':form, 'fields':fields, 'state':[('end','No','gtk-no'),('yes','Yes','gtk-yes')]}
+ 'result': {'type':'form', 'arch':form, 'fields':fields, 'state':[('end','Cancel'),('send','Send Email')]}
},
- 'yes': {
- 'actions': [_change_inv_state],
+ 'send': {
+ 'actions': [send_code],
'result': {'type':'state', 'state':'end'}
}
}
-wiz_state_open('account.wizard_paid_open')
+testemail('email.testemail')
+
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/smtpclient/wizard/verifycode.py b/addons/smtpclient/wizard/verifycode.py
new file mode 100644
index 00000000000..096523c6b69
--- /dev/null
+++ b/addons/smtpclient/wizard/verifycode.py
@@ -0,0 +1,71 @@
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 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
+from osv import osv
+from tools.translate import _
+
+form = '''
+
+
+
'''
+
+fields = {
+ 'code': {'string': 'Verification Code','required':True, 'size': 255 , 'type': 'char', 'help': 'Enter the verification code thay you get in your verification Email'}
+}
+class verifycode(wizard.interface):
+
+ def checkcode(self, cr, uid, data, context):
+
+ server_pool = pooler.get_pool(cr.dbname).get('email.smtpclient')
+ cron_pool = pooler.get_pool(cr.dbname).get('ir.cron')
+
+ server = server_pool.browse(cr, uid, data['id'], context)
+ state = server.state
+
+ if state == 'confirm':
+ raise osv.except_osv(_('Error'), _('Server already verified!'))
+
+ code = server.code
+ if code == data['form']['code']:
+ if server_pool.create_process(cr, uid, [data['id']], context={}):
+ server_pool.write(cr, uid, [data['id']], {'state':'confirm', 'pstate':'running'})
+ print 'process created'
+ else:
+ raise osv.except_osv(_('Error'), _('Verification failed. Invalid Verification Code!'))
+
+ return {}
+
+ states = {
+ 'init': {
+ 'actions': [],
+ 'result': {'type':'form', 'arch':form, 'fields':fields, 'state':[('end','Cancel'),('check','Verify Code')]}
+ },
+ 'check': {
+ 'actions': [checkcode],
+ 'result': {'type':'state', 'state':'end'}
+ }
+ }
+verifycode('email.verifycode')
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/smtpclient/wizard/wizard_spam.py b/addons/smtpclient/wizard/wizard_spam.py
new file mode 100644
index 00000000000..3b289988ef3
--- /dev/null
+++ b/addons/smtpclient/wizard/wizard_spam.py
@@ -0,0 +1,92 @@
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 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 tools
+import re
+
+email_send_form = '''
+
diff --git a/addons/wiki/wizard/show_diff.py b/addons/wiki/wizard/wiki_show_diff.py
similarity index 93%
rename from addons/wiki/wizard/show_diff.py
rename to addons/wiki/wizard/wiki_show_diff.py
index 83708a8d8ce..d1a17f0fa45 100644
--- a/addons/wiki/wizard/show_diff.py
+++ b/addons/wiki/wizard/wiki_show_diff.py
@@ -27,14 +27,13 @@ class showdiff(osv.osv_memory):
_name = 'wizard.wiki.history.show_diff'
- def _get_diff(self, cr, uid, ctx):
+ def get_diff(self, cr, uid, context=None):
""" @param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
"""
-
history = self.pool.get('wiki.wiki.history')
- ids = ctx.get('active_ids')
+ ids = context.get('active_ids')
diff = ""
if len(ids) == 2:
if ids[0] > ids[1]:
@@ -49,14 +48,15 @@ class showdiff(osv.osv_memory):
diff = history.getDiff(cr, uid, ids[0], nids[-1])
else:
raise osv.except_osv(_('Warning'), _('You need to select minimum 1 or maximum 2 history revision!'))
+
return diff
_columns = {
- 'diff': fields.text('Diff'),
+ 'diff': fields.text('Diff'),
}
_defaults = {
- 'diff': _get_diff
+ 'diff': get_diff
}
showdiff()
diff --git a/addons/wiki/wizard/wiki_show_diff_view.xml b/addons/wiki/wizard/wiki_show_diff_view.xml
new file mode 100644
index 00000000000..ec8fcb3ca6d
--- /dev/null
+++ b/addons/wiki/wizard/wiki_show_diff_view.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+ Show Difference
+ wizard.wiki.history.show_diff
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Difference
+ ir.actions.act_window
+ wizard.wiki.history.show_diff
+ form
+ form
+ new
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/wiki/wizard/wiki_wiki_help_open.py b/addons/wiki/wizard/wiki_wiki_help_open.py
deleted file mode 100644
index 1333f80b96f..00000000000
--- a/addons/wiki/wizard/wiki_wiki_help_open.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 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 fields, osv
-
-class wiki_wiki_help_open(osv.osv_memory):
- """ Basic Wiki Editing """
- _name = "wiki.wiki.help.open"
- _description = "Basic Wiki Editing"
-
- def open_wiki_page(self, cr, uid, ids, context):
-
- """ Opens Wiki Page for Editing
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of wiki page’s IDs
-
- """
- pages = self.pool.get('wiki.wiki').search(cr, uid, [('name', '=', 'Basic Wiki Editing')])
-
- value = {
- 'view_type': 'form',
- 'view_mode': 'form,tree',
- 'res_model': 'wiki.wiki',
- 'view_id': False,
- 'res_id': pages[0],
- 'type': 'ir.actions.act_window',
- }
-
- return value
-
-wiki_wiki_help_open()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/wiki/wizard/wiki_wiki_help_open_view.xml b/addons/wiki/wizard/wiki_wiki_help_open_view.xml
deleted file mode 100644
index 226ceab271f..00000000000
--- a/addons/wiki/wizard/wiki_wiki_help_open_view.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
- Basic Wiki Editing
- wiki.wiki.help.open
- form
-
-
-
-
-
-
-
-
-
-
-
-
- Basic Wiki Editing
- ir.actions.act_window
- wiki.wiki.help.open
- form
- form
- new
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/wiki/wizard/wiki_wiki_page_open.py b/addons/wiki/wizard/wiki_wiki_page_open.py
index d65748f989a..d6b8f4f0285 100644
--- a/addons/wiki/wizard/wiki_wiki_page_open.py
+++ b/addons/wiki/wizard/wiki_wiki_page_open.py
@@ -35,18 +35,17 @@ class wiki_wiki_page_open(osv.osv_memory):
@param ids: List of open wiki page’s IDs
@return: dictionay of open wiki window on give group id
"""
-
- for group in self.pool.get('wiki.groups').browse(cr, uid, ids):
-
+ group_ids = context.get('active_ids', [])
+ for group in self.pool.get('wiki.groups').browse(cr, uid, group_ids):
value = {
- 'domain': "[('group_id','=',%d)]" % (group.id),
- 'name': 'Wiki Page',
- 'view_type': 'form',
- 'view_mode': 'form,tree',
- 'res_model': 'wiki.wiki',
- 'view_id': False,
- 'type': 'ir.actions.act_window',
- }
+ 'domain': "[('group_id','=',%d)]" % (group.id),
+ 'name': 'Wiki Page',
+ 'view_type': 'form',
+ 'view_mode': 'form,tree',
+ 'res_model': 'wiki.wiki',
+ 'view_id': False,
+ 'type': 'ir.actions.act_window',
+ }
if group.method == 'page':
value['res_id'] = group.home.id
elif group.method == 'list':
diff --git a/addons/wiki/wizard/wiki_wiki_page_open_view.xml b/addons/wiki/wizard/wiki_wiki_page_open_view.xml
index d0c41d0d37f..507f3d5cdac 100644
--- a/addons/wiki/wizard/wiki_wiki_page_open_view.xml
+++ b/addons/wiki/wizard/wiki_wiki_page_open_view.xml
@@ -11,8 +11,13 @@
-
-
+
+
+
+
+
+
+
diff --git a/addons/wiki_faq/__terp__.py b/addons/wiki_faq/__openerp__.py
similarity index 100%
rename from addons/wiki_faq/__terp__.py
rename to addons/wiki_faq/__openerp__.py
diff --git a/addons/wiki_quality_manual/__terp__.py b/addons/wiki_quality_manual/__openerp__.py
similarity index 100%
rename from addons/wiki_quality_manual/__terp__.py
rename to addons/wiki_quality_manual/__openerp__.py