From 4e3cd699f98d2a49556dbdbebd65c524a342d056 Mon Sep 17 00:00:00 2001 From: Adrien Peiffer Date: Wed, 10 Dec 2014 11:24:47 +0100 Subject: [PATCH 1/6] [ADD] Add account_pay_draft_move addons --- account_pay_draft_move/README.rst | 8 ++++ account_pay_draft_move/__init__.py | 23 +++++++++++ account_pay_draft_move/__openerp__.py | 38 +++++++++++++++++++ account_pay_draft_move/wizard/__init__.py | 23 +++++++++++ .../wizard/payment_order_create.py | 35 +++++++++++++++++ 5 files changed, 127 insertions(+) create mode 100644 account_pay_draft_move/README.rst create mode 100644 account_pay_draft_move/__init__.py create mode 100644 account_pay_draft_move/__openerp__.py create mode 100644 account_pay_draft_move/wizard/__init__.py create mode 100644 account_pay_draft_move/wizard/payment_order_create.py diff --git a/account_pay_draft_move/README.rst b/account_pay_draft_move/README.rst new file mode 100644 index 000000000..afcd5900f --- /dev/null +++ b/account_pay_draft_move/README.rst @@ -0,0 +1,8 @@ +Account Payment Draft Move +============================================== + +Add payment order line from unposted move line. + +With account_default_draft_move, this module allow to add move line +before periodic processing to post all move + \ No newline at end of file diff --git a/account_pay_draft_move/__init__.py b/account_pay_draft_move/__init__.py new file mode 100644 index 000000000..62da7f088 --- /dev/null +++ b/account_pay_draft_move/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# +############################################################################## +# +# Authors: Adrien Peiffer +# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) +# +# 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 . import wizard diff --git a/account_pay_draft_move/__openerp__.py b/account_pay_draft_move/__openerp__.py new file mode 100644 index 000000000..11d8636f6 --- /dev/null +++ b/account_pay_draft_move/__openerp__.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# +############################################################################## +# +# Authors: Adrien Peiffer +# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) +# +# 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 Payment Draft Move", + "version": "1.0", + "author": "ACSONE SA/NV", + "maintainer": "ACSONE SA/NV", + "website": "http://www.acsone.eu", + "images": [], + "category": "Accounting", + "depends": ["account_banking_payment_export"], + "data": [], + "demo": [], + "test": [], + "licence": "AGPL-3", + "installable": True, + "active": False, +} diff --git a/account_pay_draft_move/wizard/__init__.py b/account_pay_draft_move/wizard/__init__.py new file mode 100644 index 000000000..e087871c3 --- /dev/null +++ b/account_pay_draft_move/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# +############################################################################## +# +# Authors: Adrien Peiffer +# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) +# +# 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 . import payment_order_create diff --git a/account_pay_draft_move/wizard/payment_order_create.py b/account_pay_draft_move/wizard/payment_order_create.py new file mode 100644 index 000000000..98b6fe44c --- /dev/null +++ b/account_pay_draft_move/wizard/payment_order_create.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# +############################################################################## +# +# Authors: Adrien Peiffer +# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) +# +# 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 openerp import models, api + + +class PaymentOrderCreate(models.TransientModel): + _inherit = 'payment.order.create' + + @api.model + def extend_payment_order_domain(self, payment_order, domain): + posted_move_domain = ('move_id.state', '=', 'posted') + if posted_move_domain in domain: + domain.remove(('move_id.state', '=', 'posted')) + return super(PaymentOrderCreate, self)\ + .extend_payment_order_domain(payment_order, domain) From ee4d7e1edd0f5147bc6dd33f492bd6d13cc51a52 Mon Sep 17 00:00:00 2001 From: Adrien Peiffer Date: Mon, 29 Dec 2014 13:14:10 +0100 Subject: [PATCH 2/6] [IMP] use posted_move_domain as a constant --- account_pay_draft_move/wizard/payment_order_create.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/account_pay_draft_move/wizard/payment_order_create.py b/account_pay_draft_move/wizard/payment_order_create.py index 98b6fe44c..2da6f3861 100644 --- a/account_pay_draft_move/wizard/payment_order_create.py +++ b/account_pay_draft_move/wizard/payment_order_create.py @@ -22,14 +22,15 @@ from openerp import models, api +POSTED_MOVE_DOMAIN = ('move_id.state', '=', 'posted') + class PaymentOrderCreate(models.TransientModel): _inherit = 'payment.order.create' @api.model def extend_payment_order_domain(self, payment_order, domain): - posted_move_domain = ('move_id.state', '=', 'posted') - if posted_move_domain in domain: - domain.remove(('move_id.state', '=', 'posted')) + if POSTED_MOVE_DOMAIN in domain: + domain.remove(POSTED_MOVE_DOMAIN) return super(PaymentOrderCreate, self)\ .extend_payment_order_domain(payment_order, domain) From b8e6e74176e61689a193bc3ccd8e9bc6ef050a2b Mon Sep 17 00:00:00 2001 From: Adrien Peiffer Date: Tue, 30 Dec 2014 09:28:07 +0100 Subject: [PATCH 3/6] [IMP] Rename account_pay_draft_move to account_payment_include_draft_move --- .../README.rst | 0 .../__init__.py | 0 .../__openerp__.py | 0 .../wizard/__init__.py | 0 .../wizard/payment_order_create.py | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename {account_pay_draft_move => account_payment_include_draft_move}/README.rst (100%) rename {account_pay_draft_move => account_payment_include_draft_move}/__init__.py (100%) rename {account_pay_draft_move => account_payment_include_draft_move}/__openerp__.py (100%) rename {account_pay_draft_move => account_payment_include_draft_move}/wizard/__init__.py (100%) rename {account_pay_draft_move => account_payment_include_draft_move}/wizard/payment_order_create.py (100%) diff --git a/account_pay_draft_move/README.rst b/account_payment_include_draft_move/README.rst similarity index 100% rename from account_pay_draft_move/README.rst rename to account_payment_include_draft_move/README.rst diff --git a/account_pay_draft_move/__init__.py b/account_payment_include_draft_move/__init__.py similarity index 100% rename from account_pay_draft_move/__init__.py rename to account_payment_include_draft_move/__init__.py diff --git a/account_pay_draft_move/__openerp__.py b/account_payment_include_draft_move/__openerp__.py similarity index 100% rename from account_pay_draft_move/__openerp__.py rename to account_payment_include_draft_move/__openerp__.py diff --git a/account_pay_draft_move/wizard/__init__.py b/account_payment_include_draft_move/wizard/__init__.py similarity index 100% rename from account_pay_draft_move/wizard/__init__.py rename to account_payment_include_draft_move/wizard/__init__.py diff --git a/account_pay_draft_move/wizard/payment_order_create.py b/account_payment_include_draft_move/wizard/payment_order_create.py similarity index 100% rename from account_pay_draft_move/wizard/payment_order_create.py rename to account_payment_include_draft_move/wizard/payment_order_create.py From fddb8e18506ccbac85a0d39a98e395c56e27785d Mon Sep 17 00:00:00 2001 From: Adrien Peiffer Date: Wed, 7 Jan 2015 14:10:37 +0100 Subject: [PATCH 4/6] [IMP] Improve readme file --- account_payment_include_draft_move/README.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/account_payment_include_draft_move/README.rst b/account_payment_include_draft_move/README.rst index afcd5900f..2a1116a8a 100644 --- a/account_payment_include_draft_move/README.rst +++ b/account_payment_include_draft_move/README.rst @@ -1,8 +1,7 @@ -Account Payment Draft Move -============================================== +Include draft moves in account payments +======================================= -Add payment order line from unposted move line. +Add payment order line from unposted move lines. -With account_default_draft_move, this module allow to add move line -before periodic processing to post all move - \ No newline at end of file +With account_default_draft_move, this module allows to add move lines +to payment orders before making the periodic process of posting all moves \ No newline at end of file From 0037017e5d496127df10385ef5cd28fd0149aa76 Mon Sep 17 00:00:00 2001 From: Adrien Peiffer Date: Wed, 7 Jan 2015 14:11:41 +0100 Subject: [PATCH 5/6] [IMP] Move maintainer key out of the manifest --- account_payment_include_draft_move/__openerp__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/account_payment_include_draft_move/__openerp__.py b/account_payment_include_draft_move/__openerp__.py index 11d8636f6..db72870a2 100644 --- a/account_payment_include_draft_move/__openerp__.py +++ b/account_payment_include_draft_move/__openerp__.py @@ -24,7 +24,6 @@ "name": "Account Payment Draft Move", "version": "1.0", "author": "ACSONE SA/NV", - "maintainer": "ACSONE SA/NV", "website": "http://www.acsone.eu", "images": [], "category": "Accounting", From e22794f07c6d1027e16617ac6874289794080967 Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Wed, 11 Feb 2015 23:14:04 +0100 Subject: [PATCH 6/6] [IMP] Replace partial domain by (1,'=',1) --- .../wizard/payment_order_create.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/account_payment_include_draft_move/wizard/payment_order_create.py b/account_payment_include_draft_move/wizard/payment_order_create.py index 2da6f3861..e58b3d65c 100644 --- a/account_payment_include_draft_move/wizard/payment_order_create.py +++ b/account_payment_include_draft_move/wizard/payment_order_create.py @@ -31,6 +31,7 @@ class PaymentOrderCreate(models.TransientModel): @api.model def extend_payment_order_domain(self, payment_order, domain): if POSTED_MOVE_DOMAIN in domain: - domain.remove(POSTED_MOVE_DOMAIN) + pos = domain.index(POSTED_MOVE_DOMAIN) + domain[pos] = (1, '=', 1) return super(PaymentOrderCreate, self)\ .extend_payment_order_domain(payment_order, domain)