Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
5785 Представления

Trying to get this aquirer button to work and I am not sure how to pass the values to the form using qweb. The values are not input type hidden, but they are in the form tag.

Here is my code 


<?xml version="1.0" encoding="utf-8"?>

<openerp>

<data noupdate="1">

<template id="stripe_acquirer_button">

<form t-if="acquirer" t-att-action="tx_url" method="post">

<script

src="https://checkout.stripe.com/checkout.js" class="stripe-button"

data-key=<t t-raw="tx_values['data-desciption'].raw_val" />

data-image="/img/documentation/checkout/marketplace.png"

data-name="tx_values['data-name']"

data-description="tx_values['data-desciption']"

data-panel-label="tx_values['data-panel-label']"

data-zip-code="tx_values['data-zip-code']"

data-email="tx_values['data-email']"

data-allow-remember-me="tx_values['data-allow-remember-me']"

data-amount="tx_values['data-amount']"

data-currency="tx_values['data-currency']">

</script>

</form>

</template>

</data>

</openerp>



My Issue is the the field like data-key and data-email etc, the rendered HTML does not show the value but instead show whatever is in double quotes.

Аватар
Отменить
Лучший ответ

Hi,


You need to replace data-amount by t-att-data-amount (idem for all other fields)

T-att- will make an eval from what you specify in double quotes...

 

<input type='text' t-att-data-xxx="1+1" data-yyy="1+1"/>

==>

<input type="text" data-xxx="2" data-yyy="1+1" />

 

More details here : https://www.odoo.com/documentation/8.0/reference/qweb.html#reference-qweb-attributes

Аватар
Отменить
Автор

Thanks you very much worked like a charm

Related Posts Ответы Просмотры Активность
5
авг. 18
16512
0
апр. 17
4376
3
нояб. 24
1055
2
июл. 22
5542
2
окт. 23
2109