Skip to content

Commit

Permalink
Release new version v14.0.0.4
Browse files Browse the repository at this point in the history
- minor bug fixes and improvemnts.
  • Loading branch information
odoo-mvds committed Feb 19, 2021
1 parent c7ecb95 commit c831b2d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion payment_mollie_official/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
'name': 'Mollie Payments',
'version': '14.0.0.3',
'version': '14.0.0.4',
'category': 'eCommerce',
'license': 'LGPL-3',
'author': 'Mollie',
Expand Down
6 changes: 4 additions & 2 deletions payment_mollie_official/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@ def action_register_refund_payment(self):
}

payment_record, mollie_transactions = self._get_mollie_payment_data_for_refund()
if payment_record:

# We will not get `amountRemaining` key if payment is not paid (only authorized)
if payment_record and payment_record.get('amountRemaining'):
# TO-DO: check the case where amount is refunded in another currency or raise warning
remaining_amount = float(payment_record['amountRemaining']['value'])
if remaining_amount:
context.update({
'default_journal_id': mollie_transactions.payment_id.journal_id.id,
'default_payment_method_id': mollie_transactions.payment_id.payment_method_id.id,
'default_amount': remaining_amount,
'default_amount': min(self.amount_residual, remaining_amount),
'default_is_mollie_refund': True,
'default_max_mollie_amount': remaining_amount,
'default_mollie_transecion_id': mollie_transactions.id
Expand Down
6 changes: 5 additions & 1 deletion payment_mollie_official/models/payment_acquirer.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ def mollie_get_active_methods(self, order=None):
if remove_voucher_method:
methods = methods.filtered(lambda m: m.method_id_code != 'voucher')

# Hide only order type methods from transection links
if request and request.httprequest.path == '/website_payment/pay':
methods = methods.filtered(lambda m: m.supports_payment_api == True)

return methods

def mollie_form_generate_values(self, tx_values):
Expand Down Expand Up @@ -269,7 +273,7 @@ def _mollie_create_payment(self, transaction):

# Add if transection has issuer
if transaction.mollie_payment_issuer:
payment_data['payment'] = {'issuer': transaction.mollie_payment_issuer}
payment_data['issuer'] = transaction.mollie_payment_issuer

result = self._api_mollie_create_payment(payment_data)

Expand Down
10 changes: 10 additions & 0 deletions payment_mollie_official/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,16 @@ <h1 style="color: #000;font-weight: bold;/* font-size: 50px; */" class="mt-5 tex
<span style="width:73px;height: 10px;display:inline-block;border-radius: 4px;background-color: #0077ff;"> </span>
</div>

<div class="card mx-auto w-md-75">
<div class="card-header bg-200">
<h4 class="m-0">v14.0.0.4</h4>
</div>
<div class="card-body">
<div> <b class="text-warning"> UPDATE </b> Set default amount in the refund dialog. </div>
<div> <b class="text-warning"> UPDATE </b> Show only payment api type methods for payment links. </div>
<div> <b class="text-danger"> FIX </b> Minor bug fixes. </div>
</div>
</div>
<div class="card mx-auto w-md-75">
<div class="card-header bg-200">
<h4 class="m-0">v14.0.0.3</h4>
Expand Down

0 comments on commit c831b2d

Please sign in to comment.