[FIX] point_of_sale: payment method name not displayed

When a payment line is created, and then the order is reloaded, by the
synchronization feature for example, the name displayed on the payment
line is empty.

This happens because the field name is not saved on the server, so
instead of using it, we are directly taking the name of the payment
method linked to the payment line.

closes odoo/odoo#43615

X-original-commit: ae4322cd81814cf4cdc462ff9d271f83ce2870c4
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
This commit is contained in:
odooqs
2020-01-21 09:00:07 +00:00
committed by Pierre Masereel
parent e18ac0963a
commit 279d3ce00b
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -712,7 +712,7 @@
<t t-esc='widget.inputbuffer' />
</div>
</t>
<div class='col-name' > <t t-esc='line.name' /> </div>
<div class='col-name' > <t t-esc='line.payment_method.name' /> </div>
<t t-if="line &amp;&amp; line.payment_status &amp;&amp; ['done', 'reversed', 'reversing'].includes(line.payment_status)">
<div/>
</t>
@@ -729,7 +729,7 @@
<t t-if='!line.selected'>
<div class='paymentline' t-att-data-cid='line.cid'>
<div class='col-tendered'> <t t-esc='widget.format_currency_no_symbol(line.get_amount())' /> </div>
<div class='col-name'> <t t-esc='line.name' /> </div>
<div class='col-name'> <t t-esc='line.payment_method.name' /> </div>
<t t-if="line &amp;&amp; line.payment_status &amp;&amp; ['done', 'reversed', 'reversing'].includes(line.payment_status)">
<div/>
</t>
@@ -1578,7 +1578,7 @@
<t t-name="Paymentline">
<div t-attf-class="paymentline #{line.selected ? 'selected' : ''}">
<div class='paymentline-name'>
<t t-esc="line.name"/>
<t t-esc="line.payment_method.name"/>
</div>
<input class='paymentline-input'
t-att-type="widget.decimal_point === '.' ? 'number' : 'text'"
@@ -1593,7 +1593,7 @@
<t t-name="PaymentlineOld">
<tr t-attf-class="paymentline #{line.selected ? 'selected' : ''}">
<td class="paymentline-type">
<t t-esc="line.name"/>
<t t-esc="line.payment_method.name"/>
</td>
<td class="paymentline-amount pos-right-align">
<input type="number" step="0.01" t-att-value="line.get_amount_str()" />
@@ -17,11 +17,11 @@
<div>WAITING FOR SWIPE</div>
</t>
<t t-if="! line.mercury_swipe_pending">
<t t-esc='line.name' />
<t t-esc='line.payment_method.name' />
</t>
</t>
<t t-if="line.payment_method.is_cash_count">
<t t-esc='line.name' />
<t t-esc='line.payment_method.name' />
</t>
</t>
<!-- if there is payment status, then it is terminal paymentline, so payment-terminal class should be added. -->