From 7b28343e8c3583d9bd77e8f2c32765d0a19cf84d Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Fri, 10 Jan 2014 15:05:48 +0100 Subject: [PATCH 01/18] [add] new module account_move_batch_validate: initial work, unfinished --- account_move_batch_validate/__init__.py | 24 ++++++ account_move_batch_validate/__openerp__.py | 51 ++++++++++++ account_move_batch_validate/account.py | 38 +++++++++ account_move_batch_validate/account_view.xml | 31 ++++++++ .../wizard/__init__.py | 22 ++++++ .../wizard/move_marker.py | 77 +++++++++++++++++++ .../wizard/move_marker_view.xml | 61 +++++++++++++++ 7 files changed, 304 insertions(+) create mode 100644 account_move_batch_validate/__init__.py create mode 100644 account_move_batch_validate/__openerp__.py create mode 100644 account_move_batch_validate/account.py create mode 100644 account_move_batch_validate/account_view.xml create mode 100644 account_move_batch_validate/wizard/__init__.py create mode 100644 account_move_batch_validate/wizard/move_marker.py create mode 100644 account_move_batch_validate/wizard/move_marker_view.xml diff --git a/account_move_batch_validate/__init__.py b/account_move_batch_validate/__init__.py new file mode 100644 index 000000000..5858ff462 --- /dev/null +++ b/account_move_batch_validate/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################### +# # +# Author: Leonardo Pistone +# Copyright 2014 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 . # +# # +############################################################################### +"""Account Move Batch Validate.""" + +import account # noqa +import wizard # noqa diff --git a/account_move_batch_validate/__openerp__.py b/account_move_batch_validate/__openerp__.py new file mode 100644 index 000000000..ebde87356 --- /dev/null +++ b/account_move_batch_validate/__openerp__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +############################################################################### +# # +# Author: Leonardo Pistone +# Copyright 2014 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 . # +# # +############################################################################### +{ + 'name': "Account Move Batch Validate", + 'version': '0.1', + 'author': 'Camptocamp', + 'maintainer': 'Camptocamp', + 'category': 'Finance', + 'complexity': 'normal', + 'depends': [ + 'account', + 'account_default_draft_move', + 'connector', + ], + 'description': """ + Account Move Batch Validate + + This module provides a wizard to post many Journal Entries in batch. it + uses the queue system introduces by the OpenERP Connector to handle a + big quantity of moves in batch. + """, + 'website': 'http://www.camptocamp.com', + 'init_xml': [], + 'update_xml': [ + 'account_view.xml', + 'wizard/move_marker_view.xml', + ], + 'demo_xml': [], + 'test': [], + 'installable': True, + 'images': [], + 'license': 'AGPL-3', +} diff --git a/account_move_batch_validate/account.py b/account_move_batch_validate/account.py new file mode 100644 index 000000000..012f3bfed --- /dev/null +++ b/account_move_batch_validate/account.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################### +# # +# Author: Leonardo Pistone +# Copyright 2014 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 . # +# # +############################################################################### +"""Accounting customisation for delayed posting.""" + +from openerp.osv import fields, orm + + +class account_move(orm.Model): + + """We add a field to mark a move for delayed posting.""" + + _name = 'account.move' + _inherit = 'account.move' + + _columns = { + 'to_post': fields.boolean( + 'To Post', + help='Check this box to mark the move for batch posting' + ), + } diff --git a/account_move_batch_validate/account_view.xml b/account_move_batch_validate/account_view.xml new file mode 100644 index 000000000..7fb8d1156 --- /dev/null +++ b/account_move_batch_validate/account_view.xml @@ -0,0 +1,31 @@ + + + + + + view.move.to_post.tree + account.move + + + + + + + + + + + + + view.move.to_post.form + account.move + + + + + + + + + + diff --git a/account_move_batch_validate/wizard/__init__.py b/account_move_batch_validate/wizard/__init__.py new file mode 100644 index 000000000..fd305e63c --- /dev/null +++ b/account_move_batch_validate/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# # +# Author: Leonardo Pistone +# Copyright 2014 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 . # +# # +############################################################################### +"""Wizard to mark account moves for batch posting.""" +import move_marker # noqa diff --git a/account_move_batch_validate/wizard/move_marker.py b/account_move_batch_validate/wizard/move_marker.py new file mode 100644 index 000000000..a6cb6ca90 --- /dev/null +++ b/account_move_batch_validate/wizard/move_marker.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +############################################################################### +# # +# Author: Leonardo Pistone +# Copyright 2014 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 . # +# # +############################################################################### +"""Wizards for batch posting.""" + +from openerp.osv import fields, orm + + +class AccountMoveMarker(orm.TransientModel): + + """Wizard to mark account moves for batch posting.""" + + _name = "account.move.marker" + _inherit = "account.common.report" + _description = "Mark Journal Items for batch posting" + + _columns = { + 'action': fields.selection([ + ('mark', 'Mark for posting'), + ('unmark', 'Unmark for posting'), + ], "Action", required=True), + + } + + _defaults = { + 'action': 'mark', + } + + def button_mark(self, cr, uid, ids, context=None): + """Mark/unmark lines and update the queue. Return action.""" + + for wiz in self.browse(cr, uid, ids, context=context): + + move_obj = self.pool['account.move'] + + if wiz.action == 'mark': + import pdb;pdb.set_trace() + elif wiz.action == 'unmark': + # TODO + raise NotImplementedError( + 'The Unmark action is not implemented yet' + ) + if wiz.filter != 'filter_no': + # TODO + raise NotImplementedError( + 'Date and period filter are not implemented yet' + ) + + domain = [] + if wiz.journal_ids: + domain.append(( + 'journal_id', + 'in', + [journal.id for journal in wiz.journal_ids] + )) + + move_ids = move_obj.search(cr, uid, domain, context=context) + move_obj.write + for move in move_ids: + import pdb;pdb.set_trace() \ No newline at end of file diff --git a/account_move_batch_validate/wizard/move_marker_view.xml b/account_move_batch_validate/wizard/move_marker_view.xml new file mode 100644 index 000000000..1387dc7e9 --- /dev/null +++ b/account_move_batch_validate/wizard/move_marker_view.xml @@ -0,0 +1,61 @@ + + + + + + Mark Jornal Items for Batch Posting + account.move.marker + +
+
+
+ + + Mark Jornal Items for Batch Posting + ir.actions.act_window + account.move.marker + form + form + new + + + + +
+
From b03b3d6a178332a1d2d4547afe8d9fffc20bc731 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Mon, 13 Jan 2014 10:12:48 +0100 Subject: [PATCH 02/18] [imp] account_move_batch_validate: first (partially) working state, yey! --- account_move_batch_validate/account.py | 27 +++++++++++++++++ account_move_batch_validate/account_view.xml | 3 -- .../wizard/move_marker.py | 29 ++++++++++--------- 3 files changed, 42 insertions(+), 17 deletions(-) diff --git a/account_move_batch_validate/account.py b/account_move_batch_validate/account.py index 012f3bfed..b1cf5fdb8 100644 --- a/account_move_batch_validate/account.py +++ b/account_move_batch_validate/account.py @@ -22,6 +22,9 @@ from openerp.osv import fields, orm +from openerp.addons.connector.queue.job import job +from openerp.addons.connector.session import ConnectorSessionHandler + class account_move(orm.Model): @@ -36,3 +39,27 @@ class account_move(orm.Model): help='Check this box to mark the move for batch posting' ), } + + def mark_for_posting(self, cr, uid, ids, context=None): + """.""" + session_hdl = ConnectorSessionHandler(cr.dbname, uid) + with session_hdl.session() as session: + for move_id in ids: + validate_one_move.delay(session, self._name, move_id) + print('===== PUT IN QUEUE!!!!! %s' % move_id) + # work with session + + +@job +def validate_one_move(session, model_name, move_id): + """Press the button to validate a move. Return True. + + This trivial function is there just to be called as a job with the delay + method. + + """ + return session.pool['account.move'].button_validate( + session.cr, + session.uid, + [move_id] + ) diff --git a/account_move_batch_validate/account_view.xml b/account_move_batch_validate/account_view.xml index 7fb8d1156..1f5a60af9 100644 --- a/account_move_batch_validate/account_view.xml +++ b/account_move_batch_validate/account_view.xml @@ -13,9 +13,6 @@ - - - view.move.to_post.form account.move diff --git a/account_move_batch_validate/wizard/move_marker.py b/account_move_batch_validate/wizard/move_marker.py index a6cb6ca90..2a7b7be3d 100644 --- a/account_move_batch_validate/wizard/move_marker.py +++ b/account_move_batch_validate/wizard/move_marker.py @@ -51,7 +51,21 @@ class AccountMoveMarker(orm.TransientModel): move_obj = self.pool['account.move'] if wiz.action == 'mark': - import pdb;pdb.set_trace() + domain = [] + if wiz.journal_ids: + domain.append(( + 'journal_id', + 'in', + [journal.id for journal in wiz.journal_ids] + )) + + move_ids = move_obj.search(cr, uid, domain, context=context) + + move_obj.write(cr, uid, move_ids, {'to_post': True}) + move_obj.mark_for_posting(cr, uid, move_ids, context=context) + + return {'type': 'ir.actions.act_window_close'} + elif wiz.action == 'unmark': # TODO raise NotImplementedError( @@ -62,16 +76,3 @@ class AccountMoveMarker(orm.TransientModel): raise NotImplementedError( 'Date and period filter are not implemented yet' ) - - domain = [] - if wiz.journal_ids: - domain.append(( - 'journal_id', - 'in', - [journal.id for journal in wiz.journal_ids] - )) - - move_ids = move_obj.search(cr, uid, domain, context=context) - move_obj.write - for move in move_ids: - import pdb;pdb.set_trace() \ No newline at end of file From db7e8e77717226e1f1fec3b99bf15ba95597ab8d Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Mon, 13 Jan 2014 11:57:52 +0100 Subject: [PATCH 03/18] [imp] do not use a new cursor to create the jobs --- account_move_batch_validate/account.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/account_move_batch_validate/account.py b/account_move_batch_validate/account.py index b1cf5fdb8..d327b3fa7 100644 --- a/account_move_batch_validate/account.py +++ b/account_move_batch_validate/account.py @@ -23,7 +23,7 @@ from openerp.osv import fields, orm from openerp.addons.connector.queue.job import job -from openerp.addons.connector.session import ConnectorSessionHandler +from openerp.addons.connector.session import Session class account_move(orm.Model): @@ -42,12 +42,9 @@ class account_move(orm.Model): def mark_for_posting(self, cr, uid, ids, context=None): """.""" - session_hdl = ConnectorSessionHandler(cr.dbname, uid) - with session_hdl.session() as session: - for move_id in ids: - validate_one_move.delay(session, self._name, move_id) - print('===== PUT IN QUEUE!!!!! %s' % move_id) - # work with session + session = Session(cr, uid, context=context) + for move_id in ids: + validate_one_move.delay(session, self._name, move_id) @job From a5522ad8e33812fedec9e63d1b8687080e86f3b9 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Mon, 13 Jan 2014 16:50:52 +0100 Subject: [PATCH 04/18] [imp] batch validate: refactor, handle job uuid --- account_move_batch_validate/account.py | 51 ++++++++++++++----- .../wizard/move_marker.py | 1 - 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/account_move_batch_validate/account.py b/account_move_batch_validate/account.py index d327b3fa7..da7353f4f 100644 --- a/account_move_batch_validate/account.py +++ b/account_move_batch_validate/account.py @@ -23,12 +23,12 @@ from openerp.osv import fields, orm from openerp.addons.connector.queue.job import job -from openerp.addons.connector.session import Session +from openerp.addons.connector.session import ConnectorSession class account_move(orm.Model): - """We add a field to mark a move for delayed posting.""" + """We modify the account move to allow delayed posting.""" _name = 'account.move' _inherit = 'account.move' @@ -38,24 +38,47 @@ class account_move(orm.Model): 'To Post', help='Check this box to mark the move for batch posting' ), + 'post_job_uuid': fields.char( + 'UUID of the Job to approve this move' + ), } - def mark_for_posting(self, cr, uid, ids, context=None): - """.""" - session = Session(cr, uid, context=context) - for move_id in ids: - validate_one_move.delay(session, self._name, move_id) + def _delay_post_marked(self, cr, uid, context=None): + """Create a job for every move marked for posting. + + If some moves already have a job, they are skipped. + + """ + + if context is None: + context = {} + + session = ConnectorSession(cr, uid, context=context) + + move_ids = self.search(cr, uid, [ + ('to_post', '=', True), + ('post_job_uuid', '=', False), + ('state', '=', 'draft'), + ], context=context) + + for move_id in move_ids: + job_uuid = validate_one_move.delay(session, self._name, move_id) + self.write(cr, uid, [move_id], { + 'post_job_uuid': job_uuid + }) + + def mark_for_posting(self, cr, uid, move_ids, context=None): + """Mark a list of moves for delayed posting, and enqueue the jobs.""" + if context is None: + context = {} + self.write(cr, uid, move_ids, {'to_post': True}, context=context) + self._delay_post_marked(cr, uid, context=context) @job def validate_one_move(session, model_name, move_id): - """Press the button to validate a move. Return True. - - This trivial function is there just to be called as a job with the delay - method. - - """ - return session.pool['account.move'].button_validate( + """Validate a move, and leave the job reference in place.""" + session.pool['account.move'].button_validate( session.cr, session.uid, [move_id] diff --git a/account_move_batch_validate/wizard/move_marker.py b/account_move_batch_validate/wizard/move_marker.py index 2a7b7be3d..5fa250215 100644 --- a/account_move_batch_validate/wizard/move_marker.py +++ b/account_move_batch_validate/wizard/move_marker.py @@ -61,7 +61,6 @@ class AccountMoveMarker(orm.TransientModel): move_ids = move_obj.search(cr, uid, domain, context=context) - move_obj.write(cr, uid, move_ids, {'to_post': True}) move_obj.mark_for_posting(cr, uid, move_ids, context=context) return {'type': 'ir.actions.act_window_close'} From 8f3f4d71775adc66a23fb49cb26adcbf7f46dcfb Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Mon, 13 Jan 2014 19:58:18 +0100 Subject: [PATCH 05/18] [add] account_move_batch_validate: yaml test --- account_move_batch_validate/__openerp__.py | 4 +- .../test/batch_validate.yml | 48 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 account_move_batch_validate/test/batch_validate.yml diff --git a/account_move_batch_validate/__openerp__.py b/account_move_batch_validate/__openerp__.py index ebde87356..1b18be8f4 100644 --- a/account_move_batch_validate/__openerp__.py +++ b/account_move_batch_validate/__openerp__.py @@ -44,7 +44,9 @@ 'wizard/move_marker_view.xml', ], 'demo_xml': [], - 'test': [], + 'test': [ + 'test/batch_validate.yml' + ], 'installable': True, 'images': [], 'license': 'AGPL-3', diff --git a/account_move_batch_validate/test/batch_validate.yml b/account_move_batch_validate/test/batch_validate.yml new file mode 100644 index 000000000..c95ea3ec4 --- /dev/null +++ b/account_move_batch_validate/test/batch_validate.yml @@ -0,0 +1,48 @@ +- + I create a move +- + !record {model: account.move, id: move1}: + journal_id: account.sales_journal + line_id: + - name: Receivable line + account_id: account.a_recv + debit: 1000.0 + - name: Sales line + account_id: account.a_sale + credit: 1000.0 +- + I check that the move is still draft +- + !assert {model: account.move, id: move1}: + - state == 'draft' +- + I create a wizard +- + !record {model: account.move.marker, id: wiz_marker1}: + action: mark +- + I run the wizard +- + !python {model: account.move.marker}: | + self.button_mark( + cr, uid, [ref('wiz_marker1')], context=context + ) +- + I read the UUID from the move, I dequeue the job and run it +- + !python {model: account.move}: | + from openerp.addons.connector.queue.job import OpenERPJobStorage + from openerp.addons.connector.session import ConnectorSession + + move = self.browse(cr, uid, ref('move1'), context=context) + uuid = move.post_job_uuid + session = ConnectorSession(cr, uid, context=context) + storage = OpenERPJobStorage(session) + + myjob = storage.load(uuid) + myjob.perform(session) +- + I check that the move is now approved +- + !assert {model: account.move, id: move1}: + - state == 'posted' From 1cc40f9c91cc1047829b402341210a9f846f4e0c Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Tue, 14 Jan 2014 12:21:47 +0100 Subject: [PATCH 06/18] [add] move batch validate: now you can cancel all jobs that are not done yet --- account_move_batch_validate/account.py | 40 ++++++++++++++++++- account_move_batch_validate/account_view.xml | 2 + .../wizard/move_marker.py | 39 +++++++++--------- 3 files changed, 59 insertions(+), 22 deletions(-) diff --git a/account_move_batch_validate/account.py b/account_move_batch_validate/account.py index da7353f4f..9030330a8 100644 --- a/account_move_batch_validate/account.py +++ b/account_move_batch_validate/account.py @@ -21,9 +21,11 @@ """Accounting customisation for delayed posting.""" from openerp.osv import fields, orm +from openerp.tools.translate import _ from openerp.addons.connector.queue.job import job from openerp.addons.connector.session import ConnectorSession +from openerp.addons.connector.queue.job import OpenERPJobStorage class account_move(orm.Model): @@ -43,7 +45,7 @@ class account_move(orm.Model): ), } - def _delay_post_marked(self, cr, uid, context=None): + def _delay_post_marked(self, cr, uid, eta=None, context=None): """Create a job for every move marked for posting. If some moves already have a job, they are skipped. @@ -62,11 +64,38 @@ class account_move(orm.Model): ], context=context) for move_id in move_ids: - job_uuid = validate_one_move.delay(session, self._name, move_id) + job_uuid = validate_one_move.delay(session, self._name, move_id, + eta=eta) self.write(cr, uid, [move_id], { 'post_job_uuid': job_uuid }) + def _cancel_jobs(self, cr, uid, context=None): + """Find moves where the mark has been removed and cancel the jobs. + + For the moves that are posted already it's too late: we skip them. + + """ + + if context is None: + context = {} + + session = ConnectorSession(cr, uid, context=context) + storage = OpenERPJobStorage(session) + + move_ids = self.search(cr, uid, [ + ('to_post', '=', False), + ('post_job_uuid', '!=', False), + ('state', '=', 'draft'), + ], context=context) + + for move in self.browse(cr, uid, move_ids, context=context): + job = storage.load(move.post_job_uuid) + if job.state in (u'pending', u'enqueued'): + job.set_done(result=_( + u'Task set to Done because the user unmarked the move' + )) + def mark_for_posting(self, cr, uid, move_ids, context=None): """Mark a list of moves for delayed posting, and enqueue the jobs.""" if context is None: @@ -74,6 +103,13 @@ class account_move(orm.Model): self.write(cr, uid, move_ids, {'to_post': True}, context=context) self._delay_post_marked(cr, uid, context=context) + def unmark_for_posting(self, cr, uid, move_ids, context=None): + """Unmark moves for delayed posting, and cancel the jobs.""" + if context is None: + context = {} + self.write(cr, uid, move_ids, {'to_post': False}, context=context) + self._cancel_jobs(cr, uid, context=context) + @job def validate_one_move(session, model_name, move_id): diff --git a/account_move_batch_validate/account_view.xml b/account_move_batch_validate/account_view.xml index 1f5a60af9..ea73c28e2 100644 --- a/account_move_batch_validate/account_view.xml +++ b/account_move_batch_validate/account_view.xml @@ -9,6 +9,7 @@ + @@ -20,6 +21,7 @@ + diff --git a/account_move_batch_validate/wizard/move_marker.py b/account_move_batch_validate/wizard/move_marker.py index 5fa250215..12a6e7d98 100644 --- a/account_move_batch_validate/wizard/move_marker.py +++ b/account_move_batch_validate/wizard/move_marker.py @@ -50,28 +50,27 @@ class AccountMoveMarker(orm.TransientModel): move_obj = self.pool['account.move'] - if wiz.action == 'mark': - domain = [] - if wiz.journal_ids: - domain.append(( - 'journal_id', - 'in', - [journal.id for journal in wiz.journal_ids] - )) + domain = [('state', '=', 'draft')] - move_ids = move_obj.search(cr, uid, domain, context=context) - - move_obj.mark_for_posting(cr, uid, move_ids, context=context) - - return {'type': 'ir.actions.act_window_close'} - - elif wiz.action == 'unmark': - # TODO - raise NotImplementedError( - 'The Unmark action is not implemented yet' - ) if wiz.filter != 'filter_no': # TODO raise NotImplementedError( - 'Date and period filter are not implemented yet' + 'Date and period filters are not implemented yet' ) + + if wiz.journal_ids: + domain.append(( + 'journal_id', + 'in', + [journal.id for journal in wiz.journal_ids] + )) + + move_ids = move_obj.search(cr, uid, domain, context=context) + + if wiz.action == 'mark': + move_obj.mark_for_posting(cr, uid, move_ids, context=context) + + elif wiz.action == 'unmark': + move_obj.unmark_for_posting(cr, uid, move_ids, context=context) + + return {'type': 'ir.actions.act_window_close'} From b863f798aa0ab95d05e5172ec71b17fef3630d31 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Tue, 14 Jan 2014 13:40:39 +0100 Subject: [PATCH 07/18] [add] new test for unmark feature --- account_move_batch_validate/__openerp__.py | 3 +- account_move_batch_validate/account.py | 4 +- .../test/batch_validate_then_unmark.yml | 62 +++++++++++++++++++ .../wizard/move_marker.py | 5 +- 4 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 account_move_batch_validate/test/batch_validate_then_unmark.yml diff --git a/account_move_batch_validate/__openerp__.py b/account_move_batch_validate/__openerp__.py index 1b18be8f4..4dedcda13 100644 --- a/account_move_batch_validate/__openerp__.py +++ b/account_move_batch_validate/__openerp__.py @@ -45,7 +45,8 @@ ], 'demo_xml': [], 'test': [ - 'test/batch_validate.yml' + 'test/batch_validate.yml', + 'test/batch_validate_then_unmark.yml', ], 'installable': True, 'images': [], diff --git a/account_move_batch_validate/account.py b/account_move_batch_validate/account.py index 9030330a8..9f0771e62 100644 --- a/account_move_batch_validate/account.py +++ b/account_move_batch_validate/account.py @@ -96,12 +96,12 @@ class account_move(orm.Model): u'Task set to Done because the user unmarked the move' )) - def mark_for_posting(self, cr, uid, move_ids, context=None): + def mark_for_posting(self, cr, uid, move_ids, eta=None, context=None): """Mark a list of moves for delayed posting, and enqueue the jobs.""" if context is None: context = {} self.write(cr, uid, move_ids, {'to_post': True}, context=context) - self._delay_post_marked(cr, uid, context=context) + self._delay_post_marked(cr, uid, eta=eta, context=context) def unmark_for_posting(self, cr, uid, move_ids, context=None): """Unmark moves for delayed posting, and cancel the jobs.""" diff --git a/account_move_batch_validate/test/batch_validate_then_unmark.yml b/account_move_batch_validate/test/batch_validate_then_unmark.yml new file mode 100644 index 000000000..0f5523f40 --- /dev/null +++ b/account_move_batch_validate/test/batch_validate_then_unmark.yml @@ -0,0 +1,62 @@ +- + I create a move +- + !record {model: account.move, id: move2}: + journal_id: account.sales_journal + line_id: + - name: Receivable line + account_id: account.a_recv + debit: 2000.0 + - name: Sales line + account_id: account.a_sale + credit: 2000.0 +- + I check that the move is still draft +- + !assert {model: account.move, id: move2}: + - state == 'draft' +- + I create a wizard with a long ETA +- + !record {model: account.move.marker, id: wiz_marker2}: + action: mark + eta: 10000 +- + I run the wizard +- + !python {model: account.move.marker}: | + self.button_mark( + cr, uid, [ref('wiz_marker2')], context=context + ) +- + Now I change my mind and I create a wizard to unmark the moves +- + !record {model: account.move.marker, id: wiz_unmarker3}: + action: unmark +- + I run the wizard +- + !python {model: account.move.marker}: | + self.button_mark( + cr, uid, [ref('wiz_unmarker3')], context=context + ) +- + Now I checked that my job is done, and the move is still draft +- + !python {model: account.move}: | + from openerp.addons.connector.queue.job import OpenERPJobStorage + from openerp.addons.connector.session import ConnectorSession + + session = ConnectorSession(cr, uid, context=context) + storage = OpenERPJobStorage(session) + + move = self.browse(cr, uid, ref('move2'), context=context) + myjob = storage.load(move.post_job_uuid) + assert myjob.state == 'done', 'Job is in state {0}, should be done'.format( + myjob.state + ) +- + I check that the move is still draft +- + !assert {model: account.move, id: move2}: + - state == 'draft' diff --git a/account_move_batch_validate/wizard/move_marker.py b/account_move_batch_validate/wizard/move_marker.py index 12a6e7d98..675882884 100644 --- a/account_move_batch_validate/wizard/move_marker.py +++ b/account_move_batch_validate/wizard/move_marker.py @@ -36,7 +36,7 @@ class AccountMoveMarker(orm.TransientModel): ('mark', 'Mark for posting'), ('unmark', 'Unmark for posting'), ], "Action", required=True), - + 'eta': fields.integer('Seconds to wait before starting the jobs') } _defaults = { @@ -68,7 +68,8 @@ class AccountMoveMarker(orm.TransientModel): move_ids = move_obj.search(cr, uid, domain, context=context) if wiz.action == 'mark': - move_obj.mark_for_posting(cr, uid, move_ids, context=context) + move_obj.mark_for_posting(cr, uid, move_ids, eta=wiz.eta, + context=context) elif wiz.action == 'unmark': move_obj.unmark_for_posting(cr, uid, move_ids, context=context) From b8d3a008dfb8203b7cda276f03148bf34daf20be Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Tue, 14 Jan 2014 15:12:11 +0100 Subject: [PATCH 08/18] [fix] store the job after changing the state --- account_move_batch_validate/account.py | 1 + 1 file changed, 1 insertion(+) diff --git a/account_move_batch_validate/account.py b/account_move_batch_validate/account.py index 9f0771e62..f9bee466c 100644 --- a/account_move_batch_validate/account.py +++ b/account_move_batch_validate/account.py @@ -95,6 +95,7 @@ class account_move(orm.Model): job.set_done(result=_( u'Task set to Done because the user unmarked the move' )) + storage.store(job) def mark_for_posting(self, cr, uid, move_ids, eta=None, context=None): """Mark a list of moves for delayed posting, and enqueue the jobs.""" From dc6d08ffdc26be9f1dc48bf48baffb3f7b7cda36 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Tue, 14 Jan 2014 15:33:52 +0100 Subject: [PATCH 09/18] [imp] implement date and period filters --- .../wizard/move_marker.py | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/account_move_batch_validate/wizard/move_marker.py b/account_move_batch_validate/wizard/move_marker.py index 675882884..c4805fe55 100644 --- a/account_move_batch_validate/wizard/move_marker.py +++ b/account_move_batch_validate/wizard/move_marker.py @@ -52,11 +52,23 @@ class AccountMoveMarker(orm.TransientModel): domain = [('state', '=', 'draft')] - if wiz.filter != 'filter_no': - # TODO - raise NotImplementedError( - 'Date and period filters are not implemented yet' - ) + if wiz.filter == 'filter_period': + period_pool = self.pool['account.period'] + period_ids = period_pool.search(cr, uid, [ + ('date_start', '>=', wiz.period_from.date_start), + ('date_stop', '<=', wiz.period_to.date_stop), + ], context=context) + + domain.append(( + 'period_id', + 'in', + period_ids + )) + elif wiz.filter == 'filter_date': + domain += [ + ('date', '>=', wiz.date_from), + ('date', '<=', wiz.date_to), + ] if wiz.journal_ids: domain.append(( From bd7474bab851b9e6f6a9d3dba55ef056c2ea004a Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Tue, 14 Jan 2014 15:47:57 +0100 Subject: [PATCH 10/18] [fix] typo --- account_move_batch_validate/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_move_batch_validate/__openerp__.py b/account_move_batch_validate/__openerp__.py index 4dedcda13..394effd2d 100644 --- a/account_move_batch_validate/__openerp__.py +++ b/account_move_batch_validate/__openerp__.py @@ -34,7 +34,7 @@ Account Move Batch Validate This module provides a wizard to post many Journal Entries in batch. it - uses the queue system introduces by the OpenERP Connector to handle a + uses the queue system introduced by the OpenERP Connector to handle a big quantity of moves in batch. """, 'website': 'http://www.camptocamp.com', From 3e0d844048ed98340201618950cd74c332ef19d0 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Fri, 17 Jan 2014 14:43:24 +0100 Subject: [PATCH 11/18] [imp] relative imports --- account_move_batch_validate/__init__.py | 4 ++-- account_move_batch_validate/wizard/__init__.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/account_move_batch_validate/__init__.py b/account_move_batch_validate/__init__.py index 5858ff462..df1a591bd 100644 --- a/account_move_batch_validate/__init__.py +++ b/account_move_batch_validate/__init__.py @@ -20,5 +20,5 @@ ############################################################################### """Account Move Batch Validate.""" -import account # noqa -import wizard # noqa +from . import account # noqa +from . import wizard # noqa diff --git a/account_move_batch_validate/wizard/__init__.py b/account_move_batch_validate/wizard/__init__.py index fd305e63c..f13b63cb0 100644 --- a/account_move_batch_validate/wizard/__init__.py +++ b/account_move_batch_validate/wizard/__init__.py @@ -19,4 +19,4 @@ # # ############################################################################### """Wizard to mark account moves for batch posting.""" -import move_marker # noqa +from . import move_marker # noqa From 2abe612cd8cc344ae12aa937713ed274d2afde27 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Fri, 17 Jan 2014 15:24:31 +0100 Subject: [PATCH 12/18] [imp] batch_validate: manifest --- account_move_batch_validate/__openerp__.py | 32 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/account_move_batch_validate/__openerp__.py b/account_move_batch_validate/__openerp__.py index 394effd2d..e2d3fba83 100644 --- a/account_move_batch_validate/__openerp__.py +++ b/account_move_batch_validate/__openerp__.py @@ -36,14 +36,40 @@ This module provides a wizard to post many Journal Entries in batch. it uses the queue system introduced by the OpenERP Connector to handle a big quantity of moves in batch. + + The module account_default_draft_move introdoces a workflow where the + Journal Entries are always entered in OpenERP in draft state, and the + posting happens later, for example at the end of the period. The core + account module provides a wizard to post all the moves in the period, + but that is problematic when there are many moves. + + The posting of a move takes some time, and doing that synchronously, + in one transaction is problematic. + + In this module, we leverage the power of the queue system of the + OpenERP Connector, that can be very well used without other concepts + like Backends and Bindings. + + This approach provides many advantages, similar to the ones we get + using that connector for e-commerce: + + - Asynchronous: the operation is done in background, and users can + continue to work. + - Dedicated workers: the queued jobs are performed by specific workers + (processes). This is good for a long task, since the main workers are + busy handling HTTP requests and can be killed if operations take + too long, for example. + - Multiple transactions: this is an operation that doesn't need to be + atomic, and if a line out of 100,000 fails, it is possible to catch + it, see the error message, and fix the situation. Meanwhile, all + other jobs can proceed. + """, 'website': 'http://www.camptocamp.com', - 'init_xml': [], - 'update_xml': [ + 'data': [ 'account_view.xml', 'wizard/move_marker_view.xml', ], - 'demo_xml': [], 'test': [ 'test/batch_validate.yml', 'test/batch_validate_then_unmark.yml', From ffcb9647973471522609e039a4fcbf764fe01caa Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Fri, 17 Jan 2014 15:25:04 +0100 Subject: [PATCH 13/18] [add] batch validate: i18n template --- .../i18n/account_move_batch_validate.pot | 191 ++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 account_move_batch_validate/i18n/account_move_batch_validate.pot diff --git a/account_move_batch_validate/i18n/account_move_batch_validate.pot b/account_move_batch_validate/i18n/account_move_batch_validate.pot new file mode 100644 index 000000000..02e169457 --- /dev/null +++ b/account_move_batch_validate/i18n/account_move_batch_validate.pot @@ -0,0 +1,191 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_move_batch_validate +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-17 14:17+0000\n" +"PO-Revision-Date: 2014-01-17 14:17+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_move_batch_validate +#: field:account.move,post_job_uuid:0 +msgid "UUID of the Job to approve this move" +msgstr "" + +#. module: account_move_batch_validate +#: help:account.move,to_post:0 +msgid "Check this box to mark the move for batch posting" +msgstr "" + +#. module: account_move_batch_validate +#: code:addons/account_move_batch_validate/account.py:95 +#, python-format +msgid "Task set to Done because the user unmarked the move" +msgstr "" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +msgid "Mark" +msgstr "" + +#. module: account_move_batch_validate +#: selection:account.move.marker,action:0 +msgid "Unmark for posting" +msgstr "" + +#. module: account_move_batch_validate +#: field:account.move,to_post:0 +msgid "To Post" +msgstr "" + +#. module: account_move_batch_validate +#: field:account.move.marker,company_id:0 +msgid "Company" +msgstr "" + +#. module: account_move_batch_validate +#: model:ir.actions.act_window,name:account_move_batch_validate.action_account_move_marker +#: model:ir.ui.menu,name:account_move_batch_validate.menu_account_move_marker +msgid "Mark Jornal Items for Batch Posting" +msgstr "" + +#. module: account_move_batch_validate +#: selection:account.move.marker,filter:0 +msgid "Date" +msgstr "" + +#. module: account_move_batch_validate +#: field:account.move.marker,chart_account_id:0 +msgid "Chart of Account" +msgstr "" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +#: field:account.move.marker,journal_ids:0 +msgid "Journals" +msgstr "" + +#. module: account_move_batch_validate +#: field:account.move.marker,target_move:0 +msgid "Target Moves" +msgstr "" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +msgid "Report Options" +msgstr "" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +#: selection:account.move.marker,filter:0 +msgid "Periods" +msgstr "" + +#. module: account_move_batch_validate +#: field:account.move.marker,date_to:0 +msgid "End Date" +msgstr "" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +msgid "Dates" +msgstr "" + +#. module: account_move_batch_validate +#: field:account.move.marker,period_from:0 +msgid "Start Period" +msgstr "" + +#. module: account_move_batch_validate +#: field:account.move.marker,eta:0 +msgid "Seconds to wait before starting the jobs" +msgstr "" + +#. module: account_move_batch_validate +#: selection:account.move.marker,target_move:0 +msgid "All Posted Entries" +msgstr "" + +#. module: account_move_batch_validate +#: help:account.move.marker,fiscalyear_id:0 +msgid "Keep empty for all open fiscal year" +msgstr "" + +#. module: account_move_batch_validate +#: field:account.move.marker,period_to:0 +msgid "End Period" +msgstr "" + +#. module: account_move_batch_validate +#: field:account.move.marker,fiscalyear_id:0 +msgid "Fiscal Year" +msgstr "" + +#. module: account_move_batch_validate +#: selection:account.move.marker,filter:0 +msgid "No Filters" +msgstr "" + +#. module: account_move_batch_validate +#: field:account.move.marker,action:0 +msgid "Action" +msgstr "" + +#. module: account_move_batch_validate +#: model:ir.model,name:account_move_batch_validate.model_account_move +msgid "Account Entry" +msgstr "" + +#. module: account_move_batch_validate +#: selection:account.move.marker,action:0 +msgid "Mark for posting" +msgstr "" + +#. module: account_move_batch_validate +#: model:ir.model,name:account_move_batch_validate.model_account_move_marker +msgid "Mark Journal Items for batch posting" +msgstr "" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +msgid "Filters" +msgstr "" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +msgid "Cancel" +msgstr "" + +#. module: account_move_batch_validate +#: field:account.move.marker,date_from:0 +msgid "Start Date" +msgstr "" + +#. module: account_move_batch_validate +#: help:account.move.marker,chart_account_id:0 +msgid "Select Charts of Accounts" +msgstr "" + +#. module: account_move_batch_validate +#: field:account.move.marker,filter:0 +msgid "Filter by" +msgstr "" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +msgid "or" +msgstr "" + +#. module: account_move_batch_validate +#: selection:account.move.marker,target_move:0 +msgid "All Entries" +msgstr "" + From a9472413958a7b9ae91fde456e9c599bd4ad3702 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Thu, 13 Feb 2014 14:31:11 +0100 Subject: [PATCH 14/18] [imp] hide old menu for normal users --- account_move_batch_validate/wizard/move_marker_view.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/account_move_batch_validate/wizard/move_marker_view.xml b/account_move_batch_validate/wizard/move_marker_view.xml index 1387dc7e9..b52ffcf80 100644 --- a/account_move_batch_validate/wizard/move_marker_view.xml +++ b/account_move_batch_validate/wizard/move_marker_view.xml @@ -57,5 +57,10 @@ id="menu_account_move_marker" icon="STOCK_PRINT"/> + + + + + From 52738a8df3f2ca3a0e89f671920aaccbe3c0d7ba Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Fri, 21 Feb 2014 14:43:46 +0100 Subject: [PATCH 15/18] [fix] mark moves for posting a bit at a time to avoid MemoryError --- account_move_batch_validate/account.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/account_move_batch_validate/account.py b/account_move_batch_validate/account.py index f9bee466c..9b84d5d40 100644 --- a/account_move_batch_validate/account.py +++ b/account_move_batch_validate/account.py @@ -27,6 +27,9 @@ from openerp.addons.connector.queue.job import job from openerp.addons.connector.session import ConnectorSession from openerp.addons.connector.queue.job import OpenERPJobStorage +# do a massive write on account moves BLOCK_SIZE at a time +BLOCK_SIZE = 1000 + class account_move(orm.Model): @@ -101,7 +104,15 @@ class account_move(orm.Model): """Mark a list of moves for delayed posting, and enqueue the jobs.""" if context is None: context = {} - self.write(cr, uid, move_ids, {'to_post': True}, context=context) + # For massive amounts of moves, this becomes necessary to avoid + # MemoryError's + for start in xrange(0, len(move_ids), BLOCK_SIZE): + self.write( + cr, + uid, + move_ids[start:start + BLOCK_SIZE], + {'to_post': True}, + context=context) self._delay_post_marked(cr, uid, eta=eta, context=context) def unmark_for_posting(self, cr, uid, move_ids, context=None): From 30e461cb800fa25dbb3cb0bbd8718c8605be7363 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Fri, 21 Feb 2014 14:44:05 +0100 Subject: [PATCH 16/18] [imp] account_move_batch_validate: hide job uuid, make mark readonly --- account_move_batch_validate/account.py | 3 ++- account_move_batch_validate/account_view.xml | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/account_move_batch_validate/account.py b/account_move_batch_validate/account.py index 9b84d5d40..ea0620418 100644 --- a/account_move_batch_validate/account.py +++ b/account_move_batch_validate/account.py @@ -40,7 +40,8 @@ class account_move(orm.Model): _columns = { 'to_post': fields.boolean( - 'To Post', + 'Posting Requested', + readonly=True, help='Check this box to mark the move for batch posting' ), 'post_job_uuid': fields.char( diff --git a/account_move_batch_validate/account_view.xml b/account_move_batch_validate/account_view.xml index ea73c28e2..1f5a60af9 100644 --- a/account_move_batch_validate/account_view.xml +++ b/account_move_batch_validate/account_view.xml @@ -9,7 +9,6 @@ - @@ -21,7 +20,6 @@ - From 045a84c0b8ab6428c4e5bc2dbff778aadeecde0f Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Fri, 21 Feb 2014 14:44:39 +0100 Subject: [PATCH 17/18] [fix] typo --- account_move_batch_validate/wizard/move_marker_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_move_batch_validate/wizard/move_marker_view.xml b/account_move_batch_validate/wizard/move_marker_view.xml index b52ffcf80..2cd395873 100644 --- a/account_move_batch_validate/wizard/move_marker_view.xml +++ b/account_move_batch_validate/wizard/move_marker_view.xml @@ -51,7 +51,7 @@ Date: Fri, 21 Feb 2014 14:44:49 +0100 Subject: [PATCH 18/18] [add] account_move_batch_validate: fr.po --- .../i18n/account_move_batch_validate.pot | 4 +- account_move_batch_validate/i18n/fr.po | 185 ++++++++++++++++++ 2 files changed, 187 insertions(+), 2 deletions(-) create mode 100644 account_move_batch_validate/i18n/fr.po diff --git a/account_move_batch_validate/i18n/account_move_batch_validate.pot b/account_move_batch_validate/i18n/account_move_batch_validate.pot index 02e169457..d979d1c72 100644 --- a/account_move_batch_validate/i18n/account_move_batch_validate.pot +++ b/account_move_batch_validate/i18n/account_move_batch_validate.pot @@ -49,12 +49,12 @@ msgstr "" #. module: account_move_batch_validate #: field:account.move.marker,company_id:0 msgid "Company" -msgstr "" +msgstr "Société" #. module: account_move_batch_validate #: model:ir.actions.act_window,name:account_move_batch_validate.action_account_move_marker #: model:ir.ui.menu,name:account_move_batch_validate.menu_account_move_marker -msgid "Mark Jornal Items for Batch Posting" +msgid "Mark Journal Items for Batch Posting" msgstr "" #. module: account_move_batch_validate diff --git a/account_move_batch_validate/i18n/fr.po b/account_move_batch_validate/i18n/fr.po new file mode 100644 index 000000000..8da8ab826 --- /dev/null +++ b/account_move_batch_validate/i18n/fr.po @@ -0,0 +1,185 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_move_batch_validate +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-19 10:51+0000\n" +"PO-Revision-Date: 2014-02-19 10:51+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_move_batch_validate +#: field:account.move,post_job_uuid:0 +msgid "UUID of the Job to approve this move" +msgstr "UUID du Job pour approuver cette move" + +#. module: account_move_batch_validate +#: help:account.move,to_post:0 +msgid "Check this box to mark the move for batch posting" +msgstr "Check this box to mark the move for batch posting" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +msgid "Mark" +msgstr "Mark" + +#. module: account_move_batch_validate +#: selection:account.move.marker,action:0 +msgid "Unmark for posting" +msgstr "Unmark for posting" + +#. module: account_move_batch_validate +#: field:account.move,to_post:0 +msgid "To Post" +msgstr "Validation demandée" + +#. module: account_move_batch_validate +#: field:account.move.marker,company_id:0 +msgid "Company" +msgstr "Société" + +#. module: account_move_batch_validate +#: model:ir.actions.act_window,name:account_move_batch_validate.action_account_move_marker +#: model:ir.ui.menu,name:account_move_batch_validate.menu_account_move_marker +msgid "Mark Jornal Items for Batch Posting" +msgstr "Sélectionner Ecritures comptables à Valider en batch" + +#. module: account_move_batch_validate +#: selection:account.move.marker,filter:0 +msgid "Date" +msgstr "Date" + +#. module: account_move_batch_validate +#: field:account.move.marker,chart_account_id:0 +msgid "Chart of Account" +msgstr "Plan Comptable" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +#: field:account.move.marker,journal_ids:0 +msgid "Journals" +msgstr "Journaux" + +#. module: account_move_batch_validate +#: field:account.move.marker,target_move:0 +msgid "Target Moves" +msgstr "Target Moves" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +msgid "Report Options" +msgstr "Report Options" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +#: selection:account.move.marker,filter:0 +msgid "Periods" +msgstr "Periods" + +#. module: account_move_batch_validate +#: field:account.move.marker,date_to:0 +msgid "End Date" +msgstr "End Date" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +msgid "Dates" +msgstr "Dates" + +#. module: account_move_batch_validate +#: field:account.move.marker,period_from:0 +msgid "Start Period" +msgstr "Période de debut" + +#. module: account_move_batch_validate +#: field:account.move.marker,eta:0 +msgid "Seconds to wait before starting the jobs" +msgstr "Seconds to wait before starting the jobs" + +#. module: account_move_batch_validate +#: selection:account.move.marker,target_move:0 +msgid "All Posted Entries" +msgstr "Toutes les écritures passées" + +#. module: account_move_batch_validate +#: help:account.move.marker,fiscalyear_id:0 +msgid "Keep empty for all open fiscal year" +msgstr "Keep empty for all open fiscal year" + +#. module: account_move_batch_validate +#: field:account.move.marker,period_to:0 +msgid "End Period" +msgstr "Période de fin" + +#. module: account_move_batch_validate +#: field:account.move.marker,fiscalyear_id:0 +msgid "Fiscal Year" +msgstr "Exercice" + +#. module: account_move_batch_validate +#: selection:account.move.marker,filter:0 +msgid "No Filters" +msgstr "Aucun filtre" + +#. module: account_move_batch_validate +#: field:account.move.marker,action:0 +msgid "Action" +msgstr "Action" + +#. module: account_move_batch_validate +#: model:ir.model,name:account_move_batch_validate.model_account_move +msgid "Account Entry" +msgstr "Pièce comptable" + +#. module: account_move_batch_validate +#: selection:account.move.marker,action:0 +msgid "Mark for posting" +msgstr "Sélectionner pour validation" + +#. module: account_move_batch_validate +#: model:ir.model,name:account_move_batch_validate.model_account_move_marker +msgid "Mark Journal Items for batch posting" +msgstr "Sélectionner Ecritures comptables à Valider en batch" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +msgid "Filters" +msgstr "Filtres" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +msgid "Cancel" +msgstr "Annuler" + +#. module: account_move_batch_validate +#: field:account.move.marker,date_from:0 +msgid "Start Date" +msgstr "Date de début" + +#. module: account_move_batch_validate +#: help:account.move.marker,chart_account_id:0 +msgid "Select Charts of Accounts" +msgstr "Sélectionner Plan Comptable" + +#. module: account_move_batch_validate +#: field:account.move.marker,filter:0 +msgid "Filter by" +msgstr "Filtrer par" + +#. module: account_move_batch_validate +#: view:account.move.marker:0 +msgid "or" +msgstr "ou" + +#. module: account_move_batch_validate +#: selection:account.move.marker,target_move:0 +msgid "All Entries" +msgstr "Toutes les écritures" +