Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
5257 Widoki

Hi,

I'm using Odoo 9.0.

I'm trying to add the payment paid for the printable invoice PDF file (e.g. Selecting an invoice, then print --> duplicate/print).


I want it to be between "Subtotal" and "Total". 


I see there's a field called 'payments_widget' of type 'text' and widget=payment in account.invoice model, but if I add this:


<span t-field="o.payments_widget" t-field-options="{&quot;widget&quot;: &quot;payment&quot;}"/>

I get this:


{"content": [{"digits": [69, 2], "currency": "$", "amount": -820.15, "name": "Customer Payment: INV/2018/1929", "date": "2018-05-17", "position": "before", "ref": "SO12680", "payment_id": 339657, "move_id": 108950, "journal_name": "Stripe Payment"}], "outstanding": false, "title": "Minus Payment"}




Can someone please advise how to get the actual fields in it like they are in the invoice?


Thanks


Awatar
Odrzuć

Thanks bro, it worked

Najlepsza odpowiedź

did you manage to solve it? I face same issue

EDIT:

I managed to solve it this way. You can add <t t-esc="pw.name_of_variable"/> from account.payment if you need any other information.

<tr class="border-black" t-if="o.payment_ids">
                            <td><strong>Already paid</strong></td>
                            <td class="text-right">
                        <t t-foreach="o.payment_ids" t-as="pw">
                            <strong>Date</strong>
                            <t t-esc="pw.payment_date" t-options="{&quot;widget&quot;: &quot;date&quot;}"/><br/>
                            <strong>Price</strong>
                            <t t-esc="pw.amount"/> Currency<br/>
                        </t>
                            </td>

                        </tr>
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
cze 25
2226
1
mar 25
1546
4
maj 24
6200
1
maj 23
3982
1
mar 23
5276