diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index abd3d1f459d..d4731fa0215 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -80,6 +80,8 @@ module named account_voucherss
'wizard/account_aged_trial_balance_view.xml',
'wizard/account_compare_account_balance_report_view.xml',
'wizard/account_third_party_ledger.xml',
+ 'wizard/account_reconcile_view.xml',
+ 'wizard/account_automatic_reconcile_view.xml',
'project/wizard/project_account_analytic_line_view.xml',
'account_end_fy.xml',
'account_invoice_view.xml',
@@ -89,6 +91,13 @@ module named account_voucherss
'account_invoice_workflow.xml',
'project/project_view.xml',
'project/project_report.xml',
+ 'project/wizard/account_analytic_check_view.xml',
+ 'project/wizard/account_analytic_balance_report_view.xml',
+ 'project/wizard/account_analytic_cost_ledger_view.xml',
+ 'project/wizard/account_analytic_inverted_balance_report.xml',
+ 'project/wizard/account_analytic_journal_report_view.xml',
+ 'project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml',
+ 'project/wizard/account_analytic_chart_view.xml',
'product_view.xml',
'account_assert_test.xml',
'process/statement_process.xml',
@@ -113,4 +122,4 @@ module named account_voucherss
'active': False,
'certificate': '0080331923549',
}
-# 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/account_move_line.py b/addons/account/account_move_line.py
index 07d8e1a02ac..b9aa089942e 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -922,10 +922,10 @@ class account_move_line(osv.osv):
vals['analytic_lines'] = [(0,0, {
'name': vals['name'],
'date': vals.get('date', time.strftime('%Y-%m-%d')),
- 'account_id': vals['analytic_account_id'],
- 'unit_amount':'quantity' in vals and vals['quantity'] or 1.0,
- 'amount': vals['debit'] or vals['credit'],
- 'general_account_id': vals['account_id'],
+ 'account_id': vals.get('analytic_account_id', False),
+ 'unit_amount': vals.get('quantity', 1.0),
+ 'amount': vals.get('debit', 0.0) or vals.get('credit', 0.0),
+ 'general_account_id': vals.get('account_id', False),
'journal_id': journal.analytic_journal_id.id,
'ref': vals.get('ref', False),
})]
diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml
index 93dba0e5249..8b093fb2310 100644
--- a/addons/account/account_wizard.xml
+++ b/addons/account/account_wizard.xml
@@ -33,9 +33,9 @@
-->
-
-
+
@@ -47,7 +47,7 @@
-
+
diff --git a/addons/account/i18n/pl.po b/addons/account/i18n/pl.po
index 6634fd4f9ec..2305e11d469 100644
--- a/addons/account/i18n/pl.po
+++ b/addons/account/i18n/pl.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-04-27 19:28+0000\n"
+"PO-Revision-Date: 2010-05-02 10:11+0000\n"
"Last-Translator: Grzegorz Grzelak (Cirrus.pl) \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-28 03:44+0000\n"
+"X-Launchpad-Export-Date: 2010-05-03 04:03+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@@ -2212,7 +2212,7 @@ msgstr "(pozostaw puste, aby stosować bieżący okres)"
#: model:ir.actions.act_window,name:account.action_invoice_tree8
#: model:ir.ui.menu,name:account.menu_action_invoice_tree8
msgid "Draft Supplier Invoices"
-msgstr "Projekt faktury dla klienta"
+msgstr "Projekty faktur od dostawcy"
#. module: account
#: wizard_field:account.invoice.refund,init,period:0
@@ -2952,7 +2952,7 @@ msgstr ""
#: model:ir.actions.act_window,name:account.action_invoice_tree12
#: model:ir.ui.menu,name:account.menu_action_invoice_tree12
msgid "Draft Supplier Refunds"
-msgstr "Projekt korekty od dostawcy"
+msgstr "Projekty korekt od dostawcy"
#. module: account
#: model:process.node,name:account.process_node_accountingstatemententries0
@@ -3039,7 +3039,7 @@ msgstr "Kurs dla op. wychodzacych"
#: model:ir.actions.act_window,name:account.action_invoice_tree10
#: model:ir.ui.menu,name:account.menu_action_invoice_tree10
msgid "Draft Customer Refunds"
-msgstr "Projekt korekty dla klienta"
+msgstr "Projekty korekt dla klienta"
#. module: account
#: field:account.journal.column,readonly:0
@@ -5481,7 +5481,7 @@ msgstr "Zapisy subskrypcji"
#: model:ir.actions.act_window,name:account.action_invoice_tree6
#: model:ir.ui.menu,name:account.menu_action_invoice_tree6
msgid "PRO-FORMA Customer Invoices"
-msgstr "Faktura PRO-FORMA dla klienta"
+msgstr "Fakturay PRO-FORMA dla klienta"
#. module: account
#: field:account.subscription,period_total:0
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index c66dda115b2..14cd952aa69 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -539,6 +539,16 @@ class account_invoice(osv.osv):
wf_service.trg_create(uid, 'account.invoice', inv_id, cr)
return True
+ def finalize_invoice_move_lines(self, cr, uid, invoice_browse, move_lines):
+ """finalize_invoice_move_lines(cr, uid, invoice, move_lines) -> move_lines
+ Hook method to be overridden in additional modules to verify and possibly alter the
+ move lines to be created by an invoice, for special cases.
+ :param invoice_browse: browsable record of the invoice that is generating the move lines
+ :param move_lines: list of dictionaries with the account.move.lines (as for create())
+ :return: the (possibly updated) final move_lines to create for this invoice
+ """
+ return move_lines
+
# Workflow stuff
#################
@@ -816,6 +826,9 @@ class account_invoice(osv.osv):
if journal.centralisation:
raise osv.except_osv(_('UserError'),
_('Cannot create invoice move on centralised journal'))
+
+ line = self.finalize_invoice_move_lines(cr, uid, inv, line)
+
move = {'ref': inv.number, 'line_id': line, 'journal_id': journal_id, 'date': date}
period_id=inv.period_id and inv.period_id.id or False
if not period_id:
diff --git a/addons/account/project/project_report.xml b/addons/account/project/project_report.xml
index 0abfd6625f5..ae6aedeaab1 100644
--- a/addons/account/project/project_report.xml
+++ b/addons/account/project/project_report.xml
@@ -3,32 +3,32 @@
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index e0854f8d65d..a97be959cd1 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -127,8 +127,8 @@
parent="account_analytic_def_account"/>
-
-
+
diff --git a/addons/account/project/report/analytic_check.py b/addons/account/project/report/analytic_check.py
index 0469c3b6918..54fbaddc4d9 100644
--- a/addons/account/project/report/analytic_check.py
+++ b/addons/account/project/report/analytic_check.py
@@ -18,9 +18,9 @@
# along with this program. If not, see .
#
##############################################################################
+import time
import pooler
-import time
from report import report_sxw
class account_analytic_analytic_check(report_sxw.rml_parse):
@@ -132,5 +132,4 @@ class account_analytic_analytic_check(report_sxw.rml_parse):
report_sxw.report_sxw('report.account.analytic.account.analytic.check', 'account.analytic.account', 'addons/account/project/report/analytic_check.rml',parser=account_analytic_analytic_check, header=False)
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/report/quantity_cost_ledger.py b/addons/account/project/report/quantity_cost_ledger.py
index c841c2131ab..12bea390eba 100644
--- a/addons/account/project/report/quantity_cost_ledger.py
+++ b/addons/account/project/report/quantity_cost_ledger.py
@@ -18,9 +18,9 @@
# along with this program. If not, see .
#
##############################################################################
+import time
import pooler
-import time
from report import report_sxw
class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
@@ -35,7 +35,7 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
})
def _lines_g(self, account_id, date1, date2, journals):
- if not journals or not journals[0][2]:
+ if not journals:
self.cr.execute("SELECT sum(aal.unit_amount) AS quantity, \
aa.code AS code, aa.name AS name, aa.id AS id \
FROM account_account AS aa, account_analytic_line AS aal \
@@ -45,7 +45,7 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
GROUP BY aa.code, aa.name, aa.id ORDER BY aa.code",
(account_id, date1, date2))
else:
- journal_ids = journals[0][2]
+ journal_ids = journals
self.cr.execute("SELECT sum(aal.unit_amount) AS quantity, \
aa.code AS code, aa.name AS name, aa.id AS id \
FROM account_account AS aa, account_analytic_line AS aal \
@@ -59,7 +59,7 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
return res
def _lines_a(self, general_account_id, account_id, date1, date2, journals):
- if not journals or not journals[0][2]:
+ if not journals:
self.cr.execute("SELECT aal.name AS name, aal.code AS code, \
aal.unit_amount AS quantity, aal.date AS date, \
aaj.code AS cj \
@@ -71,7 +71,7 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
ORDER BY aal.date, aaj.code, aal.code",
(general_account_id, account_id, date1, date2))
else:
- journal_ids = journals[0][2]
+ journal_ids = journals
self.cr.execute("SELECT aal.name AS name, aal.code AS code, \
aal.unit_amount AS quantity, aal.date AS date, \
aaj.code AS cj \
@@ -86,13 +86,13 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
return res
def _account_sum_quantity(self, account_id, date1, date2, journals):
- if not journals or not journals[0][2]:
+ if not journals:
self.cr.execute("SELECT sum(unit_amount) \
FROM account_analytic_line \
WHERE account_id=%s AND date>=%s AND date<=%s",
(account_id, date1, date2))
else:
- journal_ids = journals[0][2]
+ journal_ids = journals
self.cr.execute("SELECT sum(unit_amount) \
FROM account_analytic_line \
WHERE account_id = %s AND date >= %s AND date <= %s \
@@ -104,17 +104,17 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
ids = map(lambda x: x.id, accounts)
if not len(ids):
return 0.0
- if not journals or not journals[0][2]:
+ if not journals:
self.cr.execute("SELECT sum(unit_amount) \
FROM account_analytic_line \
WHERE account_id =ANY(%s) AND date>=%s AND date<=%s",
- (date1, date2,ids,))
+ (ids, date1, date2,))
else:
- journal_ids = journals[0][2]
+ journal_ids = journals
self.cr.execute("SELECT sum(unit_amount) \
FROM account_analytic_line \
WHERE account_id =ANY(%s) AND date >= %s AND date <= %s \
- AND journal_id =ANY(%s)",(ids,date1, date2,journal_ids))
+ AND journal_id =ANY(%s)",(ids, date1, date2, journal_ids))
return self.cr.fetchone()[0] or 0.0
report_sxw.report_sxw('report.account.analytic.account.quantity_cost_ledger',
@@ -122,6 +122,4 @@ report_sxw.report_sxw('report.account.analytic.account.quantity_cost_ledger',
'addons/account/project/report/quantity_cost_ledger.rml',
parser=account_analytic_quantity_cost_ledger, header=False)
-
-# 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/project/wizard/__init__.py b/addons/account/project/wizard/__init__.py
index f11fa936960..60f591fcb55 100644
--- a/addons/account/project/wizard/__init__.py
+++ b/addons/account/project/wizard/__init__.py
@@ -19,14 +19,13 @@
#
##############################################################################
-import wizard_account_analytic_journal_report
-import wizard_account_analytic_balance_report
-import wizard_account_analytic_inverted_balance_report
-import wizard_account_analytic_cost_ledger_report
-import wizard_account_analytic_cost_ledger_for_journal_report
-import wizard_account_analytic_analytic_check
+import account_analytic_journal_report
+import account_analytic_balance_report
+import account_analytic_inverted_balance_report
+import account_analytic_cost_ledger_report
+import account_analytic_cost_ledger_for_journal_report
+import account_analytic_check
import project_account_analytic_line
-import wizard_analytic_account_chart
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+import account_analytic_chart
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_budget/wizard/wizard_crossovered_budget_summary_report.py b/addons/account/project/wizard/account_analytic_balance_report.py
similarity index 50%
rename from addons/account_budget/wizard/wizard_crossovered_budget_summary_report.py
rename to addons/account/project/wizard/account_analytic_balance_report.py
index 5580fea385f..b751808ffb9 100644
--- a/addons/account_budget/wizard/wizard_crossovered_budget_summary_report.py
+++ b/addons/account/project/wizard/account_analytic_balance_report.py
@@ -18,37 +18,42 @@
# along with this program. If not, see .
#
##############################################################################
-
import time
-import wizard
-dates_form = '''
-'''
+from osv import osv, fields
-dates_fields = {
- 'date_from': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
- 'date_to': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
-}
+class account_analytic_balance(osv.osv_memory):
+ _name = 'account.analytic.balance'
+ _description = 'Account Analytic Balance'
-class wizard_report_summary(wizard.interface):
-
- def _default(self, cr, uid, data, context):
- data['form']['report']='analytic-one'
- return data['form']
-
- states = {
- 'init': {
- 'actions': [_default],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel', 'gtk-cancel'),('report','Print', 'gtk-print', True)]}
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'crossovered.budget.report', 'state':'end'}
+ _columns = {
+ 'date1': fields.date('Start of period', required=True),
+ 'date2': fields.date('End of period', required=True),
+ 'empty_acc': fields.boolean('Empty Accounts ? ', help='Check if you want to display Accounts with 0 balance too.'),
}
- }
-wizard_report_summary('wizard.crossovered.budget.summary')
+
+ _defaults = {
+ 'date1':time.strftime('%Y-01-01'),
+ 'date2':time.strftime('%Y-%m-%d')
+ }
+
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.analytic.account',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.account.balance',
+ 'datas': datas,
+ }
+
+account_analytic_balance()
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/account_analytic_balance_report_view.xml b/addons/account/project/wizard/account_analytic_balance_report_view.xml
new file mode 100644
index 00000000000..5144ba8647a
--- /dev/null
+++ b/addons/account/project/wizard/account_analytic_balance_report_view.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+ Account Analytic Balance
+ account.analytic.balance
+ form
+
+
+
+
+
+
+ Analytic Balance
+ ir.actions.act_window
+ account.analytic.balance
+ form
+ form
+
+ new
+
+
+
+
+
+ Account Analytic Balance
+ client_print_multi
+
+ action
+ account.analytic.account
+
+
+
+
+
diff --git a/addons/account/project/wizard/account_analytic_chart.py b/addons/account/project/wizard/account_analytic_chart.py
new file mode 100644
index 00000000000..dc55d6c43e7
--- /dev/null
+++ b/addons/account/project/wizard/account_analytic_chart.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 .
+#
+##############################################################################
+from osv import osv, fields
+
+class account_analytic_chart(osv.osv_memory):
+ _name = 'account.analytic.chart'
+ _description = 'Account Analytic Chart'
+
+ _columns = {
+ 'from_date': fields.date('From'),
+ 'to_date': fields.date('To'),
+ }
+
+ def analytic_account_chart_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')
+ result_context = {}
+ if context is None:
+ context = {}
+ result = mod_obj._get_id(cr, uid, 'account', 'action_account_analytic_account_tree2')
+ id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
+ result = act_obj.read(cr, uid, [id], context=context)[0]
+ data = self.read(cr, uid, ids, [])[0]
+ if data['from_date']:
+ result_context.update({'from_date' : data['from_date']})
+ if data['to_date']:
+ result_context.update({'to_date' : data['to_date']})
+ result['context'] = str(result_context)
+ return result
+
+account_analytic_chart()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/project/wizard/account_analytic_chart_view.xml b/addons/account/project/wizard/account_analytic_chart_view.xml
new file mode 100644
index 00000000000..cac1839712d
--- /dev/null
+++ b/addons/account/project/wizard/account_analytic_chart_view.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+ Account Analytic Chart
+ account.analytic.chart
+ form
+
+
+
+
+
+
+ Analytic Chart of Accounts
+ ir.actions.act_window
+ account.analytic.chart
+ form
+ form
+
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account_budget/wizard/wizard_analytic_account_budget.py b/addons/account/project/wizard/account_analytic_check.py
similarity index 53%
rename from addons/account_budget/wizard/wizard_analytic_account_budget.py
rename to addons/account/project/wizard/account_analytic_check.py
index 16702f7633d..48c89df8fc4 100644
--- a/addons/account_budget/wizard/wizard_analytic_account_budget.py
+++ b/addons/account/project/wizard/account_analytic_check.py
@@ -18,33 +18,40 @@
# along with this program. If not, see .
#
##############################################################################
-
import time
-import wizard
-dates_form = '''
-'''
+from osv import osv, fields
-dates_fields = {
- 'date_from': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
- 'date_to': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}
-}
+class account_analytic_check(osv.osv_memory):
+ _name = 'account.analytic.check'
+ _description = 'Account Analytic Check'
-class wizard_report(wizard.interface):
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel', 'gtk-cancel'),('report','Print', 'gtk-print', True)]}
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'account.analytic.account.budget', 'state':'end'}
+ _columns = {
+ 'date1': fields.date('Start of period', required=True),
+ 'date2': fields.date('End of period', required=True),
}
- }
-wizard_report('wizard.analytic.account.budget.report')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+ _defaults = {
+ 'date1':time.strftime('%Y-01-01'),
+ 'date2':time.strftime('%Y-%m-%d')
+ }
+
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.account',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.account.analytic.check',
+ 'datas': datas,
+ }
+
+account_analytic_check()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/account_analytic_check_view.xml b/addons/account/project/wizard/account_analytic_check_view.xml
new file mode 100644
index 00000000000..d12acd214a4
--- /dev/null
+++ b/addons/account/project/wizard/account_analytic_check_view.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+ Account Analytic Check
+ account.analytic.check
+ form
+
+
+
+
+
+
+ Analytic Check
+ ir.actions.act_window
+ account.analytic.check
+ form
+ form
+
+ new
+
+
+
+
+
+ Account Analytic Check
+ client_print_multi
+
+ action
+ account.account
+
+
+
+
+
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py
new file mode 100644
index 00000000000..73dd38533c4
--- /dev/null
+++ b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py
@@ -0,0 +1,105 @@
+# -*- 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 account_analytic_cost_ledger_journal_report(osv.osv_memory):
+ _name = 'account.analytic.cost.ledger.journal.report'
+ _description = 'Account Analytic Cost Ledger For Journal Report'
+
+ _columns = {
+ 'date1': fields.date('Start of period', required=True),
+ 'date2': fields.date('End of period', required=True),
+ 'journal': fields.many2many('account.analytic.journal', 'ledger_journal_rel','ledger_id', 'Journal_id','Journals'),
+ }
+
+ _defaults = {
+ 'date1':time.strftime('%Y-01-01'),
+ 'date2':time.strftime('%Y-%m-%d')
+ }
+
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.analytic.account',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.account.quantity_cost_ledger',
+ 'datas': datas,
+ }
+
+account_analytic_cost_ledger_journal_report()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
+#import time
+#import wizard
+#
+#_form = '''
+#'''
+#
+#_fields = {
+# 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
+# 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
+# 'journal': {'string':'Journals','type':'many2many', 'relation':'account.analytic.journal'},
+#}
+#
+#
+#class wizard_report(wizard.interface):
+# states = {
+# 'init': {
+# 'actions': [],
+# 'result': {
+# 'type': 'form',
+# 'arch': _form,
+# 'fields': _fields,
+# 'state': [
+# ('end','Cancel'),
+# ('report','Print')
+# ]
+# }
+# },
+# 'report': {
+# 'actions': [],
+# 'result': {
+# 'type': 'print',
+# 'report': 'account.analytic.account.quantity_cost_ledger',
+# 'state': 'end'
+# }
+# },
+# }
+#
+#wizard_report('account.analytic.account.quantity_cost_ledger.report')
+#
+## vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml
new file mode 100644
index 00000000000..1ad974e8650
--- /dev/null
+++ b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+ Account Analytic Cost Ledger Journal
+ account.analytic.cost.ledger.journal.report
+ form
+
+
+
+
+
+
+ Cost Ledger (Only quantities)
+ ir.actions.act_window
+ account.analytic.cost.ledger.journal.report
+ form
+ form
+
+ new
+
+
+
+
+
+ Account Analytic Cost Ledger Journal
+ client_print_multi
+
+ action
+ account.analytic.account
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/project/wizard/wizard_account_analytic_inverted_balance_report.py b/addons/account/project/wizard/account_analytic_cost_ledger_report.py
similarity index 52%
rename from addons/account/project/wizard/wizard_account_analytic_inverted_balance_report.py
rename to addons/account/project/wizard/account_analytic_cost_ledger_report.py
index 9219a8ea9ae..96b480b4fb5 100644
--- a/addons/account/project/wizard/wizard_account_analytic_inverted_balance_report.py
+++ b/addons/account/project/wizard/account_analytic_cost_ledger_report.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,38 +15,42 @@
# 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
-import wizard
-dates_form = '''
-'''
+from osv import osv, fields
-dates_fields = {
- 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
- 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
-}
+class account_analytic_cost_ledger(osv.osv_memory):
+ _name = 'account.analytic.cost.ledger'
+ _description = 'Account Analytic Cost Ledger'
-class wizard_report(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'), ('report','Print')]}
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'account.analytic.account.inverted.balance', 'state':'end'}
+ _columns = {
+ 'date1': fields.date('Start of period', required=True),
+ 'date2': fields.date('End of period', required=True),
}
- }
-wizard_report('account.analytic.account.inverted.balance.report')
+ _defaults = {
+ 'date1':time.strftime('%Y-01-01'),
+ 'date2':time.strftime('%Y-%m-%d')
+ }
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.analytic.account',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.account.cost_ledger',
+ 'datas': datas,
+ }
+account_analytic_cost_ledger()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_view.xml b/addons/account/project/wizard/account_analytic_cost_ledger_view.xml
new file mode 100644
index 00000000000..a45eda32275
--- /dev/null
+++ b/addons/account/project/wizard/account_analytic_cost_ledger_view.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+ Account Analytic Check
+ account.analytic.cost.ledger
+ form
+
+
+
+
+
+
+ Cost Ledger
+ ir.actions.act_window
+ account.analytic.cost.ledger
+ form
+ form
+
+ new
+
+
+
+
+
+ Account Analytic Cost
+ client_print_multi
+
+ action
+ account.analytic.account
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/project/wizard/account_analytic_inverted_balance_report.py b/addons/account/project/wizard/account_analytic_inverted_balance_report.py
new file mode 100644
index 00000000000..52f7da936fe
--- /dev/null
+++ b/addons/account/project/wizard/account_analytic_inverted_balance_report.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
+
+class account_analytic_inverted_balance(osv.osv_memory):
+ _name = 'account.analytic.inverted.balance'
+ _description = 'Account Analytic Inverted Balance'
+
+ _columns = {
+ 'date1': fields.date('Start of period', required=True),
+ 'date2': fields.date('End of period', required=True),
+ }
+
+ _defaults = {
+ 'date1':time.strftime('%Y-01-01'),
+ 'date2':time.strftime('%Y-%m-%d')
+ }
+
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.analytic.account',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.account.inverted.balance',
+ 'datas': datas,
+ }
+
+account_analytic_inverted_balance()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/project/wizard/account_analytic_inverted_balance_report.xml b/addons/account/project/wizard/account_analytic_inverted_balance_report.xml
new file mode 100644
index 00000000000..e989f766d7b
--- /dev/null
+++ b/addons/account/project/wizard/account_analytic_inverted_balance_report.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+ Account Analytic Inverted Balance
+ account.analytic.inverted.balance
+ form
+
+
+
+
+
+
+ Inverted Analytic Balance
+ ir.actions.act_window
+ account.analytic.inverted.balance
+ form
+ form
+
+ new
+
+
+
+
+
+ Account Analytic Inverted Balance
+ client_print_multi
+
+ action
+ account.analytic.account
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/project/wizard/wizard_account_analytic_journal_report.py b/addons/account/project/wizard/account_analytic_journal_report.py
similarity index 52%
rename from addons/account/project/wizard/wizard_account_analytic_journal_report.py
rename to addons/account/project/wizard/account_analytic_journal_report.py
index 03be104469d..aef6a85149d 100644
--- a/addons/account/project/wizard/wizard_account_analytic_journal_report.py
+++ b/addons/account/project/wizard/account_analytic_journal_report.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,37 +15,42 @@
# 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
-import wizard
-dates_form = '''
-'''
+from osv import osv, fields
-dates_fields = {
- 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
- 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
-}
+class account_analytic_Journal_report(osv.osv_memory):
+ _name = 'account.analytic.Journal.report'
+ _description = 'Account Analytic Journal'
-class wizard_report(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'), ('report','Print')]}
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'account.analytic.journal', 'state':'end'}
+ _columns = {
+ 'date1': fields.date('Start of period', required=True),
+ 'date2': fields.date('End of period', required=True),
}
- }
-wizard_report('account.analytic.account.journal.report')
+ _defaults = {
+ 'date1':time.strftime('%Y-01-01'),
+ 'date2':time.strftime('%Y-%m-%d')
+ }
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.analytic.journal',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.journal',
+ 'datas': datas,
+ }
+account_analytic_Journal_report()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/project/wizard/account_analytic_journal_report_view.xml b/addons/account/project/wizard/account_analytic_journal_report_view.xml
new file mode 100644
index 00000000000..137920ee056
--- /dev/null
+++ b/addons/account/project/wizard/account_analytic_journal_report_view.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+ Account Analytic Journal
+ account.analytic.Journal.report
+ form
+
+
+
+
+
+
+ Analytic Journal
+ ir.actions.act_window
+ account.analytic.Journal.report
+ form
+ form
+
+ new
+
+
+
+
+
+ Account Analytic Journal
+ client_print_multi
+
+ action
+ account.analytic.journal
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/project/wizard/wizard_account_analytic_analytic_check.py b/addons/account/project/wizard/wizard_account_analytic_analytic_check.py
deleted file mode 100644
index a1bbbc50b8c..00000000000
--- a/addons/account/project/wizard/wizard_account_analytic_analytic_check.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 = '''
-'''
-
-dates_fields = {
- 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
- 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
-}
-
-class wizard_report(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'), ('report','Print')]}
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'account.analytic.account.analytic.check', 'state':'end'}
- }
- }
-wizard_report('account.analytic.account.analytic.check.report')
-
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/project/wizard/wizard_account_analytic_balance_report.py b/addons/account/project/wizard/wizard_account_analytic_balance_report.py
deleted file mode 100644
index 916a123d745..00000000000
--- a/addons/account/project/wizard/wizard_account_analytic_balance_report.py
+++ /dev/null
@@ -1,55 +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 = '''
-'''
-
-dates_fields = {
- 'date1': {'string':'Start of Period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
- 'date2': {'string':'End of Period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'empty_acc': {'string':'Empty Accounts ? ', 'type':'boolean', 'help':'Check if you want to display Accounts with 0 balance too.'},
-}
-
-
-class wizard_report(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'), ('report','Print')]}
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'account.analytic.account.balance', 'state':'end'}
- }
- }
-wizard_report('account.analytic.account.balance.report')
-
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/project/wizard/wizard_account_analytic_cost_ledger_for_journal_report.py b/addons/account/project/wizard/wizard_account_analytic_cost_ledger_for_journal_report.py
deleted file mode 100644
index feafab05a47..00000000000
--- a/addons/account/project/wizard/wizard_account_analytic_cost_ledger_for_journal_report.py
+++ /dev/null
@@ -1,68 +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
-
-_form = '''
-'''
-
-_fields = {
- 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
- 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'journal': {'string':'Journals','type':'many2many', 'relation':'account.analytic.journal'},
-}
-
-
-class wizard_report(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {
- 'type': 'form',
- 'arch': _form,
- 'fields': _fields,
- 'state': [
- ('end','Cancel'),
- ('report','Print')
- ]
- }
- },
- 'report': {
- 'actions': [],
- 'result': {
- 'type': 'print',
- 'report': 'account.analytic.account.quantity_cost_ledger',
- 'state': 'end'
- }
- },
- }
-
-wizard_report('account.analytic.account.quantity_cost_ledger.report')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/project/wizard/wizard_analytic_account_chart.py b/addons/account/project/wizard/wizard_analytic_account_chart.py
deleted file mode 100644
index e011fad15bb..00000000000
--- a/addons/account/project/wizard/wizard_analytic_account_chart.py
+++ /dev/null
@@ -1,78 +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
-
-class wizard_analytic_account_chart(wizard.interface):
- _account_chart_arch = '''
- '''
-
- _account_chart_fields = {
- 'from_date': {
- 'string': 'From',
- 'type': 'date',
- },
- 'to_date': {
- 'string': 'To',
- 'type': 'date',
- },
- }
-
-
- def _analytic_account_chart_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_account_analytic_account_tree2')
- id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
- result = act_obj.read(cr, uid, [id], context=context)[0]
-
- result_context = {}
- if data['form']['from_date']:
- result_context.update({'from_date' : data['form']['from_date']})
- if data['form']['to_date']:
- result_context.update({'to_date' : data['form']['to_date']})
-
- result['context'] = str(result_context)
- return result
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':_account_chart_arch, 'fields':_account_chart_fields, 'state': [('end', 'Cancel', 'gtk-cancel'), ('open', 'Open Charts', 'gtk-ok')]}
- },
- 'open': {
- 'actions': [],
- 'result': {'type': 'action', 'action':_analytic_account_chart_open_window, 'state':'end'}
- }
- }
-wizard_analytic_account_chart('account.analytic.account.chart')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py
index 558ebc68380..e4731e2c994 100644
--- a/addons/account/report/account_balance.py
+++ b/addons/account/report/account_balance.py
@@ -29,7 +29,6 @@ from report import report_sxw
class account_balance(report_sxw.rml_parse):
_name = 'report.account.account.balance'
def __init__(self, cr, uid, name, context):
- print " KKKKKKKKKKKKKKKKKKKKKKKK"
super(account_balance, self).__init__(cr, uid, name, context=context)
self.sum_debit = 0.00
self.sum_credit = 0.00
diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py
index 91fb10e5205..39971f5c11a 100644
--- a/addons/account/wizard/__init__.py
+++ b/addons/account/wizard/__init__.py
@@ -19,10 +19,10 @@
#
##############################################################################
-import wizard_automatic_reconcile
+import account_automatic_reconcile
import account_move_line_reconcile_select
import account_move_line_unreconcile_select
-import wizard_reconcile
+import account_reconcile
import account_unreconcile
import account_invoice_refund
import account_pay_invoice
diff --git a/addons/account/wizard/account_aged_trial_balance.py b/addons/account/wizard/account_aged_trial_balance.py
index bdcb8af735a..dee5e20e086 100644
--- a/addons/account/wizard/account_aged_trial_balance.py
+++ b/addons/account/wizard/account_aged_trial_balance.py
@@ -43,7 +43,7 @@ class account_aged_trial_balance(osv.osv_memory):
'Analysis Direction', required=True),
}
- def _get_company(self, cr, uid, ids, context=None):
+ def _get_company(self, cr, uid, context=None):
user_obj = self.pool.get('res.users')
company_obj = self.pool.get('res.company')
if context is None:
@@ -55,11 +55,11 @@ class account_aged_trial_balance(osv.osv_memory):
return company_obj.search(cr, uid, [('parent_id', '=', False)])[0]
_defaults = {
- 'company_id' : _get_company,
- 'period_length' : 30,
+ 'company_id': _get_company,
+ 'period_length': 30,
'date1' : time.strftime('%Y-%m-%d'),
- 'result_selection' : 'all',
- 'direction_selection' : 'past',
+ 'result_selection': 'all',
+ 'direction_selection': 'past',
}
def calc_dates(self, cr, uid, ids, context=None):
@@ -103,4 +103,5 @@ class account_aged_trial_balance(osv.osv_memory):
}
account_aged_trial_balance()
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_automatic_reconcile.py b/addons/account/wizard/account_automatic_reconcile.py
new file mode 100644
index 00000000000..2370c6dbe13
--- /dev/null
+++ b/addons/account/wizard/account_automatic_reconcile.py
@@ -0,0 +1,243 @@
+# -*- 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 account_automatic_reconcile(osv.osv_memory):
+ _name = 'account.automatic.reconcile'
+ _description = 'Automatic Reconcile'
+
+ _columns = {
+ 'account_ids': fields.many2many('account.account', 'reconcile_account_rel', 'reconcile_id', 'account_id', 'Account to reconcile', domain = [('reconcile','=',1)], \
+ help = 'If no account is specified, the reconciliation will be made using every accounts that can be reconcilied'),
+ 'writeoff_acc_id': fields.many2one('account.account', 'Account', required=True),
+ 'journal_id': fields.many2one('account.journal', 'Journal', required=True),
+ 'period_id': fields.many2one('account.period', 'Period', required=True),
+ 'max_amount': fields.float('Maximum write-off amount'),
+ 'power': fields.selection([(p, str(p)) for p in range(2, 10)], 'Power', required=True),
+ 'date1': fields.date('Start of period', required=True),
+ 'date2': fields.date('End of period', required=True),
+ 'reconciled': fields.integer('Reconciled transactions', readonly=True),
+ 'unreconciled': fields.integer('Not reconciled transactions', readonly=True),
+ }
+
+ def _get_reconciled(self, cr, uid, context={}):
+ return context.get('reconciled', 0)
+
+ def _get_unreconciled(self, cr, uid, context={}):
+ return context.get('unreconciled', 0)
+
+ _defaults = {
+ 'date1': time.strftime('%Y-01-01'),
+ 'date2': time.strftime('%Y-%m-%d'),
+ 'reconciled': _get_reconciled,
+ 'unreconciled': _get_unreconciled,
+ }
+
+ #TODO: cleanup and comment this code... For now, it is awfulllll
+ # (way too complex, and really slow)...
+ def do_reconcile(self, cr, uid, credits, debits, max_amount, power, writeoff_acc_id, period_id, journal_id, context=None):
+ # for one value of a credit, check all debits, and combination of them
+ # depending on the power. It starts with a power of one and goes up
+ # to the max power allowed
+ move_line_obj = self.pool.get('account.move.line')
+ if context is None:
+ context = {}
+ def check2(value, move_list, power):
+ def check(value, move_list, power):
+ for i in range(len(move_list)):
+ move = move_list[i]
+ if power == 1:
+ if abs(value - move[1]) <= max_amount + 0.00001:
+ return [move[0]]
+ else:
+ del move_list[i]
+ res = check(value - move[1], move_list, power-1)
+ move_list[i:i] = [move]
+ if res:
+ res.append(move[0])
+ return res
+ return False
+
+ for p in range(1, power+1):
+ res = check(value, move_list, p)
+ if res:
+ return res
+ return False
+
+ # for a list of credit and debit and a given power, check if there
+ # are matching tuples of credit and debits, check all debits, and combination of them
+ # depending on the power. It starts with a power of one and goes up
+ # to the max power allowed
+ def check4(list1, list2, power):
+ def check3(value, list1, list2, list1power, power):
+ for i in range(len(list1)):
+ move = list1[i]
+ if list1power == 1:
+ res = check2(value + move[1], list2, power - 1)
+ if res:
+ return ([move[0]], res)
+ else:
+ del list1[i]
+ res = check3(value + move[1], list1, list2, list1power-1, power-1)
+ list1[i:i] = [move]
+ if res:
+ x, y = res
+ x.append(move[0])
+ return (x, y)
+ return False
+
+ for p in range(1, power):
+ res = check3(0, list1, list2, p, power)
+ if res:
+ return res
+ return False
+
+ def check5(list1, list2, max_power):
+ for p in range(2, max_power+1):
+ res = check4(list1, list2, p)
+ if res:
+ return res
+
+ ok = True
+ reconciled = 0
+ while credits and debits and ok:
+ res = check5(credits, debits, power)
+ if res:
+ move_line_obj.reconcile(cr, uid, res[0] + res[1], 'auto', writeoff_acc_id, period_id, journal_id, context)
+ reconciled += len(res[0]) + len(res[1])
+ credits = [(id, credit) for (id, credit) in credits if id not in res[0]]
+ debits = [(id, debit) for (id, debit) in debits if id not in res[1]]
+ else:
+ ok = False
+ return (reconciled, len(credits)+len(debits))
+
+ def reconcile(self, cr, uid, ids, context=None):
+ service = netsvc.LocalService("object_proxy")
+ move_line_obj = self.pool.get('account.move.line')
+ obj_model = self.pool.get('ir.model.data')
+ if context is None:
+ context = {}
+ form = self.read(cr, uid, ids, [])[0]
+ max_amount = form.get('max_amount', 0.0)
+ power = form['power']
+ reconciled = unreconciled = 0
+ if not form['account_ids']:
+ raise osv.except_osv(_('UserError'), _('You must select accounts to reconcile'))
+ for account_id in form['account_ids']:
+ # reconcile automatically all transactions from partners whose balance is 0
+ cr.execute(
+ "SELECT partner_id " \
+ "FROM account_move_line " \
+ "WHERE account_id=%s " \
+ "AND reconcile_id IS NULL " \
+ "AND state <> 'draft' " \
+ "GROUP BY partner_id " \
+ "HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0",
+ (account_id, max_amount or 0.0))
+ partner_ids = [id for (id,) in cr.fetchall()]
+ for partner_id in partner_ids:
+ cr.execute(
+ "SELECT id " \
+ "FROM account_move_line " \
+ "WHERE account_id=%s " \
+ "AND partner_id=%s " \
+ "AND state <> 'draft' " \
+ "AND reconcile_id IS NULL",
+ (account_id, partner_id))
+ line_ids = [id for (id,) in cr.fetchall()]
+ if len(line_ids):
+ move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
+ reconciled += len(line_ids)
+
+ # get the list of partners who have more than one unreconciled transaction
+ cr.execute(
+ "SELECT partner_id " \
+ "FROM account_move_line " \
+ "WHERE account_id=%s " \
+ "AND reconcile_id IS NULL " \
+ "AND state <> 'draft' " \
+ "AND partner_id IS NOT NULL " \
+ "GROUP BY partner_id " \
+ "HAVING count(*)>1",
+ (account_id,))
+ partner_ids = [id for (id,) in cr.fetchall()]
+ #filter?
+ for partner_id in partner_ids:
+ # get the list of unreconciled 'debit transactions' for this partner
+ cr.execute(
+ "SELECT id, debit " \
+ "FROM account_move_line " \
+ "WHERE account_id=%s " \
+ "AND partner_id=%s " \
+ "AND reconcile_id IS NULL " \
+ "AND state <> 'draft' " \
+ "AND debit > 0",
+ (account_id, partner_id))
+ debits = cr.fetchall()
+
+ # get the list of unreconciled 'credit transactions' for this partner
+ cr.execute(
+ "SELECT id, credit " \
+ "FROM account_move_line " \
+ "WHERE account_id=%s " \
+ "AND partner_id=%s " \
+ "AND reconcile_id IS NULL " \
+ "AND state <> 'draft' " \
+ "AND credit > 0",
+ (account_id, partner_id))
+ credits = cr.fetchall()
+
+ (rec, unrec) = self.do_reconcile(cr, uid, credits, debits, max_amount, power, form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
+ reconciled += rec
+ unreconciled += unrec
+
+ # add the number of transactions for partners who have only one
+ # unreconciled transactions to the unreconciled count
+ partner_filter = partner_ids and 'AND partner_id not in (%s)' % ','.join(map(str, filter(None, partner_ids))) or ''
+ cr.execute(
+ "SELECT count(*) " \
+ "FROM account_move_line " \
+ "WHERE account_id=%s " \
+ "AND reconcile_id IS NULL " \
+ "AND state <> 'draft' " + partner_filter,
+ (account_id,))
+ additional_unrec = cr.fetchone()[0]
+ context.update({'reconciled': reconciled, 'unreconciled': unreconciled + additional_unrec})
+ model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','account_automatic_reconcile_view1')])
+ resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'])[0]['res_id']
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'account.automatic.reconcile',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ 'context': context,
+ 'nodestroy':True,
+ }
+
+account_automatic_reconcile()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/wizard/account_automatic_reconcile_view.xml b/addons/account/wizard/account_automatic_reconcile_view.xml
new file mode 100644
index 00000000000..9711fc9b941
--- /dev/null
+++ b/addons/account/wizard/account_automatic_reconcile_view.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+ Account Automatic Reconcile
+ account.automatic.reconcile
+ form
+
+
+
+
+
+
+ Account Automatic Reconcile
+ account.automatic.reconcile
+ ir.actions.act_window
+ form
+ tree,form
+
+ {'record_id':active_id}
+ new
+
+
+
+
+
+ Automatic reconcile unreconcile
+ account.automatic.reconcile
+ form
+
+
+
+
+
+
+
+
diff --git a/addons/account/wizard/account_balance_report.py b/addons/account/wizard/account_balance_report.py
index 2873f479629..b131ff3123a 100644
--- a/addons/account/wizard/account_balance_report.py
+++ b/addons/account/wizard/account_balance_report.py
@@ -50,7 +50,7 @@ class account_balance_report(osv.osv_memory):
'date_to': fields.date('End date', required=True),
}
- def _get_company(self, cr, uid, ids, context=None):
+ def _get_company(self, cr, uid, 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)
@@ -109,6 +109,7 @@ class account_balance_report(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.account.balance',
'datas': data,
+ 'nodestroy':True,
}
def _check_date(self, cr, uid, data, context=None):
@@ -127,6 +128,7 @@ class account_balance_report(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.account.balance',
'datas': data,
+ 'nodestroy':True,
}
else:
raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year'))
diff --git a/addons/account/wizard/account_central_journal.py b/addons/account/wizard/account_central_journal.py
index 08fe881c81a..b1a0f3c2849 100644
--- a/addons/account/wizard/account_central_journal.py
+++ b/addons/account/wizard/account_central_journal.py
@@ -18,7 +18,6 @@
# along with this program. If not, see .
#
##############################################################################
-
from osv import osv, fields
from tools.translate import _
@@ -40,7 +39,7 @@ class account_central_journal(osv.osv_memory):
period_id = datas['form']['period_id']
journal_id = datas['form']['journal_id']
- if type(period_id)==type([]):
+ if isinstance(period_id, list):
ids_final = []
for journal in journal_id:
for period in period_id:
@@ -53,10 +52,9 @@ class account_central_journal(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.central.journal',
'datas': datas,
+ 'nodestroy':True,
}
account_central_journal()
-#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_change_currency.py b/addons/account/wizard/account_change_currency.py
index 707a182a2aa..1e23b793d27 100644
--- a/addons/account/wizard/account_change_currency.py
+++ b/addons/account/wizard/account_change_currency.py
@@ -71,4 +71,4 @@ class account_change_currency(osv.osv_memory):
account_change_currency()
-# 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_chart.py b/addons/account/wizard/account_chart.py
index 38f47114490..ba94bbfb37c 100644
--- a/addons/account/wizard/account_chart.py
+++ b/addons/account/wizard/account_chart.py
@@ -18,7 +18,6 @@
# along with this program. If not, see .
#
##############################################################################
-
from osv import fields, osv
from tools.translate import _
@@ -30,44 +29,42 @@ class account_chart(osv.osv_memory):
_description = "chart"
_columns = {
'fiscalyear': fields.many2one('account.fiscalyear', \
- 'Fiscal year', \
- help = 'Keep empty for all open fiscal years'),
- 'target_move': fields.selection([
- ('all', 'All Entries'),
- ('posted', 'All Posted Entries'),
- ], 'Target Moves', required = True),
-
+ 'Fiscal year', \
+ help = 'Keep empty for all open fiscal years'),
+ 'target_move': fields.selection([('all', 'All Entries'),
+ ('posted', 'All Posted Entries')], 'Target Moves', required = True),
}
- def _get_defaults(self, cr, uid, context={}):
- """Return default Fiscalyear value"""
- fiscalyear_obj = self.pool.get('account.fiscalyear')
- fiscalyear = fiscalyear_obj.find(cr, uid)
- return fiscalyear
+
+ def _get_fiscalyear(self, cr, uid, context=None):
+ """Return default Fiscalyear value"""
+ fiscalyear_obj = self.pool.get('account.fiscalyear')
+ fiscalyear = fiscalyear_obj.find(cr, uid)
+ return fiscalyear
def account_chart_open_window(self, cr, uid, ids, context={}):
- """
- Opens chart of Accounts
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of account chart’s IDs
- @return: dictionary of Open account chart window on given fiscalyear and all Entries or posted entries
- """
- mod_obj = self.pool.get('ir.model.data')
- act_obj = self.pool.get('ir.actions.act_window')
- for data in self.read(cr, uid, ids,context=context):
- result = mod_obj._get_id(cr, uid, 'account', 'action_account_tree')
- id = mod_obj.read(cr, uid, [result], ['res_id'],context=context)[0]['res_id']
- result = act_obj.read(cr, uid, [id], context=context)[0]
- result['context'] = str({'fiscalyear': data['fiscalyear'], \
- 'state': data['target_move']})
- if data['fiscalyear']:
- result['name'] += ':' + self.pool.get('account.fiscalyear').read(cr, uid, [data['fiscalyear']],context=context)[0]['code']
- return result
-
+ """
+ Opens chart of Accounts
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: List of account chart’s IDs
+ @return: dictionary of Open account chart window on given fiscalyear and all Entries or posted entries
+ """
+ mod_obj = self.pool.get('ir.model.data')
+ act_obj = self.pool.get('ir.actions.act_window')
+ data = self.read(cr, uid, ids, [], context=context)[0]
+ result = mod_obj._get_id(cr, uid, 'account', 'action_account_tree')
+ id = mod_obj.read(cr, uid, [result], ['res_id'],context=context)[0]['res_id']
+ result = act_obj.read(cr, uid, [id], context=context)[0]
+ result['context'] = str({'fiscalyear': data['fiscalyear'], \
+ 'state': data['target_move']})
+ if data['fiscalyear']:
+ result['name'] += ':' + self.pool.get('account.fiscalyear').read(cr, uid, [data['fiscalyear']],context=context)[0]['code']
+ return result
_defaults = {
- 'fiscalyear': _get_defaults,
- 'target_move': lambda * a: 'all'
+ 'fiscalyear': _get_fiscalyear,
+ 'target_move': 'all'
}
account_chart()
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_compare_account_balance_report.py b/addons/account/wizard/account_compare_account_balance_report.py
index fd1d4d55ada..af844854271 100644
--- a/addons/account/wizard/account_compare_account_balance_report.py
+++ b/addons/account/wizard/account_compare_account_balance_report.py
@@ -74,12 +74,14 @@ class account_compare_account_balance_report(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.account.balance.landscape',
'datas': data,
+ 'nodestroy':True,
}
else:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.balance.account.balance',
'datas': data,
+ 'nodestroy':True,
}
if data['form']['format_perc']==1:
if len(data['form']['fiscalyear'])<=2:
@@ -88,12 +90,14 @@ class account_compare_account_balance_report(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.account.balance.landscape',
'datas': data,
+ 'nodestroy':True,
}
else:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.balance.account.balance',
'datas': data,
+ 'nodestroy':True,
}
else:
if len(data['form']['fiscalyear'])==3:
@@ -102,6 +106,7 @@ class account_compare_account_balance_report(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.account.balance.landscape',
'datas': data,
+ 'nodestroy':True,
}
else:
raise osv.except_osv(_('Warning !'), _('You might have done following mistakes. Please correct them and try again. \n 1. You have selected more than 3 years in any case. \n 2. You have not selected Percentage option, but you have selected more than 2 years. \n You can select maximum 3 years. Please check again. \n 3. You have selected Percentage option with more than 2 years, but you have not selected landscape format. You have to select Landscape option. Please Check it.'))
@@ -114,6 +119,7 @@ class account_compare_account_balance_report(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.account.balance.landscape',
'datas': data,
+ 'nodestroy':True,
}
else:
raise osv.except_osv(_('Warning !'), _('You might have done following mistakes. Please correct them and try again. \n 1. You have selected more than 3 years in any case. \n 2. You have not selected Percentage option, but you have selected more than 2 years. \n You can select maximum 3 years. Please check again. \n 3. You have selected Percentage option with more than 2 years, but you have not selected landscape format. You have to select Landscape option. Please Check it.'))
@@ -123,14 +129,15 @@ class account_compare_account_balance_report(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.account.balance.landscape',
'datas': data,
+ 'nodestroy':True,
}
else:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.balance.account.balance',
'datas': data,
+ 'nodestroy':True,
}
account_compare_account_balance_report()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/wizard/account_compare_account_balance_report_view.xml b/addons/account/wizard/account_compare_account_balance_report_view.xml
index e153d11bfaa..2467928a584 100644
--- a/addons/account/wizard/account_compare_account_balance_report_view.xml
+++ b/addons/account/wizard/account_compare_account_balance_report_view.xml
@@ -44,7 +44,7 @@
src_model="account.account"
view_mode="form"
target="new"
- key2="client_action_multi"
+ key2="client_print_multi"
id="action_view_account_compare_account_balance_report"/>
diff --git a/addons/account/wizard/account_fiscalyear_close_state.py b/addons/account/wizard/account_fiscalyear_close_state.py
index eeb202a0c82..f42857eb13c 100644
--- a/addons/account/wizard/account_fiscalyear_close_state.py
+++ b/addons/account/wizard/account_fiscalyear_close_state.py
@@ -35,7 +35,7 @@ class account_fiscalyear_close_state(osv.osv_memory):
'sure': fields.boolean('Check this box', required=False)
}
- def data_save(self, cr, uid, ids, context={}):
+ def data_save(self, cr, uid, ids, context=None):
"""
This function close account fiscalyear
@param cr: the current row, from the database cursor,
diff --git a/addons/account/wizard/account_general_journal.py b/addons/account/wizard/account_general_journal.py
index 56ad7375acf..8bd2913ae62 100644
--- a/addons/account/wizard/account_general_journal.py
+++ b/addons/account/wizard/account_general_journal.py
@@ -18,7 +18,6 @@
# along with this program. If not, see .
#
##############################################################################
-
from osv import osv, fields
from tools.translate import _
@@ -31,7 +30,7 @@ class account_general_journal(osv.osv_memory):
'period_id': fields.many2many('account.period', 'account_period_rel', 'account_id', 'period_id', 'Periods', required=True),
}
- def check_data(self, cr, uid, ids, context={}):
+ def check_data(self, cr, uid, ids, context=None):
obj_jperiod = self.pool.get('account.journal.period')
datas = {}
datas['ids'] = []
@@ -53,8 +52,8 @@ class account_general_journal(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.general.journal',
'datas': datas,
+ 'nodestroy':True,
}
account_general_journal()
-
-#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_general_ledger_report.py b/addons/account/wizard/account_general_ledger_report.py
index 6292709e29d..9809f4aad89 100644
--- a/addons/account/wizard/account_general_ledger_report.py
+++ b/addons/account/wizard/account_general_ledger_report.py
@@ -50,7 +50,7 @@ class account_general_ledger_report(osv.osv_memory):
'date_to': fields.date("End date", required=True)
}
- def _get_company(self, cr, uid, ids, context=None):
+ def _get_company(self, cr, uid, context=None):
user_obj = self.pool.get('res.users')
company_obj = self.pool.get('res.company')
if context is None:
@@ -63,8 +63,8 @@ class account_general_ledger_report(osv.osv_memory):
_defaults = {
'state' : 'none',
- 'date_from' : lambda *a: time.strftime('%Y-01-01'),
- 'date_to' : lambda *a: time.strftime('%Y-%m-%d'),
+ 'date_from' : time.strftime('%Y-01-01'),
+ 'date_to' : time.strftime('%Y-%m-%d'),
'company_id' : _get_company,
'display_account' : 'bal_all',
'sortbydate' : 'sort_date',
@@ -107,12 +107,14 @@ class account_general_ledger_report(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.general.ledger_landscape',
'datas': data,
+ 'nodestroy':True,
}
else:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.general.ledger',
'datas': data,
+ 'nodestroy':True,
}
else:
raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year'))
@@ -139,12 +141,14 @@ class account_general_ledger_report(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.general.ledger_landscape',
'datas': data,
+ 'nodestroy':True,
}
else:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.general.ledger',
'datas': data,
+ 'nodestroy':True,
}
account_general_ledger_report()
diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py
index 1942fd56e60..f7e9d79b27a 100644
--- a/addons/account/wizard/account_invoice_refund.py
+++ b/addons/account/wizard/account_invoice_refund.py
@@ -34,7 +34,7 @@ class account_invoice_refund(osv.osv_memory):
'description': fields.char('Description', size=150, required=True),
}
- def compute_refund(self, cr, uid, ids, mode, context={}):
+ def compute_refund(self, cr, uid, ids, mode, context=None):
"""
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@@ -46,7 +46,11 @@ class account_invoice_refund(osv.osv_memory):
account_m_line_obj = self.pool.get('account.move.line')
mod_obj = self.pool.get('ir.model.data')
act_obj = self.pool.get('ir.actions.act_window')
- for form in self.read(cr, uid, ids,context=context):
+
+ if context is None:
+ context = {}
+
+ for form in self.read(cr, uid, ids, context=context):
created_inv = []
date = False
period = False
@@ -171,7 +175,6 @@ class account_invoice_refund(osv.osv_memory):
id = mod_obj.read(cr, uid, result, ['res_id'],context=context)['res_id']
result = act_obj.read(cr, uid, id,context=context)
result['res_id'] = created_inv
-
return result
def invoice_refund(self, cr, uid, ids, context={}):
diff --git a/addons/account/wizard/account_move_bank_reconcile.py b/addons/account/wizard/account_move_bank_reconcile.py
index e2329bf09d9..c339ed18831 100644
--- a/addons/account/wizard/account_move_bank_reconcile.py
+++ b/addons/account/wizard/account_move_bank_reconcile.py
@@ -34,29 +34,29 @@ class account_move_bank_reconcile(osv.osv_memory):
}
def action_open_window(self, cr, uid, ids, context={}):
- """
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: account move bank reconcile’s ID or list of IDs
- @return: dictionary of Open account move line on given journal_id.
- """
- for data in self.read(cr, uid, ids,context=context):
- cr.execute('select default_credit_account_id \
- from account_journal where id=%s', (data['journal_id'],))
- account_id = cr.fetchone()[0]
- if not account_id:
- raise osv.except_osv(_('Error'), _('You have to define \
+ """
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: account move bank reconcile’s ID or list of IDs
+ @return: dictionary of Open account move line on given journal_id.
+ """
+ data = self.read(cr, uid, ids,context=context)[0]
+ cr.execute('select default_credit_account_id \
+ from account_journal where id=%s', (data['journal_id'],))
+ account_id = cr.fetchone()[0]
+ if not account_id:
+ raise osv.except_osv(_('Error'), _('You have to define \
the bank account\nin the journal definition for reconciliation.'))
- return {
- 'domain': "[('journal_id','=',%d), ('account_id','=',%d), ('state','<>','draft')]" % (data['journal_id'], account_id),
- 'name': _('Standard Encoding'),
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'account.move.line',
- 'view_id': False,
- 'context': "{'journal_id': %d}" % (data['journal_id'],),
- 'type': 'ir.actions.act_window'
- }
+ return {
+ 'domain': "[('journal_id','=',%d), ('account_id','=',%d), ('state','<>','draft')]" % (data['journal_id'], account_id),
+ 'name': _('Standard Encoding'),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'account.move.line',
+ 'view_id': False,
+ 'context': "{'journal_id': %d}" % (data['journal_id'],),
+ 'type': 'ir.actions.act_window'
+ }
account_move_bank_reconcile()
diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py
index df6e41da566..142ade01737 100644
--- a/addons/account/wizard/account_move_journal.py
+++ b/addons/account/wizard/account_move_journal.py
@@ -26,13 +26,11 @@ import tools
class account_move_journal(osv.osv_memory):
_name = "account.move.journal"
_description = "Move journal"
-
_columns = {
'journal_id': fields.many2one('account.journal', 'Journal', required=True),
'period_id': fields.many2one('account.period', 'Period', required=True),
}
-
def _get_period(self, cr, uid, context={}):
"""Return default account period value"""
ids = self.pool.get('account.period').find(cr, uid, context=context)
@@ -41,7 +39,11 @@ class account_move_journal(osv.osv_memory):
period_id = ids[0]
return period_id
- def action_open_window(self, cr, uid, ids, context={}):
+ _defaults = {
+ 'period_id': _get_period
+ }
+
+ def action_open_window(self, cr, uid, ids, context=None):
"""
This function Open action move line window on given period and Journal/Payment Mode
@param cr: the current row, from the database cursor,
@@ -52,46 +54,43 @@ class account_move_journal(osv.osv_memory):
"""
jp = self.pool.get('account.journal.period')
mod_obj = self.pool.get('ir.model.data')
- for data in self.read(cr, uid, ids, ['journal_id', 'period_id'],context=context):
- cr.execute('select id,name from ir_ui_view where model=%s and type=%s', ('account.move.line', 'form'))
- view_res = cr.fetchone()
- journal_id = data['journal_id']
- period_id = data['period_id']
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, ['journal_id', 'period_id'], context=context)[0]
+ cr.execute('select id,name from ir_ui_view where model=%s and type=%s', ('account.move.line', 'form'))
+ view_res = cr.fetchone()
+ journal_id = data['journal_id']
+ period_id = data['period_id']
- ids = jp.search(cr, uid, [('journal_id', '=', journal_id), \
- ('period_id', '=', period_id)],context=context)
+ ids = jp.search(cr, uid, [('journal_id', '=', journal_id), \
+ ('period_id', '=', period_id)],context=context)
- if not len(ids):
- name = self.pool.get('account.journal').read(cr, uid, [journal_id])[0]['name']
- state = self.pool.get('account.period').read(cr, uid, [period_id])[0]['state']
- if state == 'done':
- raise osv.except_osv(_('UserError'), _('This period is already closed !'))
- company = self.pool.get('account.period').read(cr, uid, [period_id])[0]['company_id'][0]
- jp.create(cr, uid, {'name': name, 'period_id': period_id, 'journal_id': journal_id, 'company_id': company},context=context)
+ if not len(ids):
+ name = self.pool.get('account.journal').read(cr, uid, [journal_id])[0]['name']
+ state = self.pool.get('account.period').read(cr, uid, [period_id])[0]['state']
+ if state == 'done':
+ raise osv.except_osv(_('UserError'), _('This period is already closed !'))
+ company = self.pool.get('account.period').read(cr, uid, [period_id])[0]['company_id'][0]
+ jp.create(cr, uid, {'name': name, 'period_id': period_id, 'journal_id': journal_id, 'company_id': company},context=context)
- ids = jp.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)],context=context)
- jp = jp.browse(cr, uid, ids, context=context)[0]
- name = (jp.journal_id.code or '') + ':' + (jp.period_id.code or '')
+ ids = jp.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)],context=context)
+ jp = jp.browse(cr, uid, ids, context=context)[0]
+ name = (jp.journal_id.code or '') + ':' + (jp.period_id.code or '')
- result = mod_obj._get_id(cr, uid, 'account', 'view_account_move_line_filter')
- res = mod_obj.read(cr, uid, result, ['res_id'],context=context)
+ result = mod_obj._get_id(cr, uid, 'account', 'view_account_move_line_filter')
+ res = mod_obj.read(cr, uid, result, ['res_id'],context=context)
- return {
- 'domain': "[('journal_id','=',%d), ('period_id','=',%d)]" % (journal_id, period_id),
- 'name': name,
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'account.move.line',
- 'view_id': view_res,
- 'context': "{'journal_id': %d, 'period_id': %d}" % (journal_id, period_id),
- 'type': 'ir.actions.act_window',
- 'search_view_id': res['res_id']
- }
-
-
- _defaults = {
- 'period_id': _get_period
- }
+ return {
+ 'domain': "[('journal_id','=',%d), ('period_id','=',%d)]" % (journal_id, period_id),
+ 'name': name,
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'account.move.line',
+ 'view_id': view_res,
+ 'context': "{'journal_id': %d, 'period_id': %d}" % (journal_id, period_id),
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': res['res_id']
+ }
account_move_journal()
diff --git a/addons/account/wizard/account_move_line_select.py b/addons/account/wizard/account_move_line_select.py
index 474018e2fde..8b3388f7f96 100644
--- a/addons/account/wizard/account_move_line_select.py
+++ b/addons/account/wizard/account_move_line_select.py
@@ -71,5 +71,4 @@ class account_move_line_select(osv.osv_memory):
account_move_line_select()
-# 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_move_line_unreconcile_select.py b/addons/account/wizard/account_move_line_unreconcile_select.py
index 1c44e8548bd..35d442001c7 100644
--- a/addons/account/wizard/account_move_line_unreconcile_select.py
+++ b/addons/account/wizard/account_move_line_unreconcile_select.py
@@ -23,15 +23,12 @@ from osv import fields, osv
from tools.translate import _
import tools
-
class account_move_line_unreconcile_select(osv.osv_memory):
-
_name = "account.move.line.unreconcile.select"
_description = "Unreconciliation"
_columns ={
'account_id': fields.many2one('account.account','Account',required=True),
}
-
def action_open_window(self, cr, uid, ids, context={}):
data = self.read(cr, uid, ids, context=context)[0]
return {
@@ -46,6 +43,4 @@ class account_move_line_unreconcile_select(osv.osv_memory):
account_move_line_unreconcile_select()
-
-# 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_open_closed_fiscalyear.py b/addons/account/wizard/account_open_closed_fiscalyear.py
index b4f0f12b4b8..552e630125d 100644
--- a/addons/account/wizard/account_open_closed_fiscalyear.py
+++ b/addons/account/wizard/account_open_closed_fiscalyear.py
@@ -18,12 +18,10 @@
# 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 = {
diff --git a/addons/account/wizard/account_partner_balance_report.py b/addons/account/wizard/account_partner_balance_report.py
index b1b283feef6..0c330ed6d1e 100644
--- a/addons/account/wizard/account_partner_balance_report.py
+++ b/addons/account/wizard/account_partner_balance_report.py
@@ -18,7 +18,6 @@
# along with this program. If not, see .
#
##############################################################################
-
import time
from tools.translate import _
@@ -48,7 +47,7 @@ class account_partner_balance(osv.osv_memory):
'date2': fields.date('End date', required=True),
}
- def _get_company(self, cr, uid, ids, context=None):
+ def _get_company(self, cr, uid, 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)
@@ -58,13 +57,13 @@ class account_partner_balance(osv.osv_memory):
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,
+ 'state' : 'none',
+ 'date1' : time.strftime('%Y-01-01'),
+ 'date2' : time.strftime('%Y-%m-%d'),
+ 'result_selection' : 'all',
+ 'soldeinit' : True,
+ 'company_id' : _get_company,
+ 'fiscalyear' : False,
}
def check_state(self, cr, uid, ids, context=None):
@@ -84,6 +83,7 @@ class account_partner_balance(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.partner.balance',
'datas': data,
+ 'nodestroy':True,
}
def _check_date(self, cr, uid, data, context):
@@ -99,6 +99,7 @@ class account_partner_balance(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.partner.balance',
'datas': data,
+ 'nodestroy':True,
}
else:
raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year'))
diff --git a/addons/account/wizard/account_period_close.py b/addons/account/wizard/account_period_close.py
index 6e71b079dc0..f0f050e953c 100644
--- a/addons/account/wizard/account_period_close.py
+++ b/addons/account/wizard/account_period_close.py
@@ -32,7 +32,7 @@ class account_period_close(osv.osv_memory):
'sure': fields.boolean('Check this box'),
}
- def data_save(self, cr, uid, ids, context={}):
+ def data_save(self, cr, uid, ids, context=None):
"""
This function close period
@param cr: the current row, from the database cursor,
@@ -41,7 +41,7 @@ class account_period_close(osv.osv_memory):
"""
mode = 'done'
- for form in self.read(cr, uid, ids,context=context):
+ for form in self.read(cr, uid, ids, context=context):
if form['sure']:
for id in context['active_ids']:
cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id))
diff --git a/addons/account/wizard/account_print_journal.py b/addons/account/wizard/account_print_journal.py
index 89de9a643f9..f40efe3eb99 100644
--- a/addons/account/wizard/account_print_journal.py
+++ b/addons/account/wizard/account_print_journal.py
@@ -34,10 +34,10 @@ class account_print_journal(osv.osv_memory):
}
_defaults = {
- 'sort_selection': lambda *a: 'date',
- }
+ 'sort_selection': lambda *a: 'date',
+ }
- def check_data(self, cr, uid, ids, context={}):
+ def check_data(self, cr, uid, ids, context=None):
obj_jperiod = self.pool.get('account.journal.period')
datas = {}
datas['ids'] = []
@@ -59,8 +59,9 @@ class account_print_journal(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.journal.period.print',
'datas': datas,
+ 'nodestroy':True,
}
account_print_journal()
-#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_reconcile.py b/addons/account/wizard/account_reconcile.py
new file mode 100644
index 00000000000..1f745419c5a
--- /dev/null
+++ b/addons/account/wizard/account_reconcile.py
@@ -0,0 +1,207 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+import time
+import datetime
+
+from osv import fields, osv
+from tools.translate import _
+
+class account_move_line_reconcile_prompt(osv.osv_memory):
+ """
+ Asks user he wants to reconcile entries or not.
+ """
+ _name = 'account.move.line.reconcile.prompt'
+ _description = 'Account move line reconcile'
+ _columns = {
+ }
+
+ def ask_reconcilation(self, cr, uid, ids, context):
+ return self.pool.get('account.move.line.reconcile').partial_check(cr, uid, ids, context)
+
+account_move_line_reconcile_prompt()
+
+class account_move_line_reconcile(osv.osv_memory):
+ """
+ Account move line reconcile wizard, it checks for the write off the reconcile entry or directly reconcile.
+ """
+ _name = 'account.move.line.reconcile'
+ _description = 'Account move line reconcile'
+ _columns = {
+ 'trans_nbr': fields.integer('# of Transaction', readonly=True),
+ 'credit': fields.float('Credit amount',readonly=True),
+ 'debit': fields.float('Debit amount',readonly=True),
+ 'writeoff': fields.float('Write-Off amount',readonly=True),
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+ res = super(account_move_line_reconcile, self).default_get(cr, uid, fields, context=context)
+ data = self.trans_rec_get(cr, uid, context['active_ids'], context)
+ if 'trans_nbr' in fields:
+ res.update({'trans_nbr':data['trans_nbr']})
+ if 'credit' in fields:
+ res.update({'trans_nbr':data['credit']})
+ if 'debit' in fields:
+ res.update({'trans_nbr':data['debit']})
+ if 'writeoff' in fields:
+ res.update({'trans_nbr':data['writeoff']})
+ return res
+
+ def partial_check(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ data = self.trans_rec_get(cr, uid, ids, context)
+ if context is None:
+ context = {}
+ if data['writeoff'] == 0:
+ model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_account_move_line_reconcile_full')], context=context)
+ resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+ return {
+ 'name': _('Reconcile'),
+ 'context': context,
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'account.move.line.reconcile',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ }
+ else :
+ model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_account_move_line_reconcile_partial')], context=context)
+ resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+ return {
+ 'name': _('Reconcile'),
+ 'context': context,
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'account.move.line.reconcile',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ }
+
+ def trans_rec_get(self, cr, uid, ids, context=None):
+ account_move_line_obj = self.pool.get('account.move.line')
+ if context is None:
+ context = {}
+ credit = debit = 0
+ account_id = False
+ count = 0
+ for line in account_move_line_obj.browse(cr, uid, context['active_ids'], context=context):
+ if not line.reconcile_id and not line.reconcile_id.id:
+ count += 1
+ credit += line.credit
+ debit += line.debit
+ account_id = line.account_id.id
+ return {'trans_nbr': count, 'account_id': account_id, 'credit': credit, 'debit': debit, 'writeoff': debit - credit}
+
+ def trans_rec_addendum_writeoff(self, cr, uid, ids, context=None):
+ return self.pool.get('account.move.line.reconcile.writeoff').trans_rec_addendum(cr, uid, ids, context)
+
+ def trans_rec_reconcile_partial_reconcile(self, cr, uid, ids, context=None):
+ return self.pool.get('account.move.line.reconcile.writeoff').trans_rec_reconcile_partial(cr, uid, ids, context)
+
+ def trans_rec_reconcile_full(self, cr, uid, ids, context=None):
+ account_move_line_obj = self.pool.get('account.move.line')
+ date = False
+ period_id = False
+ journal_id= False
+ account_id = False
+
+ if context is None:
+ context = {}
+
+ data = self.read(cr, uid, ids, context=context)
+ date = time.strftime('%Y-%m-%d')
+ ids = self.pool.get('account.period').find(cr, uid, dt=date, context=context)
+ if len(ids):
+ period_id = ids[0]
+ account_move_line_obj.reconcile(cr, uid, context['active_ids'], 'manual', account_id,
+ period_id, journal_id, context=context)
+ return {}
+
+account_move_line_reconcile()
+
+class account_move_line_reconcile_writeoff(osv.osv_memory):
+ """
+ It opens the write off wizard form, in that user can define the journal, account, analytic account for reconcile
+ """
+ _name = 'account.move.line.reconcile.writeoff'
+ _description = 'Account move line reconcile'
+ _columns = {
+ 'journal_id': fields.many2one('account.journal','Write-Off Journal', required=True),
+ 'writeoff_acc_id': fields.many2one('account.account','Write-Off account', required=True),
+ 'date_p': fields.date('Date'),
+ 'comment': fields.char('Comment', size= 64, required=True),
+ 'analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'),
+ }
+ _defaults = {
+ 'date_p': time.strftime('%Y-%m-%d'),
+ 'comment': 'Write-off',
+ }
+
+ def trans_rec_addendum(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ if context is None:
+ context = {}
+ model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','account_move_line_reconcile_writeoff')], context=context)
+ resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+ return {
+ 'name': _('Reconcile Writeoff'),
+ 'context': context,
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'account.move.line.reconcile.writeoff',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ }
+
+ def trans_rec_reconcile_partial(self, cr, uid, ids, context=None):
+ account_move_line_obj = self.pool.get('account.move.line')
+ if context is None:
+ context = {}
+ account_move_line_obj.reconcile_partial(cr, uid, context['active_ids'], 'manual', context=context)
+ return {}
+
+ def trans_rec_reconcile(self, cr, uid, ids, context=None):
+ account_move_line_obj = self.pool.get('account.move.line')
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids,context=context)[0]
+ account_id = data['writeoff_acc_id']
+ context['date_p'] = data['date_p']
+ journal_id = data['journal_id']
+ context['comment'] = data['comment']
+ if data['analytic_id']:
+ context['analytic_id'] = data['analytic_id']
+ if context['date_p']:
+ date = context['date_p']
+
+ ids = self.pool.get('account.period').find(cr, uid, dt=date, context=context)
+ if len(ids):
+ period_id = ids[0]
+
+ account_move_line_obj.reconcile(cr, uid, context['active_ids'], 'manual', account_id,
+ period_id, journal_id, context=context)
+ return {}
+
+account_move_line_reconcile_writeoff()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/wizard/account_reconcile_view.xml b/addons/account/wizard/account_reconcile_view.xml
new file mode 100644
index 00000000000..0f92376e045
--- /dev/null
+++ b/addons/account/wizard/account_reconcile_view.xml
@@ -0,0 +1,108 @@
+
+
+
+
+
+ account.move.line.reconcile.prompt.form
+ account.move.line.reconcile.prompt
+ form
+
+
+
+
+
+
+ Reconcile Entries
+ account.move.line.reconcile.prompt
+ form
+ tree,form
+
+ new
+
+
+
+
+
+ Reconcile Entries
+ client_action_multi
+
+ action
+ account.move.line
+
+
+
+ account.move.line.reconcile.full.form
+ account.move.line.reconcile
+ form
+
+
+
+
+
+
+ account.move.line.reconcile.partial.form
+ account.move.line.reconcile
+ form
+
+
+
+
+
+
+ account.move.line.reconcile.writeoff.form
+ account.move.line.reconcile.writeoff
+ form
+
+
+
+
+
+
diff --git a/addons/account/wizard/account_third_party_ledger.py b/addons/account/wizard/account_third_party_ledger.py
index a40c469a184..7a6514e17c2 100644
--- a/addons/account/wizard/account_third_party_ledger.py
+++ b/addons/account/wizard/account_third_party_ledger.py
@@ -49,7 +49,7 @@ class account_partner_ledger(osv.osv_memory):
'date2': fields.date('End date', required=True),
}
- def _get_company(self, cr, uid, ids, context=None):
+ def _get_company(self, cr, uid, context=None):
user_obj = self.pool.get('res.users')
company_obj = self.pool.get('res.company')
if context is None:
@@ -97,12 +97,14 @@ class account_partner_ledger(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.third_party_ledger',
'datas': data,
+ 'nodestroy':True,
}
else:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.third_party_ledger_other',
'datas': data,
+ 'nodestroy':True,
}
def _check_date(self, cr, uid, data, context=None):
@@ -120,6 +122,7 @@ class account_partner_ledger(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.third_party_ledger',
'datas': data,
+ 'nodestroy':True,
}
else:
raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year'))
diff --git a/addons/account/wizard/account_use_model_view.xml b/addons/account/wizard/account_use_model_view.xml
index 877a83dbb00..fec632c2e59 100644
--- a/addons/account/wizard/account_use_model_view.xml
+++ b/addons/account/wizard/account_use_model_view.xml
@@ -12,7 +12,6 @@
-
@@ -53,7 +52,7 @@
-
+
@@ -69,7 +68,7 @@
-
+
diff --git a/addons/account/wizard/account_vat.py b/addons/account/wizard/account_vat.py
index 7e641628daf..15c5a55203a 100644
--- a/addons/account/wizard/account_vat.py
+++ b/addons/account/wizard/account_vat.py
@@ -33,7 +33,7 @@ class account_vat_declaration(osv.osv_memory):
'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={}):
+ def _get_company(self, cr, uid, context={}):
user_obj = self.pool.get('res.users')
company_obj = self.pool.get('res.company')
user = user_obj.browse(cr, uid, uid, context=context)
@@ -43,7 +43,7 @@ class account_vat_declaration(osv.osv_memory):
return company_obj.search(cr, uid, [('parent_id', '=', False)])[0]
_defaults = {
- 'based_on': lambda *a: 'invoices',
+ 'based_on': 'invoices',
'company_id': _get_company
}
@@ -57,6 +57,7 @@ class account_vat_declaration(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.vat.declaration',
'datas': datas,
+ 'nodestroy':True,
}
account_vat_declaration()
diff --git a/addons/account/wizard/wizard_automatic_reconcile.py b/addons/account/wizard/wizard_automatic_reconcile.py
deleted file mode 100644
index ac26b6c44fe..00000000000
--- a/addons/account/wizard/wizard_automatic_reconcile.py
+++ /dev/null
@@ -1,322 +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 _
-
-#TODO:
-
-# a rajouter comme questions ds le wizard:
-# - account_id (et mettre wizard ds le menu et pas sur client_action_multi)
-# - journal
-# - compte d'ajustement
-# - montant max (0,03)
- #
-# - libelle write-off
-# - devise principale ou secondaire
- # devise secondaire = amount_currency
- # si devise: pas prendre ceux avec montant_devise = 0
-
-# a demander à fabien:
-# - checkbox (comme ds sage) "lettrage rapide des comptes soldés"?
-
-# pr creer ecriture: creer move.line avec period et journal dans le contexte
-# faire methode sur period: get_current_period
-
-_reconcile_form = '''
-'''
-
-_reconcile_fields = {
- 'account_ids': {
- 'string': 'Account to reconcile',
- 'type': 'many2many',
- 'relation': 'account.account',
- 'domain': [('reconcile','=',1)],
- 'help': 'If no account is specified, the reconciliation will be made using every accounts that can be reconcilied',
- },
- 'writeoff_acc_id': {
- 'string': 'Account',
- 'type': 'many2one',
- 'relation': 'account.account',
- 'required': True
- },
- 'journal_id': {
- 'string': 'Journal',
- 'type': 'many2one',
- 'relation': 'account.journal',
- 'required': True
- },
- 'period_id': {
- 'string': 'Period',
- 'type': 'many2one',
- 'relation': 'account.period',
- 'required': True
- },
- 'max_amount': {
- 'string': 'Maximum write-off amount',
- 'type': 'float',
- },
- #'currency': {
- # 'string': 'Reconcile in',
- # 'type': 'selection',
- # 'selection': [('current','current currency'), ('secondary','secondary currency')],
- # 'required': True
- #},
- 'power': {
- 'string': 'Power',
- 'type': 'selection',
- 'selection': [(p,str(p)) for p in range(2, 10)],
- 'required': True
- },
- 'date1': {
- 'string': 'Start of period',
- 'type': 'date',
- 'required': True,
- 'default': lambda *a: time.strftime('%Y-01-01')
- },
- 'date2': {
- 'string': 'End of period',
- 'type': 'date',
- 'required': True,
- 'default': lambda *a: time.strftime('%Y-%m-%d')
- },
-}
-
-_result_form = '''
-'''
-
-_result_fields = {
- 'reconciled': {
- 'string': 'Reconciled transactions',
- 'type': 'integer',
- 'readonly': True
- },
- 'unreconciled': {
- 'string': 'Not reconciled transactions',
- 'type': 'integer',
- 'readonly': True
- },
-}
-
-#TODO: cleanup and comment this code... For now, it is awfulllll
-# (way too complex, and really slow)...
-def do_reconcile(cr, uid, credits, debits, max_amount, power, writeoff_acc_id, period_id, journal_id, context={}):
- # for one value of a credit, check all debits, and combination of them
- # depending on the power. It starts with a power of one and goes up
- # to the max power allowed
- def check2(value, move_list, power):
- def check(value, move_list, power):
- for i in range(len(move_list)):
- move = move_list[i]
- if power == 1:
- if abs(value - move[1]) <= max_amount + 0.00001:
- return [move[0]]
- else:
- del move_list[i]
- res = check(value - move[1], move_list, power-1)
- move_list[i:i] = [move]
- if res:
- res.append(move[0])
- return res
- return False
-
- for p in range(1, power+1):
- res = check(value, move_list, p)
- if res:
- return res
- return False
-
- # for a list of credit and debit and a given power, check if there
- # are matching tuples of credit and debits, check all debits, and combination of them
- # depending on the power. It starts with a power of one and goes up
- # to the max power allowed
- def check4(list1, list2, power):
- def check3(value, list1, list2, list1power, power):
- for i in range(len(list1)):
- move = list1[i]
- if list1power == 1:
- res = check2(value + move[1], list2, power - 1)
- if res:
- return ([move[0]], res)
- else:
- del list1[i]
- res = check3(value + move[1], list1, list2, list1power-1, power-1)
- list1[i:i] = [move]
- if res:
- x, y = res
- x.append(move[0])
- return (x, y)
- return False
-
- for p in range(1, power):
- res = check3(0, list1, list2, p, power)
- if res:
- return res
- return False
-
- def check5(list1, list2, max_power):
- for p in range(2, max_power+1):
- res = check4(list1, list2, p)
- if res:
- return res
-
- ok = True
- reconciled = 0
- move_line_obj = pooler.get_pool(cr.dbname).get('account.move.line')
- while credits and debits and ok:
- res = check5(credits, debits, power)
- if res:
- move_line_obj.reconcile(cr, uid, res[0] + res[1], 'auto', writeoff_acc_id, period_id, journal_id, context)
- reconciled += len(res[0]) + len(res[1])
- credits = [(id, credit) for (id, credit) in credits if id not in res[0]]
- debits = [(id, debit) for (id, debit) in debits if id not in res[1]]
- else:
- ok = False
- return (reconciled, len(credits)+len(debits))
-
-def _reconcile(self, cr, uid, data, context):
- service = netsvc.LocalService("object_proxy")
- move_line_obj = pooler.get_pool(cr.dbname).get('account.move.line')
- form = data['form']
- max_amount = form.get('max_amount', 0.0)
- power = form['power']
- reconciled = unreconciled = 0
- if not form['account_ids'][0][2]:
- raise wizard.except_wizard(_('UserError'), _('You must select accounts to reconcile'))
- for account_id in form['account_ids'][0][2]:
-
- # reconcile automatically all transactions from partners whose balance is 0
- cr.execute(
- "SELECT partner_id " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND reconcile_id IS NULL " \
- "AND state <> 'draft' " \
- "GROUP BY partner_id " \
- "HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0",
- (account_id, max_amount or 0.0))
- partner_ids = [id for (id,) in cr.fetchall()]
-
- for partner_id in partner_ids:
- cr.execute(
- "SELECT id " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND partner_id=%s " \
- "AND state <> 'draft' " \
- "AND reconcile_id IS NULL",
- (account_id, partner_id))
- line_ids = [id for (id,) in cr.fetchall()]
-
- if len(line_ids):
- move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
- reconciled += len(line_ids)
-
- # get the list of partners who have more than one unreconciled transaction
- cr.execute(
- "SELECT partner_id " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND reconcile_id IS NULL " \
- "AND state <> 'draft' " \
- "AND partner_id IS NOT NULL " \
- "GROUP BY partner_id " \
- "HAVING count(*)>1",
- (account_id,))
- partner_ids = [id for (id,) in cr.fetchall()]
- #filter?
- for partner_id in partner_ids:
- # get the list of unreconciled 'debit transactions' for this partner
- cr.execute(
- "SELECT id, debit " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND partner_id=%s " \
- "AND reconcile_id IS NULL " \
- "AND state <> 'draft' " \
- "AND debit > 0",
- (account_id, partner_id))
- debits = cr.fetchall()
-
- # get the list of unreconciled 'credit transactions' for this partner
- cr.execute(
- "SELECT id, credit " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND partner_id=%s " \
- "AND reconcile_id IS NULL " \
- "AND state <> 'draft' " \
- "AND credit > 0",
- (account_id, partner_id))
- credits = cr.fetchall()
-
- (rec, unrec) = do_reconcile(cr, uid, credits, debits, max_amount, power, form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
- reconciled += rec
- unreconciled += unrec
-
- # add the number of transactions for partners who have only one
- # unreconciled transactions to the unreconciled count
- partner_filter = partner_ids and 'AND partner_id not in (%s)' % ','.join(map(str, filter(None, partner_ids))) or ''
- cr.execute(
- "SELECT count(*) " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND reconcile_id IS NULL " \
- "AND state <> 'draft' " + partner_filter,
- (account_id,))
- additional_unrec = cr.fetchone()[0]
- return {'reconciled':reconciled, 'unreconciled':unreconciled+additional_unrec}
-
-class wiz_reconcile(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':_reconcile_form, 'fields':_reconcile_fields, 'state':[('end','Cancel', 'gtk-cancel'),('reconcile','Reconcile', 'gtk-ok')]}
- },
- 'reconcile': {
- 'actions': [_reconcile],
- 'result': {'type':'form', 'arch':_result_form, 'fields':_result_fields, 'state':[('end','OK', 'gtk-cancel')]}
- }
- }
-wiz_reconcile('account.automatic.reconcile')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/wizard/wizard_reconcile.py b/addons/account/wizard/wizard_reconcile.py
deleted file mode 100644
index ba7cf7eaef0..00000000000
--- a/addons/account/wizard/wizard_reconcile.py
+++ /dev/null
@@ -1,150 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import netsvc
-import time
-import osv
-import pooler
-from datetime import datetime
-from tools.translate import _
-
-_transaction_form = '''
-'''
-
-_transaction_fields = {
- 'trans_nbr': {'string':'# of Transaction', 'type':'integer', 'readonly':True},
- 'credit': {'string':'Credit amount', 'type':'float', 'readonly':True},
- 'debit': {'string':'Debit amount', 'type':'float', 'readonly':True},
- 'writeoff': {'string':'Write-Off amount', 'type':'float', 'readonly':True},
-}
-
-def _trans_rec_get(self, cr, uid, data, context=None):
- pool = pooler.get_pool(cr.dbname)
- account_move_line_obj = pool.get('account.move.line')
- credit = debit = 0
- account_id = False
- count = 0
- for line in account_move_line_obj.browse(cr, uid, data['ids'], context=context):
- if not line.reconcile_id and not line.reconcile_id.id:
- count += 1
- credit += line.credit
- debit += line.debit
- account_id = line.account_id.id
- return {'trans_nbr': count, 'account_id': account_id, 'credit': credit, 'debit': debit, 'writeoff': debit - credit}
-
-def _trans_rec_reconcile_partial(self, cr, uid, data, context=None):
- pool = pooler.get_pool(cr.dbname)
- account_move_line_obj = pool.get('account.move.line')
- account_move_line_obj.reconcile_partial(cr, uid, data['ids'], 'manual', context=context)
- return {}
-
-def _trans_rec_reconcile(self, cr, uid, data, context=None):
- pool = pooler.get_pool(cr.dbname)
- account_move_line_obj = pool.get('account.move.line')
-
- form = data['form']
- account_id = form.get('writeoff_acc_id', False)
- context['date_p'] = form.get('date_p', False)
- date = False
- if context['date_p']:
- date = datetime.strptime(context['date_p'], '%Y-%m-%d')
- ids = pool.get('account.period').find(cr, uid, dt=date, context=context)
- period_id = False
- if len(ids):
- period_id = ids[0]
-
- journal_id = form.get('journal_id', False)
- context['comment'] = form.get('comment', False)
- context['analytic_id'] = form.get('analytic_id', False)
- account_move_line_obj.reconcile(cr, uid, data['ids'], 'manual', account_id,
- period_id, journal_id, context=context)
- return {}
-
-def _partial_check(self, cr, uid, data, context):
- if _trans_rec_get(self,cr,uid, data, context)['writeoff'] == 0:
- return 'init_full'
- return 'init_partial'
-
-_transaction_add_form = '''
-'''
-
-_transaction_add_fields = {
- 'journal_id': {'string': 'Write-Off Journal', 'type': 'many2one', 'relation':'account.journal', 'required':True},
- 'writeoff_acc_id': {'string':'Write-Off account', 'type':'many2one', 'relation':'account.account', 'required':True},
- 'date_p': {'string':'Date','type':'date'},
- 'comment': {'string':'Comment','type':'char', 'size': 64, 'required':True},
- 'analytic_id': {'string':'Analytic Account', 'type': 'many2one', 'relation':'account.analytic.account'},
-}
-
-def _trans_rec_addendum(self, cr, uid, data, context={}):
- date_p = time.strftime('%Y-%m-%d')
- return {'date_p':date_p, 'comment': _('Write-Off')}
-
-
-class wiz_reconcile(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'choice', 'next_state': _partial_check}
- },
- 'init_full': {
- 'actions': [_trans_rec_get],
- 'result': {'type': 'form', 'arch':_transaction_form, 'fields':_transaction_fields, 'state':[('end','Cancel', 'gtk-cancel'),('reconcile','Reconcile', 'gtk-ok')]}
- },
- 'init_partial': {
- 'actions': [_trans_rec_get],
- 'result': {'type': 'form', 'arch':_transaction_form, 'fields':_transaction_fields, 'state':[('end','Cancel', 'gtk-cancel'),('addendum','Reconcile With Write-Off', 'gtk-ok'),('partial','Partial Reconcile', 'gtk-ok')]}
- },
- 'addendum': {
- 'actions': [_trans_rec_addendum],
- 'result': {'type': 'form', 'arch':_transaction_add_form, 'fields':_transaction_add_fields, 'state':[('end','Cancel', 'gtk-cancel'),('reconcile','Reconcile', 'gtk-ok')]}
- },
- 'reconcile': {
- 'actions': [_trans_rec_reconcile],
- 'result': {'type': 'state', 'state':'end'}
- },
- 'partial': {
- 'actions': [_trans_rec_reconcile_partial],
- 'result': {'type': 'state', 'state':'end'}
- }
- }
-wiz_reconcile('account.move.line.reconcile')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_analytic_plans/__openerp__.py b/addons/account_analytic_plans/__openerp__.py
index b3067358a62..0f23bc379be 100644
--- a/addons/account_analytic_plans/__openerp__.py
+++ b/addons/account_analytic_plans/__openerp__.py
@@ -60,9 +60,10 @@ of distribution models.
'init_xml': [],
'update_xml': [
'security/ir.model.access.csv',
- 'model_wizard.xml',
'account_analytic_plans_view.xml',
- 'account_analytic_plans_report.xml'
+ 'account_analytic_plans_report.xml',
+ 'wizard/analytic_plan_create_model_view.xml',
+ 'wizard/account_crossovered_analytic_view.xml'
],
'demo_xml': [],
'installable': True,
diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py
index ea3dbdd0475..57acdb6dee5 100644
--- a/addons/account_analytic_plans/account_analytic_plans.py
+++ b/addons/account_analytic_plans/account_analytic_plans.py
@@ -145,7 +145,7 @@ class account_analytic_plan_instance(osv.osv):
return self.name_get(cr, uid, ids, context or {})
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
- wiz_id = self.pool.get('ir.actions.wizard').search(cr, uid, [("wiz_name","=","create.model")])
+ wiz_id = self.pool.get('ir.actions.act_window').search(cr, uid, [("name","=","analytic.plan.create.model.action")])
res = super(account_analytic_plan_instance,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
if (res['type']=='form'):
diff --git a/addons/account_analytic_plans/account_analytic_plans_report.xml b/addons/account_analytic_plans/account_analytic_plans_report.xml
index 8bed6104b00..ee2bb1e2a87 100644
--- a/addons/account_analytic_plans/account_analytic_plans_report.xml
+++ b/addons/account_analytic_plans/account_analytic_plans_report.xml
@@ -11,12 +11,12 @@
auto="False"
menu="False"/>
-
+ keyword="client_print_multi"/>-->
diff --git a/addons/account_analytic_plans/model_wizard.xml b/addons/account_analytic_plans/model_wizard.xml
deleted file mode 100644
index 9dc545b90a5..00000000000
--- a/addons/account_analytic_plans/model_wizard.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
diff --git a/addons/account_analytic_plans/wizard/__init__.py b/addons/account_analytic_plans/wizard/__init__.py
index 4b47827094b..c91a0251b33 100644
--- a/addons/account_analytic_plans/wizard/__init__.py
+++ b/addons/account_analytic_plans/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,11 +15,11 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
-import create_model
-import wizard_crossovered_analytic
+import analytic_plan_create_model
+import account_crossovered_analytic
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_analytic_plans/wizard/account_crossovered_analytic.py b/addons/account_analytic_plans/wizard/account_crossovered_analytic.py
new file mode 100644
index 00000000000..825ab26aaf9
--- /dev/null
+++ b/addons/account_analytic_plans/wizard/account_crossovered_analytic.py
@@ -0,0 +1,75 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+import time
+
+from osv import osv, fields
+from tools.translate import _
+
+class account_crossovered_analytic(osv.osv_memory):
+ _name = 'account.crossovered.analytic'
+ _description = 'Print Crossovered Analytic'
+ _columns = {
+ 'date1': fields.date('Start Date', required=True),
+ 'date2': fields.date('End Date', required=True),
+ 'journal_ids': fields.many2many('account.analytic.journal', 'crossovered_journal_rel', 'crossover_id', 'journal_id', 'Analytic Journal'),
+ 'ref': fields.many2one('account.analytic.account', 'Analytic Account Reference', required=True),
+ 'empty_line': fields.boolean('Dont show empty lines'),
+ }
+ _defaults = {
+ 'date1': lambda *a: time.strftime('%Y-01-01'),
+ 'date2': lambda *a: time.strftime('%Y-%m-%d'),
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ cr.execute('select account_id from account_analytic_line')
+ res = cr.fetchall()
+ acc_ids = [x[0] for x in res]
+
+ data = self.read(cr, uid, ids, [], context=context)[0]
+
+ obj_acc = self.pool.get('account.analytic.account').browse(cr, uid, data['ref'])
+ name = obj_acc.name
+
+ account_ids = self.pool.get('account.analytic.account').search(cr, uid, [('parent_id', 'child_of', [data['ref']])])
+
+ flag = True
+ for acc in account_ids:
+ if acc in acc_ids:
+ flag = False
+ break
+ if flag:
+ raise osv.except_osv(_('User Error'),_('There are no Analytic lines related to Account %s' % name))
+
+ datas = {
+ 'ids': [],
+ 'model': 'account.analytic.account',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.account.crossovered.analytic',
+ 'datas': datas,
+ 'nodestroy': True
+ }
+
+account_crossovered_analytic()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_analytic_plans/wizard/account_crossovered_analytic_view.xml b/addons/account_analytic_plans/wizard/account_crossovered_analytic_view.xml
new file mode 100644
index 00000000000..8c860169f56
--- /dev/null
+++ b/addons/account_analytic_plans/wizard/account_crossovered_analytic_view.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+ account.crossovered.analytic.form
+ account.crossovered.analytic
+ form
+
+
+
+
+
+
+ Crossovered Analytic
+ ir.actions.act_window
+ account.crossovered.analytic
+ form
+ form
+ new
+
+
+
+
+
+ Crossovered Analytic
+ client_print_multi
+
+ action
+ account.analytic.account
+
+
+
+
\ No newline at end of file
diff --git a/addons/account_analytic_plans/wizard/analytic_plan_create_model.py b/addons/account_analytic_plans/wizard/analytic_plan_create_model.py
new file mode 100644
index 00000000000..aafaf986b51
--- /dev/null
+++ b/addons/account_analytic_plans/wizard/analytic_plan_create_model.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 .
+#
+##############################################################################
+from osv import osv
+from tools.translate import _
+
+class analytic_plan_create_model(osv.osv_memory):
+ _name = 'analytic.plan.create.model'
+ _description = 'analytic.plan.create.model'
+
+ def activate(self, cr, uid, ids, context=None):
+ plan_obj = self.pool.get('account.analytic.plan.instance')
+ mod_obj = self.pool.get('ir.model.data')
+ if 'active_id' in context and context['active_id']:
+ plan = plan_obj.browse(cr, uid, context['active_id'], context=context)
+ if (not plan.name) or (not plan.code):
+ raise osv.except_osv(_('Error'), _('Please put a name and a code before saving the model !'))
+ pids = self.pool.get('account.analytic.plan').search(cr, uid, [], context=context)
+ if (not pids):
+ raise osv.except_osv(_('Error'), _('No analytic plan defined !'))
+ plan_obj.write(cr, uid, [context['active_id']], {'plan_id':pids[0]})
+
+ model_data_ids = mod_obj.search(cr,uid,[('model', '=', 'ir.ui.view'),('name', '=', 'view_analytic_plan_create_model')], context=context)
+ resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+ return {
+ 'name': _('Distribution Model Saved'),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'analytic.plan.create.model',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ }
+ else:
+ return {}
+
+analytic_plan_create_model()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_analytic_plans/wizard/analytic_plan_create_model_view.xml b/addons/account_analytic_plans/wizard/analytic_plan_create_model_view.xml
new file mode 100644
index 00000000000..75ef07e0098
--- /dev/null
+++ b/addons/account_analytic_plans/wizard/analytic_plan_create_model_view.xml
@@ -0,0 +1,53 @@
+
+
+
+
+ analytic.plan.create.model.msg.form
+ analytic.plan.create.model
+ form
+
+
+
+
+
+
+ analytic.plan.create.model.form
+ analytic.plan.create.model
+ form
+
+
+
+
+
+
+
+ analytic.plan.create.model.action
+ ir.actions.act_window
+ analytic.plan.create.model
+ form
+ form
+ new
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account_analytic_plans/wizard/create_model.py b/addons/account_analytic_plans/wizard/create_model.py
deleted file mode 100644
index 4c6ecce38c3..00000000000
--- a/addons/account_analytic_plans/wizard/create_model.py
+++ /dev/null
@@ -1,71 +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 netsvc
-import pooler
-from tools.translate import _
-
-info = '''
-'''
-
-
-def activate(self, cr, uid, data, context):
- plan_obj = pooler.get_pool(cr.dbname).get('account.analytic.plan.instance')
- if data['id']:
- plan = plan_obj.browse(cr, uid, data['id'], context)
- if (not plan.name) or (not plan.code):
- raise wizard.except_wizard(_('Error'), _('Please put a name and a code before saving the model !'))
- pids = pooler.get_pool(cr.dbname).get('account.analytic.plan').search(cr, uid, [], context=context)
- if (not pids):
- raise wizard.except_wizard(_('Error'), _('No analytic plan defined !'))
- plan_obj.write(cr,uid,[data['id']],{'plan_id':pids[0]})
- return 'info'
- else:
- return 'endit'
-
-def _do_nothing(self, cr, uid, data, context):
- return 1
-
-class create_model(wizard.interface):
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'choice','next_state':activate}
- },
- 'info': {
- 'actions': [],
- 'result': {'type':'form', 'arch':info, 'fields':{}, 'state':[('end','OK')]}
- },
- 'endit': {
- 'actions': [],
- 'result': {'type':'action','action':_do_nothing , 'state':'end'} #FIXME: check
- },
- }
-create_model('create.model')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_analytic_plans/wizard/wizard_crossovered_analytic.py b/addons/account_analytic_plans/wizard/wizard_crossovered_analytic.py
deleted file mode 100644
index 64da1b73b1d..00000000000
--- a/addons/account_analytic_plans/wizard/wizard_crossovered_analytic.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 wizard
-import time
-import datetime
-import pooler
-from tools.translate import _
-
-form = """
-"""
-
-fields = {
- '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')},
- 'journal_ids': {'string':'Analytic Journal', 'type':'many2many', 'relation':'account.analytic.journal'},
- 'ref' :{'string':'Analytic Account Reference', 'type':'many2one', 'relation':'account.analytic.account','required':True},
- 'empty_line': {'string':'Dont show empty lines', 'type':'boolean', 'default': lambda *a:False},
-}
-
-class wizard_crossovered_analytic(wizard.interface):
- def _checklines(self, cr, uid, data, context):
- cr.execute('select account_id from account_analytic_line')
- res=cr.fetchall()
- acc_ids=[x[0] for x in res]
-
- obj_acc = pooler.get_pool(cr.dbname).get('account.analytic.account').browse(cr,uid,data['form']['ref'])
- name=obj_acc.name
-
- account_ids = pooler.get_pool(cr.dbname).get('account.analytic.account').search(cr, uid, [('parent_id', 'child_of', [data['form']['ref']])])
-
- flag = True
- for acc in account_ids:
- if acc in acc_ids:
- flag = False
- break
-
- if flag:
- raise wizard.except_wizard(_('User Error'),_('There are no Analytic lines related to Account %s' % name))
- return {}
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':form, 'fields':fields, 'state':[('end','Cancel'),('print','Print')]},
- },
- 'print': {
- 'actions': [_checklines],
- 'result': {'type':'print', 'report':'account.analytic.account.crossovered.analytic', 'state':'end'},
- },
- }
-
-wizard_crossovered_analytic('wizard.crossovered.analytic')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_budget/__openerp__.py b/addons/account_budget/__openerp__.py
index 7a5e9b74ce4..36f0bc1aa4b 100644
--- a/addons/account_budget/__openerp__.py
+++ b/addons/account_budget/__openerp__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -51,9 +51,15 @@ Three reports are available:
'security/ir.model.access.csv',
'security/account_budget_security.xml',
'account_budget_wizard.xml',
+ 'wizard/account_budget_spread_view.xml',
'crossovered_budget_view.xml',
'crossovered_budget_report.xml',
- 'crossovered_budget_workflow.xml'
+ 'crossovered_budget_workflow.xml',
+ 'wizard/account_budget_analytic_view.xml',
+ 'wizard/account_budget_report_view.xml',
+ 'wizard/account_budget_spread_view.xml',
+ 'wizard/account_budget_crossovered_summary_report_view.xml',
+ 'wizard/account_budget_crossovered_report_view.xml',
],
'demo_xml': ['crossovered_budget_demo.xml'],
'installable': True,
diff --git a/addons/account_budget/account_budget_wizard.xml b/addons/account_budget/account_budget_wizard.xml
index c45957da787..e153200b6a5 100644
--- a/addons/account_budget/account_budget_wizard.xml
+++ b/addons/account_budget/account_budget_wizard.xml
@@ -1,9 +1,9 @@
-
+
-
+
diff --git a/addons/account_budget/crossovered_budget_report.xml b/addons/account_budget/crossovered_budget_report.xml
index 98b0521e928..0e3fcad2fc7 100644
--- a/addons/account_budget/crossovered_budget_report.xml
+++ b/addons/account_budget/crossovered_budget_report.xml
@@ -11,35 +11,35 @@
auto="False"
menu="False" />
-
+
+
+
+
+
+
-
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/addons/account_budget/wizard/__init__.py b/addons/account_budget/wizard/__init__.py
index e174db2695c..56faa0af524 100644
--- a/addons/account_budget/wizard/__init__.py
+++ b/addons/account_budget/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,15 +15,15 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
-import wizard_crossovered_budget_report
-import wizard_analytic_account_budget
-import wizard_crossovered_budget_summary_report
+import account_budget_crossovered_report
+import account_budget_analytic
+import account_budget_crossovered_summary_report
-import wizard_budget_spread
-import wizard_budget_report
+import account_budget_spread
+import account_budget_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/wizard_account_analytic_cost_ledger_report.py b/addons/account_budget/wizard/account_budget_analytic.py
similarity index 51%
rename from addons/account/project/wizard/wizard_account_analytic_cost_ledger_report.py
rename to addons/account_budget/wizard/account_budget_analytic.py
index 2469f7f5c0c..62553520cbd 100644
--- a/addons/account/project/wizard/wizard_account_analytic_cost_ledger_report.py
+++ b/addons/account_budget/wizard/account_budget_analytic.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,38 +15,43 @@
# 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
-import wizard
-dates_form = '''
-'''
+from osv import fields, osv
-dates_fields = {
- 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
- 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
-}
+class account_budget_analytic(osv.osv_memory):
-class wizard_report(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('report','Print')]}
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'account.analytic.account.cost_ledger', 'state':'end'}
+ _name = 'account.budget.analytic'
+ _description = 'Account Budget report for analytic account'
+ _columns = {
+ 'date_from': fields.date('Start of period', required=True),
+ 'date_to': fields.date('End of period', required=True),
+ }
+ _defaults= {
+ 'date_from': time.strftime('%Y-01-01'),
+ 'date_to': time.strftime('%Y-%m-%d'),
}
- }
-wizard_report('account.analytic.account.cost_ledger.report')
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.analytic.account',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.account.budget',
+ 'datas': datas,
+ }
+account_budget_analytic()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_budget/wizard/account_budget_analytic_view.xml b/addons/account_budget/wizard/account_budget_analytic_view.xml
new file mode 100644
index 00000000000..fd6886040a0
--- /dev/null
+++ b/addons/account_budget/wizard/account_budget_analytic_view.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+ account.budget.analytic.form
+ account.budget.analytic
+ form
+
+
+
+
+
+
+ Print Budgets
+ ir.actions.act_window
+ account.budget.analytic
+ form
+ form
+
+ new
+
+
+
+
+
+ Print Budgets
+ client_print_multi
+
+ action
+ account.analytic.account
+
+
+
+
diff --git a/addons/account_budget/wizard/wizard_crossovered_budget_report.py b/addons/account_budget/wizard/account_budget_crossovered_report.py
similarity index 51%
rename from addons/account_budget/wizard/wizard_crossovered_budget_report.py
rename to addons/account_budget/wizard/account_budget_crossovered_report.py
index a1357974126..9a700e90ebb 100644
--- a/addons/account_budget/wizard/wizard_crossovered_budget_report.py
+++ b/addons/account_budget/wizard/account_budget_crossovered_report.py
@@ -18,38 +18,41 @@
# along with this program. If not, see .
#
##############################################################################
-
import time
-import wizard
-dates_form = '''
-'''
+from osv import fields, osv
-dates_fields = {
- 'date_from': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
- 'date_to': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
+class account_budget_crossvered_report(osv.osv_memory):
-}
-
-class wizard_report(wizard.interface):
-
- def _default(self, cr, uid, data, context):
- data['form']['report']='analytic-full'
- return data['form']
-
- states = {
- 'init': {
- 'actions': [_default],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel', 'gtk-cancel'),('report','Print', 'gtk-print', True)]}
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'crossovered.budget.report', 'state':'end'}
+ _name = 'account.budget.crossvered.report'
+ _description = 'Account Budget crossvered report'
+ _columns = {
+ 'date_from': fields.date('Start of period', required=True),
+ 'date_to': fields.date('End of period', required=True),
}
- }
-wizard_report('wizard.crossovered.budget')
+ _defaults= {
+ 'date_from': time.strftime('%Y-01-01'),
+ 'date_to': time.strftime('%Y-%m-%d'),
+ }
+
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'crossovered.budge',
+ 'form': data
+ }
+ datas['form']['report']='analytic-full'
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'crossovered.budget.report',
+ 'datas': datas,
+ }
+
+account_budget_crossvered_report()
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_budget/wizard/account_budget_crossovered_report_view.xml b/addons/account_budget/wizard/account_budget_crossovered_report_view.xml
new file mode 100644
index 00000000000..494c9af31ab
--- /dev/null
+++ b/addons/account_budget/wizard/account_budget_crossovered_report_view.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+ account.budget.crossvered.report.form
+ account.budget.crossvered.report
+ form
+
+
+
+
+
+
+ Print Budgets
+ ir.actions.act_window
+ account.budget.crossvered.report
+ form
+ form
+
+ new
+
+
+
+
+ Print Budgets
+ client_print_multi
+
+ action
+ crossovered.budget
+
+
+
diff --git a/addons/account_budget/wizard/account_budget_crossovered_summary_report.py b/addons/account_budget/wizard/account_budget_crossovered_summary_report.py
new file mode 100644
index 00000000000..9581546ca10
--- /dev/null
+++ b/addons/account_budget/wizard/account_budget_crossovered_summary_report.py
@@ -0,0 +1,61 @@
+# -*- 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
+
+class account_budget_crossvered_summary_report(osv.osv_memory):
+ """
+ This wizard provides the crossovered budget summary report'
+ """
+ _name = 'account.budget.crossvered.summary.report'
+ _description = 'Account Budget crossvered summary report'
+ _columns = {
+ 'date_from': fields.date('Start of period', required=True),
+ 'date_to': fields.date('End of period', required=True),
+ }
+ _defaults= {
+ 'date_from': time.strftime('%Y-01-01'),
+ 'date_to': time.strftime('%Y-%m-%d'),
+ }
+
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'crossovered.budge',
+ 'form': data
+ }
+ datas['form']['report']='analytic-one'
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'crossovered.budget.report',
+ 'datas': datas,
+ }
+ return {}
+
+account_budget_crossvered_summary_report()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account_budget/wizard/account_budget_crossovered_summary_report_view.xml b/addons/account_budget/wizard/account_budget_crossovered_summary_report_view.xml
new file mode 100644
index 00000000000..cb6c162fd57
--- /dev/null
+++ b/addons/account_budget/wizard/account_budget_crossovered_summary_report_view.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+ account.budget.crossvered.summary.report.form
+ account.budget.crossvered.summary.report
+ form
+
+
+
+
+
+
+ Print Summary of Budgets
+ ir.actions.act_window
+ account.budget.crossvered.summary.report
+ form
+ form
+
+ new
+
+
+
+
+ Print Summary of Budgets
+ client_print_multi
+
+ action
+ crossovered.budget
+
+
+
diff --git a/addons/account_budget/wizard/account_budget_report.py b/addons/account_budget/wizard/account_budget_report.py
new file mode 100644
index 00000000000..8ebb0f7368b
--- /dev/null
+++ b/addons/account_budget/wizard/account_budget_report.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 .
+#
+##############################################################################
+import time
+
+from osv import fields, osv
+from tools.translate import _
+
+class account_budget_report(osv.osv_memory):
+
+ _name = 'account.budget.report'
+ _description = 'Account Budget report for analytic account'
+ _columns = {
+ 'date1': fields.date('Start of period', required=True),
+ 'date2': fields.date('End of period', required=True),
+ }
+ _defaults= {
+ 'date1': time.strftime('%Y-01-01'),
+ 'date2': time.strftime('%Y-%m-%d'),
+ }
+
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.budget.post',
+ 'form': data
+ }
+
+ data_model = self.pool.get(datas['model']).browse(cr,uid,context['active_id'])
+ if not data_model.dotation_ids:
+ raise osv.except_osv(_('Insufficient Data!'),_('No Depreciation or Master Budget Expenses Found on Budget %s!') % data_model.name)
+
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.budget',
+ 'datas': datas,
+ }
+account_budget_report()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account_budget/wizard/account_budget_report_view.xml b/addons/account_budget/wizard/account_budget_report_view.xml
new file mode 100644
index 00000000000..3587a20dcba
--- /dev/null
+++ b/addons/account_budget/wizard/account_budget_report_view.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+ account.budget.report.form
+ account.budget.report
+ form
+
+
+
+
+
+
+ Budgets
+ ir.actions.act_window
+ account.budget.report
+ form
+ form
+
+ new
+
+
+
+
+
+ Budgets
+ client_print_multi
+
+ action
+ account.budget.post
+
+
+
+
diff --git a/addons/account_budget/wizard/wizard_budget_spread.py b/addons/account_budget/wizard/account_budget_spread.py
similarity index 57%
rename from addons/account_budget/wizard/wizard_budget_spread.py
rename to addons/account_budget/wizard/account_budget_spread.py
index a4885df2324..ab2eb3d0bf6 100644
--- a/addons/account_budget/wizard/wizard_budget_spread.py
+++ b/addons/account_budget/wizard/account_budget_spread.py
@@ -18,40 +18,27 @@
# along with this program. If not, see .
#
##############################################################################
-
-import wizard
import netsvc
+from osv import fields, osv
+import decimal_precision as dp
-_spread_form = '''
-'''
+class account_budget_spread(osv.osv_memory):
-_spread_fields = {
- 'fiscalyear': {'string':'Fiscal Year', 'type':'many2one', 'relation':'account.fiscalyear', 'required':True},
- 'amount': {'string':'Amount', 'type':'float', 'digits':(16,2)},
-}
+ _name = 'account.budget.spread'
+ _description = 'Account Budget spread '
+ _columns = {
+ 'fiscalyear': fields.many2one('account.fiscalyear','Fiscal Year', required=True),
+ 'amount': fields.float('Amount', digits_compute=dp.get_precision('Account')),
+ }
-class wizard_budget_spread(wizard.interface):
- def _spread(self, cr, uid, data, context):
+ def check_spread(self, cr, uid, ids, context=None):
service = netsvc.LocalService("object_proxy")
- form = data['form']
- res = service.execute(cr.dbname, uid, 'account.budget.post', 'spread', data['ids'], form['fiscalyear'], form['amount'])
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, [])[0]
+ res = service.execute(cr.dbname, uid, 'account.budget.post', 'spread', context['active_ids'], data['fiscalyear'], data['amount'])
return {}
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':_spread_form, 'fields':_spread_fields, 'state':[('end','Cancel'),('spread','Spread','',True)]}
- },
- 'spread': {
- 'actions': [_spread],
- 'result': {'type':'state', 'state':'end'}
- }
- }
-wizard_budget_spread('account.budget.spread')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+account_budget_spread()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_budget/wizard/account_budget_spread_view.xml b/addons/account_budget/wizard/account_budget_spread_view.xml
new file mode 100644
index 00000000000..10ac28566f7
--- /dev/null
+++ b/addons/account_budget/wizard/account_budget_spread_view.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+ account.budget.spread.form
+ account.budget.spread
+ form
+
+
+
+
+
+
+ Spread
+ ir.actions.act_window
+ account.budget.spread
+ form
+ form
+
+ new
+
+
+
+
\ No newline at end of file
diff --git a/addons/account_budget/wizard/wizard_budget_report.py b/addons/account_budget/wizard/wizard_budget_report.py
deleted file mode 100644
index 72f251445ba..00000000000
--- a/addons/account_budget/wizard/wizard_budget_report.py
+++ /dev/null
@@ -1,62 +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 datetime
-import pooler
-from tools.translate import _
-
-dates_form = '''
-'''
-
-dates_fields = {
- 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
- 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
-}
-
-class wizard_report(wizard.interface):
- def _default(self, cr, uid, data, context):
- pool_obj = pooler.get_pool(cr.dbname)
- data_model = pool_obj.get(data['model']).browse(cr,uid,data['id'])
- if not data_model.dotation_ids:
- raise wizard.except_wizard(_('Insufficient Data!'),_('No Depreciation or Master Budget Expenses Found on Budget %s!') % data_model.name)
- return data['form']
-
- states = {
- 'init': {
- 'actions': [_default],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel', 'gtk-cancel'),('report','Print', 'gtk-print', True)]}
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'account.budget', 'state':'end'}
- }
- }
-wizard_report('account.budget.report')
-
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_followup/__openerp__.py b/addons/account_followup/__openerp__.py
index 652c94a49a8..2fc950d9e0c 100644
--- a/addons/account_followup/__openerp__.py
+++ b/addons/account_followup/__openerp__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -49,7 +49,7 @@
'init_xml': [],
'update_xml': [
'security/ir.model.access.csv',
- 'wizard/wizard_view.xml',
+ 'wizard/account_followup_print_view.xml',
'followup_report_view.xml',
'followup_view.xml',
'followup_data.xml'
diff --git a/addons/account_followup/report/report_followup_print.py b/addons/account_followup/report/report_followup_print.py
index 28ec97f51fa..4f1df09c302 100644
--- a/addons/account_followup/report/report_followup_print.py
+++ b/addons/account_followup/report/report_followup_print.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 .
#
##############################################################################
@@ -41,7 +41,7 @@ class report_rappel(report_sxw.rml_parse):
pool = pooler.get_pool(self.cr.dbname)
all_partners = []
for partner in partners_ids:
- partners = pool.get('account_followup.stat').browse(self.cr, self.uid, partner[2])
+ partners = pool.get('account_followup.stat').browse(self.cr, self.uid, [partner])
for par in partners:
all_partners.append(par.name)
return all_partners
@@ -88,6 +88,7 @@ class report_rappel(report_sxw.rml_parse):
'company_name': fp_obj.browse(self.cr, self.uid, followup_id).company_id.name,
'user_signature': pooler.get_pool(self.cr.dbname).get('res.users').browse(self.cr, self.uid, self.uid, context).signature,
}
+
return text
diff --git a/addons/account_followup/wizard/__init__.py b/addons/account_followup/wizard/__init__.py
index fd936d6faa7..aea714d2a86 100644
--- a/addons/account_followup/wizard/__init__.py
+++ b/addons/account_followup/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,11 +15,10 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
-import wizard_followup_print
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+import account_followup_print
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_followup/wizard/wizard_followup_print.py b/addons/account_followup/wizard/account_followup_print.py
similarity index 53%
rename from addons/account_followup/wizard/wizard_followup_print.py
rename to addons/account_followup/wizard/account_followup_print.py
index 2f82ec6ba60..14111575748 100644
--- a/addons/account_followup/wizard/wizard_followup_print.py
+++ b/addons/account_followup/wizard/account_followup_print.py
@@ -18,209 +18,99 @@
# along with this program. If not, see .
#
##############################################################################
-
-import wizard
import datetime
-import pooler
import time
import tools
from osv import fields, osv
from tools.translate import _
-_email_summary_form = """
-"""
-
-_email_summary_fields = {
- 'summary': {'string': 'Summary', 'type': 'text', 'required': False, 'readonly': True},
-}
-
-_followup_wizard_screen1_form = """
-"""
-
-_followup_wizard_screen1_fields = {
- 'date': {'string': 'Follow-up Sending Date', 'type': 'date', 'required': True, 'help':"This field allow you to select a forecast date to plan your follow-ups"},
- 'followup_id': {'string': 'Follow-up', 'type':'many2one', 'relation':'account_followup.followup', 'required': True,},
-}
-
-
-
-_followup_wizard_all_form = """
-"""
-
-_followup_wizard_all_fields = {
- 'partner_ids': {
- 'string': "Partners",
- 'type': 'many2many',
- 'required': True,
- 'relation': 'account_followup.stat',
- },
- 'email_conf': {
- 'string': "Send email confirmation",
- 'type': 'boolean',
- },
- 'email_subject' : {
- 'string' : "Email Subject",
- 'type' : "char",
- 'size': 64,
- 'default': 'Invoices Reminder'
- },
- 'partner_lang':{
- 'string': "Send Email in Partner Language",
- 'type': 'boolean',
- 'default':True,
- 'help':'Do not change message text, if you want to send email in partner language, or configre from company'
- },
- 'email_body': {
- 'string': "Email body",
- 'type': 'text',
- 'default': '''
-Date : %(date)s
-
-Dear %(partner_name)s,
-
-Please find in attachment a reminder of all your unpaid invoices, for a total amount due of:
-
-%(followup_amount).2f %(company_currency)s
-
-
-Thanks,
---
-%(user_signature)s
-%(company_name)s
- '''
- }
-}
-
-class followup_all_print(wizard.interface):
- def _update_partners(self, cr, uid, data, context):
- to_update = data['form']['to_update']
- for id in to_update.keys():
- if to_update[id]['partner_id'] in data['form']['partner_ids'][0][2]:
- cr.execute(
- "UPDATE account_move_line "\
- "SET followup_line_id=%s, followup_date=%s "\
- "WHERE id=%s",
- (to_update[id]['level'],
- data['form']['date'], int(id),))
- return {}
-
- def _sendmail(self ,cr, uid, data, context):
- if data['form']['email_conf']:
- mail_notsent = ''
- msg_sent = ''
- msg_unsent = ''
- count = 0
- pool = pooler.get_pool(cr.dbname)
- data_user = pool.get('res.users').browse(cr,uid,uid)
- line_obj = pool.get('account_followup.stat')
- move_lines = line_obj.browse(cr,uid,data['form']['partner_ids'][0][2])
- partners = []
- dict_lines = {}
- for line in move_lines:
- partners.append(line.name)
- dict_lines[line.name.id] =line
- for partner in partners:
- ids_lines = pool.get('account.move.line').search(cr,uid,[('partner_id','=',partner.id),('reconcile_id','=',False),('account_id.type','in',['receivable'])])
- data_lines = pool.get('account.move.line').browse(cr,uid,ids_lines)
- followup_data = dict_lines[partner.id]
- dest = False
- if partner.address:
- for adr in partner.address:
- if adr.type=='contact':
- if adr.email:
- dest = [adr.email]
- if (not dest) and adr.type=='default':
- if adr.email:
- dest = [adr.email]
- src = tools.config.options['email_from']
- if not data['form']['partner_lang']:
- body = data['form']['email_body']
- else:
- cxt = context.copy()
- cxt['lang'] = partner.lang
- body = pool.get('res.users').browse(cr, uid, uid, context=cxt).company_id.follow_up_msg
-
- total_amt = followup_data.debit - followup_data.credit
- move_line = ''
- subtotal_due = 0.0
- subtotal_paid = 0.0
- subtotal_maturity = 0.0
- balance = 0.0
- l = '--------------------------------------------------------------------------------------------------------------------------'
- head = l+ '\n' + 'Date'.rjust(10) + '\t' + 'Description'.rjust(10) + '\t' + 'Ref'.rjust(10) + '\t' + 'Maturity date'.rjust(10) + '\t' + 'Due'.rjust(10) + '\t' + 'Paid'.rjust(10) + '\t' + 'Maturity'.rjust(10) + '\t' + 'Litigation'.rjust(10) + '\n' + l
- for i in data_lines:
- maturity = 0.00
- if i.date_maturity < time.strftime('%Y-%m-%d') and (i.debit - i.credit):
- maturity = i.debit - i.credit
- subtotal_due = subtotal_due + i.debit
- subtotal_paid = subtotal_paid + i.credit
- subtotal_maturity = subtotal_maturity + int(maturity)
- balance = balance + (i.debit - i.credit)
- move_line = move_line + (i.date).rjust(10) + '\t'+ (i.name).rjust(10) + '\t'+ (i.ref or '').rjust(10) + '\t' + (i.date_maturity or '').rjust(10) + '\t' + str(i.debit).rjust(10) + '\t' + str(i.credit).rjust(10) + '\t' + str(maturity).rjust(10) + '\t' + str(i.blocked).rjust(10) + '\n'
- move_line = move_line + l + '\n'+ '\t\t\t' + 'Sub total'.rjust(35) + '\t' + (str(subtotal_due) or '').rjust(10) + '\t' + (str(subtotal_paid) or '').rjust(10) + '\t' + (str(subtotal_maturity) or '').rjust(10)+ '\n'
- move_line = move_line + '\t\t\t' + 'Balance'.rjust(33) + '\t' + str(balance).rjust(10) + '\n' + l
- val = {
- 'partner_name':partner.name,
- 'followup_amount':total_amt,
- 'user_signature':data_user.name,
- 'company_name':data_user.company_id.name,
- 'company_currency':data_user.company_id.currency_id.name,
- 'line':move_line,
- 'heading': head,
- 'date':time.strftime('%Y-%m-%d'),
+class account_followup_print(osv.osv_memory):
+ _name = 'account.followup.print'
+ _description = 'Print Followup & Send Mail to Customers'
+ _columns = {
+ 'date': fields.date('Follow-up Sending Date', required=True, help="This field allow you to select a forecast date to plan your follow-ups"),
+ 'followup_id': fields.many2one('account_followup.followup', 'Follow-up', required=True)
}
- body = body%val
- sub = tools.ustr(data['form']['email_subject'])
- msg = ''
- if dest:
- tools.email_send(src,dest,sub,body)
- msg_sent += partner.name + '\n'
- else:
- msg += partner.name + '\n'
- msg_unsent += msg
- if not msg_unsent:
- summary = _("All E-mails have been successfully sent to Partners:.\n\n") + msg_sent
- else:
- msg_unsent = _("E-Mail not sent to following Partners, Email not available !\n\n") + msg_unsent
- msg_sent = msg_sent and _("\n\nE-Mail sent to following Partners successfully. !\n\n") + msg_sent
- line = '=========================================================================='
- summary = msg_unsent + line + msg_sent
- return {'summary' : summary}
- else:
- return {'summary' : '\n\n\nE-Mail has not been sent to any partner. If you want to send it, please tick send email confirmation on wizard.'}
- def _get_partners(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
+ def _get_followup(self, cr, uid, context=None):
+ company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
+ tmp = self.pool.get('account_followup.followup').search(cr, uid, [('company_id', '=', company_id)])
+ return tmp and tmp[0] or False
+
+ def do_continue(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ data = self.read(cr, uid, ids, [])[0]
+ model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_print_all')], context=context)
+ resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+ context.update({'followup_id': data['followup_id'], 'date':data['date']})
+ return {
+ 'name': _('Select partners'),
+ 'view_type': 'form',
+ 'context': context,
+ 'view_mode': 'tree,form',
+ 'res_model': 'account.followup.print.all',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ }
+
+ _defaults = {
+ 'date': time.strftime('%Y-%m-%d'),
+ 'followup_id': _get_followup,
+ }
+
+account_followup_print()
+
+class account_followup_print_all(osv.osv_memory):
+ _name = 'account.followup.print.all'
+ _description = 'Print Followup & Send Mail to Customers'
+ _columns = {
+ 'partner_ids': fields.many2many('account_followup.stat', 'partner_stat_rel', 'followup_id', 'stat_id', 'Partners', required=True),
+ 'email_conf': fields.boolean('Send email confirmation'),
+ 'email_subject': fields.char('Email Subject', size=64),
+ 'partner_lang': fields.boolean('Send Email in Partner Language', help='Do not change message text, if you want to send email in partner language, or configre from company'),
+ 'email_body': fields.text('Email body'),
+ 'summary': fields.text('Summary', required=True, readonly=True)
+ }
+ def _get_summary(self, cr, uid, context=None):
+ return context.get('summary', '')
+
+ def _get_partners(self, cr, uid, context=None):
+ return self._get_partners_followp(cr, uid, [], context)['partner_ids']
+
+ def _get_msg(self, cr, uid, context=None):
+ return self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.follow_up_msg
+
+ _defaults = {
+ 'email_body': _get_msg,
+ 'email_subject': 'Invoices Reminder',
+ 'partner_lang': True,
+ 'partner_ids': _get_partners,
+ 'summary': _get_summary,
+# 'email_body':'''
+#Date : %(date)s
+#
+#Dear %(partner_name)s,
+#
+#Please find in attachment a reminder of all your unpaid invoices, for a total amount due of:
+#
+#%(followup_amount).2f %(company_currency)s
+#
+#
+#Thanks,
+#--
+#%(user_signature)s
+#%(company_name)s
+# '''
+ }
+
+ def _get_partners_followp(self, cr, uid, ids, context=None):
+ data = {}
+ if context is None:
+ context = {}
+ if ids:
+ data = self.read(cr, uid, ids, [])[0]
cr.execute(
"SELECT l.partner_id, l.followup_line_id,l.date_maturity, l.date, l.id "\
"FROM account_move_line AS l "\
@@ -235,9 +125,10 @@ class followup_all_print(wizard.interface):
move_lines = cr.fetchall()
old = None
fups = {}
- fup_id = data['form']['followup_id']
+ fup_id = 'followup_id' in context and context['followup_id'] or data['followup_id']
+ date = 'date' in context and context['date'] or data['date']
- current_date = datetime.date(*time.strptime(data['form']['date'],
+ current_date = datetime.date(*time.strptime(date,
'%Y-%m-%d')[:3])
cr.execute(
"SELECT * "\
@@ -269,59 +160,138 @@ class followup_all_print(wizard.interface):
if partner_id not in partner_list:
partner_list.append(partner_id)
to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': partner_id}
-
- message = pool.get('res.users').browse(cr, uid, uid, context=context).company_id.follow_up_msg
- return {'partner_ids': partner_list, 'to_update': to_update, 'email_body':message}
+ return {'partner_ids': partner_list, 'to_update': to_update}
- def _get_screen1_values(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- company_id = pool.get('res.users').browse(cr, uid, uid).company_id.id
- tmp = pool.get('account_followup.followup').search(cr, uid, [('company_id', '=', company_id)])
- followup = tmp and tmp[0] or False
- return {'date': time.strftime('%Y-%m-%d'), 'followup_id': followup}
+ def do_mail(self ,cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ move_obj = self.pool.get('account.move.line')
+ user_obj = self.pool.get('res.users')
+ line_obj = self.pool.get('account_followup.stat')
+ data = self.read(cr, uid, ids, [])[0]
+ model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_print_all_msg')], context=context)
+ resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
- states = {
- 'init': {
- 'actions': [_get_screen1_values],
- 'result': {'type': 'form',
- 'arch': _followup_wizard_screen1_form,
- 'fields': _followup_wizard_screen1_fields,
- 'state': [
- ('end', 'Cancel'),
- ('next', 'Continue'),
- ]
- },
- },
- 'next': {
- 'actions': [_get_partners],
- 'result': {'type': 'form',
- 'arch': _followup_wizard_all_form,
- 'fields': _followup_wizard_all_fields,
- 'state': [
- ('end','Cancel'),
- ('print','Print Follow Ups & Send Mails'),
- ]
- },
- },
- 'print': {
- 'actions': [_update_partners],
- 'result': {'type': 'print',
- 'report':'account_followup.followup.print',
- 'state':'summary'},
- },
- 'summary': {
- 'actions': [_sendmail],
- 'result': {'type': 'form',
- 'arch': _email_summary_form,
- 'fields': _email_summary_fields,
- 'state':[('end','Ok')]
- },
- },
- }
+ if data['email_conf']:
+ mail_notsent = ''
+ msg_sent = ''
+ msg_unsent = ''
+ count = 0
+ data_user = user_obj.browse(cr, uid, uid)
+ move_lines = line_obj.browse(cr,uid,data['partner_ids'][0][2])
+ partners = []
+ dict_lines = {}
+ for line in move_lines:
+ partners.append(line.name)
+ dict_lines[line.name.id] =line
+ for partner in partners:
+ ids_lines = move_obj.search(cr,uid,[('partner_id','=',partner.id),('reconcile_id','=',False),('account_id.type','in',['receivable'])])
+ data_lines = move_obj.browse(cr,uid,ids_lines)
+ followup_data = dict_lines[partner.id]
+ dest = False
+ if partner.address:
+ for adr in partner.address:
+ if adr.type=='contact':
+ if adr.email:
+ dest = [adr.email]
+ if (not dest) and adr.type=='default':
+ if adr.email:
+ dest = [adr.email]
+ src = tools.config.options['email_from']
+ if not data['partner_lang']:
+ body = data['email_body']
+ else:
+ cxt = context.copy()
+ cxt['lang'] = partner.lang
+ body = user_obj.browse(cr, uid, uid, context=cxt).company_id.follow_up_msg
-followup_all_print('account_followup.followup.print.all')
+ total_amt = followup_data.debit - followup_data.credit
+ move_line = ''
+ subtotal_due = 0.0
+ subtotal_paid = 0.0
+ subtotal_maturity = 0.0
+ balance = 0.0
+ l = '--------------------------------------------------------------------------------------------------------------------------'
+ head = l+ '\n' + 'Date'.rjust(10) + '\t' + 'Description'.rjust(10) + '\t' + 'Ref'.rjust(10) + '\t' + 'Maturity date'.rjust(10) + '\t' + 'Due'.rjust(10) + '\t' + 'Paid'.rjust(10) + '\t' + 'Maturity'.rjust(10) + '\t' + 'Litigation'.rjust(10) + '\n' + l
+ for i in data_lines:
+ maturity = 0.00
+ if i.date_maturity < time.strftime('%Y-%m-%d') and (i.debit - i.credit):
+ maturity = i.debit - i.credit
+ subtotal_due = subtotal_due + i.debit
+ subtotal_paid = subtotal_paid + i.credit
+ subtotal_maturity = subtotal_maturity + int(maturity)
+ balance = balance + (i.debit - i.credit)
+ move_line = move_line + (i.date).rjust(10) + '\t'+ (i.name).rjust(10) + '\t'+ (i.ref or '').rjust(10) + '\t' + (i.date_maturity or '').rjust(10) + '\t' + str(i.debit).rjust(10) + '\t' + str(i.credit).rjust(10) + '\t' + str(maturity).rjust(10) + '\t' + str(i.blocked).rjust(10) + '\n'
+ move_line = move_line + l + '\n'+ '\t\t\t' + 'Sub total'.rjust(35) + '\t' + (str(subtotal_due) or '').rjust(10) + '\t' + (str(subtotal_paid) or '').rjust(10) + '\t' + (str(subtotal_maturity) or '').rjust(10)+ '\n'
+ move_line = move_line + '\t\t\t' + 'Balance'.rjust(33) + '\t' + str(balance).rjust(10) + '\n' + l
+ val = {
+ 'partner_name':partner.name,
+ 'followup_amount':total_amt,
+ 'user_signature':data_user.name,
+ 'company_name':data_user.company_id.name,
+ 'company_currency':data_user.company_id.currency_id.name,
+ 'line':move_line,
+ 'heading': head,
+ 'date':time.strftime('%Y-%m-%d'),
+ }
+ body = body%val
+ sub = tools.ustr(data['email_subject'])
+ msg = ''
+ if dest:
+ tools.email_send(src,dest,sub,body)
+ msg_sent += partner.name + '\n'
+ else:
+ msg += partner.name + '\n'
+ msg_unsent += msg
+ if not msg_unsent:
+ summary = _("All E-mails have been successfully sent to Partners:.\n\n") + msg_sent
+ else:
+ msg_unsent = _("E-Mail not sent to following Partners, Email not available !\n\n") + msg_unsent
+ msg_sent = msg_sent and _("\n\nE-Mail sent to following Partners successfully. !\n\n") + msg_sent
+ line = '=========================================================================='
+ summary = msg_unsent + line + msg_sent
+ context.update({'summary': summary})
+ else:
+ context.update({'summary': '\n\n\nE-Mail has not been sent to any partner. If you want to send it, please tick send email confirmation on wizard.'})
+ return {
+ 'name': _('Summary'),
+ 'view_type': 'form',
+ 'context': context,
+ 'view_mode': 'tree,form',
+ 'res_model': 'account.followup.print.all',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ 'nodestroy': True
+ }
+ def do_print(self, cr, uid, ids, context=None):
+ data = self.read(cr, uid, ids, [])[0]
+ res = self._get_partners_followp(cr, uid, ids, context)['to_update']
+ to_update = res
+ data['followup_id'] = 'followup_id' in context and context['followup_id'] or False
+ date = 'date' in context and context['date'] or data['date']
+ for id in to_update.keys():
+ if to_update[id]['partner_id'] in data['partner_ids'][0][2]:
+ cr.execute(
+ "UPDATE account_move_line "\
+ "SET followup_line_id=%s, followup_date=%s "\
+ "WHERE id=%s",
+ (to_update[id]['level'],
+ date, int(id),))
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+ datas = {
+ 'ids': [],
+ 'model': 'account_followup.followup',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account_followup.followup.print',
+ 'datas': datas,
+ 'nodestroy': True
+ }
+account_followup_print_all()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_followup/wizard/account_followup_print_view.xml b/addons/account_followup/wizard/account_followup_print_view.xml
new file mode 100644
index 00000000000..021fc52f63c
--- /dev/null
+++ b/addons/account_followup/wizard/account_followup_print_view.xml
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+ account.followup.print.form
+ account.followup.print
+ form
+
+
+
+
+
+
+ Send followups
+ ir.actions.act_window
+ account.followup.print
+ form
+ form
+ new
+
+
+
+
+
+ Send followups
+ client_action_multi
+
+ action
+ account_followup.followup
+
+
+
+
+
+
+
+
+ account.followup.print.all.form
+ account.followup.print.all
+ form
+
+
+
+
+
+
+ account.followup.print.all.msg.form
+ account.followup.print.all
+ form
+
+
+
+
+
+
+ Send followups
+ ir.actions.act_window
+ account.followup.print.all
+ form
+ form
+ new
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account_followup/wizard/wizard_view.xml b/addons/account_followup/wizard/wizard_view.xml
deleted file mode 100644
index 643265ddca2..00000000000
--- a/addons/account_followup/wizard/wizard_view.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
diff --git a/addons/account_invoice_layout/__openerp__.py b/addons/account_invoice_layout/__openerp__.py
index 5ba6a9291f4..f2df124dc75 100644
--- a/addons/account_invoice_layout/__openerp__.py
+++ b/addons/account_invoice_layout/__openerp__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -42,7 +42,8 @@
'update_xml': [
'security/ir.model.access.csv',
'account_invoice_layout_view.xml',
- 'account_invoice_layout_report.xml'
+ 'account_invoice_layout_report.xml',
+ 'wizard/account_invoice_special_message.xml',
],
'demo_xml': [],
'installable': True,
diff --git a/addons/account_invoice_layout/account_invoice_layout_report.xml b/addons/account_invoice_layout/account_invoice_layout_report.xml
index 2579609bfbf..747bc83d4c2 100644
--- a/addons/account_invoice_layout/account_invoice_layout_report.xml
+++ b/addons/account_invoice_layout/account_invoice_layout_report.xml
@@ -1,12 +1,12 @@
-
+ /> -->
).
#
@@ -15,10 +15,10 @@
# 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 invoice_special_message
+import account_invoice_special_message
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_invoice_layout/wizard/invoice_special_message.py b/addons/account_invoice_layout/wizard/account_invoice_special_message.py
similarity index 54%
rename from addons/account_invoice_layout/wizard/invoice_special_message.py
rename to addons/account_invoice_layout/wizard/account_invoice_special_message.py
index a97b3a144b0..5936e4c1579 100644
--- a/addons/account_invoice_layout/wizard/invoice_special_message.py
+++ b/addons/account_invoice_layout/wizard/account_invoice_special_message.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,38 +15,34 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
+from osv import osv, fields
-import wizard
-import time
-import datetime
-import pooler
+class account_invoice_special_msg(osv.osv_memory):
+ _name = 'account.invoice.special.msg'
+ _description = 'Account Invoice Special Message'
-invoice_form = """
-"""
+ _columns = {
+ 'message': fields.many2one('notify.message', 'Message', required = True, help="Message to Print at the bottom of report"),
+ }
-invoice_fields = {
- 'message': {'string': 'Message', 'type': 'many2one', 'relation': 'notify.message', 'required': True},
- }
-
-class wizard_report(wizard.interface):
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':invoice_form, 'fields':invoice_fields, 'state':[('end','Cancel'),('print','Print')]},
- },
- 'print': {
- 'actions': [],
- 'result': {'type':'print', 'report':'notify_account.invoice', 'state':'end'},
- },
- }
-
-wizard_report('wizard.notify_message')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, [])[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.invoice',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'notify_account.invoice',
+ 'datas': datas,
+ }
+account_invoice_special_msg()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_invoice_layout/wizard/account_invoice_special_message.xml b/addons/account_invoice_layout/wizard/account_invoice_special_message.xml
new file mode 100644
index 00000000000..b1cf7357241
--- /dev/null
+++ b/addons/account_invoice_layout/wizard/account_invoice_special_message.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+ Account Invioce Special Message
+ account.invoice.special.msg
+ form
+
+
+
+
+
+
+ Invoices with Layout and Message
+ ir.actions.act_window
+ account.invoice.special.msg
+ form
+ form
+
+ new
+
+
+
+
+
+ Account Invioce Special Message
+ client_print_multi
+
+ action
+ account.invoice
+
+
+
+
\ No newline at end of file
diff --git a/addons/account_payment/__openerp__.py b/addons/account_payment/__openerp__.py
index aa0829b689a..eba905a5253 100644
--- a/addons/account_payment/__openerp__.py
+++ b/addons/account_payment/__openerp__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -38,12 +38,14 @@
'update_xml': [
'security/account_payment_security.xml',
'security/ir.model.access.csv',
- 'payment_wizard.xml',
+ 'wizard/account_payment_pay_view.xml',
+ 'wizard/account_payment_create_order_view.xml',
'payment_view.xml',
'payment_workflow.xml',
'payment_sequence.xml',
'account_invoice_view.xml',
- 'payment_report.xml'
+ 'payment_report.xml',
+
],
'demo_xml': [],
'installable': True,
diff --git a/addons/account_payment/payment_view.xml b/addons/account_payment/payment_view.xml
index a0ab77a5934..b7d4262a2ca 100644
--- a/addons/account_payment/payment_view.xml
+++ b/addons/account_payment/payment_view.xml
@@ -107,7 +107,7 @@
-
+
diff --git a/addons/account_payment/payment_wizard.xml b/addons/account_payment/payment_wizard.xml
deleted file mode 100644
index 0cc5759b318..00000000000
--- a/addons/account_payment/payment_wizard.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/account_payment/wizard/__init__.py b/addons/account_payment/wizard/__init__.py
index 6254c9f5794..0a2db6f8fd0 100644
--- a/addons/account_payment/wizard/__init__.py
+++ b/addons/account_payment/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,12 +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 wizard_payment_order
-import wizard_pay
+import account_payment_order
+import account_payment_pay
import wizard_populate_statement
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_payment/wizard/account_payment_create_order_view.xml b/addons/account_payment/wizard/account_payment_create_order_view.xml
new file mode 100644
index 00000000000..d301e72e1ab
--- /dev/null
+++ b/addons/account_payment/wizard/account_payment_create_order_view.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+ payment.order.create.form
+ payment.order.create
+ form
+
+
+
+
+
+
+ payment.order.create.form
+ payment.order.create
+ form
+
+
+
+
+
+
+ Populate Payment
+ ir.actions.act_window
+ payment.order.create
+ form
+ form
+ new
+
+
+
+
\ No newline at end of file
diff --git a/addons/account_payment/wizard/account_payment_order.py b/addons/account_payment/wizard/account_payment_order.py
new file mode 100644
index 00000000000..001804c9e8a
--- /dev/null
+++ b/addons/account_payment/wizard/account_payment_order.py
@@ -0,0 +1,125 @@
+# -*- 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 lxml import etree
+
+from osv import osv, fields
+
+class payment_order_create(osv.osv_memory):
+ """
+ Create a payment object with lines corresponding to the account move line
+ to pay according to the date and the mode provided by the user.
+ Hypothesis:
+ - Small number of non-reconcilied move line , payment mode and bank account type,
+ - Big number of partner and bank account.
+
+ If a type is given, unsuitable account Entry lines are ignored.
+ """
+
+ _name = 'payment.order.create'
+ _description = 'payment.order.create'
+ _columns = {
+ 'duedate': fields.date('Due Date', required=True),
+ 'entries': fields.many2many('account.move.line', 'line_pay_rel', 'pay_id', 'line_id', 'Entries')
+ }
+ _defaults = {
+ 'duedate': time.strftime('%Y-%m-%d'),
+ }
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
+ res = super(payment_order_create, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
+ if context and 'line_ids' in context:
+ view_obj = etree.XML(res['arch'])
+ child = view_obj.getchildren()[0]
+ domain = '[("id", "in", '+ str(context['line_ids'])+')]'
+ field = etree.Element('field', attrib={'domain': domain, 'name':'entries', 'colspan':'4', 'height':'300', 'width':'800', 'nolabel':"1"})
+ child.addprevious(field)
+ res['arch'] = etree.tostring(view_obj)
+ return res
+
+ def create_payment(self, cr, uid, ids, context=None):
+ order_obj = self.pool.get('payment.order')
+ line_obj = self.pool.get('account.move.line')
+
+ data = self.read(cr, uid, ids, [], context)[0]
+ line_ids= data['entries']
+ if not line_ids: return {}
+
+ payment = order_obj.browse(cr, uid, data['active_id'],
+ context=context)
+ t = payment.mode and payment.mode.type.id or None
+ line2bank = pool.get('account.move.line').line2bank(cr, uid,
+ line_ids, t, context)
+
+ ## Finally populate the current payment with new lines:
+ for line in line_obj.browse(cr, uid, line_ids, context=context):
+ if payment.date_prefered == "now":
+ #no payment date => immediate payment
+ date_to_pay = False
+ elif payment.date_prefered == 'due':
+ date_to_pay = line.date_maturity
+ elif payment.date_prefered == 'fixed':
+ date_to_pay = payment.date_planned
+ pool.get('payment.line').create(cr, uid,{
+ 'move_line_id': line.id,
+ 'amount_currency': line.amount_to_pay,
+ 'bank_id': line2bank.get(line.id),
+ 'order_id': payment.id,
+ 'partner_id': line.partner_id and line.partner_id.id or False,
+ 'communication': line.ref or '/',
+ 'date': date_to_pay,
+ 'currency': line.invoice and line.invoice.currency_id.id or False,
+ }, context=context)
+ return {}
+
+ def search_entries(self, cr, uid, ids, context=None):
+ order_obj = self.pool.get('payment.order')
+ line_obj = self.pool.get('account.move.line')
+ mod_obj = self.pool.get('ir.model.data')
+
+ data = self.read(cr, uid, ids, [], context=context)[0]
+ search_due_date = data['duedate']
+ payment = order_obj.browse(cr, uid, context['active_id'], context=context)
+ ctx = ''
+ if payment.mode:
+ ctx = '''context="{'journal_id': %d}"''' % payment.mode.journal.id
+
+ # Search for move line to pay:
+ domain = [('reconcile_id', '=', False),('account_id.type', '=', 'payable'),('amount_to_pay', '>', 0)]
+ domain = domain + ['|',('date_maturity','<',search_due_date),('date_maturity','=',False)]
+ line_ids = line_obj.search(cr, uid, domain, context=context)
+ context.update({'line_ids': line_ids})
+ model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_create_payment_order_lines')], context=context)
+ resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+ return {
+ 'name': ('Entrie Lines'),
+ 'context': context,
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'payment.order.create',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ }
+
+payment_order_create()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_payment/wizard/account_payment_pay.py b/addons/account_payment/wizard/account_payment_pay.py
new file mode 100644
index 00000000000..74e1566520c
--- /dev/null
+++ b/addons/account_payment/wizard/account_payment_pay.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 .
+#
+##############################################################################
+import time
+from osv import fields, osv
+
+class account_payment_make_payment(osv.osv_memory):
+ _name = 'account.payment.make.payment'
+ _description = 'Account make payment'
+ _columns = {
+ }
+
+ def launch_wizard(self, cr, uid, ids, context):
+ """
+ Search for a wizard to launch according to the type.
+ If type is manual. just confirm the order.
+ """
+ obj_payment_order = self.pool.get('payment.order')
+ obj_model = self.pool.get('ir.model.data')
+ obj_act = self.pool.get('ir.actions.act_window')
+ order= obj_payment_order.browse(cr,uid,context['active_id'],context)
+ t= order.mode and order.mode.type.code or 'manual'
+ if t == 'manual' :
+ obj_payment_order.set_done(cr,uid,context['active_id'],context)
+ return {}
+
+ gw= obj_payment_order.get_wizard(t)
+ if not gw:
+ obj_payment_order.set_done(cr,uid,context['active_id'],context)
+ return {}
+
+ module, wizard= gw
+ result = mod_obj._get_id(cr, uid, module, wizard)
+ id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
+ result = act_obj.read(cr, uid, [id])[0]
+ #result['context'] = str({'fiscalyear': data['form']['fiscalyear']})
+ return result
+
+
+account_payment_make_payment()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account_payment/wizard/account_payment_pay_view.xml b/addons/account_payment/wizard/account_payment_pay_view.xml
new file mode 100644
index 00000000000..061c152361c
--- /dev/null
+++ b/addons/account_payment/wizard/account_payment_pay_view.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+ account.payment.make.payment.form
+ account.payment.make.payment
+ form
+
+
+
+
+
+
+ Make Payment
+ ir.actions.act_window
+ account.payment.make.payment
+ form
+ form
+
+ new
+
+
+
+
+
diff --git a/addons/account_payment/wizard/wizard_pay.py b/addons/account_payment/wizard/wizard_pay.py
deleted file mode 100644
index 7380cadb685..00000000000
--- a/addons/account_payment/wizard/wizard_pay.py
+++ /dev/null
@@ -1,68 +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 osv import fields
-import time
-
-
-def _launch_wizard(self, cr, uid, data, context):
- """
- Search for a wizard to launch according to the type.
- If type is manual. just confirm the order.
- """
-
- order_ref= pooler.get_pool(cr.dbname).get('payment.order')
- order= order_ref.browse(cr,uid,data['id'],context)
- t= order.mode and order.mode.type.code or 'manual'
- if t == 'manual' :
- order_ref.set_done(cr,uid,data['id'],context)
- return {}
-
- gw= order_ref.get_wizard(t)
- if not gw:
- order_ref.set_done(cr,uid,data['id'],context)
- return {}
-
- mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data')
- act_obj = pooler.get_pool(cr.dbname).get('ir.actions.wizard')
- module, wizard= gw
- result = mod_obj._get_id(cr, uid, module, wizard)
- id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
- result = act_obj.read(cr, uid, [id])[0]
- #result['context'] = str({'fiscalyear': data['form']['fiscalyear']})
- return result
-
-
-class wizard_pay(wizard.interface):
-
- states= {'init' : {'actions': [],
- 'result':{'type':'action',
- 'action':_launch_wizard,
- 'state':'end'}
- }
- }
-wizard_pay('pay_payment')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_payment/wizard/wizard_payment_order.py b/addons/account_payment/wizard/wizard_payment_order.py
deleted file mode 100644
index 7caa72dc666..00000000000
--- a/addons/account_payment/wizard/wizard_payment_order.py
+++ /dev/null
@@ -1,154 +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.misc import UpdateableStr
-import time
-
-
-FORM = UpdateableStr()
-
-FIELDS = {
- 'entries': {'string':'Entries', 'type':'many2many',
- 'relation': 'account.move.line',},
-}
-field_duedate={
- 'duedate': {'string':'Due Date', 'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d'),},
- }
-arch_duedate='''
-'''
-
-
-def search_entries(self, cr, uid, data, context):
- search_due_date=data['form']['duedate']
-
- pool = pooler.get_pool(cr.dbname)
- order_obj = pool.get('payment.order')
- line_obj = pool.get('account.move.line')
-
- payment = order_obj.browse(cr, uid, data['id'],
- context=context)
- ctx = ''
- if payment.mode:
- ctx = '''context="{'journal_id': %d}"''' % payment.mode.journal.id
-
- # Search for move line to pay:
- domain = [('reconcile_id', '=', False),('account_id.type', '=', 'payable'),('amount_to_pay', '>', 0)]
- domain = domain + ['|',('date_maturity','<',search_due_date),('date_maturity','=',False)]
- line_ids = line_obj.search(cr, uid, domain, context=context)
- FORM.string = '''
-''' % (','.join([str(x) for x in line_ids]), ctx)
- return {}
-
-def create_payment(self, cr, uid, data, context):
- line_ids= data['form']['entries'][0][2]
- if not line_ids: return {}
-
- pool= pooler.get_pool(cr.dbname)
- order_obj = pool.get('payment.order')
- line_obj = pool.get('account.move.line')
-
- payment = order_obj.browse(cr, uid, data['id'],
- context=context)
- t = payment.mode and payment.mode.type.id or None
- line2bank = pool.get('account.move.line').line2bank(cr, uid,
- line_ids, t, context)
-
- ## Finally populate the current payment with new lines:
- for line in line_obj.browse(cr, uid, line_ids, context=context):
- if payment.date_prefered == "now":
- #no payment date => immediate payment
- date_to_pay = False
- elif payment.date_prefered == 'due':
- date_to_pay = line.date_maturity
- elif payment.date_prefered == 'fixed':
- date_to_pay = payment.date_planned
- pool.get('payment.line').create(cr,uid,{
- 'move_line_id': line.id,
- 'amount_currency': line.amount_to_pay,
- 'bank_id': line2bank.get(line.id),
- 'order_id': payment.id,
- 'partner_id': line.partner_id and line.partner_id.id or False,
- 'communication': line.ref or '/',
- 'date': date_to_pay,
- 'currency': line.invoice and line.invoice.currency_id.id or False,
- }, context=context)
- return {}
-
-
-class wizard_payment_order(wizard.interface):
- """
- Create a payment object with lines corresponding to the account move line
- to pay according to the date and the mode provided by the user.
- Hypothesis:
- - Small number of non-reconcilied move line , payment mode and bank account type,
- - Big number of partner and bank account.
-
- If a type is given, unsuitable account Entry lines are ignored.
- """
- states = {
-
- 'init': {
- 'actions': [],
- 'result': {
- 'type': 'form',
- 'arch': arch_duedate,
- 'fields':field_duedate,
- 'state': [
- ('end','_Cancel'),
- ('search','_Search', '', True)
- ]
- },
- },
-
- 'search': {
- 'actions': [search_entries],
- 'result': {
- 'type': 'form',
- 'arch': FORM,
- 'fields': FIELDS,
- 'state': [
- ('end','_Cancel'),
- ('create','_Add to payment order', '', True)
- ]
- },
- },
- 'create': {
- 'actions': [],
- 'result': {
- 'type': 'action',
- 'action': create_payment,
- 'state': 'end'}
- },
- }
-
-wizard_payment_order('populate_payment')
-
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_report/__openerp__.py b/addons/account_report/__openerp__.py
index 2982c8439c4..d71d75f0bb3 100644
--- a/addons/account_report/__openerp__.py
+++ b/addons/account_report/__openerp__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -36,7 +36,8 @@
'security/ir.model.access.csv',
'account_view.xml',
'account_report.xml',
- 'account_wizard.xml'
+ 'account_wizard.xml',
+ 'wizard/account_report_print_indicators_view.xml',
],
'demo_xml': [],
'installable': True,
diff --git a/addons/account_report/account_wizard.xml b/addons/account_report/account_wizard.xml
index 84404f461ab..d56b6c9d565 100644
--- a/addons/account_report/account_wizard.xml
+++ b/addons/account_report/account_wizard.xml
@@ -1,8 +1,8 @@
-
-
+
+
diff --git a/addons/account_report/report/print_indicator.py b/addons/account_report/report/print_indicator.py
index 3c4af0ae5c5..ef94c9161f9 100644
--- a/addons/account_report/report/print_indicator.py
+++ b/addons/account_report/report/print_indicator.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 .
#
##############################################################################
@@ -215,10 +215,10 @@ class accounting_report_indicator(report_sxw.rml_parse):
obj_history=self.pool.get('account.report.history')
if data['select_base']=='year':
- tuple_search=('fiscalyear_id','in',data['base_selection'][0][2])
+ tuple_search=('fiscalyear_id','in',data['base_selection'])
base='year'
else:
- tuple_search=('period_id','in',data['base_selection'][0][2])
+ tuple_search=('period_id','in',data['base_selection'])
base='period'
history_ids=obj_history.search(self.cr,self.uid,[('name','=',object['id']),tuple_search])
@@ -232,7 +232,7 @@ class accounting_report_indicator(report_sxw.rml_parse):
data_val.append(item.val)
data_period.append(item.period_id.name)
else:
- for i in data['base_selection'][0][2]:
+ for i in data['base_selection']:
val_temp=[]
data_period.append(self.pool.get('account.fiscalyear').browse(self.cr,self.uid,i).name)
for item in obj_his:
diff --git a/addons/account_report/wizard/__init__.py b/addons/account_report/wizard/__init__.py
index 66a127f8278..2658c47cf17 100644
--- a/addons/account_report/wizard/__init__.py
+++ b/addons/account_report/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,11 +15,11 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
-import wizard_print_indicators
+import account_report_print_indicators
import wizard_print_indicators_with_pdf
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_report/wizard/account_report_print_indicators.py b/addons/account_report/wizard/account_report_print_indicators.py
new file mode 100644
index 00000000000..af855db2c89
--- /dev/null
+++ b/addons/account_report/wizard/account_report_print_indicators.py
@@ -0,0 +1,94 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+from lxml import etree
+
+from osv import fields, osv
+from tools.translate import _
+
+class account_report_print_indicators(osv.osv_memory):
+ """
+ This wizard will print indicators
+ """
+ _name = "account.report.print.indicators"
+ _description = "Print Indicators"
+ _columns = {
+ 'select_base': fields.selection([('year','Based On Fiscal Years'),
+ ('periods','Based on Fiscal Periods')],'Choose Criteria',required=True),
+ 'base_selection': fields.many2many('account.fiscalyear', 'indicator_rel','account_id','fiscalyear_id','Fiscal year'),
+ }
+ _defaults ={
+ 'select_base':'year'
+ }
+
+ def next(self, cr, uid, ids, context=None):
+ obj_model = self.pool.get('ir.model.data')
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, [])[0]
+ context.update({'base': data['select_base']})
+ model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','account_report_print_indicators_relation_view')])
+ resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'])[0]['res_id']
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'account.report.print.indicators',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ 'context': context,
+ }
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
+ record_id = context and context.get('base', False) or False
+ res = super(account_report_print_indicators, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
+ fields = res.get('fields',{})
+ if record_id:
+ if record_id == 'periods':
+ fields.update({'base_selection': {'domain': [],'string': 'Periods','relation': 'account.period','context': '', 'selectable': True,'type':'many2many'}})
+ view_obj = etree.XML(res['arch'])
+ child = view_obj.getchildren()[0]
+ field = etree.Element('field', attrib={'name':'base_selection'})
+ child.addprevious(field)
+ res['arch'] = etree.tostring(view_obj)
+ return res
+
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, [])[0]
+ data['select_base']=context['base']
+ if len(data['base_selection'])>8:
+ raise osv.except_osv(_('User Error!'),_("Please select maximum 8 records to fit the page-width."))
+ datas = {
+ 'ids': context.get('active_ids', []),
+ 'model': 'ir.ui.menu',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'print.indicators',
+ 'datas': datas,
+ }
+
+account_report_print_indicators()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_report/wizard/account_report_print_indicators_view.xml b/addons/account_report/wizard/account_report_print_indicators_view.xml
new file mode 100644
index 00000000000..9add8c9a616
--- /dev/null
+++ b/addons/account_report/wizard/account_report_print_indicators_view.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+ account.report.print.indicators.form
+ account.report.print.indicators
+ form
+
+
+
+
+
+
+ Print Indicators
+ ir.actions.act_window
+ account.report.print.indicators
+ form
+ form
+
+ new
+
+
+
+
+
+ account.report.print.indicators.relation.form
+ account.report.print.indicators
+ form
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account_report/wizard/wizard_print_indicators.py b/addons/account_report/wizard/wizard_print_indicators.py
deleted file mode 100644
index b2c20046e8d..00000000000
--- a/addons/account_report/wizard/wizard_print_indicators.py
+++ /dev/null
@@ -1,78 +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 = {
- 'select_base': {'string':'Choose Criteria', 'type':'selection','selection':[('year','Based On Fiscal Years'),('periods','Based on Fiscal Periods')],'required':True,},
-}
-
-next_form = '''
-'''
-
-next_fields = {
- 'base_selection': {'string':'Select Criteria', 'type':'many2many','required':True,},
-}
-
-def _load(self, cr, uid, data, context):
- data['form']['select_base'] = 'year'
- return data['form']
-
-def _load_base(self, cr, uid, data, context):
- next_fields['base_selection']['relation']='account.fiscalyear'
- if data['form']['select_base']=='periods':
- next_fields['base_selection']['relation']='account.period'
- return data['form']
-
-def _check_len(self, cr, uid, data, context):
- if len(data['form']['base_selection'][0][2])>8:
- raise wizard.except_wizard(_('User Error!'),_("Please select maximum 8 records to fit the page-width."))
- return data['form']
-
-class wizard_print_indicators(wizard.interface):
- states = {
- 'init': {
- 'actions': [_load],
- 'result': {'type': 'form', 'arch':form, 'fields':fields, 'state':[('end','Cancel'),('next','Next')]}
- },
- 'next': {
- 'actions': [_load_base],
- 'result': {'type':'form', 'arch':next_form, 'fields':next_fields, 'state':[('end','Cancel'),('print','Print')]}
- },
- 'print': {
- 'actions':[_check_len],
- 'result' :{'type':'print','report':'print.indicators', 'state':'end'}
- }
- }
-wizard_print_indicators('print.indicators')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_reporting/__openerp__.py b/addons/account_reporting/__openerp__.py
index d58fd77846e..b31c7fb516b 100644
--- a/addons/account_reporting/__openerp__.py
+++ b/addons/account_reporting/__openerp__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -33,7 +33,8 @@
'security/ir.model.access.csv',
'account_view.xml',
'account_report.xml',
- 'account_data.xml'
+ 'account_data.xml',
+ 'wizard/account_reporting_balance_report_view.xml',
],
'demo_xml': [],
'installable': True,
diff --git a/addons/account_reporting/account_report.xml b/addons/account_reporting/account_report.xml
index 7385f009f31..7603aaf5c45 100644
--- a/addons/account_reporting/account_report.xml
+++ b/addons/account_reporting/account_report.xml
@@ -7,12 +7,12 @@
name="account.report.bs"
rml="addons/account_report_bs/report/account_report_bs.rml"
auto="False"/>-->
-
+
+
+
+
+
+
diff --git a/addons/account_reporting/report/account_report_bs.py b/addons/account_reporting/report/account_report_bs.py
index ba097cea8e5..89ad84d1065 100644
--- a/addons/account_reporting/report/account_report_bs.py
+++ b/addons/account_reporting/report/account_report_bs.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 .
#
##############################################################################
@@ -61,7 +61,7 @@ class account_report_bs(report_sxw.rml_parse):
if object:
ids = [object.id]
elif not ids:
- ids = self.ids
+ ids = self.ids
if not ids:
return []
if not done:
@@ -69,7 +69,7 @@ class account_report_bs(report_sxw.rml_parse):
result = []
ctx = self.context.copy()
ctx['fiscalyear'] = form['fiscalyear']
- ctx['periods'] = form['periods'][0][2]
+ ctx['periods'] = form['periods']
report_objs = self.pool.get('account.report.bs').browse(self.cr, self.uid, ids)
title_name = False
if level==1:
@@ -130,7 +130,7 @@ class account_report_bs(report_sxw.rml_parse):
ids2 = [(x.code,x.id) for x in report_obj.child_id]
ids2.sort()
result += self.lines(form,[x[1] for x in ids2], done, level+1,object=False)
-
+
return result
# def check_child_id(self,account_id,level,ctx,report_type):
@@ -151,13 +151,13 @@ class account_report_bs(report_sxw.rml_parse):
# for child_id in acc_child_id :
# result += self.check_child_id(child_id,level+1,ctx,report_type)
# return result
-
-
-
-# def _sum_credit(self):
+#
+#
+#
+# def _sum_credit(self):
# return self.sum_credit
#
-# def _sum_debit(self):
+# def _sum_debit(self):
# return self.sum_debit
report_sxw.report_sxw('report.account.report.bs', 'account.report.bs', 'addons/account_reporting/report/account_report_bs.rml', parser=account_report_bs)
diff --git a/addons/account_reporting/wizard/__init__.py b/addons/account_reporting/wizard/__init__.py
index a61b6f88633..8371eaa5d82 100644
--- a/addons/account_reporting/wizard/__init__.py
+++ b/addons/account_reporting/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,10 +15,10 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
-import wizard_account_balance_report
+import account_reporting_balance_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_reporting/wizard/account_reporting_balance_report.py b/addons/account_reporting/wizard/account_reporting_balance_report.py
new file mode 100644
index 00000000000..3f67c64b64b
--- /dev/null
+++ b/addons/account_reporting/wizard/account_reporting_balance_report.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 _
+
+class account_reporting_balance_report(osv.osv_memory):
+
+ def _get_fiscalyear(self, cr, uid, context=None):
+ """Return default Fiscalyear value"""
+ fiscalyear_obj = self.pool.get('account.fiscalyear')
+ fiscalyear = fiscalyear_obj.find(cr, uid)
+ return fiscalyear
+
+ _name = 'account.reporting.balance.report'
+ _description = 'Account balance report'
+ _columns = {
+ 'fiscalyear': fields.many2one('account.fiscalyear', 'Fiscal year', required=True),
+ 'periods': fields.many2many('account.period', 'acc_reporting_relation', 'acc_id','period_id', 'Periods', help='All periods if empty'),
+ }
+ _defaults = {
+ 'fiscalyear' : _get_fiscalyear,
+ }
+
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids)[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.report.bs',
+ 'form': data
+ }
+ datas['form']['report_type'] = 'only_obj'
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.report.bs',
+ 'datas': datas,
+ }
+
+account_reporting_balance_report()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account_reporting/wizard/account_reporting_balance_report_view.xml b/addons/account_reporting/wizard/account_reporting_balance_report_view.xml
new file mode 100644
index 00000000000..b554152c19d
--- /dev/null
+++ b/addons/account_reporting/wizard/account_reporting_balance_report_view.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+ account.reporting.balance.report.form
+ account.reporting.balance.report
+ form
+
+
+
+
+
+
+ Account Balance
+ ir.actions.act_window
+ account.reporting.balance.report
+ form
+ form
+
+ new
+
+
+
+
+
+ Account Balance
+ client_print_multi
+
+ action
+ account.report.bs
+
+
+
+
diff --git a/addons/account_reporting/wizard/wizard_account_balance_report.py b/addons/account_reporting/wizard/wizard_account_balance_report.py
deleted file mode 100644
index 4496ff7a56d..00000000000
--- a/addons/account_reporting/wizard/wizard_account_balance_report.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import ir
-import pooler
-import time
-import netsvc
-from osv import fields, osv
-import mx.DateTime
-from mx.DateTime import RelativeDateTime
-
-from tools import config
-
-
-dates_form = '''
-'''
-
-#
-
-
-dates_fields = {
- 'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear', 'required': True},
- 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
-# 'report_type': {'string': 'Report Type','type': 'selection','selection': [('only_obj', 'Report Objects Only'),('with_account', 'Report Objects With Accounts'),('acc_with_child', 'Report Objects With Accounts and child of Accounts'),],'required': True},
-}
-
-back_form='''
-'''
-
-back_fields={
-}
-
-zero_form='''
-'''
-
-zero_fields={
-}
-
-periods_form='''
-'''
-
-periods_fields={
- 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'}
-}
-
-class wizard_report(wizard.interface):
- def _get_defaults(self, cr, uid, data, context):
- fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
- data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
- data['form']['report_type'] = 'only_obj'
- return data['form']
-
- states = {
- 'init': {
- 'actions': [_get_defaults],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('report','Print BalanceSheet')]}
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'account.report.bs', 'state':'end'}
- }
- }
-wizard_report('account.account.balancesheet.report')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py
index a006cb10bab..a3813f47fee 100644
--- a/addons/account_voucher/__openerp__.py
+++ b/addons/account_voucher/__openerp__.py
@@ -50,6 +50,7 @@
"voucher_view.xml",
"voucher_wizard.xml",
"account_view.xml",
+ "wizard/account_voucher_open_view.xml",
],
'certificate': '0037580727101',
"active": False,
diff --git a/addons/account_voucher/voucher_wizard.xml b/addons/account_voucher/voucher_wizard.xml
index 5e8a3f6ce5d..661acdd4241 100644
--- a/addons/account_voucher/voucher_wizard.xml
+++ b/addons/account_voucher/voucher_wizard.xml
@@ -1,20 +1,20 @@
-
-
-
+
+ parent="menu_action_voucher_list"/> -->
diff --git a/addons/account_voucher/wizard/__init__.py b/addons/account_voucher/wizard/__init__.py
index 136fd1d8ee9..bd436ecd135 100644
--- a/addons/account_voucher/wizard/__init__.py
+++ b/addons/account_voucher/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,8 +15,8 @@
# 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 open_voucher
+import account_voucher_open
diff --git a/addons/account_voucher/wizard/account_voucher_open.py b/addons/account_voucher/wizard/account_voucher_open.py
new file mode 100644
index 00000000000..b286217e106
--- /dev/null
+++ b/addons/account_voucher/wizard/account_voucher_open.py
@@ -0,0 +1,86 @@
+# -*- 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 _
+
+_types = {
+ 'pay_voucher':'Cash Payment Voucher',
+ 'bank_pay_voucher':'Bank Payment Voucher',
+ 'rec_voucher':'Cash Receipt Voucher',
+ 'bank_rec_voucher':'Bank Receipt Voucher',
+ 'cont_voucher':'Contra Voucher',
+ 'journal_sale_vou':'Journal Sale Voucher',
+ 'journal_pur_voucher':'Journal Purchase Voucher'
+ }
+_states = {
+ 'draft':'Draft',
+ 'proforma':'Pro-forma',
+ 'posted':'Posted',
+ 'cancel':'Cancel'
+ }
+
+class account_open_voucher(osv.osv_memory):
+ _name = "account.open.voucher"
+ _description = "Account Open Voucher"
+
+ _columns = {
+ 'type': fields.selection([('pay_voucher','Cash Payment Voucher'),
+ ('bank_pay_voucher','Bank Payment Voucher'),
+ ('rec_voucher','Cash Receipt Voucher'),
+ ('bank_rec_voucher','Bank Receipt Voucher'),
+ ('cont_voucher','Contra Voucher'),
+ ('journal_sale_vou','Journal Sale Voucher'),
+ ('journal_pur_voucher','Journal Purchase Voucher')],'Voucher Type', required=True),
+ 'state': fields.selection([('draft','Draft'),
+ ('proforma','Pro-forma'),
+ ('posted','Posted'),
+ ('cancel','Cancel')], 'State', required=True),
+ 'period_ids': fields.many2many('account.period', 'voucher_period_rel', 'voucher_id', 'period_id', 'Periods'),
+ }
+
+ def action_open_window(self, cr, uid, ids, context=None):
+ obj_period = self.pool.get('account.period')
+ obj_fyear = self.pool.get('account.fiscalyear')
+ periods = []
+ if context is None:
+ context = {}
+
+ form = self.read(cr, uid, ids, [])[0]
+ if not form['period_ids']:
+ year = obj_fyear.find(cr, uid)
+ periods = obj_period.search(cr, uid, [('fiscalyear_id','=',year)])
+ else:
+ periods = form['period_ids']
+ return {
+ 'domain': "[('type','=','%s'), ('state','=','%s'), ('period_id','in',%s)]" % (form['type'], form['state'], periods),
+ 'name': "%s - %s" % (_types[form['type']], _states[form['state']]),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'account.voucher',
+ 'view_id': False,
+ 'context': "{'type':'%s', 'state':'%s', 'period_id':%s}" % (form['type'], form['state'], periods),
+ 'type': 'ir.actions.act_window',
+ 'nodestroy': True
+ }
+
+account_open_voucher()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_voucher/wizard/account_voucher_open_view.xml b/addons/account_voucher/wizard/account_voucher_open_view.xml
new file mode 100644
index 00000000000..0d67c455c3f
--- /dev/null
+++ b/addons/account_voucher/wizard/account_voucher_open_view.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+ Open Vouchers
+ account.open.voucher
+ form
+
+
+
+
+
+
+ Open Vouchers
+ account.open.voucher
+ ir.actions.act_window
+ form
+ tree,form
+
+ {'record_id':active_id}
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account_voucher/wizard/open_voucher.py b/addons/account_voucher/wizard/open_voucher.py
deleted file mode 100644
index 5a3892e1a14..00000000000
--- a/addons/account_voucher/wizard/open_voucher.py
+++ /dev/null
@@ -1,104 +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 tools.translate import _
-import pooler
-
-_voucher_form = '''
-'''
-
-_types = {
- 'pay_voucher':'Cash Payment Voucher',
- 'bank_pay_voucher':'Bank Payment Voucher',
- 'rec_voucher':'Cash Receipt Voucher',
- 'bank_rec_voucher':'Bank Receipt Voucher',
- 'cont_voucher':'Contra Voucher',
- 'journal_sale_vou':'Journal Sale Voucher',
- 'journal_pur_voucher':'Journal Purchase Voucher'
-}
-_states = {
- 'draft':'Draft',
- 'proforma':'Pro-forma',
- 'posted':'Posted',
- 'cancel':'Cancel'
-}
-
-_voucher_fields = {
- 'type': {'string':'Voucher Type', 'type':'selection', 'selection':[
- ('pay_voucher','Cash Payment Voucher'),
- ('bank_pay_voucher','Bank Payment Voucher'),
- ('rec_voucher','Cash Receipt Voucher'),
- ('bank_rec_voucher','Bank Receipt Voucher'),
- ('cont_voucher','Contra Voucher'),
- ('journal_sale_vou','Journal Sale Voucher'),
- ('journal_pur_voucher','Journal Purchase Voucher')], 'required':True},
- 'state': {'string':'State', 'type':'selection', 'selection':[
- ('draft','Draft'),
- ('proforma','Pro-forma'),
- ('posted','Posted'),
- ('cancel','Cancel')], 'required':True},
- 'period_ids': {'string':'Periods', 'type':'many2many', 'relation':'account.period'},
-}
-
-def _action_open_window(self, cr, uid, data, context):
- form = data['form']
- periods = []
-
- if not form['period_ids'][0][2]:
- pool = pooler.get_pool(cr.dbname)
- period = pool.get('account.period')
- year = pool.get('account.fiscalyear')
-
- year = year.find(cr, uid)
- periods = period.search(cr, uid, [('fiscalyear_id','=',year)])
- else:
- periods = form['period_ids'][0][2]
-
- return {
- 'domain': "[('type','=','%s'), ('state','=','%s'), ('period_id','in',%s)]" % (form['type'], form['state'], periods),
- 'name': "%s - %s" % (_types[form['type']], _states[form['state']]),
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'account.voucher',
- 'view_id': False,
- 'context': "{'type':'%s', 'state':'%s', 'period_id':%s}" % (form['type'], form['state'], periods),
- 'type': 'ir.actions.act_window'
- }
-
-class OpenVoucherEntries(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':_voucher_form, 'fields':_voucher_fields, 'state':[('end','Cancel'),('open','Open Voucher Entries')]}
- },
- 'open': {
- 'actions': [],
- 'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
- }
- }
-OpenVoucherEntries('account.voucher.open')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_module_record/base_module_record.py b/addons/base_module_record/base_module_record.py
index 899241b4188..9eb3f2eda7f 100644
--- a/addons/base_module_record/base_module_record.py
+++ b/addons/base_module_record/base_module_record.py
@@ -36,6 +36,8 @@ class recording_objects_proxy(osv_pool):
_old_args = args[5].copy()
elif len(args) >= 5 and isinstance(args[4], dict):
_old_args = args[4].copy()
+ elif len(args) > 5 and args[3] != 'write' and isinstance(args[5], dict):
+ _old_args = args[5].copy()
else:
_old_args = None
res = super(recording_objects_proxy, self).execute(*args, **argv)
@@ -45,11 +47,17 @@ class recording_objects_proxy(osv_pool):
if mod and mod.recording:
if args[3] not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink'):
if _old_args is not None:
- if args[3] == 'create':
- args[4].update(_old_args)
- elif args[3] == 'write':
- args[5].update(_old_args)
- mod.recording_data.append(('query', args, argv,res))
+ if args[3] != 'write' and args[3] != 'create' and len(args) > 5 and isinstance(args[5], dict):
+ args=list(args)
+ args[5]=_old_args
+ args=tuple(args)
+ mod.recording_data.append(('osv_memory_action', args, argv ,None))
+ else:
+ if args[3] == 'create':
+ args[4].update(_old_args)
+ elif args[3] == 'write':
+ args[5].update(_old_args)
+ mod.recording_data.append(('query', args, argv,res))
return res
def exec_workflow(self, *args, **argv):
@@ -61,7 +69,7 @@ class recording_objects_proxy(osv_pool):
return res
recording_objects_proxy()
-
+
class xElement(minidom.Element):
"""dom.Element with compact print
The Element in minidom has a problem: if printed, adds whitespace
@@ -113,6 +121,15 @@ class eval(yaml.YAMLObject):
def __repr__(self):
return 'eval(%s)' % (str(self.expr,))
+class function(yaml.YAMLObject):
+ yaml_tag = u'!python'
+ def __init__(self, model, action=None,attrs={}):
+ self.model = model
+ self.action = action
+ self.attrs=attrs
+ def __repr__(self):
+ return '!python {model: %s}: |' % (str(self.model), )
+
class base_module_record(osv.osv):
_name = "ir.module.record"
_columns = {
@@ -143,7 +160,8 @@ class base_module_record(osv.osv):
if type(id)==type(()):
id=id[0]
if (model,id) in self.ids:
- return self.ids[(model,id)], False
+ res_id = self.ids[(model,id)]
+ return res_id, False
dt = self.pool.get('ir.model.data')
dtids = dt.search(cr, uid, [('model','=',model), ('res_id','=',id)])
if not dtids:
@@ -153,13 +171,14 @@ class base_module_record(osv.osv):
return obj.module+'.'+obj.name, obj.noupdate
def _create_record(self, cr, uid, doc, model, data, record_id, noupdate=False):
-
+ data_pool = self.pool.get('ir.model.data')
model_pool = self.pool.get(model)
record = doc.createElement('record')
record.setAttribute("id", record_id)
record.setAttribute("model", model)
record_list = [record]
+
lids = data_pool.search(cr, uid, [('model','=',model)])
res = data_pool.read(cr, uid, lids[:1], ['module'])
if res:
@@ -212,17 +231,7 @@ class base_module_record(osv.osv):
newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2])
valitem[1]=newid
self.ids[(fields[key]['relation'], valitem[1])] = newid
-# if valitem[0] in (0,1):
-# if key in model_pool._columns:
-# fname = model_pool._columns[key]._fields_id
-# else:
-# fname = model_pool._inherit_fields[key][2]._fields_id
-# valitem[2][fname] = record_id
-# newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1])
-# if not newid:
-# newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2])
-# self.ids[(fields[key]['relation'], valitem[1])] = newid
-#
+
childrecord, update = self._create_record(cr, uid, doc, fields[key]['relation'],valitem[2], newid)
noupdate = noupdate or update
record_list += childrecord
@@ -254,26 +263,31 @@ class base_module_record(osv.osv):
model_pool = self.pool.get(model)
data_pool = self.pool.get('ir.model.data')
-
lids = data_pool.search(cr, uid, [('model','=',model)])
+
res = data_pool.read(cr, uid, lids[:1], ['module'])
attrs={}
if res:
self.depends[res[0]['module']]=True
fields = model_pool.fields_get(cr, uid)
defaults={}
- defaults[model] = model_pool.default_get(cr, uid, data)
+ try:
+ defaults[model] = model_pool.default_get(cr, uid, data)
+ except:
+ defaults[model]={}
for key,val in data.items():
if ((key in defaults[model]) and (val == defaults[model][key])) and not(fields[key].get('required',False)):
continue
- if not (val or (fields[key]['type']=='function')):
+ if fields[key]['type'] in ('integer','float'):
+ if not val:
+ val=0.0
+ attrs[key] = val
+ elif not (val or (fields[key]['type']=='function')):
continue
elif fields[key]['type'] in ('boolean',):
if not val:
continue
attrs[key] = val
- elif fields[key]['type'] in ('integer','float'):
- attrs[key] = val
elif fields[key]['type'] in ('many2one',):
if type(val) in (type(''), type(u'')):
id = val
@@ -420,9 +434,9 @@ class base_module_record(osv.osv):
def _generate_object_yaml(self, cr, uid, rec, result=None):
if self.mode=="create":
- id = self._create_id(cr, uid, rec[2],rec[4])
- self.ids[(rec[2], result)] = id
- record = self._create_yaml_record(cr, uid, rec[2], rec[4], id)
+ yml_id = self._create_id(cr, uid, rec[2],rec[4])
+ self.ids[(rec[2], result)] = yml_id
+ record = self._create_yaml_record(cr, uid, rec[2], rec[4], yml_id)
return record
if self.mode=="workflow":
id,update = self._get_id(cr, uid, rec[2], rec[4])
@@ -445,6 +459,32 @@ class base_module_record(osv.osv):
self.ids[(rec[2], result)] = id
return record
+ def _generate_function_yaml(self, cr, uid, args):
+ db, uid, model, action, ids, context = args
+ temp_context = context.copy()
+ active_id = temp_context['active_id']
+ active_model = temp_context['active_model']
+ active_id, update = self._get_id(cr, uid, active_model, active_id)
+ if not active_id:
+ active_id = 1
+ rec_id, noupdate = self._get_id(cr, uid, model, ids[0])
+ temp_context['active_id'] = "ref('%s')"%unicode(active_id)
+ temp_context['active_ids'][0] = "ref('%s')"%str(active_id)
+ function={}
+ function['model'] = model
+ function['action'] = action
+ attrs = "self.%s(cr, uid, [ref('%s')], {" %(action, rec_id, )
+ for k, v in temp_context.iteritems():
+ if isinstance(v, str):
+ f= "'"+k+"': "+"'%s'"%v + ", "
+ else:
+ v=str(v).replace('"', '')
+ f= "'"+k+"': "+"%s"%v + ", "
+ attrs = attrs + f
+ attrs=str(attrs)+'})'
+ function['attrs'] = attrs
+ return function
+
def _generate_assert_xml(self, rec, doc):
pass
@@ -496,15 +536,27 @@ class base_module_record(osv.osv):
self.mode="copy"
elif rec[0] == 'workflow':
self.mode="workflow"
+ elif rec[0] == 'osv_memory_action':
+ self.mode='osv_memory_action'
else:
continue
if self.mode == "workflow":
record= self._generate_object_yaml(cr, uid, rec[1],rec[0])
yaml_file+="!comment Performing a workflow action %s on module %s"%(record['action'], record['model']) + '''\n'''
object=yaml.load(unicode('''\n !workflow %s \n'''%record,'iso-8859-1'))
+ attrs=attrs.replace("''", '"')
yaml_file += str(object) + '''\n\n'''
+ elif self.mode == 'osv_memory_action':
+ osv_action= self._generate_function_yaml(cr, uid, rec[1])
+ yaml_file+="!comment Performing an osv_memory action %s on module %s"%(osv_action['action'], osv_action['model']) + '''\n'''
+ osv_action=yaml.load(unicode('''\n !python %s \n'''%osv_action,'iso-8859-1'))
+ yaml_file += str(osv_action) + '''\n'''
+ attrs=yaml.dump(osv_action.attrs, default_flow_style=False)
+ attrs=attrs.replace("''", '"')
+ attrs=attrs.replace("'", '')
+ yaml_file += attrs + '''\n\n'''
else:
- record= self._generate_object_yaml(cr, uid, rec[1],rec[3])
+ record= self._generate_object_yaml(cr, uid, rec[1], rec[3])
if self.mode == "create" or self.mode == "copy":
yaml_file+="!comment Creating a %s record"%(record['model']) + '''\n'''
else:
@@ -517,9 +569,7 @@ class base_module_record(osv.osv):
yaml_result=''''''
for line in yaml_file.split('\n'):
line=line.replace("''","'")
- if line.find('!record') == 0:
- line = "- \n" + " " + line
- elif line.find('!workflow') == 0:
+ if (line.find('!record') == 0) or (line.find('!workflow') == 0) or (line.find('!python') == 0):
line = "- \n" + " " + line
elif line.find('!comment') == 0:
line=line.replace('!comment','- \n ')
diff --git a/addons/crm_profiling/i18n/ru.po b/addons/crm_profiling/i18n/ru.po
index 16c4e3aeb79..c7c6c60a932 100644
--- a/addons/crm_profiling/i18n/ru.po
+++ b/addons/crm_profiling/i18n/ru.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: 2008-11-01 16:12+0000\n"
-"Last-Translator: Sergei Kostigoff \n"
+"PO-Revision-Date: 2010-05-01 15:57+0000\n"
+"Last-Translator: g0nz1k12 \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:17+0000\n"
+"X-Launchpad-Export-Date: 2010-05-02 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm_profiling
@@ -116,7 +116,7 @@ msgstr ""
#. module: crm_profiling
#: field:crm.segmentation,profiling_active:0
msgid "Use The Profiling Rules"
-msgstr ""
+msgstr "Используйте Правила Профилирования"
#. module: crm_profiling
#: view:crm_profiling.question:0
@@ -147,7 +147,7 @@ msgstr "Вопросы"
#. module: crm_profiling
#: field:crm.segmentation,parent_id:0
msgid "Parent Profile"
-msgstr ""
+msgstr "Родительский Профиль"
#. module: crm_profiling
#: wizard_button:open_questionnaire,init,end:0
diff --git a/addons/hr_holidays/i18n/es.po b/addons/hr_holidays/i18n/es.po
index 60a661a9717..0aa743eeb55 100644
--- a/addons/hr_holidays/i18n/es.po
+++ b/addons/hr_holidays/i18n/es.po
@@ -7,71 +7,71 @@ 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-11-09 13:37+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2010-04-30 21:12+0000\n"
+"Last-Translator: Cristian Salamea (GnuThink) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
+"X-Launchpad-Export-Date: 2010-05-01 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
#: model:ir.ui.menu,name:hr_holidays.menu_open_ask_holidays_new
msgid "New Holidays Request"
-msgstr ""
+msgstr "Nueva petición de vacaciones"
#. module: hr_holidays
#: model:ir.ui.menu,name:hr_holidays.menu_action_all_holiday
msgid "All Holidays Requests"
-msgstr ""
+msgstr "Todas las peticiones de vacaciones"
#. module: hr_holidays
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Nombre de modelo no válido en la definición de la acción"
#. module: hr_holidays
#: field:hr.holidays.per.user,remaining_leaves:0
msgid "Remaining Leaves"
-msgstr ""
+msgstr "Vacaciones disponibles"
#. module: hr_holidays
#: model:ir.actions.act_window,name:hr_holidays.action_holiday_waiting
msgid "Requests Awaiting for Validation"
-msgstr ""
+msgstr "Peticiones esperando validación"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Light Blue"
-msgstr ""
+msgstr "Azul claro"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Brown"
-msgstr ""
+msgstr "Café"
#. module: hr_holidays
#: xsl:holidays.summary:0
msgid "of the"
-msgstr ""
+msgstr "del"
#. module: hr_holidays
#: xsl:holidays.summary:0
msgid "Off-Days' Summary"
-msgstr ""
+msgstr "Resumen días de ausencia"
#. module: hr_holidays
#: view:hr.holidays:0
#: view:hr.holidays.per.user:0
#: model:process.transition,name:hr_holidays.process_transition_employeeholidays0
msgid "Employee Holidays"
-msgstr ""
+msgstr "Vacaciones de empleado"
#. module: hr_holidays
#: view:hr.holidays:0
msgid "Set to Draft"
-msgstr ""
+msgstr "Cambiar a borrador"
#. module: hr_holidays
#: view:hr.holidays.per.user:0
@@ -79,27 +79,27 @@ msgstr ""
#: model:ir.model,name:hr_holidays.model_hr_holidays
#: model:process.node,name:hr_holidays.process_node_holidays0
msgid "Holidays"
-msgstr ""
+msgstr "Vacaciones"
#. module: hr_holidays
#: xsl:holidays.summary:0
msgid "to"
-msgstr ""
+msgstr "hasta"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Light Cyan"
-msgstr ""
+msgstr "Cian Claro"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Light Green"
-msgstr ""
+msgstr "Verde claro"
#. module: hr_holidays
#: model:process.transition,name:hr_holidays.process_transition_employeedeclaration0
msgid "Employee Declaration"
-msgstr ""
+msgstr "Declaración de empleado"
#. module: hr_holidays
#: view:hr.holidays:0
@@ -111,7 +111,7 @@ msgstr "Validar"
#. module: hr_holidays
#: model:process.transition,name:hr_holidays.process_transition_refusedrequest0
msgid "Refused Request"
-msgstr ""
+msgstr "Petición rechazada"
#. module: hr_holidays
#: model:process.node,name:hr_holidays.process_node_approved0
@@ -121,113 +121,113 @@ msgstr "Aprobado"
#. module: hr_holidays
#: selection:hr.holidays.summary.employee,init,holiday_type:0
msgid "Both"
-msgstr ""
+msgstr "Ambas"
#. module: hr_holidays
#: view:hr.holidays:0
msgid "Refuse"
-msgstr ""
+msgstr "Rechazar"
#. module: hr_holidays
#: wizard_button:hr.holidays.summary,notify,end:0
#: wizard_button:hr.holidays.summary.employee,notify,end:0
msgid "Ok"
-msgstr ""
+msgstr "Ok"
#. module: hr_holidays
#: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday
msgid "My Holidays Requests"
-msgstr ""
+msgstr "Mis peticiones de vacaciones"
#. module: hr_holidays
#: field:hr.holidays,notes:0
#: field:hr.holidays.per.user,notes:0
msgid "Notes"
-msgstr ""
+msgstr "Notas"
#. module: hr_holidays
#: field:hr.holidays,holiday_status:0
#: field:hr.holidays.log,holiday_status:0
#: field:hr.holidays.per.user,holiday_status:0
msgid "Holiday's Status"
-msgstr ""
+msgstr "Estado de vacaciones"
#. module: hr_holidays
#: model:process.transition,note:hr_holidays.process_transition_refusedrequest0
msgid "Request is refused."
-msgstr ""
+msgstr "Petición es rechazada."
#. module: hr_holidays
#: model:ir.ui.menu,name:hr_holidays.menu_open_ask_holidays
msgid "Holidays Management"
-msgstr ""
+msgstr "Gestión de vacaciones"
#. module: hr_holidays
#: xsl:holidays.summary:0
msgid "Analyze from"
-msgstr ""
+msgstr "Análisis desde"
#. module: hr_holidays
#: model:ir.actions.report.xml,name:hr_holidays.report_holidays_summary
msgid "Summary Of Holidays"
-msgstr ""
+msgstr "Resumen de las vacaciones"
#. module: hr_holidays
#: model:process.node,note:hr_holidays.process_node_calendar0
msgid "The holiday is set in the calendar"
-msgstr ""
+msgstr "Las vacaciones son fijadas en el calendario"
#. module: hr_holidays
#: view:hr.holidays.status:0
msgid "Holiday status"
-msgstr ""
+msgstr "Estado Vacaciones"
#. module: hr_holidays
#: model:ir.model,name:hr_holidays.model_hr_holidays_status
msgid "Holidays Status"
-msgstr ""
+msgstr "Estado de Vacaciones"
#. module: hr_holidays
#: field:hr.holidays,date_to:0
msgid "Vacation end day"
-msgstr ""
+msgstr "Fecha Fin Vacaciones"
#. module: hr_holidays
#: view:hr.holidays.per.user:0
msgid "Holidays Allowed"
-msgstr ""
+msgstr "Vacaciones permitidas"
#. module: hr_holidays
#: model:process.node,note:hr_holidays.process_node_legaldeclaration0
msgid "Legal Declaration Document to declare new employee"
-msgstr ""
+msgstr "Documento de declaración oficial para declarar nuevo empleado"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Magenta"
-msgstr ""
+msgstr "Violeta"
#. module: hr_holidays
#: model:ir.model,name:hr_holidays.model_hr_holidays_per_user
msgid "Holidays Per User"
-msgstr ""
+msgstr "Vacaciones por usuario"
#. module: hr_holidays
#: view:hr.holidays.status:0
msgid "Define holiday status"
-msgstr ""
+msgstr "Definir Estado Vacaciones"
#. module: hr_holidays
#: selection:hr.holidays.summary,init,holiday_type:0
#: selection:hr.holidays.summary.employee,init,holiday_type:0
msgid "Confirmed"
-msgstr ""
+msgstr "Confirmado"
#. module: hr_holidays
#: wizard_field:hr.holidays.summary,init,date_from:0
#: wizard_field:hr.holidays.summary.employee,init,date_from:0
msgid "From"
-msgstr ""
+msgstr "Desde"
#. module: hr_holidays
#: view:hr.holidays:0
@@ -239,73 +239,73 @@ msgstr "Confirmar"
#: model:ir.actions.act_window,name:hr_holidays.action_my_holiday_waiting
#: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday_waiting
msgid "My Awaiting Confirmation Holidays Requests"
-msgstr ""
+msgstr "Mis peticiones de vacaciones esperando confirmación"
#. module: hr_holidays
#: field:hr.holidays,user_id:0
msgid "Employee_id"
-msgstr ""
+msgstr "Empleado"
#. module: hr_holidays
#: model:process.node,note:hr_holidays.process_node_holidaysdefinition0
msgid "Encoding of annual available holidays."
-msgstr ""
+msgstr "Codificación de vacaciones disponibles anuales."
#. module: hr_holidays
#: field:hr.holidays,employee_id:0
#: field:hr.holidays.log,employee_id:0
#: field:hr.holidays.per.user,employee_id:0
msgid "Employee"
-msgstr ""
+msgstr "Empleado"
#. module: hr_holidays
#: selection:hr.holidays,state:0
msgid "Waiting Validation"
-msgstr ""
+msgstr "Esperando Validación"
#. module: hr_holidays
#: model:process.transition,note:hr_holidays.process_transition_employeeholidays0
msgid "Employee get holidays"
-msgstr ""
+msgstr "Empleado obtiene vacaciones"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Light Salmon"
-msgstr ""
+msgstr "Salmón claro"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Wheat"
-msgstr ""
+msgstr "Abano"
#. module: hr_holidays
#: field:hr.holidays.log,nb_holidays:0
msgid "Number of Holidays Requested"
-msgstr ""
+msgstr "Número de vacaciones solicitadas"
#. module: hr_holidays
#: model:ir.actions.act_window,name:hr_holidays.act_hr_employee_holiday_request
msgid "My Holiday Requests"
-msgstr ""
+msgstr "Mis peticiones"
#. module: hr_holidays
#: view:hr.holidays:0
#: view:hr.holidays.per.user:0
msgid "Number of Days"
-msgstr ""
+msgstr "Número de Días"
#. module: hr_holidays
#: field:hr.holidays.status,name:0
#: model:ir.actions.act_window,name:hr_holidays.open_view_holiday_status
#: model:ir.ui.menu,name:hr_holidays.menu_open_view_holiday_status
msgid "Holiday Status"
-msgstr ""
+msgstr "Estado de Vacaciones"
#. module: hr_holidays
#: wizard_view:hr.holidays.summary,init:0
#: wizard_view:hr.holidays.summary.employee,init:0
msgid "Report Options"
-msgstr ""
+msgstr "Opciones de Reporte"
#. module: hr_holidays
#: constraint:ir.ui.view:0
@@ -315,74 +315,75 @@ msgstr "¡XML inválido para la definición de la vista!"
#. module: hr_holidays
#: model:process.node,note:hr_holidays.process_node_approved0
msgid "His manager approves the request"
-msgstr ""
+msgstr "Su responsable aprueba la petición"
#. module: hr_holidays
#: model:process.transition,note:hr_holidays.process_transition_holidaysdefrequest0
msgid "If holidays available, employee can take it and fill it."
msgstr ""
+"Si hay vacaciones disponibles, el empleado puede cogerla y rellenarla."
#. module: hr_holidays
#: wizard_view:hr.holidays.summary.employee,notify:0
msgid "You have to select at least 1 Employee. Try again."
-msgstr ""
+msgstr "Selecciona por lo menos un empleado. Prueba otra vez."
#. module: hr_holidays
#: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday_validate
msgid "My Validated Holidays Requests"
-msgstr ""
+msgstr "Mis peticiones de vacaciones validadas"
#. module: hr_holidays
#: wizard_field:hr.holidays.summary.employee,init,emp:0
msgid "Employee(s)"
-msgstr ""
+msgstr "Empleado(s)"
#. module: hr_holidays
#: field:hr.holidays,number_of_days:0
msgid "Number of Days in this Holiday Request"
-msgstr ""
+msgstr "Número de días solicitados en esta petición"
#. module: hr_holidays
#: view:hr.holidays.per.user:0
#: model:ir.actions.act_window,name:hr_holidays.action_holidays_per_user
#: model:ir.ui.menu,name:hr_holidays.menu_open_holidays_per_user
msgid "Holidays Per Employee"
-msgstr ""
+msgstr "Vacaciones por empleado"
#. module: hr_holidays
#: field:hr.holidays.status,limit:0
msgid "Allow to override Limit"
-msgstr ""
+msgstr "Permite superar el límite"
#. module: hr_holidays
#: field:hr.holidays.log,holiday_user_id:0
msgid "Holidays user"
-msgstr ""
+msgstr "Usuario de vacaciones"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Lavender"
-msgstr ""
+msgstr "Lavanda"
#. module: hr_holidays
#: model:ir.model,name:hr_holidays.model_hr_holidays_log
msgid "hr.holidays.log"
-msgstr ""
+msgstr "Log de Vacaciones"
#. module: hr_holidays
#: model:ir.actions.wizard,name:hr_holidays.wizard_holidays_summary
msgid "Print Summary of Employee's Holidays"
-msgstr ""
+msgstr "Imprimir resumen de vacaciones"
#. module: hr_holidays
#: model:process.node,name:hr_holidays.process_node_calendar0
msgid "Calendar"
-msgstr ""
+msgstr "Calendario"
#. module: hr_holidays
#: field:hr.holidays,date_from:0
msgid "Vacation start day"
-msgstr ""
+msgstr "Inicio de Vacaciones"
#. module: hr_holidays
#: model:ir.module.module,description:hr_holidays.module_meta_information
@@ -420,164 +421,180 @@ msgid ""
" Administration / Users / Users\n"
" for example, you maybe will do it for the user 'admin'.\n"
msgstr ""
+"Recursos Humanos: Registro y seguimiento de Vacaciones\n"
+"Este modulo permite administrar las vacaciones y peticiones. Para cada "
+"empleado se puede definir un numero de vacaciones disponibles.\n"
+"Ademas:\n"
+"Sincronizacion con la agenda (usando el modulo de CRM) es posible: "
+"automatizar la creacion de casos cuando una peticion es aceptada, tiene un "
+"link para los estados de vacaciones. Puede configurar esta info en el color "
+"de su preferencia.\n"
+"Estado de Vacaciones:\n"
+"Un empleado puede crear peticiones negativas (pedir -2 dias por ejemplo). es "
+"es considerado por el sistema como una peticion de mas dias de ausencia.\n"
+"Hay 2 maneras para imprimir las vacaciones:\n"
+"Elegir empleados por departamento y usar un asistente.\n"
+"O imprimir un empleado especifico.\n"
+"Ademas el asistente permite elegir las vacaciones validadas y confirmadas o "
+"solo una.\n"
#. module: hr_holidays
#: wizard_view:hr.holidays.summary,notify:0
#: wizard_view:hr.holidays.summary.employee,notify:0
msgid "Notification"
-msgstr ""
+msgstr "Notificación"
#. module: hr_holidays
#: model:process.node,note:hr_holidays.process_node_holidaysrequest0
msgid "Employee fills in a request for holidays"
-msgstr ""
+msgstr "Petición de Vacaciones"
#. module: hr_holidays
#: model:process.transition,note:hr_holidays.process_transition_setholiday0
msgid "Holiday is set in the calendar."
-msgstr ""
+msgstr "Las vacaciones son fijadas en el calendario."
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Light Coral"
-msgstr ""
+msgstr "Coral claro"
#. module: hr_holidays
#: model:ir.actions.act_window,name:hr_holidays.action_my_holiday_available
#: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday_available
msgid "My Available Holidays"
-msgstr ""
+msgstr "Mis vacaciones disponibles"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Black"
-msgstr ""
+msgstr "Negro"
#. module: hr_holidays
#: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday_refuse
msgid "My Refused Holidays Requests"
-msgstr ""
+msgstr "Mis peticiones rechazadas"
#. module: hr_holidays
#: model:process.transition,name:hr_holidays.process_transition_setholiday0
msgid "Set Holiday"
-msgstr ""
+msgstr "Fijar vacaciones"
#. module: hr_holidays
#: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday_draft
msgid "My Draft Holidays Requests"
-msgstr ""
+msgstr "Mis peticiones en borrador"
#. module: hr_holidays
#: field:hr.holidays.per.user,max_leaves:0
msgid "Maximum Leaves Allowed"
-msgstr ""
+msgstr "Máximo de vacaciones permitidas"
#. module: hr_holidays
#: field:hr.holidays,state:0
msgid "Status"
-msgstr ""
+msgstr "Estado"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Ivory"
-msgstr ""
+msgstr "Marfil"
#. module: hr_holidays
#: model:ir.actions.act_window,name:hr_holidays.action_my_holiday
msgid "My Holidays Request"
-msgstr ""
+msgstr "Mis peticiones de vacaciones"
#. module: hr_holidays
#: field:hr.holidays.status,color_name:0
msgid "Color of the status"
-msgstr ""
+msgstr "Color de Estado"
#. module: hr_holidays
#: selection:hr.holidays.summary,init,holiday_type:0
msgid "Both Validated and Confirmed"
-msgstr ""
+msgstr "Validadas y Confirmadas"
#. module: hr_holidays
#: field:hr.holidays.per.user,leaves_taken:0
msgid "Leaves Already Taken"
-msgstr ""
+msgstr "Vacaciones realizadas"
#. module: hr_holidays
#: xsl:holidays.summary:0
msgid "holidays."
-msgstr ""
+msgstr "Vacaciones."
#. module: hr_holidays
#: selection:hr.holidays,state:0
msgid "draft"
-msgstr ""
+msgstr "Borrador"
#. module: hr_holidays
#: field:hr.holidays.per.user,user_id:0
msgid "User"
-msgstr ""
+msgstr "Usuario"
#. module: hr_holidays
#: model:process.transition,note:hr_holidays.process_transition_employeedeclaration0
msgid "Document for employee"
-msgstr ""
+msgstr "Documento para empleado"
#. module: hr_holidays
#: field:hr.holidays.log,date:0
msgid "Date"
-msgstr ""
+msgstr "Fecha"
#. module: hr_holidays
#: model:process.transition.action,name:hr_holidays.process_transition_action_reufse0
msgid "Reufse"
-msgstr ""
+msgstr "Rechazar"
#. module: hr_holidays
#: field:hr.holidays.status,section_id:0
msgid "Section"
-msgstr ""
+msgstr "Sección"
#. module: hr_holidays
#: field:hr.holidays,manager_id:0
msgid "Holiday manager"
-msgstr ""
+msgstr "Responsable de vacaciones"
#. module: hr_holidays
#: field:hr.holidays.per.user,active:0
#: field:hr.holidays.status,active:0
msgid "Active"
-msgstr ""
+msgstr "Activo"
#. module: hr_holidays
#: model:ir.actions.act_window,name:hr_holidays.action_my_holiday_draft
msgid "My Holidays Request Draft"
-msgstr ""
+msgstr "Mis peticiones en Borrador"
#. module: hr_holidays
#: model:process.transition,name:hr_holidays.process_transition_approvedrequest0
msgid "Approved Request"
-msgstr ""
+msgstr "Petición aprobada"
#. module: hr_holidays
#: model:process.node,name:hr_holidays.process_node_holidaysrequest0
msgid "Holidays Request"
-msgstr ""
+msgstr "Petición de vacaciones"
#. module: hr_holidays
#: model:ir.ui.menu,name:hr_holidays.menu_action_holiday_waiting
msgid "Holidays Requests Awaiting for Validation"
-msgstr ""
+msgstr "Peticiones esperando validación"
#. module: hr_holidays
#: view:hr.holidays:0
msgid "General"
-msgstr ""
+msgstr "General"
#. module: hr_holidays
#: view:hr.holidays.per.user:0
msgid "General Information"
-msgstr ""
+msgstr "Información general"
#. module: hr_holidays
#: view:hr.holidays:0
@@ -585,23 +602,23 @@ msgstr ""
#: wizard_button:hr.holidays.summary,init,end:0
#: wizard_button:hr.holidays.summary.employee,init,end:0
msgid "Cancel"
-msgstr ""
+msgstr "Cancelar"
#. module: hr_holidays
#: model:process.transition,name:hr_holidays.process_transition_holidaysdefrequest0
msgid "Holidays def Request"
-msgstr ""
+msgstr "Petición define vacaciones"
#. module: hr_holidays
#: selection:hr.holidays.summary,init,holiday_type:0
#: selection:hr.holidays.summary.employee,init,holiday_type:0
msgid "Validated"
-msgstr ""
+msgstr "Validado"
#. module: hr_holidays
#: model:ir.actions.act_window,name:hr_holidays.action_my_holiday_refuse
msgid "My Holidays Request Refused"
-msgstr ""
+msgstr "Mis peticiones rechazadas"
#. module: hr_holidays
#: constraint:ir.model:0
@@ -615,23 +632,23 @@ msgstr ""
#: wizard_button:hr.holidays.summary,init,checkdept:0
#: wizard_button:hr.holidays.summary.employee,init,checkemp:0
msgid "Print"
-msgstr ""
+msgstr "Imprimir"
#. module: hr_holidays
#: model:ir.actions.wizard,name:hr_holidays.holidays_summary
#: model:ir.ui.menu,name:hr_holidays.menu_holidays_summary
msgid "Print Summary of Holidays"
-msgstr ""
+msgstr "Imprimir resumen de vacaciones"
#. module: hr_holidays
#: wizard_field:hr.holidays.summary,init,depts:0
msgid "Department(s)"
-msgstr ""
+msgstr "Departamento(s)"
#. module: hr_holidays
#: field:hr.holidays,name:0
msgid "Description"
-msgstr ""
+msgstr "Descripción"
#. module: hr_holidays
#: selection:hr.holidays,state:0
@@ -642,85 +659,85 @@ msgstr "Rechazado"
#. module: hr_holidays
#: model:process.transition,note:hr_holidays.process_transition_approvedrequest0
msgid "Request is approved."
-msgstr ""
+msgstr "Petición aprobada."
#. module: hr_holidays
#: model:process.node,name:hr_holidays.process_node_holidaysdefinition0
msgid "Holidays Definition"
-msgstr ""
+msgstr "Definición vacaciones"
#. module: hr_holidays
#: wizard_field:hr.holidays.summary,init,holiday_type:0
#: wizard_field:hr.holidays.summary.employee,init,holiday_type:0
msgid "Select Holiday Type"
-msgstr ""
+msgstr "Seleccionar un tipo de vacaciones"
#. module: hr_holidays
#: field:hr.holidays,case_id:0
msgid "Case"
-msgstr ""
+msgstr "Caso"
#. module: hr_holidays
#: field:hr.holidays,holiday_user_id:0
msgid "Holiday per user"
-msgstr ""
+msgstr "Vacaiones por usuario"
#. module: hr_holidays
#: model:process.node,note:hr_holidays.process_node_holidays0
msgid "Encode number of available holidays"
-msgstr ""
+msgstr "Codifica número de vacaciones disponibles"
#. module: hr_holidays
#: model:process.node,name:hr_holidays.process_node_legaldeclaration0
msgid "Secretariat Social"
-msgstr ""
+msgstr "Secretaría social"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Violet"
-msgstr ""
+msgstr "Violeta"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Red"
-msgstr ""
+msgstr "Rojo"
#. module: hr_holidays
#: model:ir.module.module,shortdesc:hr_holidays.module_meta_information
msgid "Human Resources: Holidays management"
-msgstr ""
+msgstr "Gestión de Vacaciones"
#. module: hr_holidays
#: model:process.process,name:hr_holidays.process_process_holidaysprocess0
msgid "Holidays Process"
-msgstr ""
+msgstr "Proceso de vacaciones"
#. module: hr_holidays
#: wizard_view:hr.holidays.summary,notify:0
msgid "You have to select at least 1 Department. Try again."
-msgstr ""
+msgstr "Debe seleccionar por lo menos 1 departamento. Inténtelo de nuevo."
#. module: hr_holidays
#: model:ir.actions.act_window,name:hr_holidays.action_my_holiday_validate
msgid "My Holidays Request Validated"
-msgstr ""
+msgstr "Mis peticiones validadas"
#. module: hr_holidays
#: field:hr.holidays.log,holiday_req_id:0
msgid "Holiday Request ID"
-msgstr ""
+msgstr "ID solicitud de vacaciones"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Light Yellow"
-msgstr ""
+msgstr "Amarillo claro"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Light Pink"
-msgstr ""
+msgstr "Rosa claro"
#. module: hr_holidays
#: model:process.node,note:hr_holidays.process_node_refused0
msgid "His manager refuses the request"
-msgstr ""
+msgstr "Su responsable rechaza la petición"
diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_department.py b/addons/hr_holidays/wizard/hr_holidays_summary_department.py
index 5e35bbdb916..9c6d1447f89 100644
--- a/addons/hr_holidays/wizard/hr_holidays_summary_department.py
+++ b/addons/hr_holidays/wizard/hr_holidays_summary_department.py
@@ -51,6 +51,7 @@ class hr_holidays_summary_dept(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'holidays.summary',
'datas': datas,
+ 'nodestroy': True,
}
hr_holidays_summary_dept()
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py
index eb0d1ae1334..7ea4f52a392 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -135,7 +135,7 @@ class hr_applicant(osv.osv):
'default_name': opp.name
}
value = {
- 'name': _('Meetings'),
+ 'name': ('Meetings'),
'domain': "[('user_id','=',%s)]" % (uid),
'context': context,
'view_type': 'form',
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_print_users.py b/addons/hr_timesheet/wizard/hr_timesheet_print_users.py
index 3931e41e185..f7358eca990 100644
--- a/addons/hr_timesheet/wizard/hr_timesheet_print_users.py
+++ b/addons/hr_timesheet/wizard/hr_timesheet_print_users.py
@@ -49,6 +49,7 @@ class analytical_timesheet_employees(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'hr.analytical.timesheet_users',
'datas': datas,
+ 'nodestroy':True
}
analytical_timesheet_employees()
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py
index f5b37256a02..b83b84746d2 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py
@@ -72,6 +72,8 @@ class account_analytic_profit(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.analytic.profit',
'datas': datas,
+ 'nodestroy': True
+
}
account_analytic_profit()
diff --git a/addons/olap_crm/i18n/de.po b/addons/olap_crm/i18n/de.po
new file mode 100644
index 00000000000..41398f13f85
--- /dev/null
+++ b/addons/olap_crm/i18n/de.po
@@ -0,0 +1,31 @@
+# German translation for openobject-addons
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2009-11-26 05:29+0000\n"
+"PO-Revision-Date: 2010-05-01 20:41+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: German \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-05-02 03:57+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: olap_crm
+#: model:ir.module.module,description:olap_crm.module_meta_information
+msgid ""
+"\n"
+" Sale module will load the data in olap tables\n"
+" "
+msgstr ""
+
+#. module: olap_crm
+#: model:ir.module.module,shortdesc:olap_crm.module_meta_information
+msgid "olap_crm"
+msgstr ""
diff --git a/addons/profile_manufacturing/i18n/pt_BR.po b/addons/profile_manufacturing/i18n/pt_BR.po
index b7ebdce281a..725964a977f 100644
--- a/addons/profile_manufacturing/i18n/pt_BR.po
+++ b/addons/profile_manufacturing/i18n/pt_BR.po
@@ -7,24 +7,24 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-09-08 16:46+0000\n"
-"Last-Translator: Aldo Giovani \n"
+"PO-Revision-Date: 2010-05-01 19:21+0000\n"
+"Last-Translator: sbrianti \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:16+0000\n"
+"X-Launchpad-Export-Date: 2010-05-02 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,mrp_operation:0
msgid "Manufacturing Operations"
-msgstr ""
+msgstr "Operações de Manufatura"
#. module: profile_manufacturing
#: model:ir.module.module,description:profile_manufacturing.module_meta_information
msgid "Profile for manufacturing industries"
-msgstr ""
+msgstr "Perfil para indústrias de manufatura"
#. module: profile_manufacturing
#: constraint:ir.model:0
@@ -37,22 +37,22 @@ msgstr ""
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,mrp_jit:0
msgid "Just in Time Scheduling"
-msgstr ""
+msgstr "Agendamento de Just in Time"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,sale_journal:0
msgid "Manage by Journals"
-msgstr ""
+msgstr "Gerenciamento por Diários"
#. module: profile_manufacturing
#: view:profile.manufacturing.config.install_modules_wizard:0
msgid "Relationship Management"
-msgstr ""
+msgstr "Gestão de Relacionamentos"
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,portal:0
msgid "This module allows you to manage a Portal system."
-msgstr ""
+msgstr "Este módulo permite o gerenciamento de um sistema de portal."
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,board_document:0
@@ -62,6 +62,11 @@ msgid ""
"documents, printed reports, calendar system). It opens an FTP access for the "
"users to easily browse association's document."
msgstr ""
+"O Sistema de Gerenciamento de Documentos do Open ERP permite que você "
+"armazene, navegue, indexe automaticamente, busque e pré-visualize todos os "
+"tipos de documentos (documentos internos, relatórios impressos, sistema de "
+"calendário). Ele abre um acesso FTP para que os usuário naveguem com "
+"facilidade pelos documentos."
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,sale_journal:0
@@ -80,7 +85,7 @@ msgstr ""
#: model:ir.actions.act_window,name:profile_manufacturing.action_config_install_module
#: view:profile.manufacturing.config.install_modules_wizard:0
msgid "Manufacturing Profile: Install Extra Modules"
-msgstr ""
+msgstr "Perfil de manufatura: Instalar módulos extras"
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,mrp_jit:0
@@ -101,17 +106,17 @@ msgstr ""
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,board_document:0
msgid "Document Management"
-msgstr ""
+msgstr "Gerenciamento de Documentos"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,portal:0
msgid "Portal"
-msgstr ""
+msgstr "Portal"
#. module: profile_manufacturing
#: view:profile.manufacturing.config.install_modules_wizard:0
msgid "Stock & Manufacturing"
-msgstr ""
+msgstr "Estoque e Manufatura"
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,mrp_repair:0
@@ -136,12 +141,12 @@ msgstr ""
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,mrp_subproduct:0
msgid "This module allows you to add sub poducts in mrp bom."
-msgstr ""
+msgstr "Este módulo permite a inserção de subprodutos em um BoM de MRP."
#. module: profile_manufacturing
#: model:ir.module.module,shortdesc:profile_manufacturing.module_meta_information
msgid "Manufacturing industry profile"
-msgstr ""
+msgstr "Perfil de indústria de manufatura"
#. module: profile_manufacturing
#: model:ir.model,name:profile_manufacturing.model_profile_manufacturing_config_install_modules_wizard
@@ -159,12 +164,12 @@ msgstr ""
#. module: profile_manufacturing
#: view:profile.manufacturing.config.install_modules_wizard:0
msgid "Install"
-msgstr ""
+msgstr "Instalar"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,sale_crm:0
msgid "CRM and Calendars"
-msgstr ""
+msgstr "CRM e Calendários"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,mrp_repair:0
@@ -188,22 +193,22 @@ msgstr ""
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,mrp_subproduct:0
msgid "Mrp Sub Product"
-msgstr ""
+msgstr "Subproduto de MRP"
#. module: profile_manufacturing
#: view:profile.manufacturing.config.install_modules_wizard:0
msgid "Sales Management"
-msgstr ""
+msgstr "Gerenciamento de Vendas"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,warning:0
msgid "Warning"
-msgstr ""
+msgstr "Aviso"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,sale_margin:0
msgid "Margins on Sales Order"
-msgstr ""
+msgstr "Margens em Ordens de Venda"
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,stock_location:0
@@ -218,14 +223,14 @@ msgstr ""
#. module: profile_manufacturing
#: view:profile.manufacturing.config.install_modules_wizard:0
msgid "Cancel"
-msgstr ""
+msgstr "Cancelar"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,point_of_sale:0
msgid "Point of Sale"
-msgstr ""
+msgstr "Ponto de Venda"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,stock_location:0
msgid "Advanced Locations"
-msgstr ""
+msgstr "Locais Avançados"
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 196b70eceb1..6a74161b250 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -443,6 +443,7 @@
tree,form,calendar,gantt,graph
+ {"search_default_project_id":context.get('project_id',False)}
@@ -629,7 +630,7 @@
form
tree,form
- {"search_default_my_msg":1}
+ {"search_default_project_id":context.get('project_id',False), "search_default_my_msg":1}
diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml
index b4ee058433a..1615319c7b9 100644
--- a/addons/project_gtd/project_gtd_view.xml
+++ b/addons/project_gtd/project_gtd_view.xml
@@ -75,8 +75,8 @@
-
-
+
+
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index f1bf2108eb3..3bf0bf39751 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -133,7 +133,7 @@ class project_issue(osv.osv):
def _get_project(self, cr, uid, context):
user = self.pool.get('res.users').browse(cr,uid,uid, context=context)
if user.context_project_id:
- return user.context_project_id
+ return user.context_project_id.id
return False
def convert_issue_task(self, cr, uid, ids, context=None):
@@ -166,7 +166,7 @@ class project_issue(osv.osv):
'date': bug.date,
'project_id':bug.project_id.id,
'priority':bug.priority,
- 'user_id':bug.user_id.id,
+ 'user_id':bug.assigned_to.id,
'planned_hours': 0.0,
})
diff --git a/addons/scrum/__openerp__.py b/addons/scrum/__openerp__.py
index 33a114a3040..19facdbaed3 100644
--- a/addons/scrum/__openerp__.py
+++ b/addons/scrum/__openerp__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -52,9 +52,10 @@
'update_xml': [
'security/ir.model.access.csv',
'scrum_report.xml',
- 'scrum_wizard.xml',
+ 'wizard/scrum_backlog_create_task_view.xml',
'scrum_view.xml',
- 'process/scrum_process.xml'
+ 'process/scrum_process.xml',
+ 'wizard/scrum_backlog_sprint_view.xml',
],
'demo_xml': ['scrum_demo.xml'],
'installable': True,
diff --git a/addons/scrum/scrum_view.xml b/addons/scrum/scrum_view.xml
index 329a77bc56d..41ddb3ff2cd 100644
--- a/addons/scrum/scrum_view.xml
+++ b/addons/scrum/scrum_view.xml
@@ -45,7 +45,7 @@
-
+
@@ -86,7 +86,7 @@
-
+
diff --git a/addons/scrum/scrum_wizard.xml b/addons/scrum/scrum_wizard.xml
deleted file mode 100644
index 171d30ba37f..00000000000
--- a/addons/scrum/scrum_wizard.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/addons/scrum/wizard/__init__.py b/addons/scrum/wizard/__init__.py
index 117e64dcea7..6e0d739f889 100644
--- a/addons/scrum/wizard/__init__.py
+++ b/addons/scrum/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,12 +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 backlog_to_task
-import assign_backlog_to_sprint
+import scrum_backlog_create_task
+import scrum_backlog_sprint
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/scrum/wizard/assign_backlog_to_sprint.py b/addons/scrum/wizard/assign_backlog_to_sprint.py
deleted file mode 100644
index fe36344976c..00000000000
--- a/addons/scrum/wizard/assign_backlog_to_sprint.py
+++ /dev/null
@@ -1,86 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import ir
-from mx.DateTime import now
-import pooler
-import netsvc
-
-bts_form = """
-"""
-
-bts_fields = {
- 'sprint_id' : {'string':'Sprint Name', 'type':'many2one', 'relation':'scrum.sprint', 'required':True},
- 'state_open' : {'string':'Set Open', 'type':'boolean', 'default': lambda *a: True},
- 'convert_to_task' : {'string':'Convert To Task', 'type':'boolean', 'default': lambda *a: True}
-}
-
-def _assign_sprint(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- backlog_obj = pool.get('scrum.product.backlog')
- task = pool.get('project.task')
- state_open = data['form']['state_open']
- convert_to_task = data['form']['convert_to_task']
- for backlog in backlog_obj.browse(cr, uid, data['ids'], context=context):
- backlog_obj.write(cr, uid, backlog.id, {'sprint_id':data['form']['sprint_id']}, context=context)
- if convert_to_task:
- task.create(cr, uid, {
- 'product_backlog_id': backlog.id,
- 'name': backlog.name,
- 'description': backlog.note,
- 'project_id': backlog.project_id.id,
- 'user_id': False,
- 'planned_hours':backlog.planned_hours,
- 'remaining_hours':backlog.expected_hours,
- })
- if state_open:
- if backlog.state == "draft":
- backlog_obj.write(cr, uid, backlog.id, {'state':'open'})
- return {}
-
-class wiz_bts(wizard.interface):
- states = {
- 'init':{
- 'actions': [],
- 'result': {'type':'form', 'arch':bts_form, 'fields':bts_fields, 'state':[('end', 'Cancel'), ('assign', 'Assign Sprint')] },
- },
- 'assign':{
- 'actions': [],
- 'result': {'type':'action', 'action': _assign_sprint, 'state':'end'},
- },
- }
-wiz_bts('scrum.product.backlog.sprint.assign')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/scrum/wizard/backlog_to_task.py b/addons/scrum/wizard/backlog_to_task.py
deleted file mode 100644
index 2602b108fda..00000000000
--- a/addons/scrum/wizard/backlog_to_task.py
+++ /dev/null
@@ -1,84 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import ir
-from mx.DateTime import now
-import pooler
-import netsvc
-
-btt_form = """
-"""
-
-btt_fields = {
- 'user_id' : {'string':'Assign To', 'type':'many2one', 'relation':'res.users'},
-}
-
-def _do_create(self, cr, uid, data, context={}):
- pool = pooler.get_pool(cr.dbname)
- backlogs = pool.get('scrum.product.backlog').browse(cr, uid, data['ids'], context=context)
- mod_obj = pool.get('ir.model.data')
- result = mod_obj._get_id(cr, uid, 'project', 'view_task_search_form')
- id = mod_obj.read(cr, uid, result, ['res_id'])
- ids = []
- for backlog in backlogs:
- task = pooler.get_pool(cr.dbname).get('project.task')
- ids.append(task.create(cr, uid, {
- 'product_backlog_id': backlog.id,
- 'name': backlog.name,
- 'description': backlog.note,
- 'project_id': backlog.project_id.id,
- 'user_id': data['form']['user_id'] or False,
- 'planned_hours': backlog.planned_hours,
- 'remaining_hours':backlog.expected_hours,
- 'sequence':backlog.sequence,
- }))
- value = {
- 'domain': "[('product_backlog_id','in',["+','.join(map(str,data['ids']))+"])]",
- 'name': 'Open Backlog Tasks',
- 'res_id': ids,
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'project.task',
- 'view_id': False,
- 'type': 'ir.actions.act_window',
- 'search_view_id': id['res_id'],
- }
- return value
-
-class wiz_btt(wizard.interface):
- states = {
- 'init':{
- 'actions': [],
- 'result': {'type':'form', 'arch':btt_form, 'fields':btt_fields, 'state':[('end', 'Cancel'), ('create', 'Create Tasks')] },
- },
- 'create':{
- 'actions': [],
- 'result': {'type':'action', 'action': _do_create, 'state':'end'},
- },
- }
-wiz_btt('scrum.product.backlog.task.create')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/scrum/wizard/scrum_backlog_create_task.py b/addons/scrum/wizard/scrum_backlog_create_task.py
new file mode 100644
index 00000000000..71493a1c1a2
--- /dev/null
+++ b/addons/scrum/wizard/scrum_backlog_create_task.py
@@ -0,0 +1,69 @@
+# -*- 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 backlog_create_task(osv.osv_memory):
+ _name = 'backlog.create.task'
+ _description = 'Create Tasks from Product Backlogs'
+ _columns = {
+ 'user_id': fields.many2one('res.users', 'Assign To')
+ }
+
+ def do_create(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ task = self.pool.get('project.task')
+ backlog_id = self.pool.get('scrum.product.backlog')
+ ids_task = []
+
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, [], context=context)[0]
+ backlogs = backlog_id.browse(cr, uid, context['active_ids'], context=context)
+ result = mod_obj._get_id(cr, uid, 'project', 'view_task_search_form')
+ id = mod_obj.read(cr, uid, result, ['res_id'])
+
+ for backlog in backlogs:
+ ids_task.append(task.create(cr, uid, {
+ 'product_backlog_id': backlog.id,
+ 'name': backlog.name,
+ 'description': backlog.note,
+ 'project_id': backlog.project_id.id,
+ 'user_id': data['user_id'] or False,
+ 'planned_hours': backlog.planned_hours,
+ 'remaining_hours':backlog.expected_hours,
+ 'sequence':backlog.sequence,
+ }))
+
+ return {
+ 'domain': "[('product_backlog_id','in',["+','.join(map(str, context['active_ids']))+"])]",
+ 'name': 'Open Backlog Tasks',
+ 'res_id': ids_task,
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'project.task',
+ 'view_id': False,
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': id['res_id'],
+ }
+
+backlog_create_task()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/scrum/wizard/scrum_backlog_create_task_view.xml b/addons/scrum/wizard/scrum_backlog_create_task_view.xml
new file mode 100644
index 00000000000..25cc78b873f
--- /dev/null
+++ b/addons/scrum/wizard/scrum_backlog_create_task_view.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+ backlog.create.task.form
+ backlog.create.task
+ form
+
+
+
+
+
+
+ Create Tasks
+ ir.actions.act_window
+ backlog.create.task
+ form
+ form
+ new
+
+
+
+
+
+ Create Tasks
+ client_action_multi
+
+ action
+ scrum.product.backlog
+
+
+
+
\ No newline at end of file
diff --git a/addons/scrum/wizard/scrum_backlog_sprint.py b/addons/scrum/wizard/scrum_backlog_sprint.py
new file mode 100644
index 00000000000..8125df1ba53
--- /dev/null
+++ b/addons/scrum/wizard/scrum_backlog_sprint.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
+
+class backlog_sprint_assign(osv.osv_memory):
+ _name = 'backlog.assign.sprint'
+ _description = 'Assign sprint to backlogs'
+ _columns = {
+ 'sprint_id': fields.many2one('scrum.sprint', 'Sprint Name', required=True),
+ 'state_open': fields.boolean('Set Open', help="Change the state of product backlogs to open if its in draft state"),
+ 'convert_to_task': fields.boolean('Convert To Task', help="Create Task for Product Backlog")
+ }
+ _defaults = {
+ 'state_open': True,
+ 'convert_to_task': True,
+ }
+
+ def assign_sprint(self, cr, uid, ids, context=None):
+ backlog_obj = self.pool.get('scrum.product.backlog')
+ task = self.pool.get('project.task')
+ backlog_ids = []
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, [], context=context)[0]
+ for backlog in backlog_obj.browse(cr, uid, context['active_ids'], context=context):
+ backlog_ids.append(backlog.id)
+ if data['convert_to_task']:
+ task.create(cr, uid, {
+ 'product_backlog_id': backlog.id,
+ 'name': backlog.name,
+ 'description': backlog.note,
+ 'project_id': backlog.project_id.id,
+ 'user_id': False,
+ 'planned_hours':backlog.planned_hours,
+ 'remaining_hours':backlog.expected_hours,
+ })
+ if data['state_open'] and backlog.state == "draft":
+ backlog_obj.write(cr, uid, backlog.id, {'state':'open'})
+ backlog_obj.write(cr, uid, backlog_ids, {'sprint_id': data['sprint_id']}, context=context)
+ return {}
+
+backlog_sprint_assign()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/scrum/wizard/scrum_backlog_sprint_view.xml b/addons/scrum/wizard/scrum_backlog_sprint_view.xml
new file mode 100644
index 00000000000..20fedbb6978
--- /dev/null
+++ b/addons/scrum/wizard/scrum_backlog_sprint_view.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+ backlog.assign.sprint.form
+ backlog.assign.sprint
+ form
+
+
+
+
+
+
+ Assign Sprint
+ ir.actions.act_window
+ backlog.assign.sprint
+ form
+ form
+ new
+
+
+
+
+
+ Assign Sprint
+ client_action_multi
+
+ action
+ scrum.product.backlog
+
+
+
+
\ No newline at end of file
diff --git a/addons/smtpclient/smtpclient.py b/addons/smtpclient/smtpclient.py
index 36b49c77bea..6b0a2393cd1 100644
--- a/addons/smtpclient/smtpclient.py
+++ b/addons/smtpclient/smtpclient.py
@@ -302,7 +302,10 @@ class smtpclient(osv.osv):
if self.server[serverid]['auth']:
password = self.server[serverid]['password']
- password = base64.b64decode(password)
+ try:
+ password = base64.b64decode(password)
+ except:
+ pass
self.smtpServer[serverid].login(str(self.server[serverid]['user']), password)
except Exception, e:
@@ -539,7 +542,7 @@ class smtpclient(osv.osv):
sids = queue.search(cr, uid, [('state','not in',['send','sending']), ('server_id','in',ids)], order="priority", limit=30)
message = ""
- if len(ids) > 0:
+ if len(ids) > 1:
message = "sending %s emails from message queuq !" % (len(ids))
logger.notifyChannel('smtp', netsvc.LOG_INFO, message)
diff --git a/addons/stock/wizard/stock_change_standard_price.py b/addons/stock/wizard/stock_change_standard_price.py
index a18136fcac8..d83b2c1d140 100644
--- a/addons/stock/wizard/stock_change_standard_price.py
+++ b/addons/stock/wizard/stock_change_standard_price.py
@@ -91,68 +91,16 @@ class change_standard_price(osv.osv_memory):
"""
rec_id = context and context.get('active_id', False)
- prod_obj = self.pool.get('product.template')
- location_obj = self.pool.get('stock.location')
- lot_obj = self.pool.get('stock.report.prodlots')
- move_obj = self.pool.get('account.move')
- move_line_obj = self.pool.get('account.move.line')
- data_obj = self.pool.get('ir.model.data')
-
- res = self.read(cr, uid, ids[0], ['new_price'])
- new_price = res.get('new_price',[])
- data = prod_obj.browse(cr, uid, rec_id)
- diff = data.standard_price - new_price
- prod_obj.write(cr, uid, rec_id, {'standard_price': new_price})
-
- loc_ids = location_obj.search(cr, uid, [('account_id','<>',False),('usage','=','internal')])
- lot_ids = lot_obj.search(cr, uid, [('location_id', 'in', loc_ids),('product_id','=',rec_id)])
- qty = 0
- debit = 0.0
- credit = 0.0
- stock_input_acc = data.property_stock_account_input.id or data.categ_id.property_stock_account_input_categ.id
- stock_output_acc = data.property_stock_account_output.id or data.categ_id.property_stock_account_output_categ.id
-
- for lots in lot_obj.browse(cr, uid, lot_ids):
- qty += lots.name
-
- if stock_input_acc and stock_output_acc and lot_ids:
- move_id = move_obj.create(cr, uid, {'journal_id': data.categ_id.property_stock_journal.id})
- if diff > 0:
- credit = qty * diff
- move_line_obj.create(cr, uid, {
- 'name': data.name,
- 'account_id': stock_input_acc,
- 'credit': credit,
- 'move_id': move_id
- })
- for lots in lot_obj.browse(cr, uid, lot_ids):
- credit = lots.name * diff
- move_line_obj.create(cr, uid, {
- 'name': 'Expense',
- 'account_id': lots.location_id.account_id.id,
- 'debit': credit,
- 'move_id': move_id
- })
- elif diff < 0:
- debit = qty * -diff
- move_line_obj.create(cr, uid, {
- 'name': data.name,
- 'account_id': stock_output_acc,
- 'debit': debit,
- 'move_id': move_id
- })
- for lots in lot_obj.browse(cr, uid, lot_ids):
- debit = lots.name * -diff
- move_line_obj.create(cr, uid, {
- 'name': 'Income',
- 'account_id': lots.location_id.account_id.id,
- 'credit': debit,
- 'move_id': move_id
- })
- else:
- raise osv.except_osv(_('Warning!'),_('No Change in Price.'))
- else:
- pass
+ assert rec_id, _('Active ID is not set in Context')
+ prod_obj = self.pool.get('product.product')
+ res = self.browse(cr, uid, ids)
+ datas = {
+ 'new_price' : res[0].new_price,
+ 'stock_output_account' : res[0].stock_account_output.id,
+ 'stock_input_account' : res[0].stock_account_input.id,
+ 'stock_journal' : res[0].stock_journal.id
+ }
+ prod_obj.do_change_standard_price(cr, uid, [rec_id], datas, context)
return {}
change_standard_price()
diff --git a/addons/thunderbird/installer.py b/addons/thunderbird/installer.py
index a1fc99d8d58..4e0f4435d31 100644
--- a/addons/thunderbird/installer.py
+++ b/addons/thunderbird/installer.py
@@ -53,8 +53,8 @@ class thunderbird_installer(osv.osv_memory):
'name':fields.char('File name', size=34),
'pdf_name':fields.char('File name', size=64),
'thunderbird':fields.boolean('Thunderbird Module ', help="Allows you to select an object that you’d like to add to your email and its attachments."),
- 'plugin_file':fields.binary('Thunderbird Plug-in', readonly=True, help="Thunderbird plug-in file. Save as this file and install this plug-in in thunderbird."),
- 'pdf_file':fields.binary('Thunderbird Plug-in Installation File', help="Thunderbird plug-in installation file in .pdf format.", readonly=True),
+ 'plugin_file':fields.binary('Thunderbird Plug-in', readonly=True, help="Thunderbird plug-in file. Save as this file and install this plug-in in thunderbir."),
+ 'pdf_file':fields.binary('Thunderbird Plug-in Installation File', help="The documentation file :- how to install Thunderbird Plug-in.", readonly=True),
}
_defaults = {
diff --git a/addons/thunderbird/partner/partner.py b/addons/thunderbird/partner/partner.py
index 2de650180a2..e37d0ac12ef 100644
--- a/addons/thunderbird/partner/partner.py
+++ b/addons/thunderbird/partner/partner.py
@@ -92,9 +92,6 @@ class tinythunderbird_partner(osv.osv):
partner=add_obj.read(cr,user,partner_ids,['partner_id'])
if partner and partner[0] and partner[0]['partner_id']:
dictcreate.update({'partner_id':partner[0]['partner_id'][0]})
-# 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(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)
diff --git a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi b/addons/thunderbird/plugin/tiny_plugin-2.0.xpi
deleted file mode 100644
index 89a58cd8283..00000000000
Binary files a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi and /dev/null differ
diff --git a/addons/thunderbird/thunderbird_installer.xml b/addons/thunderbird/thunderbird_installer.xml
index 4f923cd7ac5..59e0cc4f604 100644
--- a/addons/thunderbird/thunderbird_installer.xml
+++ b/addons/thunderbird/thunderbird_installer.xml
@@ -23,6 +23,7 @@
+
@@ -70,15 +71,11 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+