Skip to content

Commit

Permalink
[FIX] account_payment_group: Error validation new aml lines
Browse files Browse the repository at this point in the history
Do not require account.payment.group when try to validate new_aml from
reconcilation wizard.
  • Loading branch information
zaoral committed Sep 17, 2018
1 parent dcc20d5 commit 7fa5529
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion account_payment_group/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Payment with Multiple methods",
"version": "11.0.1.1.1",
"version": "11.0.1.1.2",
"category": "Accounting",
"website": "www.adhoc.com.ar",
"author": "ADHOC SA,",
Expand Down
9 changes: 9 additions & 0 deletions account_payment_group/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,15 @@ def check_payment_group(self):
# odoo tests don't create payments with payment gorups
if self.env.registry.in_test_mode():
return True

counterpart_aml_dicts = self._context.get('counterpart_aml_dicts', [])
new_aml_dicts = self._context.get('new_aml_dicts', [])

# Not need to create payment group if create one new aml from
# reconcilation wizard.
if not counterpart_aml_dicts and new_aml_dicts:
return

for rec in self:
if rec.partner_type and not rec.payment_group_id:
raise ValidationError(_(
Expand Down

0 comments on commit 7fa5529

Please sign in to comment.