openerp-community-reviewer team mailing list archive
-
openerp-community-reviewer team
-
Mailing list archive
-
Message #02838
lp:~camptocamp/account-financial-tools/7.0-move-draft-improvements-mdh into lp:account-financial-tools
Matthieu Dietrich @ camptocamp has proposed merging lp:~camptocamp/account-financial-tools/7.0-move-draft-improvements-mdh into lp:account-financial-tools.
Commit message:
[IMP] removed buttons for posting/unposting entries.
[ADD] modified wizard for posting multiple entries.
Requested reviews:
Account Core Editors (account-core-editors)
For more details, see:
https://code.launchpad.net/~camptocamp/account-financial-tools/7.0-move-draft-improvements-mdh/+merge/201359
A few changes for draft moves:
- in account_default_draft_move: change an eval field in the invoice view (issues when you reinstalled the module), and removed cancel/post buttons in the move's form view.
- new module, account_move_validation_improvement, re-defining the "Post Journal Entries" wizard from account, to use multiple journals/periods.
--
https://code.launchpad.net/~camptocamp/account-financial-tools/7.0-move-draft-improvements-mdh/+merge/201359
Your team OpenERP Community Reviewer/Maintainer is subscribed to branch lp:account-financial-tools.
=== modified file 'account_default_draft_move/__openerp__.py'
--- account_default_draft_move/__openerp__.py 2013-02-13 10:56:26 +0000
+++ account_default_draft_move/__openerp__.py 2014-01-13 10:16:45 +0000
@@ -48,7 +48,8 @@
""",
'website': 'http://www.camptocamp.com',
- 'data' : ['invoice_view.xml'],
+ 'data' : ['account_view.xml',
+ 'invoice_view.xml'],
'installable': True,
'active': False,
}
=== added file 'account_default_draft_move/account_view.xml'
--- account_default_draft_move/account_view.xml 1970-01-01 00:00:00 +0000
+++ account_default_draft_move/account_view.xml 2014-01-13 10:16:45 +0000
@@ -0,0 +1,17 @@
+<openerp>
+ <data>
+
+ <record id="view_move_form_remove_button" model="ir.ui.view">
+ <field name="name">account.move.form.remove.button</field>
+ <field name="model">account.move</field>
+ <field name="inherit_id" ref="account.view_move_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <button name="button_validate" position="replace"/>
+ <button name="button_cancel" position="replace"/>
+ </data>
+ </field>
+ </record>
+
+ </data>
+</openerp>
\ No newline at end of file
=== modified file 'account_default_draft_move/invoice_view.xml'
=== added directory 'account_move_validation_improvement'
=== added file 'account_move_validation_improvement/__init__.py'
--- account_move_validation_improvement/__init__.py 1970-01-01 00:00:00 +0000
+++ account_move_validation_improvement/__init__.py 2014-01-13 10:16:45 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Author Matthieu Dietrich. Copyright 2012 Camptocamp SA
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from . import wizard
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
=== added file 'account_move_validation_improvement/__openerp__.py'
--- account_move_validation_improvement/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_move_validation_improvement/__openerp__.py 2014-01-13 10:16:45 +0000
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Author Vincent Renaville/Joel Grand-Guillaume. Copyright 2012 Camptocamp SA
+#
+# 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 <http://www.gnu.org/licenses/>.
+##############################################################################
+{
+ "name" : "Wizard to validate multiple moves",
+ "version" : "1.0",
+ "depends" : ["base", "account", "account_constraints"],
+ "author" : "Camptocamp",
+ 'license': 'AGPL-3',
+ "description": """
+Re-defining a base wizard (validate all moves in a period for a journal),
+but extending it to multiple periods and multiple journals. It replaces the
+base one defined in addons/account/wizard.
+ """,
+ 'website': 'http://www.camptocamp.com',
+ 'data' : ['wizard/account_validate_move_view.xml'],
+ 'installable': True,
+ 'active': False,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added directory 'account_move_validation_improvement/wizard'
=== added file 'account_move_validation_improvement/wizard/__init__.py'
--- account_move_validation_improvement/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ account_move_validation_improvement/wizard/__init__.py 2014-01-13 10:16:45 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Author Matthieu Dietrich. Copyright 2012 Camptocamp SA
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from . import account_validate_move
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
=== added file 'account_move_validation_improvement/wizard/account_validate_move.py'
--- account_move_validation_improvement/wizard/account_validate_move.py 1970-01-01 00:00:00 +0000
+++ account_move_validation_improvement/wizard/account_validate_move.py 2014-01-13 10:16:45 +0000
@@ -0,0 +1,60 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from openerp.osv import fields, orm, osv
+from openerp.tools.translate import _
+
+
+class ValidateAccountMove(orm.TransientModel):
+ _name = "validate.account.move"
+ _inherit = "validate.account.move"
+
+ _columns = {
+ 'journal_ids': fields.many2many('account.journal', string='Journals',
+ required=True),
+ 'period_ids': fields.many2many('account.period', string='Periods',
+ required=True,
+ domain=[('state', '<>', 'done')]),
+ # re-define existing fields as non-mandatory
+ 'journal_id': fields.many2one('account.journal', 'Journal',
+ required=False),
+ 'period_id': fields.many2one('account.period', 'Period',
+ required=False),
+ }
+
+ def validate_move(self, cr, uid, ids, context=None):
+ obj_move = self.pool.get('account.move')
+ if context is None:
+ context = {}
+ data = self.browse(cr, uid, ids, context=context)[0]
+ journal_ids = [journal.id for journal in data.journal_ids]
+ period_ids = [period.id for period in data.period_ids]
+ ids_move = obj_move.search(cr, uid, [('state', '=', 'draft'),
+ ('journal_id', 'in', journal_ids),
+ ('period_id', '=', period_ids)],
+ context=context)
+ if not ids_move:
+ raise osv.except_osv(_('Warning!'),
+ ('Specified journal does not have any account move entries in draft state for this period.'))
+ obj_move.button_validate(cr, uid, ids_move, context=context)
+ return {'type': 'ir.actions.act_window_close'}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
=== added file 'account_move_validation_improvement/wizard/account_validate_move_view.xml'
--- account_move_validation_improvement/wizard/account_validate_move_view.xml 1970-01-01 00:00:00 +0000
+++ account_move_validation_improvement/wizard/account_validate_move_view.xml 2014-01-13 10:16:45 +0000
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!--Account Moves-->
+ <record id="account.validate_account_move_view" model="ir.ui.view">
+ <field name="name">Post Journal Entries</field>
+ <field name="model">validate.account.move</field>
+ <field name="arch" type="xml">
+ <form string="Post Journal Entries" version="7.0">
+ <group>
+ <field name="journal_ids"/>
+ <field name="period_ids"/>
+ </group>
+ <footer>
+ <button string="Approve" name="validate_move" type="object" class="oe_highlight"/>
+ or
+ <button string="Cancel" class="oe_link" special="cancel"/>
+ </footer>
+ </form>
+ </field>
+ </record>
+
+ </data>
+</openerp>
Follow ups