Skip to Content
Menu
This question has been flagged
1 Reply
2716 Views

I have a problem getting the data from my template. I need to get data into my controller and after that send request to payment service. If I get SUCCESS for my data I get URL to redirect to.

I the form generate values I add. Data for the tx_url is of my controller.

def bankart_form_generate_values(self, values):
	public_ip = self.get_public_ip()
	bankart_values = {
		'reference': values.get('reference'),
		'partner_id': values.get('partner_id'),
		'amount': values.get('amount'),
		'partner_first_name': values.get('partner_first_name'),
		'partner_last_name': values.get('partner_last_name'),
		'partner_country': values.get('partner_country').code,
		'partner_email': values.get('partner_email'),
		'ip_address': public_ip
	}
	ban_values.update(values)

	return ban_values

The template form

<odoo>
    <data noupdate="1">
        <template id="ban_form">
            <form t-if="acquirer" t-att-action="tx_url" method="post">
                <input type='hidden' name='reference' t-att-value='reference'/>
                <input type='hidden' name='partner_id' t-att-value='partner_id'/>
                <input type='hidden' name='amount' t-att-value='amount or "0.0"'/>
                <input type='hidden' name='partner_first_name' t-att-value='partner_first_name'/>
                <input type='hidden' name='partner_last_name' t-att-value='partner_last_name'/>
                <input type='hidden' name='partner_country' t-att-value='partner_country.code or "SI"'/>
                <input type='hidden' name='partner_email' t-att-value='partner_email'/>
                <input type='hidden' name='ip_address' t-att-value='ip_address'/>
                <input type='hidden' name='currency' t-att-value='currency.code or "EUR"'/>
            </form>
        </template>
    </data>
</odoo>

The problem is that I do not get this data in my controller? Why don't I get this data, what is wrong?

Avatar
Discard
Best Answer

The method: _form_generate_values dose not exist in Odoo 15. 

Avatar
Discard
Related Posts Replies Views Activity
0
Nov 19
2212
0
Dec 20
2622
1
Dec 22
4641
3
Jul 20
5079
1
Apr 19
3310