[10.0] Add filter on partners on wizard "Create Payment Lines from Journal Items" (#489)

* Add filter on partners on wizard "Create Payment Lines from Journal Items"

* Bump version number
This commit is contained in:
Alexis de Lattre
2018-09-02 15:16:37 +02:00
committed by Carlos Roca
parent 79cd725865
commit 372743f5bb
4 changed files with 28 additions and 11 deletions

View File

@@ -8,7 +8,7 @@
{
'name': 'Account Payment Order',
'version': '11.0.1.2.2',
'version': '11.0.1.3.0',
'license': 'AGPL-3',
'author': "ACSONE SA/NV, "
"Therp BV, "

View File

@@ -342,14 +342,14 @@ msgid "Debit Orders"
msgstr ""
#. module: account_payment_order
#: code:addons/account_payment_order/models/account_payment_order.py:442
#: code:addons/account_payment_order/models/account_payment_order.py:444
#, python-format
msgid "Debit bank line %s"
msgstr ""
#. module: account_payment_order
#: code:addons/account_payment_order/models/account_payment_order.py:371
#: code:addons/account_payment_order/models/account_payment_order.py:392
#: code:addons/account_payment_order/models/account_payment_order.py:394
#, python-format
msgid "Debit order %s"
msgstr ""
@@ -575,6 +575,11 @@ msgstr ""
msgid "Keep empty for using all journals"
msgstr ""
#. module: account_payment_order
#: model:ir.ui.view,arch_db:account_payment_order.account_payment_line_create_form
msgid "Keep empty to use all partners"
msgstr ""
#. module: account_payment_order
#: model:ir.model.fields,help:account_payment_order.field_account_payment_line_communication
msgid "Label of the payment that will be seen by the destinee"
@@ -778,6 +783,11 @@ msgstr ""
msgid "Partner Bank Account"
msgstr ""
#. module: account_payment_order
#: model:ir.model.fields,field_description:account_payment_order.field_account_payment_line_create_partner_ids
msgid "Partners"
msgstr ""
#. module: account_payment_order
#: model:ir.model.fields,help:account_payment_order.field_account_payment_mode_transfer_account_id
msgid "Pay off lines in 'file uploaded' payment orders with a move on this account. You can only select accounts that are marked for reconciliation"
@@ -878,7 +888,7 @@ msgid "Payment Type"
msgstr ""
#. module: account_payment_order
#: code:addons/account_payment_order/models/account_payment_order.py:440
#: code:addons/account_payment_order/models/account_payment_order.py:442
#, python-format
msgid "Payment bank line %s"
msgstr ""
@@ -890,7 +900,7 @@ msgstr ""
#. module: account_payment_order
#: code:addons/account_payment_order/models/account_payment_order.py:369
#: code:addons/account_payment_order/models/account_payment_order.py:390
#: code:addons/account_payment_order/models/account_payment_order.py:392
#, python-format
msgid "Payment order %s"
msgstr ""
@@ -937,7 +947,7 @@ msgid "Search Payment Orders"
msgstr ""
#. module: account_payment_order
#: code:addons/account_payment_order/wizard/account_payment_line_create.py:126
#: code:addons/account_payment_order/wizard/account_payment_line_create.py:130
#, python-format
msgid "Select Move Lines to Create Transactions"
msgstr ""

View File

@@ -16,6 +16,8 @@ class AccountPaymentLineCreate(models.TransientModel):
'account.payment.order', string='Payment Order')
journal_ids = fields.Many2many(
'account.journal', string='Journals Filter')
partner_ids = fields.Many2many(
'res.partner', string='Partners', domain=[('parent_id', '=', False)])
target_move = fields.Selection([
('posted', 'All Posted Entries'),
('all', 'All Entries'),
@@ -61,10 +63,12 @@ class AccountPaymentLineCreate(models.TransientModel):
@api.multi
def _prepare_move_line_domain(self):
self.ensure_one()
journals = self.journal_ids or self.env['account.journal'].search([])
domain = [('reconciled', '=', False),
('company_id', '=', self.order_id.company_id.id),
('journal_id', 'in', journals.ids)]
('company_id', '=', self.order_id.company_id.id)]
if self.journal_ids:
domain += [('journal_id', 'in', self.journal_ids.ids)]
if self.partner_ids:
domain += [('partner_id', 'in', self.partner_ids.ids)]
if self.target_move == 'posted':
domain += [('move_id.state', '=', 'posted')]
if not self.allow_blocked:
@@ -135,7 +139,7 @@ class AccountPaymentLineCreate(models.TransientModel):
@api.onchange(
'date_type', 'move_date', 'due_date', 'journal_ids', 'invoice',
'target_move', 'allow_blocked', 'payment_mode')
'target_move', 'allow_blocked', 'payment_mode', 'partner_ids')
def move_line_filters_change(self):
domain = self._prepare_move_line_domain()
res = {'domain': {'move_line_ids': domain}}

View File

@@ -19,7 +19,10 @@
<field name="due_date" attrs="{'required': [('date_type', '=', 'due')], 'invisible': [('date_type', '!=', 'due')]}"/>
<field name="journal_ids"
widget="many2many_tags"
placeholder="Keep empty for using all journals"/>
placeholder="Keep empty for using all journals"/>
<field name="partner_ids"
widget="many2many_tags"
placeholder="Keep empty to use all partners"/>
<field name="payment_mode"/>
<field name="target_move" widget="radio"/>
<field name="invoice"/>