Skip to content

Commit

Permalink
Merge d8a8e07 into c6e5d9e
Browse files Browse the repository at this point in the history
  • Loading branch information
jobiols committed Aug 8, 2020
2 parents c6e5d9e + d8a8e07 commit c5086af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions account_payment_group/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def post_init_hook(cr, registry):
for payment in payments:

_logger.info('creating payment group for payment %s' % payment.id)
_state = payment.state in ['sent', 'reconciled'] and 'posted' or payment.state
_state = _state if _state != 'cancelled' else 'cancel'
env['account.payment.group'].create({
'company_id': payment.company_id.id,
'partner_type': payment.partner_type,
Expand All @@ -31,7 +33,5 @@ def post_init_hook(cr, registry):
# name es la secuencia
'communication': payment.communication,
'payment_ids': [(4, payment.id, False)],
'state': (
payment.state in ['sent', 'reconciled'] and
'posted' or payment.state),
'state': _state,
})

0 comments on commit c5086af

Please sign in to comment.