Add option 'target_move' (all or posted) in wizard to select move lines to pay

Remove module account_payment_include_draft_move
This commit is contained in:
Alexis de Lattre
2016-05-07 20:13:22 +02:00
parent 12a2076c1f
commit 882e0e5292
10 changed files with 14 additions and 190 deletions

View File

@@ -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 <https://github.com/OCA/bank-payment/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 <https://github.com/OCA/bank-payment/issues/new?body=module:%20account_payment_include_draft_move%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits
=======
Contributors
------------
* Adrien Peiffer <adrien.peiffer@acsone.eu>
* 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.

View File

@@ -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 <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import wizard

View File

@@ -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 <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"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,
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -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 <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import payment_order_create

View File

@@ -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 <http://www.gnu.org/licenses/>.
#
##############################################################################
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)

View File

@@ -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'),

View File

@@ -16,6 +16,7 @@
<group name="payment_order_create_defaults" string="Select Move Lines to Pay - Default Values">
<field name="default_journal_ids" widget="many2many_tags"/>
<field name="default_payment_mode"/>
<field name="default_target_move" widget="radio"/>
<field name="default_invoice"/>
<field name="default_date_type"/>
</group>

View File

@@ -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 += [
'|',

View File

@@ -21,6 +21,7 @@
widget="many2many_tags"
placeholder="Keep empty for using all journals"/>
<field name="payment_mode"/>
<field name="target_move" widget="radio"/>
<field name="invoice"/>
<label string="Click on Add All Move Lines to auto-select the move lines matching the above criteria or click on Add an item to manually select the move lines filtered by the above criteria." colspan="2"/>
<button name="populate" type="object" string="Add All Move Lines"/>