-
+
-
+
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/partner_balance.py b/addons/account/report/partner_balance.py
index a5b746a0bde..f296475cb3f 100755
--- a/addons/account/report/partner_balance.py
+++ b/addons/account/report/partner_balance.py
@@ -67,10 +67,10 @@ class partner_balance(report_sxw.rml_parse):
## Get All Period Date
#
# If we have no period we will take all perdio in the FiscalYear.
- if not data['form']['periods'][0][2] :
+ if not data['form']['periods']:
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
else:
- periods_id = data['form']['periods'][0][2]
+ periods_id = data['form']['periods']
date_array = []
for period_id in periods_id:
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
@@ -85,35 +85,38 @@ class partner_balance(report_sxw.rml_parse):
self.date_lst.sort()
def transform_both_into_date_array(self,data):
- if not data['form']['periods'][0][2] :
+ final_date_array = []
+ date_start_date = data['form']['date1']
+ date_stop_date = data['form']['date2']
+ if not data['form']['periods']:
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
else:
- periods_id = data['form']['periods'][0][2]
+ periods_id = data['form']['periods']
date_array = []
- for period_id in periods_id:
- period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
- date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
+ if periods_id:
+ for period_id in periods_id:
+ period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
+ date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
+ period_start_date = date_array[0]
+ period_stop_date = date_array[-1]
- period_start_date = date_array[0]
- date_start_date = data['form']['date1']
- period_stop_date = date_array[-1]
- date_stop_date = data['form']['date2']
+ if period_start_date= 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..db19cfe9961 100644
--- a/addons/account/wizard/__init__.py
+++ b/addons/account/wizard/__init__.py
@@ -23,40 +23,39 @@ 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
import wizard_general_ledger_report
import wizard_third_party_ledger
-import wizard_account_balance_report
-import wizard_partner_balance_report
+import account_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 wizard_use_model
+import account_validate_account_move
+import account_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_partner_balance_report.py b/addons/account/wizard/account_partner_balance_report.py
new file mode 100644
index 00000000000..b1b283feef6
--- /dev/null
+++ b/addons/account/wizard/account_partner_balance_report.py
@@ -0,0 +1,109 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import time
+
+from tools.translate import _
+from osv import fields, osv
+
+class account_partner_balance(osv.osv_memory):
+ """
+ This wizard will provide the partner balance report by periods, between any two dates.
+ """
+ _name = 'account.partner.balance'
+ _description = 'Account Partner Balance'
+ _columns = {
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'state': fields.selection([('bydate','By Date'),
+ ('byperiod','By Period'),
+ ('all','By Date and Period'),
+ ('none','No Filter')
+ ],'Date/Period Filter'),
+ 'fiscalyear': fields.many2one('account.fiscalyear', 'Fiscal year', help='Keep empty for all open fiscal year'),
+ 'periods': fields.many2many('account.period', 'period_report_rel', 'report_id', 'period_id', 'Periods', help='All periods if empty'),
+ 'result_selection': fields.selection([('customer','Receivable Accounts'),
+ ('supplier','Payable Accounts'),
+ ('all','Receivable and Payable Accounts')],
+ 'Partner', required=True),
+ 'soldeinit': fields.boolean('Include initial balances'),
+ 'date1': fields.date('Start date', required=True),
+ 'date2': fields.date('End date', required=True),
+ }
+
+ def _get_company(self, cr, uid, ids, context=None):
+ user_obj = self.pool.get('res.users')
+ company_obj = self.pool.get('res.company')
+ user = user_obj.browse(cr, uid, uid, context=context)
+ if user.company_id:
+ return user.company_id.id
+ else:
+ return company_obj.search(cr, uid, [('parent_id', '=', False)])[0]
+
+ _defaults={
+ 'state' : 'none',
+ 'date1' : lambda *a: time.strftime('%Y-01-01'),
+ 'date2' : lambda *a: time.strftime('%Y-%m-%d'),
+ 'result_selection' : lambda *a: 'all',
+ 'soldeinit' : True,
+ 'company_id' : _get_company,
+ 'fiscalyear' : False,
+ }
+
+ def check_state(self, cr, uid, ids, context=None):
+ data = {
+ 'ids':[],
+ 'model': 'res.partner',
+ 'form': self.read(cr, uid, ids, [])[0],
+ }
+
+ if data['form']['state'] == 'bydate' :
+ return self._check_date(cr, uid, data, context)
+ if data['form']['state'] == 'byperiod':
+ if not data['form']['periods']:
+ raise osv.except_osv(_('Warning'),_('Please Enter Periods ! '))
+
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.partner.balance',
+ 'datas': data,
+ }
+
+ def _check_date(self, cr, uid, data, context):
+ sql = """
+ SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """
+ cr.execute(sql,(data['form']['date1'],))
+ res = cr.dictfetchall()
+ if res:
+ if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']):
+ raise osv.except_osv(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop'])))
+ else:
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.partner.balance',
+ 'datas': data,
+ }
+ else:
+ raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year'))
+
+account_partner_balance()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account/wizard/account_partner_balance_report_view.xml b/addons/account/wizard/account_partner_balance_report_view.xml
new file mode 100644
index 00000000000..02c2ec03a25
--- /dev/null
+++ b/addons/account/wizard/account_partner_balance_report_view.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+ Select period
+ account.partner.balance
+ form
+
+
+
+
+
+
+ Select Period
+ account.partner.balance
+ ir.actions.act_window
+ form
+ tree,form
+
+ {'record_id':active_id}
+ 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
+
+
+
+
+
+
+ Create Entries From Models
+ account.use.model
+ form
+ tree,form
+
+ new
+
+
+
+
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_partner_balance_report.py b/addons/account/wizard/wizard_partner_balance_report.py
deleted file mode 100644
index f7b049a4f0f..00000000000
--- a/addons/account/wizard/wizard_partner_balance_report.py
+++ /dev/null
@@ -1,127 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import time
-import wizard
-import pooler
-from tools.translate import _
-
-period_form = '''
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
'''
-
-period_fields = {
- 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
- 'state':{
- 'string':"Date/Period Filter",
- 'type':'selection',
- 'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
- 'default': lambda *a:'none'
- },
- 'fiscalyear': {
- 'string':'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
- 'default': lambda *a:False,
- 'help': 'Keep empty for all open fiscal year'
- },
- 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
- 'result_selection':{
- 'string':"Partner",
- 'type':'selection',
- 'selection':[('customer','Receivable Accounts'),('supplier','Payable Accounts'),('all','Receivable and Payable Accounts')],
- 'required':True
- },
- 'soldeinit':{'string':"Include initial balances",'type':'boolean'},
- 'date1': {'string':' Start date', 'type':'date', 'required':True,'default': lambda *a: time.strftime('%Y-01-01')},
- 'date2': {'string':'End date', 'type':'date', 'required':True,'default': lambda *a: time.strftime('%Y-%m-%d')},
-}
-
-class wizard_report(wizard.interface):
-
- def _get_defaults(self,cr,uid,data,context):
- user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
- if user.company_id:
- company_id = user.company_id.id
- else:
- company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
-
- fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
- periods_obj=pooler.get_pool(cr.dbname).get('account.period')
- data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
- data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
- data['form']['company_id'] = company_id
- data['form']['soldeinit'] = True
- data['form']['fiscalyear'] = False
- data['form']['result_selection'] = 'all'
- return data['form']
-
- def _check_state(self, cr, uid, data, context):
-
- if data['form']['state'] == 'bydate' :
- self._check_date(cr, uid, data, context)
- return data['form']
-
- def _check_date(self, cr, uid, data, context):
- sql = """
- SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """
- cr.execute(sql,(data['form']['date1'],))
- res = cr.dictfetchall()
- if res:
- if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']):
- raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop'])))
- else:
- return 'report'
-
- else:
- raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year'))
-
- states = {
- 'init': {
- 'actions': [_get_defaults],
- 'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel','gtk-cancel'),('report','Print','gtk-print')]}
- },
-
- 'report': {
- 'actions': [_check_state],
- 'result': {'type':'print', 'report':'account.partner.balance', 'state':'end'}
- }
- }
-wizard_report('account.partner.balance.report')
-# 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_use_model.py b/addons/account/wizard/wizard_use_model.py
deleted file mode 100644
index ef3a4ba1310..00000000000
--- a/addons/account/wizard/wizard_use_model.py
+++ /dev/null
@@ -1,131 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import time
-import datetime
-import pooler
-from tools.translate import _
-
-model_form = """
-
-"""
-fields = {
- }
-def _create_entries(self, cr, uid, data, context):
- pool_obj = pooler.get_pool(cr.dbname)
- if data['model']=='ir.ui.menu' or data['model']=='account.move.line':
- model_ids = data['form']['model'][0][2]
- data_model = pool_obj.get('account.model').browse(cr,uid,model_ids)
- else:
- data_model = pool_obj.get('account.model').browse(cr,uid,data['ids'])
- move_ids = []
- for model in data_model:
-
- period_id = pool_obj.get('account.period').find(cr,uid, context=context)
- if not period_id:
- raise wizard.except_wizard(_('No period found !'), _('Unable to find a valid period !'))
- period_id = period_id[0]
- move_id = pool_obj.get('account.move').create(cr, uid, {
- 'ref': model.ref,
- 'period_id': period_id,
- 'journal_id': model.journal_id.id,
- })
- move_ids.append(move_id)
- for line in model.lines_id:
- val = {
- 'move_id': move_id,
- 'journal_id': model.journal_id.id,
- 'period_id': period_id
- }
- val.update({
- 'name': line.name,
- 'quantity': line.quantity,
- 'debit': line.debit,
- 'credit': line.credit,
- 'account_id': line.account_id.id,
- 'move_id': move_id,
- 'ref': line.ref,
- 'partner_id': line.partner_id.id,
- 'date': time.strftime('%Y-%m-%d'),
- 'date_maturity': time.strftime('%Y-%m-%d')
- })
- c = context.copy()
- c.update({'journal_id': model.journal_id.id,'period_id': period_id})
- id_line = pool_obj.get('account.move.line').create(cr, uid, val, context=c)
- data['form']['move_ids']=move_ids
- return data['form']
-
-class use_model(wizard.interface):
-
- def _open_moves(self, cr, uid, data, context):
- pool_obj = pooler.get_pool(cr.dbname)
- model_data_ids = pool_obj.get('ir.model.data').search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_move_form')])
- resource_id = pool_obj.get('ir.model.data').read(cr,uid,model_data_ids,fields=['res_id'])[0]['res_id']
- return {
- 'domain': "[('id','in', ["+','.join(map(str,data['form']['move_ids']))+"])]",
- 'name': 'Entries',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'account.move',
- 'views': [(False,'tree'),(resource_id,'form')],
- 'type': 'ir.actions.act_window'
- }
-
- def _check(self, cr, uid, data, context):
- if data['model']=='ir.ui.menu' or data['model']=='account.move.line':
- return 'init_form'
- return 'create'
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'choice','next_state':_check}
- },
- 'init_form': {
- 'actions': [],
- 'result': {'type':'form', 'arch':model_form, 'fields':model_fields, 'state':[('end','Cancel', 'gtk-cancel'),('create','Create', 'gtk-ok')]},
- },
- 'create': {
- 'actions': [_create_entries],
- 'result': {'type': 'form','arch':form, 'fields':fields, 'state':[('end','Ok'),('open_move','Open')]},
- },
- 'open_move': {
- 'actions': [],
- 'result': {'type':'action', 'action':_open_moves, 'state':'end'}
- }
- }
-
-use_model("account_use_models")# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
-# 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 email_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"),
+ 'user_id':fields.many2one('res.users', 'User', required=False),
+ }
+ _defaults = {
+ 'state': lambda *a: "draft",
+ 'active': lambda *a: True,
+ 'priority': lambda *a: 5,
+ 'date': lambda *a: time.strftime('%Y-%m-%d'),
+ 'user_id': lambda self, cr, uid, ctx: uid,
+ }
+
+ 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={}):
+ context.update({
+ 'server_id':server.id
+ })
+ 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={}):
+ 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))
+
+ count = 0
+ 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()
+ 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
+
+email_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):
+
+ _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/fetchmail/fetchmail_data.xml b/addons/fetchmail/fetchmail_data.xml
new file mode 100644
index 00000000000..d9f35874356
--- /dev/null
+++ b/addons/fetchmail/fetchmail_data.xml
@@ -0,0 +1,31 @@
+
+
+
+
+ Fetchmail Service
+ 5
+ minutes
+ -1
+
+
+
+
+
+
+
+
+
+ User wise Server
+
+
+
+
+
+
+ =
+ user.id
+
+
+
+
+
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..e8501d64af1 100644
--- a/addons/hr_holidays/i18n/nl.po
+++ b/addons/hr_holidays/i18n/nl.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-12-11 20:08+0000\n"
-"Last-Translator: Pieter J. Kersten (EduSense BV) \n"
+"PO-Revision-Date: 2010-04-22 09:05+0000\n"
+"Last-Translator: Jan Verlaan (Veritos) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-30 04:11+0000\n"
+"X-Launchpad-Export-Date: 2010-04-23 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
@@ -600,7 +600,7 @@ msgstr "Verlofaanvraag"
#. module: hr_holidays
#: model:ir.ui.menu,name:hr_holidays.menu_action_holiday_waiting
msgid "Holidays Requests Awaiting for Validation"
-msgstr ""
+msgstr "Verlofaanvragen wachtend op bevestiging"
#. module: hr_holidays
#: view:hr.holidays:0
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 27767c493cb..eb0d1ae1334 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -61,6 +61,112 @@ class hr_applicant(osv.osv):
'survey' : fields.related('job_id', 'survey_id', type='many2one', relation='survey', string='Survey'),
'response' : fields.integer("Response"),
}
+
+ def stage_previous(self, cr, uid, ids, context=None):
+ """This function computes previous stage for case from its current stage
+ using available stage for that case type
+ @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 ids: List of case IDs
+ @param context: A standard dictionary for contextual values"""
+ if not context:
+ context = {}
+ for case in self.browse(cr, uid, ids, context):
+ section = (case.section_id.id or False)
+ st = case.stage_id.id or False
+ stage_ids = self.pool.get('crm.case.stage').search(cr, uid, [])
+ if st and stage_ids.index(st):
+ self.write(cr, uid, [case.id], {'stage_id': stage_ids[stage_ids.index(st)-1]})
+ return True
+
+ def stage_next(self, cr, uid, ids, context=None):
+ """This function computes next stage for case from its current stage
+ using available stage for that case type
+ @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 ids: List of case IDs
+ @param context: A standard dictionary for contextual values"""
+ if not context:
+ context = {}
+ for case in self.browse(cr, uid, ids, context):
+ section = (case.section_id.id or False)
+ st = case.stage_id.id or False
+ stage_ids = self.pool.get('crm.case.stage').search(cr, uid, [])
+ if st and len(stage_ids) != stage_ids.index(st)+1:
+ self.write(cr, uid, [case.id], {'stage_id': stage_ids[stage_ids.index(st)+1]})
+ return True
+
+ def action_makeMeeting(self, cr, uid, ids, context=None):
+ """
+ This opens Meeting's calendar view to schedule meeting on current Opportunity
+ @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 ids: List of Opportunity to Meeting IDs
+ @param context: A standard dictionary for contextual values
+
+ @return : Dictionary value for created Meeting view
+ """
+ value = {}
+ for opp in self.browse(cr, uid, ids):
+ data_obj = self.pool.get('ir.model.data')
+
+ # Get meeting views
+ result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_meetings_filter')
+ res = data_obj.read(cr, uid, result, ['res_id'])
+ id1 = data_obj._get_id(cr, uid, 'crm', 'crm_case_calendar_view_meet')
+ id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_form_view_meet')
+ id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_tree_view_meet')
+ if id1:
+ id1 = data_obj.browse(cr, uid, id1, context=context).res_id
+ if id2:
+ id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+ if id3:
+ id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+
+ context = {
+ 'default_opportunity_id': opp.id,
+ 'default_partner_id': opp.partner_id and opp.partner_id.id or False,
+ 'default_section_id': opp.section_id and opp.section_id.id or False,
+ 'default_email_from': opp.email_from,
+ 'default_state': 'open',
+ 'default_name': opp.name
+ }
+ value = {
+ 'name': _('Meetings'),
+ 'domain': "[('user_id','=',%s)]" % (uid),
+ 'context': context,
+ 'view_type': 'form',
+ 'view_mode': 'calendar,form,tree',
+ 'res_model': 'crm.meeting',
+ 'view_id': False,
+ 'views': [(id1, 'calendar'), (id2, 'form'), (id3, 'tree')],
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': res['res_id'],
+ 'nodestroy': True
+ }
+ return value
+
+ def action_print_survey(self, cr, uid, ids, context=None):
+ """
+ If response is available then print this response otherwise print survey form(print template of the survey).
+
+ @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 ids: List of Survey IDs
+ @param context: A standard dictionary for contextual values
+ @return : Dictionary value for print survey form.
+ """
+ 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,})
+ value = self.pool.get("survey").action_print_survey(cr, uid, ids, context)
+ return value
hr_applicant()
class hr_job(osv.osv):
diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml
index 0d9fa7ec72d..64c9ed934b7 100644
--- a/addons/hr_recruitment/hr_recruitment_view.xml
+++ b/addons/hr_recruitment/hr_recruitment_view.xml
@@ -73,6 +73,7 @@
+
@@ -84,10 +85,11 @@
-
-
-
+
+
+
diff --git a/addons/hr_timesheet/__terp__.py b/addons/hr_timesheet/__openerp__.py
similarity index 91%
rename from addons/hr_timesheet/__terp__.py
rename to addons/hr_timesheet/__openerp__.py
index 976242edc0c..4bd6d3525fc 100644
--- a/addons/hr_timesheet/__terp__.py
+++ b/addons/hr_timesheet/__openerp__.py
@@ -44,7 +44,10 @@ 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',
+ 'wizard/hr_timesheet_sign_in_out_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..fa36c03ae10 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 acb4bc52b66..8da6cb5fbef 100644
--- a/addons/hr_timesheet/i18n/de.po
+++ b/addons/hr_timesheet/i18n/de.po
@@ -13,7 +13,11 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+<<<<<<< TREE
"X-Launchpad-Export-Date: 2010-04-07 03:46+0000\n"
+=======
+"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
+>>>>>>> MERGE-SOURCE
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
diff --git a/addons/hr_timesheet/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..5f2bc1443e3 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_sign_in_out
+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/hr_timesheet_sign_in_out.py b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py
new file mode 100644
index 00000000000..fa57cfdd1a5
--- /dev/null
+++ b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py
@@ -0,0 +1,169 @@
+# -*- 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_so_project(osv.osv_memory):
+ _name = 'hr.sign.out.project'
+ _description = 'Sign Out By Project'
+ _columns = {
+ 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, domain=[('type','=','normal')]),
+ 'info': fields.char('Work Description', size=256, required=True),
+ 'date_start': fields.datetime('Starting Date', readonly=True),
+ 'date': fields.datetime('Closing Date'),
+ 'analytic_amount': fields.float('Minimum Analytic Amount'),
+ 'name': fields.char('Employees name', size=32, required=True, readonly=True),
+ 'state': fields.char('Current state', size=32, required=True, readonly=True),
+ 'server_date': fields.datetime('Current Date', required=True, readonly=True),
+ 'emp_id': fields.char('Employee ID', size=256, required=False),
+ }
+
+ def _get_empid(self, cr, uid, context=None):
+ emp_obj = self.pool.get('hr.employee')
+ emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
+ if emp_id:
+ employee = emp_obj.read(cr, uid, emp_id)[0]
+ return {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0], 'server_date':time.strftime('%Y-%m-%d %H:%M:%S')}
+ raise osv.except_osv(_('UserError'), _('No employee defined for your user !'))
+
+ def _get_empid2(self, cr, uid, context):
+ res = self._get_empid(cr, uid, context)
+ cr.execute('select name,action from hr_attendance where employee_id=%s order by name desc limit 1', (res['emp_id'],))
+ res['server_date'] = time.strftime('%Y-%m-%d %H:%M:%S')
+ res['date_start'] = cr.fetchone()[0]
+ return res
+
+ def default_get(self, cr, uid, fields_list, context=None):
+ res = super(hr_so_project, self).default_get(cr, uid, fields_list, context=context)
+ res.update(self._get_empid2(cr, uid, context=context))
+ return res
+
+ def _write(self, cr, uid, data, emp_id, context=None):
+ timesheet_obj = self.pool.get('hr.analytic.timesheet')
+ emp_obj = self.pool.get('hr.employee')
+ hour = (time.mktime(time.strptime(data['date'] or time.strftime('%Y-%m-%d %H:%M:%S'), '%Y-%m-%d %H:%M:%S')) -
+ time.mktime(time.strptime(data['date_start'], '%Y-%m-%d %H:%M:%S'))) / 3600.0
+ minimum = data['analytic_amount']
+ if minimum:
+ hour = round(round((hour + minimum / 2) / minimum) * minimum, 2)
+ res = timesheet_obj.default_get(cr, uid, ['product_id','product_uom_id'])
+ if not res['product_uom_id']:
+ raise osv.except_osv(_('UserError'), _('No cost unit defined for this employee !'))
+ up = timesheet_obj.on_change_unit_amount(cr, uid, False, res['product_id'], hour, res['product_uom_id'])['value']
+ res['name'] = data['info']
+ res['account_id'] = data['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)
+ return timesheet_obj.create(cr, uid, res, context=context)
+
+ def sign_out_result_end(self, cr, uid, ids, context=None):
+ emp_obj = self.pool.get('hr.employee')
+ data = self.read(cr, uid, ids, [])[0]
+ emp_id = data['emp_id']
+ emp_obj.attendance_action_change(cr, uid, [emp_id], type='sign_out',dt=data['date'])
+ self._write(cr, uid, data, emp_id, context=context)
+ return {}
+
+ def sign_out_result(self, cr, uid, ids, context=None):
+ emp_obj = self.pool.get('hr.employee')
+ data = self.read(cr, uid, ids, [])[0]
+ emp_id = data['emp_id']
+ emp_obj.attendance_action_change(cr, uid, [emp_id], type='action', dt=data['date'])
+ self._write(cr, uid, data, emp_id, context=context)
+ return {}
+
+hr_so_project()
+
+class hr_si_project(osv.osv_memory):
+ _name = 'hr.sign.in.project'
+ _description = 'Sign In By Project'
+ _columns = {
+ 'name': fields.char('Employees name', size=32, required=True, readonly=True),
+ 'state': fields.char('Current state', size=32, required=True, readonly=True),
+ 'date': fields.datetime('Starting Date'),
+ 'server_date': fields.datetime('Current Date', required=True, readonly=True),
+ 'emp_id': fields.char('Employee ID', size=512, required=False),
+ }
+
+ def check_state(self, cr, uid, ids, context=None):
+ obj_model = self.pool.get('ir.model.data')
+ emp_id = self._get_empid(cr, uid, context)['emp_id']
+ # get the latest action (sign_in or out) for this employee
+ cr.execute('select action from hr_attendance where employee_id=%s and action in (\'sign_in\',\'sign_out\') order by name desc limit 1', (emp_id,))
+ res = (cr.fetchone() or ('sign_out',))[0]
+ #TODO: invert sign_in et sign_out
+ if res == 'sign_out':
+ model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_hr_timesheet_sign_in')])
+ resource_id = obj_model.read(cr,uid,model_data_ids,fields=['res_id'])[0]['res_id']
+ return {
+ 'name': 'Sign in / Sign out',
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'hr.sign.in.project',
+ 'views': [(False,'tree'), (resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new'
+ }
+ else:
+ model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_hr_timesheet_sign_out')])
+ resource_id = obj_model.read(cr,uid,model_data_ids,fields=['res_id'])[0]['res_id']
+ return {
+ 'name': 'Sign in / Sign out',
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'hr.sign.out.project',
+ 'views': [(False,'tree'), (resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new'
+ }
+
+ def _get_empid(self, cr, uid, context=None):
+ emp_obj = self.pool.get('hr.employee')
+ emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
+ if emp_id:
+ employee = emp_obj.read(cr, uid, emp_id)[0]
+ return {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0], 'server_date':time.strftime('%Y-%m-%d %H:%M:%S')}
+ raise osv.except_osv(_('UserError'), _('No employee defined for your user !'))
+
+ def sign_in_result(self, cr, uid, ids, context):
+ emp_obj = self.pool.get('hr.employee')
+ data = self.read(cr, uid, ids, [], context)[0]
+ emp_id = data['emp_id']
+ try:
+ success = emp_obj.attendance_action_change(cr, uid, [emp_id], type = 'sign_in' ,dt=data['date'] or False)
+ except except_osv, e:
+ raise osv.except_osv(e.name, e.value)
+ return {}
+
+ def default_get(self, cr, uid, fields_list, context=None):
+ res = super(hr_si_project, self).default_get(cr, uid, fields_list, context=context)
+ res.update(self._get_empid(cr, uid, context=context))
+ return res
+
+hr_si_project()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out_view.xml b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out_view.xml
new file mode 100644
index 00000000000..487208bfbf6
--- /dev/null
+++ b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out_view.xml
@@ -0,0 +1,95 @@
+
+
+
+
+ hr.sign.in.project.message.form
+ hr.sign.in.project
+ form
+
+
+
+
+
+
+ Sign in / Sign out by project
+ hr.sign.in.project
+ form
+ tree,form
+
+ new
+
+
+
+
+
+ hr.sign.out.project.form
+ hr.sign.out.project
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sign in / Sign out by project
+ hr.sign.out.project
+ form
+ tree,form
+
+ new
+
+
+
+
diff --git a/addons/hr_timesheet/wizard/sign_in_out.py b/addons/hr_timesheet/wizard/sign_in_out.py
deleted file mode 100644
index 4aea035f829..00000000000
--- a/addons/hr_timesheet/wizard/sign_in_out.py
+++ /dev/null
@@ -1,171 +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 _
-
-si_form ='''
-
'''
-
-so_fields = {
- 'name': {'string':"Employee's name", 'type':'char', 'required':True, 'readonly':True},
- 'state': {'string':"Current state", 'type':'char', 'required':True, 'readonly':True},
- 'account_id': {'string':"Analytic Account", 'type':'many2one', 'relation':'account.analytic.account', 'required':True, 'domain':"[('type','=','normal')]"},
- 'info': {'string':"Work Description", 'type':'char', 'size':256, 'required':True},
- 'date': {'string':"Closing Date", 'type':'datetime'},
- 'date_start': {'string':"Starting Date", 'type':'datetime', 'readonly':True},
- 'server_date': {'string':"Current Server Date", 'type':'datetime', 'readonly':True},
- 'analytic_amount': {'string':"Minimum Analytic Amount", 'type':'float'},
-}
-
-def _get_empid(self, cr, uid, data, context):
- emp_obj = pooler.get_pool(cr.dbname).get('hr.employee')
- emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
- if emp_id:
- employee = emp_obj.read(cr, uid, emp_id)[0]
- return {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0], 'date':False, 'server_date':time.strftime('%Y-%m-%d %H:%M:%S')}
- raise wizard.except_wizard(_('UserError'), _('No employee defined for your user !'))
-
-def _get_empid2(self, cr, uid, data, context):
- res = _get_empid(self,cr, uid, data, context)
- cr.execute('select name,action from hr_attendance where employee_id=%s order by name desc limit 1', (res['emp_id'],))
- res['server_date'] = time.strftime('%Y-%m-%d %H:%M:%S')
- res['date_start'] = cr.fetchone()[0]
- res['info'] = ''
- res['account_id'] = False
- return res
-
-def _sign_in_result(self, cr, uid, data, context):
- emp_obj = pooler.get_pool(cr.dbname).get('hr.employee')
- emp_id = data['form']['emp_id']
- from osv.osv import except_osv
- try:
- success = emp_obj.attendance_action_change(cr, uid, [emp_id], type = 'sign_in' ,dt=data['form']['date'] or False)
- except except_osv, e:
- raise wizard.except_wizard(e.name, e.value)
- return {}
-
-def _write(self, cr, uid, data, emp_id, context):
- timesheet_obj = pooler.get_pool(cr.dbname).get('hr.analytic.timesheet')
- 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']
- if minimum:
- hour = round(round((hour + minimum / 2) / minimum) * minimum, 2)
- res = timesheet_obj.default_get(cr, uid, ['product_id','product_uom_id'])
- if not res['product_uom_id']:
- raise wizard.except_wizard(_('UserError'), _('No cost unit defined for this employee !'))
- up = timesheet_obj.on_change_unit_amount(cr, uid, False, res['product_id'], hour, res['product_uom_id'])['value']
- res['name'] = data['form']['info']
- res['account_id'] = data['form']['account_id']
- res['unit_amount'] = hour
- res.update(up)
- up = timesheet_obj.on_change_account_id(cr, uid, [], res['account_id']).get('value', {})
- res.update(up)
- return timesheet_obj.create(cr, uid, res, context)
-
-def _sign_out_result_end(self, cr, uid, data, context):
- emp_obj = pooler.get_pool(cr.dbname).get('hr.employee')
- emp_id = data['form']['emp_id']
- emp_obj.attendance_action_change(cr, uid, [emp_id], type='sign_out',dt=data['form']['date'])
- _write(self, cr, uid, data, emp_id, context)
- return {}
-
-def _sign_out_result(self, cr, uid, data, context):
- emp_obj = pooler.get_pool(cr.dbname).get('hr.employee')
- emp_id = data['form']['emp_id']
- emp_obj.attendance_action_change(cr, uid, [emp_id], type='action',dt=data['form']['date'])
- _write(self, cr, uid, data, emp_id, context)
- return {}
-
-def _state_check(self, cr, uid, data, context):
- emp_id = _get_empid(self, cr, uid, data, context)['emp_id']
- # get the latest action (sign_in or out) for this employee
- cr.execute('select action from hr_attendance where employee_id=%s and action in (\'sign_in\',\'sign_out\') order by name desc limit 1', (emp_id,))
- res = (cr.fetchone() or ('sign_out',))[0]
-#TODO: invert sign_in et sign_out
- return res
-
-class wiz_si_so(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [_get_empid],
- 'result' : {'type' : 'choice', 'next_state': _state_check}
- },
- 'sign_out' : { # this means sign_in...
- 'actions' : [_get_empid],
- 'result' : {'type':'form', 'arch':si_form, 'fields' : si_fields, 'state':[('end', 'Cancel'),('si_result', 'Start Working') ] }
- },
- 'si_result' : {
- 'actions' : [_sign_in_result],
- 'result' : {'type':'state', 'state':'end'}
- },
- 'sign_in' : { # this means sign_out...
- 'actions' : [_get_empid2],
- 'result' : {'type':'form', 'arch':so_form, 'fields':so_fields, 'state':[('end', 'Cancel'),('so_result', 'Change Work'),('so_result_end', 'Stop Working') ] }
- },
- 'so_result' : {
- 'actions' : [_sign_out_result],
- 'result' : {'type':'state', 'state':'end'}
- },
- 'so_result_end' : {
- 'actions' : [_sign_out_result_end],
- 'result' : {'type':'state', 'state':'end'}
- },
- }
-wiz_si_so('hr_timesheet.si_so')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
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='''
-
+
+
+
+
+ Cost Ledger
+ ir.actions.act_window
+ hr.timesheet.analytic.cost.ledger
+ form
+ form
+ new
+
+
+
+
+
+ Cost Ledger
+ client_print_multi
+
+ action
+ account.analytic.account
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
index ac575a625e4..7e5edca5474 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
@@ -193,7 +193,7 @@ class invoice_create(wizard.interface):
_create_form = """
-
+
diff --git a/addons/hr_timesheet_invoice/wizard/wizard_account_analytic_cost_ledger_report.py b/addons/hr_timesheet_invoice/wizard/wizard_account_analytic_cost_ledger_report.py
deleted file mode 100644
index 632f7f84268..00000000000
--- a/addons/hr_timesheet_invoice/wizard/wizard_account_analytic_cost_ledger_report.py
+++ /dev/null
@@ -1,52 +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
-
-dates_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 = '''
-
-
-
-
'''
-
-_email_done_form = '''
-
-
-
-
-
'''
-
-_email_fields = {
- 'server': {'string':"Server", 'type':'text', 'readonly':True},
- }
-
-_email_done_fields = {
- 'message': {'string':"Log Detail", 'type':'text', 'readonly':True},
- }
-
-def _default(self , cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- gateway_pool=pool.get('mail.gateway')
- server = []
- for mail_gateway in gateway_pool.browse(cr, uid, data['ids'], context=context):
- if mail_gateway.server_id.active:
- server.append(mail_gateway.name or '%s (%s)'%(mail_gateway.server_id.login, mail_gateway.server_id.name) )
- data['form']['server'] = '\n'.join(server)
- return data['form']
-
-def section_fetch_mail(self , cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- gateway_pool=pool.get('mail.gateway')
- messages = gateway_pool.fetch_mails(cr, uid, ids=data['ids'], context=context)
- data['form']['message'] = '\n'.join(messages)
- return data['form']
-
-class wiz_mailgateway_fetch_mail(wizard.interface):
- states = {
- 'init': {
- 'actions': [_default],
- 'result': {'type': 'form', 'arch':_email_form, 'fields':_email_fields, 'state':[('end','Cancel','gtk-cancel'), ('fetch','Fetch','gtk-execute')]}
- },
- 'fetch': {
- 'actions': [section_fetch_mail],
- 'result': {'type': 'form', 'arch': _email_done_form,
- 'fields': _email_done_fields,
- 'state': (
- ('end', 'Close'),
- )
- },
- },
- }
-wiz_mailgateway_fetch_mail('mail_gateway.fetchmail')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/membership/__terp__.py b/addons/membership/__openerp__.py
similarity index 100%
rename from addons/membership/__terp__.py
rename to addons/membership/__openerp__.py
diff --git a/addons/membership/i18n/ar.po b/addons/membership/i18n/ar.po
index e81e2fac6ae..0ab4dd431fa 100644
--- a/addons/membership/i18n/ar.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/bg.po b/addons/membership/i18n/bg.po
index f125b67cb86..49be796f1d7 100644
--- a/addons/membership/i18n/bg.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/bs.po b/addons/membership/i18n/bs.po
index 7c3b2eb2733..e6ca0339b6e 100644
--- a/addons/membership/i18n/bs.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/ca.po b/addons/membership/i18n/ca.po
index 1e8cda2bf8b..270c7c15c8c 100644
--- a/addons/membership/i18n/ca.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/cs.po b/addons/membership/i18n/cs.po
index 8115eeea676..50e2aa93f91 100644
--- a/addons/membership/i18n/cs.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/de.po b/addons/membership/i18n/de.po
index 3ec3534f998..77259c70498 100644
--- a/addons/membership/i18n/de.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/es.po b/addons/membership/i18n/es.po
index da52998aba8..ee0d69a3d15 100644
--- a/addons/membership/i18n/es.po
+++ b/addons/membership/i18n/es.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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/es_AR.po b/addons/membership/i18n/es_AR.po
index ed7a6920423..ce7d96472e4 100644
--- a/addons/membership/i18n/es_AR.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/et.po b/addons/membership/i18n/et.po
index 14d262a8115..bfcec029418 100644
--- a/addons/membership/i18n/et.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/fi.po b/addons/membership/i18n/fi.po
index 02b36dfa2f5..4865955bdb7 100644
--- a/addons/membership/i18n/fi.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/fr.po b/addons/membership/i18n/fr.po
index 36612292795..eb0e209bc9a 100644
--- a/addons/membership/i18n/fr.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/hr.po b/addons/membership/i18n/hr.po
index e81e2fac6ae..0ab4dd431fa 100644
--- a/addons/membership/i18n/hr.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/hu.po b/addons/membership/i18n/hu.po
index 1af1461f2c5..bf85069a6e1 100644
--- a/addons/membership/i18n/hu.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/id.po b/addons/membership/i18n/id.po
index 878d5385e04..da4441e6a5d 100644
--- a/addons/membership/i18n/id.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/it.po b/addons/membership/i18n/it.po
index d11c9563849..9ecabd89b91 100644
--- a/addons/membership/i18n/it.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/ko.po b/addons/membership/i18n/ko.po
index 548bf4b2197..22bd7027c57 100644
--- a/addons/membership/i18n/ko.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/lt.po b/addons/membership/i18n/lt.po
index 6352f23e8e9..76c2404d05b 100644
--- a/addons/membership/i18n/lt.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/nl.po b/addons/membership/i18n/nl.po
index dfafc9b6863..5224be4fee4 100644
--- a/addons/membership/i18n/nl.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/nl_BE.po b/addons/membership/i18n/nl_BE.po
index c9a1abebe85..2c00887e6d4 100644
--- a/addons/membership/i18n/nl_BE.po
+++ b/addons/membership/i18n/nl_BE.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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/pl.po b/addons/membership/i18n/pl.po
index 3eacbd37a27..82e341bfa5c 100644
--- a/addons/membership/i18n/pl.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/pt.po b/addons/membership/i18n/pt.po
index 2f66bfa6912..10fcacee4af 100644
--- a/addons/membership/i18n/pt.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/pt_BR.po b/addons/membership/i18n/pt_BR.po
index c2cc3640345..244813039a7 100644
--- a/addons/membership/i18n/pt_BR.po
+++ b/addons/membership/i18n/pt_BR.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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/ro.po b/addons/membership/i18n/ro.po
index 547ce6270fe..43b164bae2b 100644
--- a/addons/membership/i18n/ro.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/ru.po b/addons/membership/i18n/ru.po
index 28359c3dc57..384eb797307 100644
--- a/addons/membership/i18n/ru.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/sk.po b/addons/membership/i18n/sk.po
index 4ca5bee87a9..a3a385fd739 100644
--- a/addons/membership/i18n/sk.po
+++ b/addons/membership/i18n/sk.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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/sl.po b/addons/membership/i18n/sl.po
index d72ec0f2a25..7c1c82ea882 100644
--- a/addons/membership/i18n/sl.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/sv.po b/addons/membership/i18n/sv.po
index eaa1f21374f..8db434508d1 100644
--- a/addons/membership/i18n/sv.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/tlh.po b/addons/membership/i18n/tlh.po
index e76339fd130..3320094a8ac 100644
--- a/addons/membership/i18n/tlh.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/tr.po b/addons/membership/i18n/tr.po
index a66d06ebbb4..54f205ed397 100644
--- a/addons/membership/i18n/tr.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/uk.po b/addons/membership/i18n/uk.po
index d7b45c51fe9..78b311d2813 100644
--- a/addons/membership/i18n/uk.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/zh_CN.po b/addons/membership/i18n/zh_CN.po
index 0fcc36e492e..3937d1ead5a 100644
--- a/addons/membership/i18n/zh_CN.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/i18n/zh_TW.po b/addons/membership/i18n/zh_TW.po
index 93c998909ec..24c877a9769 100644
--- a/addons/membership/i18n/zh_TW.po
+++ b/addons/membership/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 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: membership
diff --git a/addons/membership/membership_view.xml b/addons/membership/membership_view.xml
index dd23cb61145..b459ab1eb9d 100644
--- a/addons/membership/membership_view.xml
+++ b/addons/membership/membership_view.xml
@@ -111,22 +111,22 @@
- res.partner.select
- res.partner
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
+ res.partner.select
+ res.partner
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
Members
@@ -180,13 +180,13 @@
-
-
+
+
-
-
-
-
+
+
+
+
diff --git a/addons/mrp/__terp__.py b/addons/mrp/__openerp__.py
similarity index 100%
rename from addons/mrp/__terp__.py
rename to addons/mrp/__openerp__.py
diff --git a/addons/mrp/company.py b/addons/mrp/company.py
index 064b1034ba0..1844fff47eb 100644
--- a/addons/mrp/company.py
+++ b/addons/mrp/company.py
@@ -26,7 +26,7 @@ class company(osv.osv):
_columns = {
'schedule_range': fields.float('Scheduler Range', required=True,
help="This is the time frame analysed by the scheduler when "\
- "computing Requisitions. All Requisition that are not between "\
+ "computing procurements. All procurements that are not between "\
"today and today+range are skipped for futur computation."),
'po_lead': fields.float('Purchase Lead Time', required=True,
help="This is the leads/security time for each purchase order."),
diff --git a/addons/mrp/i18n/ar.po b/addons/mrp/i18n/ar.po
index 406de140a0c..cc9014da297 100644
--- a/addons/mrp/i18n/ar.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/bg.po b/addons/mrp/i18n/bg.po
index c0bfc16aa98..e6b4e40ff7e 100644
--- a/addons/mrp/i18n/bg.po
+++ b/addons/mrp/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-04-01 03:40+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/bs.po b/addons/mrp/i18n/bs.po
index 737e69e0ea3..412aad53c7f 100644
--- a/addons/mrp/i18n/bs.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/ca.po b/addons/mrp/i18n/ca.po
index 6b1a1f9d8f4..fae49bfebb9 100644
--- a/addons/mrp/i18n/ca.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/cs.po b/addons/mrp/i18n/cs.po
index 43405b23ceb..31dd05f853f 100644
--- a/addons/mrp/i18n/cs.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/de.po b/addons/mrp/i18n/de.po
index fdf3a1bc3dc..0f54ce877d8 100644
--- a/addons/mrp/i18n/de.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/el.po b/addons/mrp/i18n/el.po
index 979733ed22b..a3db8209bf2 100644
--- a/addons/mrp/i18n/el.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"X-Poedit-Country: GREECE\n"
"X-Poedit-Language: Greek\n"
diff --git a/addons/mrp/i18n/es.po b/addons/mrp/i18n/es.po
index 6d221871751..3a601c8bdbb 100644
--- a/addons/mrp/i18n/es.po
+++ b/addons/mrp/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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/es_AR.po b/addons/mrp/i18n/es_AR.po
index 3358e029308..5794b191ca4 100644
--- a/addons/mrp/i18n/es_AR.po
+++ b/addons/mrp/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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/et.po b/addons/mrp/i18n/et.po
index 7e4b5597093..b844bd23f6b 100644
--- a/addons/mrp/i18n/et.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/fi.po b/addons/mrp/i18n/fi.po
index 5121d802519..f43fb857b50 100644
--- a/addons/mrp/i18n/fi.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/fr.po b/addons/mrp/i18n/fr.po
index e55720e2c9e..34e0d2ef7aa 100644
--- a/addons/mrp/i18n/fr.po
+++ b/addons/mrp/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-04-01 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/hr.po b/addons/mrp/i18n/hr.po
index 526b0fc1069..e5826d09524 100644
--- a/addons/mrp/i18n/hr.po
+++ b/addons/mrp/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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/hu.po b/addons/mrp/i18n/hu.po
index 254e59ddde7..5c2e4ecfc8a 100644
--- a/addons/mrp/i18n/hu.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/id.po b/addons/mrp/i18n/id.po
index 7ec4388218d..cb1c3c07aa4 100644
--- a/addons/mrp/i18n/id.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/it.po b/addons/mrp/i18n/it.po
index 1969a623e19..e185ff7b169 100644
--- a/addons/mrp/i18n/it.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/ko.po b/addons/mrp/i18n/ko.po
index c30d6115bdc..d3068b07a8b 100644
--- a/addons/mrp/i18n/ko.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/lt.po b/addons/mrp/i18n/lt.po
index ccf4358bc28..386d7e6c51f 100644
--- a/addons/mrp/i18n/lt.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/nl.po b/addons/mrp/i18n/nl.po
index 7106ff5670f..508f3241032 100644
--- a/addons/mrp/i18n/nl.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/nl_BE.po b/addons/mrp/i18n/nl_BE.po
index f56ad983e2c..8f29ba236c6 100644
--- a/addons/mrp/i18n/nl_BE.po
+++ b/addons/mrp/i18n/nl_BE.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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/pl.po b/addons/mrp/i18n/pl.po
index 83711002cff..59e69651b19 100644
--- a/addons/mrp/i18n/pl.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/pt.po b/addons/mrp/i18n/pt.po
index d7b1d15ae6f..35e3e1cdd62 100644
--- a/addons/mrp/i18n/pt.po
+++ b/addons/mrp/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 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/pt_BR.po b/addons/mrp/i18n/pt_BR.po
index d0b46d7ee40..95ab9f386db 100644
--- a/addons/mrp/i18n/pt_BR.po
+++ b/addons/mrp/i18n/pt_BR.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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/ro.po b/addons/mrp/i18n/ro.po
index a5bd09b8da7..7351640fedc 100644
--- a/addons/mrp/i18n/ro.po
+++ b/addons/mrp/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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/ru.po b/addons/mrp/i18n/ru.po
index cf3fc9234cf..7577452a51d 100644
--- a/addons/mrp/i18n/ru.po
+++ b/addons/mrp/i18n/ru.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-03-30 10:42+0000\n"
-"Last-Translator: Nikolay Chesnokov \n"
+"PO-Revision-Date: 2010-04-13 05:41+0000\n"
+"Last-Translator: grisha \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-01 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
@@ -69,7 +69,7 @@ msgstr "Используемые мощности маршрута"
#. module: mrp
#: help:mrp.property,composition:0
msgid "Not used in computations, for information purpose only."
-msgstr ""
+msgstr "Не используется в расчётах, только для справки"
#. module: mrp
#: model:ir.actions.act_window,name:mrp.mrp_routing_action
@@ -157,6 +157,8 @@ msgid ""
"Number of operation this workcenter can do in parallel. If this workcenter "
"represent a team of 5 workers, the capacity per cycle is 5."
msgstr ""
+"Количество одновременно выполняемых рабочим центром операций. Если рабочиё "
+"центр представлен пятью рабочими, этот показатель равен 5"
#. module: mrp
#: wizard_button:product.product.procurement,init,create:0
@@ -204,7 +206,7 @@ msgstr ""
#. module: mrp
#: rml:mrp.production.order:0
msgid "Destination Location"
-msgstr ""
+msgstr "Место назначения"
#. module: mrp
#: view:mrp.workcenter:0
@@ -214,7 +216,7 @@ msgstr "Бухг. аналитика"
#. module: mrp
#: model:process.node,note:mrp.process_node_servicemts0
msgid "Do nothing"
-msgstr ""
+msgstr "Ничего не делать"
#. module: mrp
#: rml:mrp.production.order:0
@@ -341,7 +343,7 @@ msgstr "Запланированная к производству продук
#. module: mrp
#: field:mrp.workcenter,timesheet_id:0
msgid "Working Time"
-msgstr ""
+msgstr "Рабочее время"
#. module: mrp
#: view:mrp.procurement:0
diff --git a/addons/mrp/i18n/sk.po b/addons/mrp/i18n/sk.po
index fd3ebdc335a..f7ae917e3ae 100644
--- a/addons/mrp/i18n/sk.po
+++ b/addons/mrp/i18n/sk.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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/sl.po b/addons/mrp/i18n/sl.po
index bca323256e8..12881e14d55 100644
--- a/addons/mrp/i18n/sl.po
+++ b/addons/mrp/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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/sv.po b/addons/mrp/i18n/sv.po
index 94e3942736e..ce361f3fa4d 100644
--- a/addons/mrp/i18n/sv.po
+++ b/addons/mrp/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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/tlh.po b/addons/mrp/i18n/tlh.po
index dedabeeb88b..edcae46acf9 100644
--- a/addons/mrp/i18n/tlh.po
+++ b/addons/mrp/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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/tr.po b/addons/mrp/i18n/tr.po
index ebfb1d41338..7f127a90780 100644
--- a/addons/mrp/i18n/tr.po
+++ b/addons/mrp/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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/uk.po b/addons/mrp/i18n/uk.po
index 041e4b2067d..d74180713a1 100644
--- a/addons/mrp/i18n/uk.po
+++ b/addons/mrp/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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/zh_CN.po b/addons/mrp/i18n/zh_CN.po
index 6f3db8936d1..d4ce1b9c90c 100644
--- a/addons/mrp/i18n/zh_CN.po
+++ b/addons/mrp/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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/zh_HK.po b/addons/mrp/i18n/zh_HK.po
index 5303015f8f4..e651cb71509 100644
--- a/addons/mrp/i18n/zh_HK.po
+++ b/addons/mrp/i18n/zh_HK.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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/i18n/zh_TW.po b/addons/mrp/i18n/zh_TW.po
index 227c9846172..72f81afcdf7 100644
--- a/addons/mrp/i18n/zh_TW.po
+++ b/addons/mrp/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 03:55+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/installer.py b/addons/mrp/installer.py
index d595860ba39..361998f50bd 100644
--- a/addons/mrp/installer.py
+++ b/addons/mrp/installer.py
@@ -26,23 +26,23 @@ class mrp_installer(osv.osv_memory):
_columns = {
# Manufacturing Resource Planning
- 'stock_location':fields.boolean('Advanced Routes',
+ 'stock_location': fields.boolean('Advanced Routes',
help="Manages product routes and paths within and between "
"locations (e.g. warehouses)"),
- 'mrp_jit':fields.boolean('Just In Time Scheduling',
+ 'mrp_jit': fields.boolean('Just In Time Scheduling',
help="Enables Just In Time computation of procurement orders."
"\n\nWhile it's more resource intensive than the default "
"setup, the JIT computer avoids having to wait for the "
"procurement scheduler to run or having to run the "
"procurement scheduler manually."),
- 'mrp_operations':fields.boolean('Manufacturing Operations',
+ 'mrp_operations': fields.boolean('Manufacturing Operations',
help="Enhances production orders with readiness states as well "
"as the dates of start and end of execution of the order."),
- 'mrp_subproduct':fields.boolean('MRP Subproducts',
+ 'mrp_subproduct': fields.boolean('MRP Subproducts',
help="Enables multiple product output from a single production "
"order: without this, a productio order can have only one "
"output product."),
- 'mrp_repair':fields.boolean('Repairs',
+ 'mrp_repair': fields.boolean('Repairs',
help="Enables warranty and repair management (and their impact "
"on stocks and invoicing)."),
}
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index 40d204d34eb..429a3497634 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -161,15 +161,16 @@ class mrp_bom(osv.osv):
@return: Dictionary of values
"""
result = {}
+ bom_obj = self.pool.get('mrp.bom')
for bom in self.browse(cr, uid, ids, context=context):
result[bom.id] = map(lambda x: x.id, bom.bom_lines)
if bom.bom_lines:
continue
ok = ((name=='child_complete_ids') and (bom.product_id.supply_method=='produce'))
if bom.type=='phantom' or ok:
- sids = self.pool.get('mrp.bom').search(cr, uid, [('bom_id','=',False),('product_id','=',bom.product_id.id)])
+ sids = bom_obj.search(cr, uid, [('bom_id','=',False),('product_id','=',bom.product_id.id)])
if sids:
- bom2 = self.pool.get('mrp.bom').browse(cr, uid, sids[0], context=context)
+ bom2 = bom_obj.browse(cr, uid, sids[0], context=context)
result[bom.id] += map(lambda x: x.id, bom2.bom_lines)
return result
@@ -182,13 +183,13 @@ class mrp_bom(osv.osv):
"""
res = dict(map(lambda x: (x,''), ids))
for line in self.browse(cr, uid, ids):
- if line.type=='phantom' and not line.bom_id:
+ if line.type == 'phantom' and not line.bom_id:
res[line.id] = 'set'
continue
- if line.bom_lines or line.type=='phantom':
+ if line.bom_lines or line.type == 'phantom':
continue
- if line.product_id.supply_method=='produce':
- if line.product_id.procure_method=='make_to_stock':
+ if line.product_id.supply_method == 'produce':
+ if line.product_id.procure_method == 'make_to_stock':
res[line.id] = 'stock'
else:
res[line.id] = 'order'
@@ -223,7 +224,6 @@ class mrp_bom(osv.osv):
'child_complete_ids': fields.function(_child_compute,relation='mrp.bom', method=True, string="BoM Hierarchy", type='many2many'),
'company_id': fields.many2one('res.company','Company',required=True),
'multi_level_bom': fields.boolean('Multi-level BoM'),
-
}
_defaults = {
'active': lambda *a: 1,
@@ -261,8 +261,8 @@ class mrp_bom(osv.osv):
@return: Dictionary of changed values
"""
if product_id:
- prod=self.pool.get('product.product').browse(cr,uid,[product_id])[0]
- v = {'product_uom':prod.uom_id.id}
+ prod = self.pool.get('product.product').browse(cr, uid, [product_id])[0]
+ v = {'product_uom': prod.uom_id.id}
if not name:
v['name'] = prod.name
return {'value': v}
@@ -285,8 +285,8 @@ class mrp_bom(osv.osv):
prop = 0
for prop_id in bom.property_ids:
if prop_id.id in properties:
- prop+=1
- if (prop>max_prop) or ((max_prop==0) and not result):
+ prop += 1
+ if (prop > max_prop) or ((max_prop == 0) and not result):
result = bom.id
max_prop = prop
return result
@@ -303,20 +303,20 @@ class mrp_bom(osv.osv):
"""
factor = factor / (bom.product_efficiency or 1.0)
factor = rounding(factor, bom.product_rounding)
- if factor'internal':
+ if routing_loc.usage <> 'internal':
pick_type = 'out'
address_id = routing_loc.address_id and routing_loc.address_id.id or False
routing_loc = routing_loc.id
- pick_name = seq_obj.get(cr, uid, 'stock.picking.'+pick_type)
+ pick_name = seq_obj.get(cr, uid, 'stock.picking.' + pick_type)
picking_id = pick_obj.create(cr, uid, {
'name': pick_name,
- 'origin': (production.origin or '').split(':')[0] +':'+production.name,
+ 'origin': (production.origin or '').split(':')[0] + ':' + production.name,
'type': pick_type,
'move_type': 'one',
'state': 'auto',
@@ -866,7 +870,7 @@ class mrp_production(osv.osv):
source = production.product_id.product_tmpl_id.property_stock_production.id
data = {
- 'name':'PROD:'+production.name,
+ 'name':'PROD:' + production.name,
'date_planned': production.date_planned,
'product_id': production.product_id.id,
'product_qty': production.product_qty,
@@ -884,11 +888,11 @@ class mrp_production(osv.osv):
self.write(cr, uid, [production.id], {'move_created_ids': [(6, 0, [res_final_id])]})
moves = []
for line in production.product_lines:
- move_id=False
+ move_id = False
newdate = production.date_planned
if line.product_id.type in ('product', 'consu'):
res_dest_id = move_obj.create(cr, uid, {
- 'name':'PROD:'+production.name,
+ 'name':'PROD:' + production.name,
'date_planned': production.date_planned,
'product_id': line.product_id.id,
'product_qty': line.product_qty,
@@ -903,7 +907,7 @@ class mrp_production(osv.osv):
})
moves.append(res_dest_id)
move_id = move_obj.create(cr, uid, {
- 'name':'PROD:'+production.name,
+ 'name':'PROD:' + production.name,
'picking_id':picking_id,
'product_id': line.product_id.id,
'product_qty': line.product_qty,
@@ -931,12 +935,10 @@ class mrp_production(osv.osv):
'move_id': move_id,
'company_id': production.company_id.id,
})
- wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
proc_ids.append(proc_id)
- wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
- self.write(cr, uid, [production.id], {'picking_id':picking_id, 'move_lines': [(6,0,moves)], 'state':'confirmed'})
+ self.write(cr, uid, [production.id], {'picking_id': picking_id, 'move_lines': [(6,0,moves)], 'state':'confirmed'})
return picking_id
def force_production(self, cr, uid, ids, *args):
@@ -954,6 +956,7 @@ class mrp_production_workcenter_line(osv.osv):
_name = 'mrp.production.workcenter.line'
_description = 'Work Orders'
_order = 'sequence'
+
_columns = {
'name': fields.char('Work Order', size=64, required=True),
'workcenter_id': fields.many2one('mrp.workcenter', 'Work Center', required=True),
@@ -972,6 +975,7 @@ mrp_production_workcenter_line()
class mrp_production_product_line(osv.osv):
_name = 'mrp.production.product.line'
_description = 'Production scheduled products'
+
_columns = {
'name': fields.char('Name', size=64, required=True),
'product_id': fields.many2one('product.product', 'Product', required=True),
@@ -992,15 +996,16 @@ mrp_production_product_line()
#
class mrp_procurement(osv.osv):
"""
- Procument Orders / Requisitions
+ Procument Orders
"""
_name = "mrp.procurement"
_description = "Procurement"
_order = 'priority,date_planned'
+
_columns = {
- 'name': fields.char('Reason', size=64, required=True, help='Requisition name.'),
+ 'name': fields.char('Reason', size=64, required=True, help='Procurement name.'),
'origin': fields.char('Source Document', size=64,
- help="Reference of the document that created this Requisition.\n"
+ help="Reference of the document that created this Procurement.\n"
"This is automatically completed by Open ERP."),
'priority': fields.selection([('0','Not urgent'),('1','Normal'),('2','Urgent'),('3','Very Urgent')], 'Priority', required=True),
'date_planned': fields.datetime('Scheduled date', required=True),
@@ -1037,7 +1042,7 @@ class mrp_procurement(osv.osv):
('waiting','Waiting')], 'State', required=True,
help='When a procurement is created the state is set to \'Draft\'.\n If the procurement is confirmed, the state is set to \'Confirmed\'.\
\nAfter confirming the state is set to \'Running\'.\n If any exception arises in the order then the state is set to \'Exception\'.\n Once the exception is removed the state becomes \'Ready\'.\n It is in \'Waiting\'. state when the procurement is waiting for another one to finish.'),
- 'note' : fields.text('Note'),
+ 'note': fields.text('Note'),
'company_id': fields.many2one('res.company','Company',required=True),
}
_defaults = {
@@ -1046,7 +1051,7 @@ class mrp_procurement(osv.osv):
'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
'close_move': lambda *a: 0,
'procure_method': lambda *a: 'make_to_order',
- 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.procurement', context=c)
+ 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.procurement', context=c)
}
def unlink(self, cr, uid, ids, context=None):
@@ -1056,7 +1061,7 @@ class mrp_procurement(osv.osv):
if s['state'] in ['draft','cancel']:
unlink_ids.append(s['id'])
else:
- raise osv.except_osv(_('Invalid action !'), _('Cannot delete Requisition Order(s) which are in %s State!' % s['state']))
+ raise osv.except_osv(_('Invalid action !'), _('Cannot delete Procurement Order(s) which are in %s State!' % s['state']))
return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
def onchange_product_id(self, cr, uid, ids, product_id, context={}):
@@ -1065,10 +1070,10 @@ class mrp_procurement(osv.osv):
@return: Dictionary of values.
"""
if product_id:
- w=self.pool.get('product.product').browse(cr,uid,product_id, context)
+ w = self.pool.get('product.product').browse(cr, uid, product_id, context)
v = {
- 'product_uom':w.uom_id.id,
- 'product_uos':w.uos_id and w.uos_id.id or w.uom_id.id
+ 'product_uom': w.uom_id.id,
+ 'product_uos': w.uos_id and w.uos_id.id or w.uom_id.id
}
return {'value': v}
return {}
@@ -1091,7 +1096,7 @@ class mrp_procurement(osv.osv):
for procurement in self.browse(cr, uid, ids, context):
if procurement.move_id:
ok = True
- if not procurement.move_id.state=='cancel':
+ if not procurement.move_id.state == 'cancel':
res = False
return res and ok
@@ -1102,7 +1107,7 @@ class mrp_procurement(osv.osv):
res = True
for proc in self.browse(cr, uid, ids, context):
if proc.move_id:
- if not proc.move_id.state=='done':
+ if not proc.move_id.state == 'done':
res = False
return res
@@ -1115,7 +1120,7 @@ class mrp_procurement(osv.osv):
@param proc: Current procurement.
@return: Quantity or False.
"""
- if proc.product_id.type=='product':
+ if proc.product_id.type == 'product':
if proc.move_id.product_uos:
return proc.move_id.product_uos_qty
return False
@@ -1125,7 +1130,7 @@ class mrp_procurement(osv.osv):
@param proc: Current procurement.
@return: UoS or False.
"""
- if proc.product_id.type=='product':
+ if proc.product_id.type == 'product':
if proc.move_id.product_uos:
return proc.move_id.product_uos.id
return False
@@ -1159,7 +1164,7 @@ class mrp_procurement(osv.osv):
@return: True or False
"""
for procurement in self.browse(cr, uid, ids, context=context):
- if procurement.move_id and procurement.move_id.state=='auto':
+ if procurement.move_id and procurement.move_id.state == 'auto':
return True
return False
@@ -1184,7 +1189,7 @@ class mrp_procurement(osv.osv):
"""
ok = True
for procurement in self.browse(cr, uid, ids, context=context):
- if procurement.product_id.type=='service':
+ if procurement.product_id.type == 'service':
ok = ok and self._check_make_to_stock_service(cr, uid, procurement, context)
else:
ok = ok and self._check_make_to_stock_product(cr, uid, procurement, context)
@@ -1197,7 +1202,7 @@ class mrp_procurement(osv.osv):
res = True
user = self.pool.get('res.users').browse(cr, uid, uid)
for procurement in self.browse(cr, uid, ids):
- if procurement.product_id.product_tmpl_id.supply_method<>'produce':
+ if procurement.product_id.product_tmpl_id.supply_method <> 'produce':
if procurement.product_id.seller_ids:
partner = procurement.product_id.seller_ids[0].name
if user.company_id and user.company_id.partner_id:
@@ -1219,7 +1224,7 @@ class mrp_procurement(osv.osv):
user = self.pool.get('res.users').browse(cr, uid, uid)
partner_obj = self.pool.get('res.partner')
for procurement in self.browse(cr, uid, ids):
- if procurement.product_id.product_tmpl_id.supply_method<>'buy':
+ if procurement.product_id.product_tmpl_id.supply_method <> 'buy':
return False
if not procurement.product_id.seller_ids:
cr.execute('update mrp_procurement set message=%s where id=%s', (_('No supplier defined for this product !'), procurement.id))
@@ -1239,7 +1244,7 @@ class mrp_procurement(osv.osv):
@return: True or False
"""
for record in self.browse(cr, uid, ids):
- if record.move_id and record.move_id.state=='cancel':
+ if record.move_id and record.move_id.state == 'cancel':
return True
return False
@@ -1250,36 +1255,36 @@ class mrp_procurement(osv.osv):
move_obj = self.pool.get('stock.move')
for procurement in self.browse(cr, uid, ids):
if procurement.product_qty <= 0.00:
- raise osv.except_osv(_('Data Insufficient !'), _('Please check the Quantity of Requisition Order(s), it should not be less than 1!'))
+ raise osv.except_osv(_('Data Insufficient !'), _('Please check the Quantity of Procurement Order(s), it should not be less than 1!'))
if procurement.product_id.type in ('product', 'consu'):
if not procurement.move_id:
source = procurement.location_id.id
- if procurement.procure_method=='make_to_order':
+ if procurement.procure_method == 'make_to_order':
source = procurement.product_id.product_tmpl_id.property_stock_procurement.id
id = move_obj.create(cr, uid, {
- 'name': 'PROC:'+procurement.name,
+ 'name': 'PROC:' + procurement.name,
'location_id': source,
'location_dest_id': procurement.location_id.id,
'product_id': procurement.product_id.id,
- 'product_qty':procurement.product_qty,
+ 'product_qty': procurement.product_qty,
'product_uom': procurement.product_uom.id,
'date_planned': procurement.date_planned,
- 'state':'confirmed',
+ 'state': 'confirmed',
'company_id': procurement.company_id.id,
})
- self.write(cr, uid, [procurement.id], {'move_id': id, 'close_move':1})
+ self.write(cr, uid, [procurement.id], {'move_id': id, 'close_move': 1})
else:
# TODO: check this
- if procurement.procure_method=='make_to_stock' and procurement.move_id.state in ('waiting',):
+ if procurement.procure_method == 'make_to_stock' and procurement.move_id.state in ('waiting',):
id = move_obj.write(cr, uid, [procurement.move_id.id], {'state':'confirmed'})
- self.write(cr, uid, ids, {'state':'confirmed','message':''})
+ self.write(cr, uid, ids, {'state': 'confirmed', 'message': ''})
return True
def action_move_assigned(self, cr, uid, ids, context={}):
""" Changes procurement state to Running and writes message.
@return: True
"""
- self.write(cr, uid, ids, {'state':'running','message':_('from stock: products assigned.')})
+ self.write(cr, uid, ids, {'state': 'running', 'message': _('from stock: products assigned.')})
return True
def _check_make_to_stock_service(self, cr, uid, procurement, context={}):
@@ -1305,7 +1310,7 @@ class mrp_procurement(osv.osv):
@return: True
"""
for procurement in self.browse(cr, uid, ids):
- self.write(cr, uid, [procurement.id], {'state':'running'})
+ self.write(cr, uid, [procurement.id], {'state': 'running'})
return True
def action_produce_assign_product(self, cr, uid, ids, context={}):
@@ -1345,12 +1350,12 @@ class mrp_procurement(osv.osv):
'company_id': procurement.company_id.id,
})
res[procurement.id] = produce_id
- self.write(cr, uid, [procurement.id], {'state':'running'})
+ self.write(cr, uid, [procurement.id], {'state': 'running'})
bom_result = production_obj.action_compute(cr, uid,
[produce_id], properties=[x.id for x in procurement.property_ids])
wf_service.trg_validate(uid, 'mrp.production', produce_id, 'button_confirm', cr)
move_obj.write(cr, uid, [res_id],
- {'location_id':procurement.location_id.id})
+ {'location_id': procurement.location_id.id})
return res
def action_po_assign(self, cr, uid, ids, context={}):
@@ -1384,7 +1389,7 @@ class mrp_procurement(osv.osv):
qty = uom_obj._compute_qty(cr, uid, procurement.product_uom.id, procurement.product_qty, uom_id)
if procurement.product_id.seller_ids[0].qty:
- qty=max(qty,procurement.product_id.seller_ids[0].qty)
+ qty = max(qty,procurement.product_id.seller_ids[0].qty)
price = pricelist_obj.price_get(cr, uid, [pricelist_id], procurement.product_id.id, qty, False, {'uom': uom_id})[pricelist_id]
@@ -1393,9 +1398,9 @@ class mrp_procurement(osv.osv):
newdate = newdate - procurement.product_id.seller_ids[0].delay
#Passing partner_id to context for purchase order line integrity of Line name
- context.update({'lang':partner.lang, 'partner_id':partner_id})
+ context.update({'lang': partner.lang, 'partner_id': partner_id})
- product = prod_obj.browse(cr,uid,procurement.product_id.id,context=context)
+ product = prod_obj.browse(cr, uid, procurement.product_id.id, context=context)
line = {
'name': product.partner_ref,
@@ -1405,13 +1410,13 @@ class mrp_procurement(osv.osv):
'price_unit': price,
'date_planned': newdate.strftime('%Y-%m-%d %H:%M:%S'),
'move_dest_id': res_id,
- 'notes':product.description_purchase,
+ 'notes': product.description_purchase,
}
taxes_ids = procurement.product_id.product_tmpl_id.supplier_taxes_id
taxes = acc_pos_obj.map_tax(cr, uid, partner.property_account_position, taxes_ids)
line.update({
- 'taxes_id':[(6,0,taxes)]
+ 'taxes_id': [(6,0,taxes)]
})
purchase_id = po_obj.create(cr, uid, {
'origin': procurement.origin,
@@ -1424,7 +1429,7 @@ class mrp_procurement(osv.osv):
'fiscal_position': partner.property_account_position and partner.property_account_position.id or False
})
res[procurement.id] = purchase_id
- self.write(cr, uid, [procurement.id], {'state':'running', 'purchase_id':purchase_id})
+ self.write(cr, uid, [procurement.id], {'state': 'running', 'purchase_id': purchase_id})
return res
def action_cancel(self, cr, uid, ids):
@@ -1436,16 +1441,16 @@ class mrp_procurement(osv.osv):
move_obj = self.pool.get('stock.move')
for proc in self.browse(cr, uid, ids):
if proc.close_move:
- if proc.move_id.state not in ('done','cancel'):
+ if proc.move_id.state not in ('done', 'cancel'):
todo2.append(proc.move_id.id)
else:
- if proc.move_id and proc.move_id.state=='waiting':
+ if proc.move_id and proc.move_id.state == 'waiting':
todo.append(proc.move_id.id)
if len(todo2):
move_obj.action_cancel(cr, uid, todo2)
if len(todo):
- move_obj.write(cr, uid, todo, {'state':'assigned'})
- self.write(cr, uid, ids, {'state':'cancel'})
+ move_obj.write(cr, uid, todo, {'state': 'assigned'})
+ self.write(cr, uid, ids, {'state': 'cancel'})
wf_service = netsvc.LocalService("workflow")
for id in ids:
wf_service.trg_trigger(uid, 'mrp.procurement', id, cr)
@@ -1460,7 +1465,7 @@ class mrp_procurement(osv.osv):
"""
ok = False
for procurement in self.browse(cr, uid, ids):
- if procurement.move_id.state=='assigned' or procurement.move_id.state=='done':
+ if procurement.move_id.state == 'assigned' or procurement.move_id.state == 'done':
self.action_done(cr, uid, [procurement.id])
ok = True
return ok
@@ -1469,7 +1474,7 @@ class mrp_procurement(osv.osv):
""" Changes procurement state to Ready.
@return: True
"""
- res = self.write(cr, uid, ids, {'state':'ready'})
+ res = self.write(cr, uid, ids, {'state': 'ready'})
return res
def action_done(self, cr, uid, ids):
@@ -1481,7 +1486,7 @@ class mrp_procurement(osv.osv):
if procurement.move_id:
if procurement.close_move and (procurement.move_id.state <> 'done'):
move_obj.action_done(cr, uid, [procurement.move_id.id])
- res = self.write(cr, uid, ids, {'state':'done', 'date_close':time.strftime('%Y-%m-%d')})
+ res = self.write(cr, uid, ids, {'state': 'done', 'date_close': time.strftime('%Y-%m-%d')})
wf_service = netsvc.LocalService("workflow")
for id in ids:
wf_service.trg_trigger(uid, 'mrp.procurement', id, cr)
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index 3614ebf67bb..7f36a3688a1 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -39,7 +39,7 @@
id="menu_mrp_configuration"
name="Configuration"
parent="base.menu_mrp_root"
- groups="group_mrp_manager"
+ groups="base.group_extended"
sequence="50" />
@@ -115,7 +115,7 @@
-
+
@@ -134,7 +134,7 @@
-
+
@@ -197,7 +197,7 @@
-
-
-
- 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
@@ -166,9 +170,6 @@
formtree,form
-
-
-
product.pricelist.type.formproduct.pricelist.type
@@ -187,7 +188,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 @@
+
+
+ Configure Your Purchase System
+
+
+ After having installed the core purchase application, you can extend it with more modules on needs of your organization
+
+
+
+
+
+
+
+
+
+
+
+ Purchase Profile : Install Extra Modules
+ ir.actions.act_window
+ purchase.installer
+
+ form
+ form
+ new
+
+
+
+
+ 3
+
+
+
+
diff --git a/addons/purchase/wizard/purchase_line_invoice.py b/addons/purchase/wizard/purchase_line_invoice.py
new file mode 100644
index 00000000000..12024df71ad
--- /dev/null
+++ b/addons/purchase/wizard/purchase_line_invoice.py
@@ -0,0 +1,132 @@
+# -*- 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 netsvc
+import ir
+from osv import osv
+from tools.translate import _
+
+class purchase_line_invoice(osv.osv_memory):
+
+ """ To create invoice for purchase order line"""
+
+ _name = 'purchase.order.line_invoice'
+ _description = 'Purchase Order Line Make Invoice'
+
+ def makeInvoices(self, cr, uid, ids, context):
+ """
+ To get Purchase Order line and create Invoice
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : retrun view of Invoice
+ """
+ record_ids = context.get('active_ids',[])
+ if record_ids:
+ res = False
+ invoices = {}
+ invoice_obj=self.pool.get('account.invoice')
+ purchase_line_obj=self.pool.get('purchase.order.line')
+ property_obj=self.pool.get('ir.property')
+ account_fiscal_obj=self.pool.get('account.fiscal.position')
+ invoice_line_obj=self.pool.get('account.invoice.line')
+
+ def make_invoice(order, lines):
+ a = order.partner_id.property_account_payable.id
+ if order.partner_id and order.partner_id.property_payment_term.id:
+ pay_term = order.partner_id.property_payment_term.id
+ else:
+ pay_term = False
+ inv = {
+ 'name': order.name,
+ 'origin': order.name,
+ 'type': 'in_invoice',
+ 'reference': "P%dPO%d" % (order.partner_id.id, order.id),
+ 'account_id': a,
+ 'partner_id': order.partner_id.id,
+ 'address_invoice_id': order.partner_address_id.id,
+ 'address_contact_id': order.partner_address_id.id,
+ 'invoice_line': [(6,0,lines)],
+ 'currency_id' : order.pricelist_id.currency_id.id,
+ 'comment': order.notes,
+ 'payment_term': pay_term,
+ 'fiscal_position': order.partner_id.property_account_position.id
+ }
+ inv_id = invoice_obj.create(cr, uid, inv)
+ return inv_id
+
+ for line in purchase_line_obj.browse(cr,uid,record_ids):
+ if (not line.invoiced) and (line.state not in ('draft','cancel')):
+ if not line.order_id.id in invoices:
+ invoices[line.order_id.id] = []
+ if line.product_id:
+ a = line.product_id.product_tmpl_id.property_account_expense.id
+ if not a:
+ a = line.product_id.categ_id.property_account_expense_categ.id
+ if not a:
+ raise osv.except_osv(_('Error !'),
+ _('There is no expense account defined ' \
+ 'for this product: "%s" (id:%d)') % \
+ (line.product_id.name, line.product_id.id,))
+ else:
+ a = property_obj.get(cr, uid,
+ 'property_account_expense_categ', 'product.category',
+ context=context)
+ fpos = line.order_id.fiscal_position or False
+ a = account_fiscal_obj.map_account(cr, uid, fpos, a)
+ inv_id = invoice_line_obj.create(cr, uid, {
+ 'name': line.name,
+ 'origin': line.order_id.name,
+ 'account_id': a,
+ 'price_unit': line.price_unit,
+ 'quantity': line.product_qty,
+ 'uos_id': line.product_uom.id,
+ 'product_id': line.product_id.id or False,
+ 'invoice_line_tax_id': [(6, 0, [x.id for x in line.taxes_id])],
+ 'note': line.notes,
+ 'account_analytic_id': line.account_analytic_id and line.account_analytic_id.id or False,
+ })
+ cr.execute('insert into purchase_order_line_invoice_rel (order_line_id,invoice_id) values (%s,%s)', (line.id, inv_id))
+ purchase_line_obj.write(cr, uid, [line.id], {'invoiced': True})
+ invoices[line.order_id.id].append((line,inv_id))
+
+ res = []
+ for result in invoices.values():
+ order = result[0][0].order_id
+ il = map(lambda x: x[1], result)
+ res.append(make_invoice(order, il))
+
+ return {
+ 'domain': "[('id','in', ["+','.join(map(str,res))+"])]",
+ 'name': _('Supplier Invoices'),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'account.invoice',
+ 'view_id': False,
+ 'context': "{'type':'in_invoice'}",
+ 'type': 'ir.actions.act_window'
+ }
+purchase_line_invoice()
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/purchase/wizard/purchase_line_invoice_view.xml b/addons/purchase/wizard/purchase_line_invoice_view.xml
new file mode 100644
index 00000000000..c5855e5d448
--- /dev/null
+++ b/addons/purchase/wizard/purchase_line_invoice_view.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+ Control invoices
+ purchase.order.line_invoice
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/purchase_analytic_plans/__terp__.py b/addons/purchase_analytic_plans/__openerp__.py
similarity index 100%
rename from addons/purchase_analytic_plans/__terp__.py
rename to addons/purchase_analytic_plans/__openerp__.py
diff --git a/addons/purchase_analytic_plans/i18n/ar.po b/addons/purchase_analytic_plans/i18n/ar.po
index 9baa0d4c19e..79e70e1c2c6 100644
--- a/addons/purchase_analytic_plans/i18n/ar.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/bg.po b/addons/purchase_analytic_plans/i18n/bg.po
index 0c077268451..515caa1920f 100644
--- a/addons/purchase_analytic_plans/i18n/bg.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/bs.po b/addons/purchase_analytic_plans/i18n/bs.po
index 11b35bf094d..041e8fc5fdb 100644
--- a/addons/purchase_analytic_plans/i18n/bs.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/ca.po b/addons/purchase_analytic_plans/i18n/ca.po
index c783f68a9f2..10f2d03cc74 100644
--- a/addons/purchase_analytic_plans/i18n/ca.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/cs.po b/addons/purchase_analytic_plans/i18n/cs.po
index 44995511f92..92b4ef27231 100644
--- a/addons/purchase_analytic_plans/i18n/cs.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/de.po b/addons/purchase_analytic_plans/i18n/de.po
index d71aa133aa2..d80e9917699 100644
--- a/addons/purchase_analytic_plans/i18n/de.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/el.po b/addons/purchase_analytic_plans/i18n/el.po
index b7c3b296f2a..bcdaf82c322 100644
--- a/addons/purchase_analytic_plans/i18n/el.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"X-Poedit-Country: GREECE\n"
"X-Poedit-Language: Greek\n"
diff --git a/addons/purchase_analytic_plans/i18n/es.po b/addons/purchase_analytic_plans/i18n/es.po
index b2b543bcb4a..804fcdea5f2 100644
--- a/addons/purchase_analytic_plans/i18n/es.po
+++ b/addons/purchase_analytic_plans/i18n/es.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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/es_AR.po b/addons/purchase_analytic_plans/i18n/es_AR.po
index 378d00c36e2..0a554905e87 100644
--- a/addons/purchase_analytic_plans/i18n/es_AR.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/et.po b/addons/purchase_analytic_plans/i18n/et.po
index 1bc86d7b0d2..a8712401c6d 100644
--- a/addons/purchase_analytic_plans/i18n/et.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/fr.po b/addons/purchase_analytic_plans/i18n/fr.po
index 6c322f83a5d..684470cb0ee 100644
--- a/addons/purchase_analytic_plans/i18n/fr.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/gl.po b/addons/purchase_analytic_plans/i18n/gl.po
index e43e4e9b91a..f7c0ac3a24c 100644
--- a/addons/purchase_analytic_plans/i18n/gl.po
+++ b/addons/purchase_analytic_plans/i18n/gl.po
@@ -15,7 +15,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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/hr.po b/addons/purchase_analytic_plans/i18n/hr.po
index ee518cfe370..abd5fb8755c 100644
--- a/addons/purchase_analytic_plans/i18n/hr.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/hu.po b/addons/purchase_analytic_plans/i18n/hu.po
index 9baa0d4c19e..79e70e1c2c6 100644
--- a/addons/purchase_analytic_plans/i18n/hu.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/id.po b/addons/purchase_analytic_plans/i18n/id.po
index 662e3ca93a8..431bd1d8cdf 100644
--- a/addons/purchase_analytic_plans/i18n/id.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/it.po b/addons/purchase_analytic_plans/i18n/it.po
index c41e1ee1c80..7358fab9ab9 100644
--- a/addons/purchase_analytic_plans/i18n/it.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/ko.po b/addons/purchase_analytic_plans/i18n/ko.po
index 78c5557b830..0f355b081ae 100644
--- a/addons/purchase_analytic_plans/i18n/ko.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/lt.po b/addons/purchase_analytic_plans/i18n/lt.po
index 9baa0d4c19e..79e70e1c2c6 100644
--- a/addons/purchase_analytic_plans/i18n/lt.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/nl.po b/addons/purchase_analytic_plans/i18n/nl.po
index ed6a501f28c..f601b75fdec 100644
--- a/addons/purchase_analytic_plans/i18n/nl.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/nl_BE.po b/addons/purchase_analytic_plans/i18n/nl_BE.po
index 751c58af557..7afae446a11 100644
--- a/addons/purchase_analytic_plans/i18n/nl_BE.po
+++ b/addons/purchase_analytic_plans/i18n/nl_BE.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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/pl.po b/addons/purchase_analytic_plans/i18n/pl.po
index a116fec31e2..2d97bc9ba82 100644
--- a/addons/purchase_analytic_plans/i18n/pl.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/pt.po b/addons/purchase_analytic_plans/i18n/pt.po
index 7981f6f1d70..0d582dc489c 100644
--- a/addons/purchase_analytic_plans/i18n/pt.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/pt_BR.po b/addons/purchase_analytic_plans/i18n/pt_BR.po
index 2875f2648e9..65d95ea606f 100644
--- a/addons/purchase_analytic_plans/i18n/pt_BR.po
+++ b/addons/purchase_analytic_plans/i18n/pt_BR.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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/ro.po b/addons/purchase_analytic_plans/i18n/ro.po
index 0b399799144..91d6abf3c67 100644
--- a/addons/purchase_analytic_plans/i18n/ro.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/ru.po b/addons/purchase_analytic_plans/i18n/ru.po
index b2a1dbe547e..0102cc4deea 100644
--- a/addons/purchase_analytic_plans/i18n/ru.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/sl.po b/addons/purchase_analytic_plans/i18n/sl.po
index 7d13f76b47c..15f5149f5ac 100644
--- a/addons/purchase_analytic_plans/i18n/sl.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/sv.po b/addons/purchase_analytic_plans/i18n/sv.po
index 9baa0d4c19e..79e70e1c2c6 100644
--- a/addons/purchase_analytic_plans/i18n/sv.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/tlh.po b/addons/purchase_analytic_plans/i18n/tlh.po
index 95dc9b662b8..458dd83c5b4 100644
--- a/addons/purchase_analytic_plans/i18n/tlh.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/tr.po b/addons/purchase_analytic_plans/i18n/tr.po
index be0ec6c9ed2..43bfbce2e58 100644
--- a/addons/purchase_analytic_plans/i18n/tr.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/uk.po b/addons/purchase_analytic_plans/i18n/uk.po
index 75f1dfd0d6f..2b2bd6f1755 100644
--- a/addons/purchase_analytic_plans/i18n/uk.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/ur.po b/addons/purchase_analytic_plans/i18n/ur.po
index efb09db73d8..7804b999d8a 100644
--- a/addons/purchase_analytic_plans/i18n/ur.po
+++ b/addons/purchase_analytic_plans/i18n/ur.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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/zh_CN.po b/addons/purchase_analytic_plans/i18n/zh_CN.po
index 54005c01ac4..57568e14aa1 100644
--- a/addons/purchase_analytic_plans/i18n/zh_CN.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/i18n/zh_TW.po b/addons/purchase_analytic_plans/i18n/zh_TW.po
index 131b1d5858f..ac53e7388b7 100644
--- a/addons/purchase_analytic_plans/i18n/zh_TW.po
+++ b/addons/purchase_analytic_plans/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 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase_analytic_plans
diff --git a/addons/purchase_analytic_plans/purchase_analytic_plans_view.xml b/addons/purchase_analytic_plans/purchase_analytic_plans_view.xml
index 9d0ac4c06cf..498ceb2bd0a 100644
--- a/addons/purchase_analytic_plans/purchase_analytic_plans_view.xml
+++ b/addons/purchase_analytic_plans/purchase_analytic_plans_view.xml
@@ -2,17 +2,17 @@
-
- purchase.order.line.form.inherit
- purchase.order.line
- form
-
-
-
-
-
-
-
+
+ purchase.order.line.form.inherit
+ purchase.order.line
+ form
+
+
+
+
+
+
+
diff --git a/addons/purchase_manual/purchase_manual.py b/addons/purchase_manual/purchase_manual.py
deleted file mode 100644
index f31b96f4c8a..00000000000
--- a/addons/purchase_manual/purchase_manual.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 .
-#
-##############################################################################
-
-from osv import fields
-from osv import osv
-import netsvc
-
-class purchase_order_line(osv.osv):
- _inherit='purchase.order.line'
- _columns = {
- 'state': fields.selection([('draft', 'Draft'), ('confirmed', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', required=True, readonly=True,
- help=' * The \'Draft\' state is set automatically when purchase order in draft state. \
- \n* The \'Confirmed\' state is set automatically as confirm when purchase order in confirm state. \
- \n* The \'Done\' state is set automatically when purchase order is set as done. \
- \n* The \'Cancelled\' state is set automatically when user cancel purchase order.'),
- 'invoice_lines': fields.many2many('account.invoice.line', 'purchase_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True),
- 'invoiced': fields.boolean('Invoiced', readonly=True),
- 'partner_id': fields.related('order_id','partner_id',string='Partner',readonly=True,type="many2one", relation="res.partner"),
- 'date_order': fields.related('order_id','date_order',string='Order Date',readonly=True,type="date")
- }
- _defaults = {
- 'state': lambda *args: 'draft',
- 'invoiced': lambda *a: 0,
-
- }
- def copy_data(self, cr, uid, id, default=None, context={}):
- print 'copy called'
- if not default:
- default = {}
- default.update({
- 'state':'draft',
- 'invoiced':0,
- 'invoice_lines':[],
- })
- return super(purchase_order_line, self).copy_data(cr, uid, id, default, context)
-
- def action_confirm(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state': 'confirmed'}, context)
- return True
-purchase_order_line()
-
-class purchase_order(osv.osv):
- _inherit='purchase.order'
- def action_invoice_create(self, cr, uid, ids, context={}):
- print 'Invoice Create'
- res = super(purchase_order, self).action_invoice_create(cr, uid, ids, context)
- for po in self.browse(cr, uid, ids, context):
- todo = []
- for line in po.order_line:
- todo.append(line.id)
- self.pool.get('purchase.order.line').write(cr, uid, todo, {'invoiced':True}, context)
- return res
-
- def wkf_confirm_order(self, cr, uid, ids, context={}):
- res = super(purchase_order, self).wkf_confirm_order(cr, uid, ids, context)
- todo = []
- for po in self.browse(cr, uid, ids, context):
- for line in po.order_line:
- if line.state=='draft':
- todo.append(line.id)
- self.pool.get('purchase.order.line').action_confirm(cr, uid, todo, context)
- return res
-purchase_order()
diff --git a/addons/purchase_manual/purchase_manual_view.xml b/addons/purchase_manual/purchase_manual_view.xml
deleted file mode 100644
index 4e698dcac53..00000000000
--- a/addons/purchase_manual/purchase_manual_view.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
- #
- # Define PO Line Views
- #
-
-
- purchase.order.form
- purchase.order
- form
-
-
-
-
-
-
-
-
-
-
- purchase.order.line.form
- purchase.order.line
- form
-
- 17
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- purchase.order.line.tree
- purchase.order.line
- tree
-
-
-
-
-
-
-
-
-
- #
- # Inherit PO view to get buttons
- #
-
-
- Purchase Order Lines
- ir.actions.act_window
- purchase.order.line
- tree,form
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
- Uninvoiced Purchase Order Lines
- ir.actions.act_window
- purchase.order.line
- [('state','in',('confirmed','done')), ('invoiced','=',False)]
- form
- tree,form
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
-
diff --git a/addons/purchase_manual/purchase_manual_wizard.xml b/addons/purchase_manual/purchase_manual_wizard.xml
deleted file mode 100644
index 62771cf9fbb..00000000000
--- a/addons/purchase_manual/purchase_manual_wizard.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/addons/purchase_manual/wizard/wizard_purchase_line_invoice.py b/addons/purchase_manual/wizard/wizard_purchase_line_invoice.py
deleted file mode 100644
index 0e30368d41b..00000000000
--- a/addons/purchase_manual/wizard/wizard_purchase_line_invoice.py
+++ /dev/null
@@ -1,162 +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 ir
-import pooler
-from osv import osv
-from tools.translate import _
-
-invoice_form = """
-
-
-
-"""
-
-invoice_fields = {
-}
-
-def _makeInvoices(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- res = False
- invoices = {}
-
- def make_invoice(order, lines):
- a = order.partner_id.property_account_payable.id
- if order.partner_id and order.partner_id.property_payment_term.id:
- pay_term = order.partner_id.property_payment_term.id
- else:
- pay_term = False
- inv = {
- 'name': order.name,
- 'origin': order.name,
- 'type': 'in_invoice',
- 'reference': "P%dPO%d" % (order.partner_id.id, order.id),
- 'account_id': a,
- 'partner_id': order.partner_id.id,
- 'address_invoice_id': order.partner_address_id.id,
- 'address_contact_id': order.partner_address_id.id,
- 'invoice_line': [(6,0,lines)],
- 'currency_id' : order.pricelist_id.currency_id.id,
- 'comment': order.notes,
- 'payment_term': pay_term,
- 'fiscal_position': order.partner_id.property_account_position.id
- }
- inv_id = pool.get('account.invoice').create(cr, uid, inv)
- return inv_id
-
- for line in pool.get('purchase.order.line').browse(cr,uid,data['ids']):
- if (not line.invoiced) and (line.state not in ('draft','cancel')):
- if not line.order_id.id in invoices:
- invoices[line.order_id.id] = []
- if line.product_id:
- a = line.product_id.product_tmpl_id.property_account_expense.id
- if not a:
- a = line.product_id.categ_id.property_account_expense_categ.id
- if not a:
- raise osv.except_osv(_('Error !'),
- _('There is no expense account defined ' \
- 'for this product: "%s" (id:%d)') % \
- (line.product_id.name, line.product_id.id,))
- else:
- a = pool.get('ir.property').get(cr, uid,
- 'property_account_expense_categ', 'product.category',
- context=context)
- fpos = line.order_id.fiscal_position or False
- a = pool.get('account.fiscal.position').map_account(cr, uid, fpos, a)
- inv_id = pool.get('account.invoice.line').create(cr, uid, {
- 'name': line.name,
- 'origin': line.order_id.name,
- 'account_id': a,
- 'price_unit': line.price_unit,
- 'quantity': line.product_qty,
- 'uos_id': line.product_uom.id,
- 'product_id': line.product_id.id or False,
- 'invoice_line_tax_id': [(6, 0, [x.id for x in line.taxes_id])],
- 'note': line.notes,
- 'account_analytic_id': line.account_analytic_id and line.account_analytic_id.id or False,
- })
- cr.execute('insert into purchase_order_line_invoice_rel (order_line_id,invoice_id) values (%s,%s)', (line.id, inv_id))
- pool.get('purchase.order.line').write(cr, uid, [line.id], {'invoiced': True})
- invoices[line.order_id.id].append((line,inv_id))
-
- res = []
- for result in invoices.values():
- order = result[0][0].order_id
- il = map(lambda x: x[1], result)
- res.append(make_invoice(order, il))
- return {'invoice_ids': res}
-
- return {
- 'domain': "[('id','in', ["+','.join(map(str,res))+"])]",
- 'name': _('Supplier Invoices'),
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'account.invoice',
- 'view_id': False,
- 'context': "{'type':'in_invoice'}",
- 'type': 'ir.actions.act_window'
- }
-
-class line_make_invoice(wizard.interface):
- def _open_invoice(self, cr, uid, data, context):
- pool_obj = pooler.get_pool(cr.dbname)
- model_data_ids = pool_obj.get('ir.model.data').search(cr,uid,[('model','=','ir.ui.view'),('name','=','invoice_supplier_form')])
- resource_id = pool_obj.get('ir.model.data').read(cr,uid,model_data_ids,fields=['res_id'])[0]['res_id']
- return {
- 'domain': "[('id','in', ["+','.join(map(str,data['form']['invoice_ids']))+"])]",
- 'name': 'Invoices',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'account.invoice',
- 'views': [(False,'tree'),(resource_id,'form')],
- 'context': "{'type':'in_invoice'}",
- 'type': 'ir.actions.act_window'
- }
-
- states = {
- 'init' : {
- 'actions': [],
- 'result': {
- 'type': 'form',
- 'arch': invoice_form,
- 'fields': invoice_fields,
- 'state': [
- ('end', 'Cancel'),
- ('invoice', 'Create invoices')
- ]
- }
- },
- 'invoice' : {
- 'actions' : [_makeInvoices],
- 'result' : {'type': 'state', 'state': 'open'}
- },
- 'open': {
- 'actions': [],
- 'result': {'type':'action', 'action':_open_invoice, 'state':'end'}
- }
- }
-
-line_make_invoice("purchase.order.line.make_invoice")
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/purchase_tender/__init__.py b/addons/purchase_requisition/__init__.py
similarity index 95%
rename from addons/purchase_tender/__init__.py
rename to addons/purchase_requisition/__init__.py
index 68f1f7ae5bc..ea44f749bbf 100644
--- a/addons/purchase_tender/__init__.py
+++ b/addons/purchase_requisition/__init__.py
@@ -17,6 +17,8 @@
# along with this program. If not, see .
#
##############################################################################
-import purchase_tender
+
+import purchase_requisition
+import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/purchase_tender/__terp__.py b/addons/purchase_requisition/__openerp__.py
similarity index 80%
rename from addons/purchase_tender/__terp__.py
rename to addons/purchase_requisition/__openerp__.py
index fb514e64bd0..d3c259d1a00 100644
--- a/addons/purchase_tender/__terp__.py
+++ b/addons/purchase_requisition/__openerp__.py
@@ -18,20 +18,23 @@
#
##############################################################################
{
- "name" : "Purchase - Purchase Tender",
+ "name" : "Purchase - Purchase Requisition",
"version" : "0.1",
"author" : "Tiny",
"category" : "Generic Modules/Sales & Purchases",
"website" : "http://www.openerp.com",
"description": """
- This module allows you to manage your Purchase Tenders.
- When a purchase order is created, you now have the opportunity to save the related tender.
+ This module allows you to manage your Purchase Requisition.
+ When a purchase order is created, you now have the opportunity to save the related requisition.
This new object will regroup and will allow you to easily keep track and order all your purchase orders.
""",
"depends" : ["purchase"],
"init_xml" : [],
"demo_xml" : [],
- "update_xml" : ["purchase_tender_view.xml","security/ir.model.access.csv","purchase_tender_sequence.xml"],
+ "update_xml" : ["wizard/purchase_requisition_partner_view.xml",
+ "purchase_requisition_view.xml",
+ "security/ir.model.access.csv","purchase_requisition_sequence.xml"],
+
"active": False,
"installable": True
}
diff --git a/addons/purchase_requisition/i18n/fr_BE.po b/addons/purchase_requisition/i18n/fr_BE.po
new file mode 100644
index 00000000000..964e58391a2
--- /dev/null
+++ b/addons/purchase_requisition/i18n/fr_BE.po
@@ -0,0 +1,134 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * purchase_requisition
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 5.0.6\n"
+"Report-Msgid-Bugs-To: support@openerp.com\n"
+"POT-Creation-Date: 2009-11-25 14:07:40+0000\n"
+"PO-Revision-Date: 2009-11-25 14:07:40+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: purchase_requisition
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "XML incorrect pour l'Architecture des Vues!"
+
+#. module: purchase_requisition
+#: field:purchase.requisition,date_end:0
+msgid "Date End"
+msgstr "Date de fin"
+
+#. module: purchase_requisition
+#: constraint:ir.model:0
+msgid "The Object name must start with x_ and not contain any special character !"
+msgstr "Le nom de l'Objet doit commencer par x_ et ne pas comporter de caractères spéciaux !"
+
+#. module: purchase_requisition
+#: view:purchase.requisition:0
+#: field:purchase.requisition,description:0
+msgid "Description"
+msgstr "Description"
+
+#. module: purchase_requisition
+#: model:ir.model,name:purchase_requisition.model_purchase_requisition
+#: field:purchase.order,requisition_id:0
+#: view:purchase.requisition:0
+msgid "Purchase requisition"
+msgstr "Appel d'Offre"
+
+#. module: purchase_requisition
+#: model:ir.actions.act_window,name:purchase_requisition.action_purchase_requisition
+#: model:ir.ui.menu,name:purchase_requisition.menu_purchase_requisition1
+#: model:ir.ui.menu,name:purchase_requisition.menu_purchase_requisition
+msgid "Purchase requisitions"
+msgstr "Appels d'offre"
+
+#. module: purchase_requisition
+#: selection:purchase.requisition,state:0
+msgid "Open"
+msgstr "Ouvert"
+
+#. module: purchase_requisition
+#: field:purchase.requisition,user_id:0
+msgid "Responsible"
+msgstr "Responsable"
+
+#. module: purchase_requisition
+#: model:ir.actions.act_window,name:purchase_requisition.action_purchase_requisition_draft
+#: model:ir.ui.menu,name:purchase_requisition.menu_purchase_requisition1_draft
+msgid "Draft Purchase requisitions"
+msgstr "Appels d'Offre brouillons"
+
+#. module: purchase_requisition
+#: field:purchase.requisition,state:0
+msgid "State"
+msgstr "Etat"
+
+#. module: purchase_requisition
+#: selection:purchase.requisition,state:0
+msgid "Draft"
+msgstr "Brouillon"
+
+#. module: purchase_requisition
+#: model:ir.actions.act_window,name:purchase_requisition.action_purchase_requisition_open
+#: model:ir.ui.menu,name:purchase_requisition.menu_purchase_requisition1_open
+msgid "Open Purchase requisitions"
+msgstr "Appels d'offre ouverts"
+
+#. module: purchase_requisition
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr "Nom de modèle incorrect pour la définition de l'action"
+
+#. module: purchase_requisition
+#: model:ir.module.module,shortdesc:purchase_requisition.module_meta_information
+msgid "Purchase - Purchase requisition"
+msgstr "Achat - Appel d'offre"
+
+#. module: purchase_requisition
+#: field:purchase.requisition,name:0
+msgid "requisition Reference"
+msgstr "Référence"
+
+#. module: purchase_requisition
+#: selection:purchase.requisition,state:0
+msgid "Close"
+msgstr "Clôturé"
+
+#. module: purchase_requisition
+#: field:purchase.requisition,date_start:0
+msgid "Date Start"
+msgstr "Date de début"
+
+#. module: purchase_requisition
+#: view:purchase.requisition:0
+msgid "Quotations"
+msgstr ""
+
+#. module: purchase_requisition
+#: model:ir.module.module,description:purchase_requisition.module_meta_information
+msgid " This module allows you to manage your Purchase requisitions. When a purchase order is created, you now have the opportunity to save the related requisition. \n"
+" This new object will regroup and will allow you to easily keep track and order all your purchase orders.\n"
+""
+msgstr "Ce module vous permet de gérer des appels d'offre. Quand un appel d'offre est créé, vous avez maintenant l'opportunité de conserver une trace. \n"
+" Ce nouvel objet regroupe et conserve la trace de tous vos appels d'offre.\n"
+""
+
+#. module: purchase_requisition
+#: model:ir.actions.act_window,name:purchase_requisition.action_purchase_requisition_new
+#: model:ir.ui.menu,name:purchase_requisition.menu_purchase_requisition1_new
+msgid "New Purchase requisitions"
+msgstr "Nouveaux Appels d'Offre"
+
+#. module: purchase_requisition
+#: field:purchase.requisition,purchase_ids:0
+msgid "Purchase Orders"
+msgstr "Bons d'achat"
+
diff --git a/addons/purchase_requisition/purchase_requisition.py b/addons/purchase_requisition/purchase_requisition.py
new file mode 100644
index 00000000000..ec450fe59f4
--- /dev/null
+++ b/addons/purchase_requisition/purchase_requisition.py
@@ -0,0 +1,164 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 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
+from osv import orm
+import netsvc
+import time
+
+class purchase_requisition(osv.osv):
+ _name = "purchase.requisition"
+ _description="Purchase requisition"
+ _columns = {
+ 'name': fields.char('Requisition Reference', size=32,required=True),
+ 'origin': fields.char('Origin', size=32),
+ 'date_start': fields.datetime('Requisition Date'),
+ 'date_end': fields.datetime('Requisition Deadline'),
+ 'user_id': fields.many2one('res.users', 'Responsible'),
+ 'exclusive': fields.selection([('exclusive','Purchase Tender (exclusive)'),('multiple','Multiple Requisitions')],'Requisition Type', help="If the requisition is exclusive, it will cancel all purchase orders when you confirm one of them", required=True),
+ 'description': fields.text('Description'),
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'purchase_ids' : fields.one2many('purchase.order','requisition_id','Purchase Orders'),
+ 'line_ids' : fields.one2many('purchase.requisition.line','requisition_id','Products to Purchase'),
+ 'state': fields.selection([('draft','Draft'),('in_progress','In Progress'),('cancel','Cancelled'),('done','Done')], 'State', required=True)
+ }
+ _defaults = {
+ 'date_start': lambda *args: time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'state': lambda *args: 'draft',
+ 'exclusive': lambda *args: 'multiple',
+ 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
+ 'user_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).id ,
+ 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'purchase.order.requisition'),
+ }
+purchase_tender()
+
+ def tender_cancel(self, cr, uid, ids, context={}):
+ purchase_order_obj = self.pool.get('purchase.order')
+ for purchase in self.browse(cr, uid, ids):
+ for purchase_id in purchase.purchase_ids:
+ if str(purchase_id.state) in('draft','wait'):
+ purchase_order_obj.action_cancel(cr,uid,[purchase_id.id])
+ self.write(cr, uid, ids, {'state': 'cancel'})
+ return True
+ def tender_in_progress(self, cr, uid, ids, context={}):
+ self.write(cr, uid, ids, {'state':'in_progress'} ,context=context)
+ return True
+ def tender_reset(self, cr, uid, ids, context={}):
+ self.write(cr, uid, ids, {'state': 'draft'})
+ return True
+ def tender_done(self, cr, uid, ids, context={}):
+ self.write(cr, uid, ids, {'state':'done', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
+ return True
+
+
+
+purchase_requisition()
+
+class purchase_requisition_line(osv.osv):
+ _name = "purchase.requisition.line"
+ _description="Purchase Requisition Line"
+ _rec_name = 'product_id'
+ _columns = {
+ 'product_id': fields.many2one('product.product', 'Product' , domain=[('purchase_requisition', '=', True)]),
+ 'product_uom_id': fields.many2one('product.uom', 'Product UoM'),
+ 'product_qty': fields.float('Quantity', digits=(16,2)),
+ 'requisition_id' : fields.many2one('purchase.requisition','Purchase Requisition', ondelete='cascade'),
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'requisition_id' : fields.many2one('purchase.requisition','Purchase Requisition', ondelete='cascade')
+ }
+
+ def onchange_product_id(self, cr, uid, ids, product_id, context={}):
+
+ """ Changes UoM and name if product_id changes.
+ @param name: Name of the field
+ @param product_id: Changed product_id
+ @return: Dictionary of changed values
+ """
+ value = {}
+
+ if product_id:
+ prod = self.pool.get('product.product').browse(cr, uid, [product_id])[0]
+
+ value = {'product_uom_id': prod.uom_id.id}
+
+ return {'value': value}
+ _defaults = {
+ 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
+ }
+
+purchase_requisition_line()
+
+
+class purchase_order(osv.osv):
+ _inherit = "purchase.order"
+ _description = "purchase order"
+ _columns = {
+ 'requisition_id' : fields.many2one('purchase.requisition','Purchase Requisition')
+ }
+ def wkf_confirm_order(self, cr, uid, ids, context={}):
+ res = super(purchase_order, self).wkf_confirm_order(cr, uid, ids, context)
+ for po in self.browse(cr, uid, ids, context):
+ if po.requisition_id and (po.requisition_id.exclusive=='exclusive'):
+ for order in po.requisition_id.purchase_ids:
+ if order.id<>po.id:
+ wf_service = netsvc.LocalService("workflow")
+ wf_service.trg_validate(uid, 'purchase.order', order.id, 'purchase_cancel', cr)
+ self.pool.get('purchase.requisition').write(cr, uid, [po.requisition_id.id], {'state':'close','date_end':time.strftime('%Y-%m-%d %H:%M:%S')})
+
+ return res
+
+
+purchase_order()
+
+class product_product(osv.osv):
+ _inherit = 'product.product'
+ _columns = {
+ 'purchase_requisition': fields.boolean('Purchase Requisition', help="Check this box so that requisitions generates purchase requisitions instead of directly requests for quotations.")
+ }
+ _defaults = {
+ 'purchase_requisition': lambda *args: False
+ }
+product_product()
+
+
+class mrp_procurement(osv.osv):
+ _inherit = 'mrp.procurement'
+ def make_po(self, cr, uid, ids, context={}):
+ sequence_obj=self.pool.get('ir.sequence')
+ res = super(mrp_procurement, self).make_po(cr, uid, ids, context)
+ for proc_id,po_id in res.items():
+ procurement = self.browse(cr, uid, proc_id)
+ if procurement.product_id.purchase_requisition:
+ self.pool.get('purchase.requisition').create(cr, uid, {
+ 'name': sequence_obj.get(cr, uid, 'purchase.order.requisition'),
+ 'origin': procurement.name,
+ 'date_end': procurement.date_planned,
+ 'line_ids': [(0,0,{
+ 'product_id': procurement.product_id.id,
+ 'product_uom_id': procurement.product_uom.id,
+ 'product_qty': procurement.product_qty
+
+ })],
+ 'purchase_ids': [(6,0,[po_id])]
+ })
+ return res
+mrp_procurement()
diff --git a/addons/purchase_requisition/purchase_requisition_sequence.xml b/addons/purchase_requisition/purchase_requisition_sequence.xml
new file mode 100644
index 00000000000..c0b08ec11d4
--- /dev/null
+++ b/addons/purchase_requisition/purchase_requisition_sequence.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Purchase Requisition Order
+ purchase.order.requisition
+
+
+ Purchase Requisition Order
+ purchase.order.requisition
+ TE
+ 5
+
+
+
diff --git a/addons/purchase_requisition/purchase_requisition_view.xml b/addons/purchase_requisition/purchase_requisition_view.xml
new file mode 100644
index 00000000000..870f80c8735
--- /dev/null
+++ b/addons/purchase_requisition/purchase_requisition_view.xml
@@ -0,0 +1,161 @@
+
+
+
+
+
+ purchase.order.tree.inherit
+ tree
+ purchase.order
+
+
+
+
+
+
+
+
+
+ purchase.order.form.inherit
+ form
+ purchase.order
+
+
+
+
+
+
+
+
+
+ purchase.requisition.form
+ form
+ purchase.requisition
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ purchase.requisition.tree
+ tree
+ purchase.requisition
+
+
+
+
+
+
+
+
+
+
+
+
+
+ purchase.requisition.list.select
+ purchase.requisition
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Purchase Requisitions
+ ir.actions.act_window
+ purchase.requisition
+ form
+ tree,form
+
+
+
+
+
+
+ product.form.inherit
+ form
+ product.product
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/purchase_requisition/security/ir.model.access.csv b/addons/purchase_requisition/security/ir.model.access.csv
new file mode 100644
index 00000000000..8ba518cea7d
--- /dev/null
+++ b/addons/purchase_requisition/security/ir.model.access.csv
@@ -0,0 +1,3 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_purchase_requisition","purchase.requisition","model_purchase_requisition","purchase.group_purchase_user",1,1,1,1
+"access_purchase_requisition_line","purchase.requisition.line","model_purchase_requisition_line","purchase.group_purchase_user",1,1,1,1
diff --git a/addons/purchase_requisition/security/purchase_tender.xml b/addons/purchase_requisition/security/purchase_tender.xml
new file mode 100644
index 00000000000..c8318ef01da
--- /dev/null
+++ b/addons/purchase_requisition/security/purchase_tender.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+ Purchase Requisition / Manager
+
+
+ Purchase Requisition / User
+
+
+
+
+ Purchase Requisition multi-company
+
+
+
+
+
+
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+
+
+
+ Purchase requisition Line multi-company
+
+
+
+
+
+
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+
+
+
+
diff --git a/addons/mail_gateway/wizard/__init__.py b/addons/purchase_requisition/wizard/__init__.py
similarity index 96%
rename from addons/mail_gateway/wizard/__init__.py
rename to addons/purchase_requisition/wizard/__init__.py
index 496b15be6dd..a9691cb6e25 100644
--- a/addons/mail_gateway/wizard/__init__.py
+++ b/addons/purchase_requisition/wizard/__init__.py
@@ -19,8 +19,7 @@
#
##############################################################################
-import wizard_fetch_mail
-
+import purchase_requisition_partner
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/purchase_requisition/wizard/purchase_requisition_partner.py b/addons/purchase_requisition/wizard/purchase_requisition_partner.py
new file mode 100644
index 00000000000..ea5195936cc
--- /dev/null
+++ b/addons/purchase_requisition/wizard/purchase_requisition_partner.py
@@ -0,0 +1,132 @@
+# -*- 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 service import web_services
+import netsvc
+import pooler
+import time
+from mx import DateTime
+from osv.orm import browse_record, browse_null
+
+class purchase_requisition_partner(osv.osv_memory):
+ _name = "purchase.requisition.partner"
+ _description = "Purchase Requisition Partner"
+ _columns = {
+ 'partner_id': fields.many2one('res.partner', 'Partner', required=True,domain=[('supplier', '=', True)]),
+ 'partner_address_id':fields.many2one('res.partner.address', 'Address', required=True),
+ }
+
+
+ def view_init(self, cr, uid, fields_list, context=None):
+ res = super(purchase_requisition_partner, self).view_init(cr, uid, fields_list, context=context)
+ record_id = context and context.get('active_id', False) or False
+ tender = self.pool.get('purchase.requisition').browse(cr, uid, record_id)
+ if not tender.line_ids:
+ raise osv.except_osv('Error!','No Product in Tender')
+ True
+
+ def onchange_partner_id(self, cr, uid, ids, partner_id):
+ addr = self.pool.get('res.partner').address_get(cr, uid, [partner_id], ['default'])
+ part = self.pool.get('res.partner').browse(cr, uid, partner_id)
+ return {'value':{'partner_address_id': addr['default']}}
+
+ def create_order(self, cr, uid, ids, context):
+ """
+ To Create a purchase orders .
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs
+ @param context: A standard dictionary
+ @return: {}
+
+ """
+ record_ids = context and context.get('active_ids', False)
+ if record_ids:
+ data = self.read(cr, uid, ids)
+ company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
+ order_obj = self.pool.get('purchase.order')
+ order_line_obj = self.pool.get('purchase.order.line')
+ partner_obj = self.pool.get('res.partner')
+ tender_line_obj = self.pool.get('purchase.requisition.line')
+ pricelist_obj = self.pool.get('product.pricelist')
+ prod_obj = self.pool.get('product.product')
+ tender_obj = self.pool.get('purchase.requisition')
+ acc_pos_obj = self.pool.get('account.fiscal.position')
+ partner_id = data[0]['partner_id']
+
+ supplier_data = partner_obj.browse(cr, uid,[ partner_id])[0]
+
+ address_id = partner_obj.address_get(cr, uid, [partner_id], ['delivery'])['delivery']
+ list_line=[]
+ purchase_order_line={}
+ for tender in tender_obj.browse(cr, uid, record_ids):
+ for line in tender.line_ids:
+
+ uom_id = line.product_id.uom_po_id and line.product_id.uom_po_id.id or False
+ newdate = DateTime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S')
+ newdate = newdate - DateTime.RelativeDateTime(days=company.po_lead)
+ newdate = newdate -(line.product_id.seller_ids and line.product_id.seller_ids[0].delay or DateTime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S') )
+
+
+ partner = line.product_id.seller_ids and line.product_id.seller_ids[0].name or supplier_data
+ pricelist_id = partner.property_product_pricelist_purchase and partner.property_product_pricelist_purchase.id
+ price = pricelist_obj.price_get(cr, uid, [pricelist_id], line.product_id.id, line.product_qty, False, {'uom': uom_id})[pricelist_id]
+ product = prod_obj.browse(cr, uid, line.product_id.id, context=context)
+
+
+ purchase_order_line= {
+ 'name': product.partner_ref,
+ 'product_qty': line.product_qty,
+ 'product_id': line.product_id.id,
+ 'product_uom': uom_id,
+ 'price_unit': price,
+ 'date_planned': newdate.strftime('%Y-%m-%d %H:%M:%S'),
+ 'notes': product.description_purchase,
+ }
+ taxes_ids = line.product_id.product_tmpl_id.supplier_taxes_id
+ taxes = acc_pos_obj.map_tax(cr, uid, partner.property_account_position, taxes_ids)
+ purchase_order_line.update({
+ 'taxes_id': [(6,0,taxes)]
+ })
+ list_line.append(purchase_order_line)
+ purchase_id = order_obj.create(cr, uid, {
+ 'origin': tender.name,
+ 'partner_id': partner_id,
+ 'partner_address_id': address_id,
+ 'pricelist_id': pricelist_id,
+ 'location_id': line.product_id.product_tmpl_id.property_stock_production.id,
+ 'company_id': tender.company_id.id,
+ 'fiscal_position': partner.property_account_position and partner.property_account_position.id or False,
+ 'requisition_id':tender.id,
+ })
+ order_ids=[]
+ for order_line in list_line:
+ order_line.update({
+ 'order_id': purchase_id
+ })
+ order_line_obj.create(cr,uid,order_line)
+ return {}
+
+purchase_requisition_partner()
+
diff --git a/addons/purchase_requisition/wizard/purchase_requisition_partner_view.xml b/addons/purchase_requisition/wizard/purchase_requisition_partner_view.xml
new file mode 100644
index 00000000000..abac95bba16
--- /dev/null
+++ b/addons/purchase_requisition/wizard/purchase_requisition_partner_view.xml
@@ -0,0 +1,32 @@
+
+
+
+
+ Purchase Requisition
+ purchase.requisition.partner
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Purchase Requisition
+ ir.actions.act_window
+ purchase.requisition.partner
+ form
+ form
+ {'record_id' : active_id}
+ new
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/purchase_tender/i18n/fr_BE.po b/addons/purchase_tender/i18n/fr_BE.po
deleted file mode 100644
index 5b9c10ca2cb..00000000000
--- a/addons/purchase_tender/i18n/fr_BE.po
+++ /dev/null
@@ -1,134 +0,0 @@
-# Translation of OpenERP Server.
-# This file contains the translation of the following modules:
-# * purchase_tender
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: OpenERP Server 5.0.6\n"
-"Report-Msgid-Bugs-To: support@openerp.com\n"
-"POT-Creation-Date: 2009-11-25 14:07:40+0000\n"
-"PO-Revision-Date: 2009-11-25 14:07:40+0000\n"
-"Last-Translator: <>\n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: \n"
-"Plural-Forms: \n"
-
-#. module: purchase_tender
-#: constraint:ir.ui.view:0
-msgid "Invalid XML for View Architecture!"
-msgstr "XML incorrect pour l'Architecture des Vues!"
-
-#. module: purchase_tender
-#: field:purchase.tender,date_end:0
-msgid "Date End"
-msgstr "Date de fin"
-
-#. module: purchase_tender
-#: constraint:ir.model:0
-msgid "The Object name must start with x_ and not contain any special character !"
-msgstr "Le nom de l'Objet doit commencer par x_ et ne pas comporter de caractères spéciaux !"
-
-#. module: purchase_tender
-#: view:purchase.tender:0
-#: field:purchase.tender,description:0
-msgid "Description"
-msgstr "Description"
-
-#. module: purchase_tender
-#: model:ir.model,name:purchase_tender.model_purchase_tender
-#: field:purchase.order,tender_id:0
-#: view:purchase.tender:0
-msgid "Purchase Tender"
-msgstr "Appel d'Offre"
-
-#. module: purchase_tender
-#: model:ir.actions.act_window,name:purchase_tender.action_purchase_tender
-#: model:ir.ui.menu,name:purchase_tender.menu_purchase_Tender1
-#: model:ir.ui.menu,name:purchase_tender.menu_purchase_tender
-msgid "Purchase Tenders"
-msgstr "Appels d'offre"
-
-#. module: purchase_tender
-#: selection:purchase.tender,state:0
-msgid "Open"
-msgstr "Ouvert"
-
-#. module: purchase_tender
-#: field:purchase.tender,user_id:0
-msgid "Responsible"
-msgstr "Responsable"
-
-#. module: purchase_tender
-#: model:ir.actions.act_window,name:purchase_tender.action_purchase_tender_draft
-#: model:ir.ui.menu,name:purchase_tender.menu_purchase_Tender1_draft
-msgid "Draft Purchase Tenders"
-msgstr "Appels d'Offre brouillons"
-
-#. module: purchase_tender
-#: field:purchase.tender,state:0
-msgid "State"
-msgstr "Etat"
-
-#. module: purchase_tender
-#: selection:purchase.tender,state:0
-msgid "Draft"
-msgstr "Brouillon"
-
-#. module: purchase_tender
-#: model:ir.actions.act_window,name:purchase_tender.action_purchase_tender_open
-#: model:ir.ui.menu,name:purchase_tender.menu_purchase_Tender1_open
-msgid "Open Purchase Tenders"
-msgstr "Appels d'offre ouverts"
-
-#. module: purchase_tender
-#: constraint:ir.actions.act_window:0
-msgid "Invalid model name in the action definition."
-msgstr "Nom de modèle incorrect pour la définition de l'action"
-
-#. module: purchase_tender
-#: model:ir.module.module,shortdesc:purchase_tender.module_meta_information
-msgid "Purchase - Purchase Tender"
-msgstr "Achat - Appel d'offre"
-
-#. module: purchase_tender
-#: field:purchase.tender,name:0
-msgid "Tender Reference"
-msgstr "Référence"
-
-#. module: purchase_tender
-#: selection:purchase.tender,state:0
-msgid "Close"
-msgstr "Clôturé"
-
-#. module: purchase_tender
-#: field:purchase.tender,date_start:0
-msgid "Date Start"
-msgstr "Date de début"
-
-#. module: purchase_tender
-#: view:purchase.tender:0
-msgid "Quotations"
-msgstr ""
-
-#. module: purchase_tender
-#: model:ir.module.module,description:purchase_tender.module_meta_information
-msgid " This module allows you to manage your Purchase Tenders. When a purchase order is created, you now have the opportunity to save the related tender. \n"
-" This new object will regroup and will allow you to easily keep track and order all your purchase orders.\n"
-""
-msgstr "Ce module vous permet de gérer des appels d'offre. Quand un appel d'offre est créé, vous avez maintenant l'opportunité de conserver une trace. \n"
-" Ce nouvel objet regroupe et conserve la trace de tous vos appels d'offre.\n"
-""
-
-#. module: purchase_tender
-#: model:ir.actions.act_window,name:purchase_tender.action_purchase_tender_new
-#: model:ir.ui.menu,name:purchase_tender.menu_purchase_Tender1_new
-msgid "New Purchase Tenders"
-msgstr "Nouveaux Appels d'Offre"
-
-#. module: purchase_tender
-#: field:purchase.tender,purchase_ids:0
-msgid "Purchase Orders"
-msgstr "Bons d'achat"
-
diff --git a/addons/purchase_tender/purchase_tender.py b/addons/purchase_tender/purchase_tender.py
deleted file mode 100644
index d68281f3a6f..00000000000
--- a/addons/purchase_tender/purchase_tender.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2008 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
-from osv import orm
-import netsvc
-import time
-
-class purchase_tender(osv.osv):
- _name = "purchase.tender"
- _description="Purchase Tender"
- _columns = {
- 'name': fields.char('Tender Reference', size=32,required=True),
- 'date_start': fields.datetime('Date Start'),
- 'date_end': fields.datetime('Date End'),
- 'user_id': fields.many2one('res.users', 'Responsible'),
- 'description': fields.text('Description'),
- 'purchase_ids' : fields.one2many('purchase.order','tender_id','Purchase Orders'),
- 'state': fields.selection([('draft','Draft'),('open','Open'),('close','Close')], 'State', required=True)
- }
- _defaults = {
- 'date_start': lambda *args: time.strftime('%Y-%m-%d %H:%M:%S'),
- 'state': lambda *args: 'open',
- 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'purchase.order.tender'),
- }
-purchase_tender()
-
-class purchase_order(osv.osv):
- _inherit = "purchase.order"
- _description = "purchase order"
- _columns = {
- 'tender_id' : fields.many2one('purchase.tender','Purchase Tender')
- }
- def wkf_confirm_order(self, cr, uid, ids, context={}):
- res = super(purchase_order, self).wkf_confirm_order(cr, uid, ids, context)
- for po in self.browse(cr, uid, ids, context):
- if po.tender_id:
- for order in po.tender_id.purchase_ids:
- if order.id<>po.id:
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'purchase.order', order.id, 'purchase_cancel', cr)
- self.pool.get('purchase.tender').write(cr, uid, [po.tender_id.id], {'state':'close'})
- return res
-purchase_order()
diff --git a/addons/purchase_tender/purchase_tender_sequence.xml b/addons/purchase_tender/purchase_tender_sequence.xml
deleted file mode 100644
index 222e3f46282..00000000000
--- a/addons/purchase_tender/purchase_tender_sequence.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
- Purchase Tender Order
- purchase.order.tender
-
-
- Purchase Tender Order
- purchase.order.tender
- TE
- 5
-
-
-
diff --git a/addons/purchase_tender/purchase_tender_view.xml b/addons/purchase_tender/purchase_tender_view.xml
deleted file mode 100644
index d76de0bee9f..00000000000
--- a/addons/purchase_tender/purchase_tender_view.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
-
- purchase.order.tree.inherit
- tree
- purchase.order
-
-
-
-
-
-
-
-
-
- purchase.order.form.inherit
- form
- purchase.order
-
-
-
-
-
-
-
-
-
- purchase.tender.form
- form
- purchase.tender
-
-
+
+
+
+ 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 e93c28bfe14..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,4 +18,9 @@
#
##############################################################################
-import wizard_purchase_line_invoice
+import sendcode
+import verifycode
+import testemail
+import wizard_spam
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
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 = '''
+
@@ -477,13 +476,13 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
@@ -1051,7 +1050,7 @@
-
+
@@ -1163,9 +1162,9 @@
res_model="survey.response"
src_model="survey"/>
-
+
diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py
index 2bc48cf339d..b5f88f20432 100644
--- a/addons/survey/wizard/survey_answer.py
+++ b/addons/survey/wizard/survey_answer.py
@@ -588,14 +588,15 @@ class survey_question_wiz(osv.osv_memory):
self.pool.get(context.get('object',False)).survey_req_done(cr, uid, [int(context.get('cur_id'))], context)
else:
self.pool.get(context.get('object',False)).write(cr, uid, [int(context.get('cur_id',False))], {'response' : response_id})
-
- for key,val in sur_name_read['store_ans'].items():
- for field in vals:
- if field.split('_')[0] == val['question_id']:
- click_state = False
- click_update.append(key)
- break
-
+ if sur_name_read['store_ans'] and type(sur_name_read['store_ans']) == dict:
+ for key,val in sur_name_read['store_ans'].items():
+ for field in vals:
+ if field.split('_')[0] == val['question_id']:
+ click_state = False
+ click_update.append(key)
+ break
+ else:
+ sur_name_read['store_ans'] = {}
if click_state:
que_li = []
resp_id_list = []
diff --git a/addons/thunderbird/__openerp__.py b/addons/thunderbird/__openerp__.py
new file mode 100644
index 00000000000..2cb470bf886
--- /dev/null
+++ b/addons/thunderbird/__openerp__.py
@@ -0,0 +1,45 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved
+# Copyright (c) 2004 Axelor SPRL. (http://www.axelor.com) All Rights Reserved.
+#
+# 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 .
+#
+##############################################################################
+{
+ "name" : "Thunderbird Interface",
+ "version" : "1.0",
+ "author" : "Axelor",
+ "website" : "http://www.axelor.com/",
+ "depends" : ["base","crm"],
+ "category" : "Generic Modules/Thunderbird interface",
+ "description": '''
+ This module is required for the thuderbird plug-in to work
+ properly.
+
+ This allows you to select an object that you’d like to add
+ to your email and its attachments. You can select a partner, a task,
+ a project, an analytical account, or any other object and attach selected
+ mail as .eml file in attachment of selected record.
+
+ You can create new case in crm using Create Case button.
+ Select a section for which you want to create case.''',
+ "init_xml" : [],
+ "demo_xml" : [],
+ "update_xml" : ['security/ir.model.access.csv'],
+ "active": False,
+ "installable": True
+}
diff --git a/addons/thunderbird/__terp__.py b/addons/thunderbird/__terp__.py
deleted file mode 100644
index 1b7c752d1b1..00000000000
--- a/addons/thunderbird/__terp__.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2008 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 .
-#
-##############################################################################
-##############################################################################
-#
-# Copyright (c) 2004 Axelor SPRL. (http://www.axelor.com) All Rights Reserved.
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-{
- "name" : "Thunderbird Interface",
- "version" : "1.0",
- "author" : "Axelor",
- "website" : "http://www.axelor.com/",
- "depends" : ["base","crm"],
- "category" : "Generic Modules/Thunderbird interface",
- "description": '''
- This module is required for the thuderbird plug-in to work
- properly.
-
- This allows you to select an object that you’d like to add
- to your email and its attachments. You can select a partner, a task,
- a project, an analytical account, or any other object and attach selected
- mail as .eml file in attachment of selected record.
-
- You can create new case in crm using Create Case button.
- Select a section for which you want to create case.''',
- "init_xml" : [],
- "demo_xml" : [],
- "update_xml" : ['security/ir.model.access.csv'],
- "active": False,
- "installable": True
-}
diff --git a/addons/thunderbird/i18n/bg.po b/addons/thunderbird/i18n/bg.po
index a59aabd1beb..fcc7758efa7 100644
--- a/addons/thunderbird/i18n/bg.po
+++ b/addons/thunderbird/i18n/bg.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:16+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:21+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: thunderbird
diff --git a/addons/thunderbird/i18n/cs.po b/addons/thunderbird/i18n/cs.po
index eb1074d839c..e9f2d5d8f3e 100644
--- a/addons/thunderbird/i18n/cs.po
+++ b/addons/thunderbird/i18n/cs.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:16+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:21+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: thunderbird
diff --git a/addons/thunderbird/i18n/de.po b/addons/thunderbird/i18n/de.po
index 856d454c6a9..9f1a0910b4d 100644
--- a/addons/thunderbird/i18n/de.po
+++ b/addons/thunderbird/i18n/de.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:16+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:21+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: thunderbird
diff --git a/addons/thunderbird/i18n/fr.po b/addons/thunderbird/i18n/fr.po
index 39c8a736fcf..cfcae2d5c37 100644
--- a/addons/thunderbird/i18n/fr.po
+++ b/addons/thunderbird/i18n/fr.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:16+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:21+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: thunderbird
diff --git a/addons/thunderbird/i18n/hr.po b/addons/thunderbird/i18n/hr.po
index af3f235b175..e7accb0d6e0 100644
--- a/addons/thunderbird/i18n/hr.po
+++ b/addons/thunderbird/i18n/hr.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:16+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:21+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/thunderbird/i18n/it.po b/addons/thunderbird/i18n/it.po
index 39e2e86b242..df7fe6511ed 100644
--- a/addons/thunderbird/i18n/it.po
+++ b/addons/thunderbird/i18n/it.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:16+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:21+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: thunderbird
diff --git a/addons/thunderbird/i18n/sk.po b/addons/thunderbird/i18n/sk.po
index 7d1d794f3ca..047dcaba5f1 100644
--- a/addons/thunderbird/i18n/sk.po
+++ b/addons/thunderbird/i18n/sk.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:16+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:21+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: thunderbird
diff --git a/addons/thunderbird/i18n/sl.po b/addons/thunderbird/i18n/sl.po
index f702babce4c..4a60d1f4805 100644
--- a/addons/thunderbird/i18n/sl.po
+++ b/addons/thunderbird/i18n/sl.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:16+0000\n"
+"X-Launchpad-Export-Date: 2010-04-17 04:21+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: thunderbird
diff --git a/addons/thunderbird/partner/partner.py b/addons/thunderbird/partner/partner.py
index d3aa9020444..3d678289988 100644
--- a/addons/thunderbird/partner/partner.py
+++ b/addons/thunderbird/partner/partner.py
@@ -87,7 +87,7 @@ class tinythunderbird_partner(osv.osv):
header_name = email.Header.decode_header(dictcreate['name'])
dictcreate['name'] = header_name and header_name[0] and header_name[0][0]
add_obj=self.pool.get('res.partner.address')
- case_pool=self.pool.get('crm.case')
+ case_pool=self.pool.get(dictcreate.get('object','crm.case'))
partner_ids=add_obj.search(cr,user,[('email','=',dictcreate['email_from'])])
partner=add_obj.read(cr,user,partner_ids,['partner_id'])
if partner:
@@ -95,7 +95,7 @@ class tinythunderbird_partner(osv.osv):
search_id = self.pool.get('res.request.link').search(cr,user,[('object','=',dictcreate['ref'].split(',')[0])])
if not search_id:
create_link_id = self.pool.get('res.request.link').create(cr,user,{'name':dictcreate['ref'].split(',')[0],'object':dictcreate['ref'].split(',')[0]})
- create_id = self.pool.get('crm.case').create(cr, user, dictcreate)
+ create_id = self.pool.get(dictcreate.get('object','crm.case')).create(cr, user, dictcreate)
cases=case_pool.browse(cr,user,[create_id])
case_pool._history(cr, user, cases, _('Archive'), history=True, email=False)
return create_id
diff --git a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi b/addons/thunderbird/plugin/tiny_plugin-2.0.xpi
index 57fa5ac8104..1ec2f9daa0c 100644
Binary files a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi and b/addons/thunderbird/plugin/tiny_plugin-2.0.xpi differ
diff --git a/addons/users_ldap/__terp__.py b/addons/users_ldap/__openerp__.py
similarity index 100%
rename from addons/users_ldap/__terp__.py
rename to addons/users_ldap/__openerp__.py
diff --git a/addons/users_ldap/users_ldap_view.xml b/addons/users_ldap/users_ldap_view.xml
index 976743287f3..b055ef2938d 100644
--- a/addons/users_ldap/users_ldap_view.xml
+++ b/addons/users_ldap/users_ldap_view.xml
@@ -1,35 +1,35 @@
-
-
- res.company.form.inherit.users_ldap
- res.company
- 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