Merge remote-tracking branch 'odoo/master' into master-odoo-cmd-fme
This commit is contained in:
commit
6085a8301b
|
@ -20,7 +20,7 @@
|
|||
<input t-if="tx_values.get('merchantReturnData')" type='hidden' name='merchantReturnData'
|
||||
t-att-value="tx_values.get('merchantReturnData')"/>
|
||||
<!-- submit -->
|
||||
<button type="image" name="submit" width="100px"
|
||||
<button type="submit" width="100px"
|
||||
t-att-class="submit_class">
|
||||
<img t-if="not submit_txt" src="/payment_adyen/static/src/img/adyen_icon.png"/>
|
||||
<span t-if="submit_txt"><t t-esc="submit_txt"/> <span class="fa fa-long-arrow-right"/></span>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<input type='hidden' name='EXCEPTIONURL' t-att-value='tx_values["EXCEPTIONURL"]'/>
|
||||
<input type='hidden' name='CANCELURL' t-att-value='tx_values["CANCELURL"]'/>
|
||||
<!-- submit -->
|
||||
<button type="image" name="submit" width="100px"
|
||||
<button type="submit" width="100px"
|
||||
t-att-class="submit_class">
|
||||
<img t-if="not submit_txt" src="/payment_ogone/static/src/img/ogone_icon.png"/>
|
||||
<span t-if="submit_txt"><t t-esc="submit_txt"/> <span class="fa fa-long-arrow-right"/></span>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<input t-if="tx_values.get('cancel_return')" type="hidden" name="cancel_return"
|
||||
t-att-value="tx_values.get('cancel_return')"/>
|
||||
<!-- submit -->
|
||||
<button type="image" name="submit" width="100px"
|
||||
<button type="submit" width="100px"
|
||||
t-att-class="submit_class">
|
||||
<img t-if="not submit_txt" src="/payment_paypal/static/src/img/paypal_icon.png"/>
|
||||
<span t-if="submit_txt"><t t-esc="submit_txt"/> <span class="fa fa-long-arrow-right"/></span>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<input type='hidden' name='amount' t-att-value='amount or "0.0"'/>
|
||||
<input type='hidden' name='currency' t-att-value='currency.name'/>
|
||||
<!-- submit -->
|
||||
<button name="submit" width="100px"
|
||||
<button type="submit" width="100px"
|
||||
t-att-class="submit_class">
|
||||
<img t-if="not submit_txt" src="/payment_transfer/static/src/img/transfer_icon.png"/>
|
||||
<span t-if="submit_txt"><t t-esc="submit_txt"/> <span class="fa fa-long-arrow-right"/></span>
|
||||
|
|
|
@ -336,16 +336,17 @@
|
|||
</p>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="blog_navigation_frontend" inherit_id="website.assets_frontend" name="Blog Navigation Frontend">
|
||||
<xpath expr="." position="inside">
|
||||
<link rel='stylesheet' href='/website_blog/static/src/css/website_blog.css'/>
|
||||
<script type="text/javascript" src="/website_blog/static/src/js/website_blog.inline.discussion.js"></script>
|
||||
<script type="text/javascript" src="/website_blog/static/src/js/website_blog.js"/>
|
||||
<script type="text/javascript" src="/website_blog/static/lib/contentshare.js"/>
|
||||
</xpath>
|
||||
</template>
|
||||
<!-- Page -->
|
||||
<template id="index" name="Blog Navigation">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="head">
|
||||
<link rel='stylesheet' href='/website_blog/static/src/css/website_blog.css'/>
|
||||
<script type="text/javascript" src="/website_blog/static/src/js/website_blog.inline.discussion.js"></script>
|
||||
<script type="text/javascript" src="/website_blog/static/src/js/website_blog.js"/>
|
||||
<script type="text/javascript" src="/website_blog/static/lib/contentshare.js"/>
|
||||
</t>
|
||||
<div id="wrap" class="js_blog">
|
||||
<t t-raw="0"/>
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<data>
|
||||
|
||||
<template id="event_script" inherit_id="website.assets_frontend" name="Country Events Snippet Script">
|
||||
<xpath expr="/t" position="inside">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_event/static/src/js/website_geolocation.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<template name="Sponsors" id="event_sponsor" inherit_option_id="website_event.layout" inherit_id="website_event.layout">
|
||||
<xpath expr="//t[@t-call='website.layout']" position="inside">
|
||||
<t t-set="head">
|
||||
<link rel='stylesheet' href='/website_event_track/static/src/css/website_event_track.css'/>
|
||||
<t t-raw="head or ''"/>
|
||||
</t>
|
||||
<template id="even_track_frontend" inherit_id="website.assets_frontend" name="Event Track Frontend">
|
||||
<xpath expr="." position="inside">
|
||||
<link rel='stylesheet' href='/website_event_track/static/src/css/website_event_track.css'/>
|
||||
<script type="text/javascript" src="/website_event_track/static/src/js/website_event_track.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
<template name="Sponsors" id="event_sponsor" inherit_option_id="website_event.layout" inherit_id="website_event.layout">
|
||||
<xpath expr="//div[@id='wrap']" position="inside">
|
||||
<div class="container mt32 mb16 hidden-print" t-if="event.sponsor_ids">
|
||||
<section data-snippet-id="title">
|
||||
|
@ -42,10 +41,6 @@
|
|||
|
||||
<template id="agenda">
|
||||
<t t-call="website_event.layout">
|
||||
<t t-set="head">
|
||||
<script type="text/javascript" src="/website_event_track/static/src/js/website_event_track.js"></script>
|
||||
<t t-raw="head or ''"/>
|
||||
</t>
|
||||
<section class="container">
|
||||
<h1 class="text-center" t-field="event.name"/>
|
||||
<div class="form-inline pull-right">
|
||||
|
|
|
@ -1,13 +1,4 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
var website = openerp.website;
|
||||
|
||||
website.snippet.BuildingBlock.include({
|
||||
_get_snippet_url: function () {
|
||||
return '/website_mail/snippets';
|
||||
}
|
||||
});
|
||||
|
||||
// Copy the template to the body of the email
|
||||
$(document).ready(function () {
|
||||
$('.js_template_set').click(function(ev) {
|
||||
|
|
|
@ -3,6 +3,12 @@
|
|||
|
||||
var website = openerp.website;
|
||||
var _t = openerp._t;
|
||||
|
||||
website.snippet.BuildingBlock.include({
|
||||
_get_snippet_url: function () {
|
||||
return '/website_mail/snippets';
|
||||
}
|
||||
});
|
||||
|
||||
website.snippet.options.subscribe = website.snippet.Option.extend({
|
||||
on_prompt: function () {
|
||||
|
|
|
@ -3,11 +3,14 @@
|
|||
<data>
|
||||
|
||||
<!-- Template Choice page -->
|
||||
<template id="website_email_frontend" inherit_id="website.assets_frontend" name="Website Mail Frontend">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_mail/static/src/js/website_email_designer.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="email_designer" name="Email Designer">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="head">
|
||||
<script type="text/javascript" src="/website_mail/static/src/js/website_email_designer.js"></script>
|
||||
</t>
|
||||
<div id="wrap" class="container" t-ignore="True">
|
||||
<div id="email_template" class="mb32" t-att-style="mode != 'email_template' and 'display: none' or ''">
|
||||
<a class="mt16 btn btn-default pull-right"
|
||||
|
|
|
@ -20,13 +20,13 @@
|
|||
</template>
|
||||
|
||||
<template id="head" inherit_id="website.assets_frontend" name="Mail customization">
|
||||
<xpath expr="/t" position="inside">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_mail/static/src/js/website_mail.js"></script>
|
||||
<link rel='stylesheet' href='/website_mail/static/src/css/website_mail.css'/>
|
||||
</xpath>
|
||||
</template>
|
||||
<template id="editor" inherit_id="website.assets_editor" name="Mail snippet">
|
||||
<xpath expr="/t" position="inside">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_mail/static/src/js/website_mail.editor.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<template id="website_quote_frontend" inherit_id="website.assets_frontend" name="Website Quote Frontend">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_quote/static/src/js/website_quotation.js"></script>
|
||||
<script type="text/javascript" src="/website_quote/static/lib/jSignature/jSignature.min.js"></script>
|
||||
<link rel='stylesheet' href='/website_quote/static/src/css/website_quotation.css'/>
|
||||
</xpath>
|
||||
</template>
|
||||
<template id="pricing" name="Price">
|
||||
<section data-snippet-id="title">
|
||||
<h1 class="page-header">Pricing</h1>
|
||||
|
@ -161,12 +168,6 @@
|
|||
|
||||
<template id="so_quotation" name="Product Quotation">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="head">
|
||||
<script type="text/javascript" src="/website_quote/static/src/js/website_quotation.js"></script>
|
||||
<script type="text/javascript" src="/website_quote/static/lib/jSignature/jSignature.min.js"></script>
|
||||
<link rel='stylesheet' href='/website_quote/static/src/css/website_quotation.css'/>
|
||||
<t t-raw="head or ''"/>
|
||||
</t>
|
||||
<body data-spy="scroll" data-target=".navspy">
|
||||
<div class="container">
|
||||
<div class="row mt16">
|
||||
|
@ -457,11 +458,6 @@
|
|||
|
||||
<template id="so_template" name="SO Template">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="head">
|
||||
<script type="text/javascript" src="/website_quote/static/src/js/website_quotation.js"></script>
|
||||
<link rel='stylesheet' href='/website_quote/static/src/css/website_quotation.css'/>
|
||||
<t t-raw="head or ''"/>
|
||||
</t>
|
||||
<body data-spy="scroll" data-target=".navspy">
|
||||
<div class="container">
|
||||
<div class="row mt16">
|
||||
|
|
|
@ -490,7 +490,6 @@ class website_sale(http.Controller):
|
|||
values['acquirers'] = payment_obj.browse(cr, uid, acquirer_ids, context=context)
|
||||
render_ctx = dict(context, submit_class='btn btn-primary', submit_txt='Pay Now')
|
||||
for acquirer in values['acquirers']:
|
||||
render_ctx['tx_url'] = '/shop/payment/transaction/%s' % acquirer.id
|
||||
acquirer.button = payment_obj.render(
|
||||
cr, SUPERUSER_ID, acquirer.id,
|
||||
order.name,
|
||||
|
@ -504,20 +503,17 @@ class website_sale(http.Controller):
|
|||
|
||||
return request.website.render("website_sale.payment", values)
|
||||
|
||||
@http.route(['/shop/payment/transaction/<int:acquirer_id>'], type='http', methods=['POST'], auth="public", website=True)
|
||||
def payment_transaction(self, acquirer_id, **post):
|
||||
""" Hook method that creates a payment.transaction and redirect to the
|
||||
acquirer, using post values to re-create the post action.
|
||||
@http.route(['/shop/payment/transaction/<int:acquirer_id>'], type='json', auth="public", website=True)
|
||||
def payment_transaction(self, acquirer_id):
|
||||
""" Json method that creates a payment.transaction, used to create a
|
||||
transaction when the user clicks on 'pay now' button. After having
|
||||
created the transaction, the event continues and the user is redirected
|
||||
to the acquirer website.
|
||||
|
||||
:param int acquirer_id: id of a payment.acquirer record. If not set the
|
||||
user is redirected to the checkout page
|
||||
:param dict post: should coutain all post data for the acquirer
|
||||
"""
|
||||
# @TDEFIXME: don't know why we received those data, but should not be send to the acquirer
|
||||
post.pop('submit.x', None)
|
||||
post.pop('submit.y', None)
|
||||
cr, uid, context = request.cr, request.uid, request.context
|
||||
payment_obj = request.registry.get('payment.acquirer')
|
||||
transaction_obj = request.registry.get('payment.transaction')
|
||||
sale_order_obj = request.registry['sale.order']
|
||||
order = request.website.sale_get_order(context=context)
|
||||
|
@ -529,7 +525,13 @@ class website_sale(http.Controller):
|
|||
|
||||
# find an already existing transaction
|
||||
tx = request.website.sale_get_transaction()
|
||||
if not tx:
|
||||
if tx:
|
||||
if tx.state == 'draft': # button cliked but no more info -> rewrite on tx or create a new one ?
|
||||
tx.write({
|
||||
'acquirer_id': acquirer_id,
|
||||
})
|
||||
tx_id = tx.id
|
||||
else:
|
||||
tx_id = transaction_obj.create(cr, SUPERUSER_ID, {
|
||||
'acquirer_id': acquirer_id,
|
||||
'type': 'form',
|
||||
|
@ -541,10 +543,6 @@ class website_sale(http.Controller):
|
|||
'sale_order_id': order.id,
|
||||
}, context=context)
|
||||
request.session['sale_transaction_id'] = tx_id
|
||||
elif tx and tx.state == 'draft': # button cliked but no more info -> rewrite on tx or create a new one ?
|
||||
tx.write({
|
||||
'acquirer_id': acquirer_id,
|
||||
})
|
||||
|
||||
# update quotation
|
||||
sale_order_obj.write(
|
||||
|
@ -555,9 +553,7 @@ class website_sale(http.Controller):
|
|||
# confirm the quotation
|
||||
sale_order_obj.action_button_confirm(cr, SUPERUSER_ID, [order.id], context=request.context)
|
||||
|
||||
acquirer_form_post_url = payment_obj.get_form_action_url(cr, uid, acquirer_id, context=context)
|
||||
acquirer_total_url = '%s?%s' % (acquirer_form_post_url, werkzeug.url_encode(post))
|
||||
return request.redirect(acquirer_total_url)
|
||||
return tx_id
|
||||
|
||||
@http.route('/shop/payment/get_status/<int:sale_order_id>', type='json', auth="public", website=True)
|
||||
def payment_get_status(self, sale_order_id, **post):
|
||||
|
|
|
@ -9,4 +9,18 @@ $(document).ready(function () {
|
|||
})
|
||||
.find("input[name='acquirer']:checked").click();
|
||||
|
||||
// When clicking on payment button: create the tx using json then continue to the acquirer
|
||||
$('button[type="submit"]').on("click", function (ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
var $form = $(ev.currentTarget).parents('form');
|
||||
var acquirer_id = $(ev.currentTarget).parents('div.oe_sale_acquirer_button').first().data('id');
|
||||
if (! acquirer_id) {
|
||||
return false;
|
||||
}
|
||||
openerp.jsonRpc('/shop/payment/transaction/' + acquirer_id, 'call', {}).then(function (data) {
|
||||
$form.submit();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -111,8 +111,6 @@
|
|||
<script type="text/javascript" src="/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js"></script>
|
||||
</t>
|
||||
<link rel='stylesheet' href="/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.9.1.custom.css"/>
|
||||
<script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
|
||||
<link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
|
||||
<t t-raw="head or ''"/>
|
||||
</t>
|
||||
<t t-set="additional_title">Shop</t>
|
||||
|
@ -304,14 +302,18 @@
|
|||
</template>
|
||||
|
||||
<!-- /shop/product product page -->
|
||||
<template id="website_sale_frontend" inherit_id="website.assets_frontend" name="Website Sale Frontend">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
|
||||
<link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
|
||||
<link rel='stylesheet' href='/website_sale/static/src/css/website_mail.css'/>
|
||||
<script type="text/javascript" src="/website_sale/static/src/js/website_sale_payment.js"></script>
|
||||
<script type="text/javascript" src="/website_sale/static/src/js/website_sale_validate.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="product" name="Product">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="head">
|
||||
<script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
|
||||
<link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
|
||||
<link rel='stylesheet' href='/website_sale/static/src/css/website_mail.css'/>
|
||||
</t>
|
||||
<t t-set="additional_title" t-value="product.name"/>
|
||||
<div itemscope="itemscope" itemtype="http://schema.org/Product" id="wrap" class="js_sale">
|
||||
|
||||
|
@ -484,11 +486,6 @@
|
|||
|
||||
<template id="cart" name="Shopping Cart">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="head">
|
||||
<script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
|
||||
<link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
|
||||
<t t-raw="head or ''"/>
|
||||
</t>
|
||||
<div id="wrap">
|
||||
<div class="container oe_website_sale">
|
||||
|
||||
|
@ -671,11 +668,6 @@
|
|||
|
||||
<template id="checkout">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="head">
|
||||
<script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
|
||||
<link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
|
||||
<t t-raw="head or ''"/>
|
||||
</t>
|
||||
<t t-set="additional_title">Shop - Checkout</t>
|
||||
<div id="wrap">
|
||||
<div class="container oe_website_sale">
|
||||
|
@ -832,12 +824,6 @@
|
|||
|
||||
<template id="payment">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="head">
|
||||
<script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
|
||||
<script type="text/javascript" src="/website_sale/static/src/js/website_sale_payment.js"></script>
|
||||
<link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
|
||||
<t t-raw="head or ''"/>
|
||||
</t>
|
||||
<t t-set="additional_title">Shop - Select Payment Mode</t>
|
||||
<div id="wrap">
|
||||
<div class="container oe_website_sale">
|
||||
|
@ -956,11 +942,6 @@
|
|||
|
||||
<template id="confirmation">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="head">
|
||||
<link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
|
||||
<script type="text/javascript" src="/website_sale/static/src/js/website_sale_validate.js"></script>
|
||||
<t t-raw="head or ''"/>
|
||||
</t>
|
||||
<t t-set="additional_title">Shop - Confirmed</t>
|
||||
<div id="wrap">
|
||||
<div class="container oe_website_sale">
|
||||
|
|
|
@ -16,11 +16,13 @@
|
|||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="payment_delivery" name="Delivery Costs" inherit_id="website_sale.payment">
|
||||
<xpath expr="//t[@t-set='head']" position="inside">
|
||||
<template id="website_sale_delivery_frontend" inherit_id="website.assets_frontend" name="Website Sale Delivery Frontend">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_sale_delivery/static/src/js/website_sale_delivery.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="payment_delivery" name="Delivery Costs" inherit_id="website_sale.payment">
|
||||
<xpath expr="//div[@id='payment_method']" position="before">
|
||||
<div t-if="deliveries" class="row" id="delivery_carrier">
|
||||
<div class="col-lg-5 col-sm-6">
|
||||
|
|
|
@ -23,13 +23,13 @@
|
|||
</xpath>
|
||||
</template>
|
||||
<template id="twitter" inherit_id="website.assets_frontend" name="Twitter Snippet">
|
||||
<xpath expr="/t" position="inside">
|
||||
<xpath expr="." position="inside">
|
||||
<link rel="stylesheet" href="/website_twitter/static/src/css/website.twitter.css" type="text/css"/>
|
||||
<script type="text/javascript" src="/website_twitter/static/src/js/website.twitter.animation.js"/>
|
||||
</xpath>
|
||||
</template>
|
||||
<template id="twitter_editor" inherit_id="website.assets_editor" name="Twitter options">
|
||||
<xpath expr="/t" position="inside">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_twitter/static/src/js/website.twitter.editor.js"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue