diff --git a/account_payment_include_draft_move/README.rst b/account_payment_include_draft_move/README.rst deleted file mode 100644 index 6d70ac802..000000000 --- a/account_payment_include_draft_move/README.rst +++ /dev/null @@ -1,68 +0,0 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :alt: License: AGPL-3 - -Account Payment Draft Move -========================== - -Include draft moves in account payments - -Add payment order line from unposted move lines. -With account_default_draft_move, this module allows to add move lines -to payment orders before making the periodic process of posting all moves. - -Installation -============ - -This module depends on : -* account_banking_payment_export - -This module is part of the OCA/bank-payment suite. - -Configuration -============= - -There is nothing to configure. - -Usage -===== - -A new payment order allow to select draft journal items related to an invoice. - -For further information, please visit: - - * https://www.odoo.com/forum/help-1 - -Known issues / Roadmap -====================== - - * No known issues. - -Bug Tracker -=========== - -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. - -Credits -======= - -Contributors ------------- - -* Adrien Peiffer -* Alexandre Fayolle - -Maintainer ----------- - -.. image:: http://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: http://odoo-community.org - -This module is maintained by the OCA. - -OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. - -To contribute to this module, please visit http://odoo-community.org. \ No newline at end of file diff --git a/account_payment_include_draft_move/__init__.py b/account_payment_include_draft_move/__init__.py deleted file mode 100644 index 62da7f088..000000000 --- a/account_payment_include_draft_move/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- 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_payment_include_draft_move/__openerp__.py b/account_payment_include_draft_move/__openerp__.py deleted file mode 100644 index c6aa38216..000000000 --- a/account_payment_include_draft_move/__openerp__.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- 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": "8.0.1.0.0", - "author": "ACSONE SA/NV,Odoo Community Association (OCA)", - "website": "http://www.acsone.eu", - "images": [], - "category": "Accounting", - "depends": ["account_banking_payment_export"], - "data": [], - "demo": [], - "test": [], - "licence": "AGPL-3", - 'installable': False, - "active": False, -} diff --git a/account_payment_include_draft_move/static/description/icon.png b/account_payment_include_draft_move/static/description/icon.png deleted file mode 100644 index 3a0328b51..000000000 Binary files a/account_payment_include_draft_move/static/description/icon.png and /dev/null differ diff --git a/account_payment_include_draft_move/wizard/__init__.py b/account_payment_include_draft_move/wizard/__init__.py deleted file mode 100644 index e087871c3..000000000 --- a/account_payment_include_draft_move/wizard/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- 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_payment_include_draft_move/wizard/payment_order_create.py b/account_payment_include_draft_move/wizard/payment_order_create.py deleted file mode 100644 index 5564a2040..000000000 --- a/account_payment_include_draft_move/wizard/payment_order_create.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- 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 - -POSTED_MOVE_DOMAIN = ('move_id.state', '=', 'posted') - - -class PaymentOrderCreate(models.TransientModel): - _inherit = 'payment.order.create' - - @api.multi - def extend_payment_order_domain(self, payment_order, domain): - if POSTED_MOVE_DOMAIN in domain: - pos = domain.index(POSTED_MOVE_DOMAIN) - domain[pos] = (1, '=', 1) - return super(PaymentOrderCreate, self)\ - .extend_payment_order_domain(payment_order, domain) diff --git a/account_payment_order/models/account_payment_mode.py b/account_payment_order/models/account_payment_mode.py index 741c68c5a..501be87a1 100644 --- a/account_payment_order/models/account_payment_mode.py +++ b/account_payment_order/models/account_payment_mode.py @@ -26,6 +26,10 @@ class AccountPaymentMode(models.Model): 'account.journal', string="Journals Filter") default_invoice = fields.Boolean( string='Linked to an Invoice or Refund', default=False) + default_target_move = fields.Selection([ + ('posted', 'All Posted Entries'), + ('all', 'All Entries'), + ], string='Target Moves', default='posted') default_date_type = fields.Selection([ ('due', 'Due'), ('move', 'Move'), diff --git a/account_payment_order/views/account_payment_mode.xml b/account_payment_order/views/account_payment_mode.xml index 47ba96f79..fba7b0512 100644 --- a/account_payment_order/views/account_payment_mode.xml +++ b/account_payment_order/views/account_payment_mode.xml @@ -16,6 +16,7 @@ + diff --git a/account_payment_order/wizard/account_payment_line_create.py b/account_payment_order/wizard/account_payment_line_create.py index 283047ed1..b8769032e 100644 --- a/account_payment_order/wizard/account_payment_line_create.py +++ b/account_payment_order/wizard/account_payment_line_create.py @@ -16,6 +16,10 @@ class AccountPaymentLineCreate(models.TransientModel): 'account.payment.order', string='Payment Order') journal_ids = fields.Many2many( 'account.journal', string='Journals Filter') + target_move = fields.Selection([ + ('posted', 'All Posted Entries'), + ('all', 'All Entries'), + ], string='Target Moves') invoice = fields.Boolean( string='Linked to an Invoice or Refund') date_type = fields.Selection([ @@ -44,6 +48,7 @@ class AccountPaymentLineCreate(models.TransientModel): mode = order.payment_mode_id res.update({ 'journal_ids': mode.default_journal_ids.ids or False, + 'target_move': mode.default_target_move, 'invoice': mode.default_invoice, 'date_type': mode.default_date_type, 'payment_mode': mode.default_payment_mode, @@ -55,10 +60,11 @@ class AccountPaymentLineCreate(models.TransientModel): def _prepare_move_line_domain(self): self.ensure_one() journals = self.journal_ids or self.env['account.journal'].search([]) - domain = [('move_id.state', '=', 'posted'), - ('reconciled', '=', False), + domain = [('reconciled', '=', False), ('company_id', '=', self.order_id.company_id.id), ('journal_id', 'in', journals.ids)] + if self.target_move == 'posted': + domain += [('move_id.state', '=', 'posted')] if self.date_type == 'due': domain += [ '|', diff --git a/account_payment_order/wizard/account_payment_line_create_view.xml b/account_payment_order/wizard/account_payment_line_create_view.xml index 4996b5813..e12034e75 100644 --- a/account_payment_order/wizard/account_payment_line_create_view.xml +++ b/account_payment_order/wizard/account_payment_line_create_view.xml @@ -21,6 +21,7 @@ widget="many2many_tags" placeholder="Keep empty for using all journals"/> +