diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py
index 10ecea48d77..1fe6bd355bd 100644
--- a/addons/account/__terp__.py
+++ b/addons/account/__terp__.py
@@ -55,7 +55,8 @@ module named account_voucherss
'wizard/account_move_journal_view.xml',
'account_wizard.xml',
'wizard/account_move_line_unreconcile_select_view.xml',
-
+ 'wizard/account_subscription_generate_view.xml',
+ 'project/wizard/project_account_analytic_line_view.xml',
'account_view.xml',
'account_end_fy.xml',
'account_invoice_view.xml',
diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml
index b17df5b4edb..1597ec8898e 100644
--- a/addons/account/account_wizard.xml
+++ b/addons/account/account_wizard.xml
@@ -86,8 +86,10 @@
-->
+
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index e53047b8718..e0854f8d65d 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -204,10 +204,14 @@
form
-
+
-
+
+
Analytic Entries
diff --git a/addons/account/project/wizard/__init__.py b/addons/account/project/wizard/__init__.py
index 21a811ebe5f..f11fa936960 100644
--- a/addons/account/project/wizard/__init__.py
+++ b/addons/account/project/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -25,7 +25,7 @@ import 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 wizard_account_analytic_line
+import project_account_analytic_line
import wizard_analytic_account_chart
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/project_account_analytic_line.py b/addons/account/project/wizard/project_account_analytic_line.py
new file mode 100644
index 00000000000..a7fbe0a8254
--- /dev/null
+++ b/addons/account/project/wizard/project_account_analytic_line.py
@@ -0,0 +1,58 @@
+# -*- 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 project_account_analytic_line(osv.osv_memory):
+ _name = "project.account.analytic.line"
+ _description = "Analytic Entries by line"
+ _columns = {
+ 'from_date': fields.date('From'),
+ 'to_date': fields.date('To'),
+ }
+
+ def action_open_window(self, cr, uid, ids, context={}):
+ mod_obj =self.pool.get('ir.model.data')
+ domain = []
+ for data in self.read(cr, uid, ids,context=context):
+ from_date =data['from_date']
+ to_date =data['to_date']
+ if from_date and to_date:
+ domain = [('date','>=',from_date), ('date','<=',to_date)]
+ elif from_date:
+ domain = [('date','>=',from_date)]
+ elif to_date:
+ domain = [('date','<=',to_date)]
+ result = mod_obj._get_id(cr, uid, 'account', 'view_account_analytic_line_filter')
+ id = mod_obj.read(cr, uid, result, ['res_id'], context=context)
+ return {
+ 'name': _('Analytic Entries by line'),
+ 'view_type': 'form',
+ "view_mode": 'tree,form',
+ 'res_model': 'account.analytic.line',
+ 'type': 'ir.actions.act_window',
+ 'domain': domain,
+ 'search_view_id': id['res_id'],}
+
+project_account_analytic_line()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/project/wizard/project_account_analytic_line_view.xml b/addons/account/project/wizard/project_account_analytic_line_view.xml
new file mode 100644
index 00000000000..30cc9998cb5
--- /dev/null
+++ b/addons/account/project/wizard/project_account_analytic_line_view.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+ project.account.analytic.line.form
+ project.account.analytic.line
+ form
+
+
+
+
+
+
+ Entries by Line
+ project.account.analytic.line
+ form
+ tree,form
+
+ new
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/project/wizard/wizard_account_analytic_line.py b/addons/account/project/wizard/wizard_account_analytic_line.py
deleted file mode 100644
index 4d63aff05f5..00000000000
--- a/addons/account/project/wizard/wizard_account_analytic_line.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 pooler
-import time
-from tools.translate import _
-
-def _action_open_window(self, cr, uid, data, context):
- domain = []
- from_date = data['form']['from_date']
- to_date = data['form']['to_date']
- if from_date and to_date:
- domain = [('date','>=',from_date),('date','<=',to_date)]
- elif from_date:
- domain = [('date','>=',from_date)]
- elif to_date:
- domain = [('date','<=',to_date)]
- mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data')
- result = mod_obj._get_id(cr, uid, 'account', 'view_account_analytic_line_filter')
- id = mod_obj.read(cr, uid, result, ['res_id'])
-
- return {
- 'name': _('Analytic Entries by line'),
- 'view_type': 'form',
- "view_mode": 'tree,form',
- 'res_model': 'account.analytic.line',
- 'type': 'ir.actions.act_window',
- 'domain': domain,
- 'search_view_id': id['res_id'],}
-
-
-class account_analytic_line(wizard.interface):
- form1 = '''
- '''
- form1_fields = {
- 'from_date': {
- 'string': 'From',
- 'type': 'date',
- },
- 'to_date': {
- 'string': 'To',
- 'type': 'date',
- },
- }
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, 'state': [('end', 'Cancel','gtk-cancel'),('open', 'Open Entries','gtk-ok')]}
- },
- 'open': {
- 'actions': [],
- 'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
- }
- }
-account_analytic_line('account.analytic.line')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py
index f44be1f804c..f3a05ebe184 100644
--- a/addons/account/wizard/__init__.py
+++ b/addons/account/wizard/__init__.py
@@ -29,7 +29,7 @@ import wizard_pay_invoice
import account_move_journal
import wizard_journal_select
import account_move_bank_reconcile
-import wizard_subscription_generate
+import account_subscription_generate
import wizard_aged_trial_balance
import wizard_general_ledger_report
import wizard_third_party_ledger
diff --git a/addons/account/wizard/account_subscription_generate.py b/addons/account/wizard/account_subscription_generate.py
new file mode 100644
index 00000000000..5c44a611b0d
--- /dev/null
+++ b/addons/account/wizard/account_subscription_generate.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+import time
+
+from osv import fields, osv
+
+class account_subscription_generate(osv.osv_memory):
+
+ _name = "account.subscription.generate"
+ _description = "Subscription Compute"
+ _columns = {
+ 'date': fields.date('Date', required=True),
+ }
+ _defaults = {
+ 'date': lambda *a: time.strftime('%Y-%m-%d'),
+ }
+ def action_generate(self, cr, uid, ids, context={}):
+ for data in self.read(cr, uid, ids,context=context):
+ cr.execute('select id from account_subscription_line where date<%s and move_id is null', (data['date'],))
+ ids = map(lambda x: x[0], cr.fetchall())
+ self.pool.get('account.subscription.line').move_create(cr, uid, ids)
+ return {}
+
+account_subscription_generate()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account/wizard/account_subscription_generate_view.xml b/addons/account/wizard/account_subscription_generate_view.xml
new file mode 100644
index 00000000000..ce4438198d4
--- /dev/null
+++ b/addons/account/wizard/account_subscription_generate_view.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+ account.subscription.generate.form
+ account.subscription.generate
+ form
+
+
+
+
+
+
+ Create subscription entries
+ account.subscription.generate
+ form
+ tree,form
+
+ new
+
+
+
+
+
+
diff --git a/addons/account/wizard/wizard_subscription_generate.py b/addons/account/wizard/wizard_subscription_generate.py
deleted file mode 100644
index 1df25b219cd..00000000000
--- a/addons/account/wizard/wizard_subscription_generate.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import time
-import wizard
-import pooler
-
-#
-# TODO: add an intermediate screen for checks
-#
-
-_subscription_form = '''
-''' % ('Subscription Compute',)
-
-_subscription_fields = {
- 'date': {'string':'Date', 'type':'date', 'default':lambda *a: time.strftime('%Y-%m-%d'), 'required':True},
-}
-
-class wiz_subscription(wizard.interface):
- def _action_generate(self, cr, uid, data, context={}):
- cr.execute('select id from account_subscription_line where date<%s and move_id is null', (data['form']['date'],))
- ids = map(lambda x: x[0], cr.fetchall())
- pooler.get_pool(cr.dbname).get('account.subscription.line').move_create(cr, uid, ids)
- return {}
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':_subscription_form, 'fields':_subscription_fields, 'state':[('end','Cancel', 'gtk-cancel'),('generate','Compute', 'gtk-ok')]}
- },
- 'generate': {
- 'actions': [_action_generate],
- 'result': {'type': 'state', 'state':'end'}
- }
- }
-wiz_subscription('account.subscription.generate')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-