[FIX] account_payment: transfer provider code doesn't exists anymore
Fine-tuning of61b8c0c1a2. Missing rename of `transfer` to `custom` following commit5f41f15. Part-of: odoo/odoo#99846
This commit is contained in:
@@ -11,7 +11,7 @@ class AccountPaymentMethod(models.Model):
|
||||
def _get_payment_method_information(self):
|
||||
res = super()._get_payment_method_information()
|
||||
for code, _desc in self.env['payment.provider']._fields['code'].selection:
|
||||
if code in ('none', 'transfer'):
|
||||
if code in ('none', 'custom'):
|
||||
continue
|
||||
res[code] = {
|
||||
'mode': 'unique',
|
||||
|
||||
@@ -75,7 +75,7 @@ class Paymentprovider(models.Model):
|
||||
|
||||
@api.model
|
||||
def _setup_payment_method(self, code):
|
||||
if code not in ('none', 'transfer') and not self._get_provider_payment_method(code):
|
||||
if code not in ('none', 'custom') and not self._get_provider_payment_method(code):
|
||||
providers_description = dict(self._fields['code']._description_selection(self.env))
|
||||
self.env['account.payment.method'].create({
|
||||
'name': providers_description[code],
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<xpath expr="//t[@t-foreach='invoices']/tr/td[last()]" position="before">
|
||||
<td class="text-center">
|
||||
<t t-set="tx_ids" t-value="invoice.transaction_ids.filtered(lambda tx: tx.state in ('pending', 'authorized', 'done'))"/>
|
||||
<t t-set="pending_manual_txs" t-value="tx_ids.filtered(lambda tx: tx.state == 'pending' and tx.provider in ('none', 'transfer'))"/>
|
||||
<t t-set="pending_manual_txs" t-value="tx_ids.filtered(lambda tx: tx.state == 'pending' and tx.provider in ('none', 'custom'))"/>
|
||||
<a t-if="invoice.state == 'posted' and invoice.payment_state in ('not_paid', 'partial') and invoice.amount_total and invoice.move_type == 'out_invoice' and (pending_manual_txs or not tx_ids or invoice.amount_paid < invoice.amount_total)"
|
||||
t-att-href="invoice.get_portal_url(anchor='portal_pay')" title="Pay Now" aria-label="Pay now" class="btn btn-sm btn-primary" role="button">
|
||||
<i class="fa fa-arrow-circle-right"/><span class='d-none d-md-inline'> Pay Now</span>
|
||||
@@ -16,13 +16,13 @@
|
||||
<xpath expr="//t[@t-foreach='invoices']/tr/td[hasclass('tx_status')]" position="replace">
|
||||
<t t-set="last_tx" t-value="invoice.get_portal_last_transaction()"/>
|
||||
<td class="tx_status text-center">
|
||||
<t t-if="invoice.state == 'posted' and invoice.payment_state in ('not_paid', 'partial') and (last_tx.state not in ['pending', 'authorized', 'done', 'cancel'] or (last_tx.state == 'pending' and last_tx.provider in ('none', 'transfer')))">
|
||||
<t t-if="invoice.state == 'posted' and invoice.payment_state in ('not_paid', 'partial') and (last_tx.state not in ['pending', 'authorized', 'done', 'cancel'] or (last_tx.state == 'pending' and last_tx.provider in ('none', 'custom')))">
|
||||
<span class="badge rounded-pill text-bg-info"><i class="fa fa-fw fa-clock-o"></i><span class="d-none d-md-inline"> Waiting for Payment</span></span>
|
||||
</t>
|
||||
<t t-if="invoice.state == 'posted' and last_tx.state == 'authorized'">
|
||||
<span class="badge rounded-pill text-bg-primary"><i class="fa fa-fw fa-check"/><span class="d-none d-md-inline"> Authorized</span></span>
|
||||
</t>
|
||||
<t t-if="invoice.state == 'posted' and last_tx.state == 'pending' and last_tx.provider not in ('none', 'transfer')">
|
||||
<t t-if="invoice.state == 'posted' and last_tx.state == 'pending' and last_tx.provider not in ('none', 'custom')">
|
||||
<span class="badge rounded-pill text-bg-warning"><span class="d-none d-md-inline"> Pending</span></span>
|
||||
</t>
|
||||
<t t-if="invoice.state == 'posted' and invoice.payment_state in ('paid', 'in_payment') or last_tx.state == 'done'">
|
||||
@@ -65,7 +65,7 @@
|
||||
<template id="portal_invoice_page_inherit_payment" name="Payment on My Invoices" inherit_id="account.portal_invoice_page">
|
||||
<xpath expr="//t[@t-call='portal.portal_record_sidebar']//div[hasclass('o_download_pdf')]" position="before">
|
||||
<t t-set="tx_ids" t-value="invoice.transaction_ids.filtered(lambda tx: tx.state in ('pending', 'authorized', 'done'))"/>
|
||||
<t t-set="pending_manual_txs" t-value="tx_ids.filtered(lambda tx: tx.state == 'pending' and tx.provider in ('none', 'transfer'))"/>
|
||||
<t t-set="pending_manual_txs" t-value="tx_ids.filtered(lambda tx: tx.state == 'pending' and tx.provider in ('none', 'custom'))"/>
|
||||
<div class="d-grid">
|
||||
<a href="#" t-if="invoice.state == 'posted' and invoice.payment_state in ('not_paid', 'partial') and invoice.amount_total and invoice.move_type == 'out_invoice' and (pending_manual_txs or not tx_ids or invoice.amount_paid < invoice.amount_total)"
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
<t t-if="success == 'pay_invoice'">
|
||||
<t t-set="payment_tx_id" t-value="invoice.get_portal_last_transaction()"/>
|
||||
<span t-if='payment_tx_id.provider_id.sudo().done_msg' t-out="payment_tx_id.provider_id.sudo().done_msg"/>
|
||||
<div t-if="payment_tx_id.provider_id.sudo().pending_msg and payment_tx_id.provider_code == 'transfer' and invoice.ref">
|
||||
<div t-if="payment_tx_id.provider_id.sudo().pending_msg and payment_tx_id.provider_code == 'custom' and invoice.ref">
|
||||
<b>Communication: </b><span t-esc='invoice.ref'/>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<group name="payment_followup" position="inside">
|
||||
<field name="journal_id"
|
||||
context="{'default_type': 'bank'}"
|
||||
attrs="{'required': [('state', '!=', 'disabled'), ('code', 'not in', ['none', 'transfer'])]}"/>
|
||||
attrs="{'required': [('state', '!=', 'disabled'), ('code', 'not in', ['none', 'custom'])]}"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -7,7 +7,7 @@ from odoo.addons.payment import setup_provider, reset_payment_provider
|
||||
|
||||
|
||||
def post_init_hook(cr, registry):
|
||||
setup_provider(cr, registry, 'transfer')
|
||||
setup_provider(cr, registry, 'custom')
|
||||
|
||||
|
||||
def uninstall_hook(cr, registry):
|
||||
|
||||
@@ -843,7 +843,7 @@ class SaleOrder(models.Model):
|
||||
def action_done(self):
|
||||
for order in self:
|
||||
tx = order.sudo().transaction_ids._get_last()
|
||||
if tx and tx.state == 'pending' and tx.provider_id.code == 'transfer':
|
||||
if tx and tx.state == 'pending' and tx.provider_id.code == 'custom':
|
||||
tx._set_done()
|
||||
tx.write({'is_post_processed': True})
|
||||
self.write({'state': 'done'})
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<field name="inherit_id" ref="payment.payment_provider_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="payment_form" position="inside">
|
||||
<field name="so_reference_type" attrs="{'invisible': [('code', '!=', 'transfer')]}"/>
|
||||
<field name="so_reference_type" attrs="{'invisible': [('code', '!=', 'custom')]}"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -1958,7 +1958,7 @@
|
||||
<span t-esc="payment_tx_id.state_message"/>
|
||||
</t>
|
||||
</div>
|
||||
<t t-if="payment_tx_id.provider_code == 'transfer'">
|
||||
<t t-if="payment_tx_id.provider_code == 'custom'">
|
||||
<div t-if="order.reference" class="card-body">
|
||||
<b>Communication: </b><span t-esc='order.reference'/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user