[MERGE] forward port branch saas-11 up to b9374d5c21
This commit is contained in:
@@ -32,7 +32,7 @@ class StripeController(http.Controller):
|
|||||||
tx = request.env['payment.transaction'].sudo().browse(
|
tx = request.env['payment.transaction'].sudo().browse(
|
||||||
int(request.session.get('sale_transaction_id') or request.session.get('website_payment_tx_id', False))
|
int(request.session.get('sale_transaction_id') or request.session.get('website_payment_tx_id', False))
|
||||||
)
|
)
|
||||||
response = tx._create_stripe_charge(tokenid=post['tokenid'])
|
response = tx._create_stripe_charge(tokenid=post['tokenid'], email=post['email'])
|
||||||
_logger.info('Stripe: entering form_feedback with post data %s', pprint.pformat(response))
|
_logger.info('Stripe: entering form_feedback with post data %s', pprint.pformat(response))
|
||||||
if response:
|
if response:
|
||||||
request.env['payment.transaction'].sudo().form_feedback(response, 'stripe')
|
request.env['payment.transaction'].sudo().form_feedback(response, 'stripe')
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class PaymentAcquirerStripe(models.Model):
|
|||||||
class PaymentTransactionStripe(models.Model):
|
class PaymentTransactionStripe(models.Model):
|
||||||
_inherit = 'payment.transaction'
|
_inherit = 'payment.transaction'
|
||||||
|
|
||||||
def _create_stripe_charge(self, acquirer_ref=None, tokenid=None):
|
def _create_stripe_charge(self, acquirer_ref=None, tokenid=None, email=None):
|
||||||
api_url_charge = 'https://%s/charges' % (self.acquirer_id._get_stripe_api_url())
|
api_url_charge = 'https://%s/charges' % (self.acquirer_id._get_stripe_api_url())
|
||||||
charge_params = {
|
charge_params = {
|
||||||
'amount': int(self.amount*100), # Stripe takes amount in cents (https://support.stripe.com/questions/which-zero-decimal-currencies-does-stripe-support)
|
'amount': int(self.amount*100), # Stripe takes amount in cents (https://support.stripe.com/questions/which-zero-decimal-currencies-does-stripe-support)
|
||||||
@@ -92,6 +92,8 @@ class PaymentTransactionStripe(models.Model):
|
|||||||
charge_params['customer'] = acquirer_ref
|
charge_params['customer'] = acquirer_ref
|
||||||
if tokenid:
|
if tokenid:
|
||||||
charge_params['card'] = str(tokenid)
|
charge_params['card'] = str(tokenid)
|
||||||
|
if email:
|
||||||
|
charge_params['receipt_email'] = email
|
||||||
r = requests.post(api_url_charge,
|
r = requests.post(api_url_charge,
|
||||||
auth=(self.acquirer_id.stripe_secret_key, ''),
|
auth=(self.acquirer_id.stripe_secret_key, ''),
|
||||||
params=charge_params,
|
params=charge_params,
|
||||||
|
|||||||
@@ -1217,7 +1217,7 @@ class Export(http.Controller):
|
|||||||
info = {}
|
info = {}
|
||||||
fields = self.fields_get(model)
|
fields = self.fields_get(model)
|
||||||
if ".id" in export_fields:
|
if ".id" in export_fields:
|
||||||
fields['.id'] = fields.pop('id', {'string': 'ID'})
|
fields['.id'] = fields.get('id', {'string': 'ID'})
|
||||||
|
|
||||||
# To make fields retrieval more efficient, fetch all sub-fields of a
|
# To make fields retrieval more efficient, fetch all sub-fields of a
|
||||||
# given field at the same time. Because the order in the export list is
|
# given field at the same time. Because the order in the export list is
|
||||||
|
|||||||
@@ -1062,8 +1062,10 @@ var One2ManyListView = X2ManyListView.extend({
|
|||||||
this._dataset_changed = false;
|
this._dataset_changed = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on('warning', this, function(e) { // In case of a one2many, we do not want any warning which comes from the editor
|
this.on('warning', this, function(e) { // In case of editable list view, we do not want any warning which comes from the editor
|
||||||
e.stop_propagation();
|
if (this.editable()) {
|
||||||
|
e.stop_propagation();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
do_add_record: function () {
|
do_add_record: function () {
|
||||||
|
|||||||
@@ -403,6 +403,7 @@ var DataExport = Dialog.extend({
|
|||||||
},
|
},
|
||||||
add_field: function(field_id, string) {
|
add_field: function(field_id, string) {
|
||||||
var $field_list = this.$('.o_fields_list');
|
var $field_list = this.$('.o_fields_list');
|
||||||
|
field_id = this.records[field_id].value || field_id;
|
||||||
if($field_list.find("option[value='" + field_id + "']").length === 0) {
|
if($field_list.find("option[value='" + field_id + "']").length === 0) {
|
||||||
$field_list.append(new Option(string, field_id));
|
$field_list.append(new Option(string, field_id));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class WebsiteCustomer(http.Controller):
|
|||||||
|
|
||||||
if tag_id:
|
if tag_id:
|
||||||
tag_id = unslug(tag_id)[1] or 0
|
tag_id = unslug(tag_id)[1] or 0
|
||||||
domain += [('tag_ids', 'in', tag_id)]
|
domain += [('website_tag_ids', 'in', tag_id)]
|
||||||
|
|
||||||
# group by country, based on customers found with the search(domain)
|
# group by country, based on customers found with the search(domain)
|
||||||
countries = Partner.sudo().read_group(domain, ["id", "country_id"], groupby="country_id", orderby="country_id")
|
countries = Partner.sudo().read_group(domain, ["id", "country_id"], groupby="country_id", orderby="country_id")
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ odoo.define('website_sale.website_sale', function (require) {
|
|||||||
var precision = 2;
|
var precision = 2;
|
||||||
|
|
||||||
if ($(".decimal_precision").length) {
|
if ($(".decimal_precision").length) {
|
||||||
precision = parseInt($(".decimal_precision").first().data('precision'));
|
precision = parseInt($(".decimal_precision").last().data('precision'));
|
||||||
}
|
}
|
||||||
var formatted = _.str.sprintf('%.' + precision + 'f', price).split('.');
|
var formatted = _.str.sprintf('%.' + precision + 'f', price).split('.');
|
||||||
formatted[0] = utils.insert_thousand_seps(formatted[0]);
|
formatted[0] = utils.insert_thousand_seps(formatted[0]);
|
||||||
|
|||||||
@@ -584,8 +584,7 @@
|
|||||||
|
|
||||||
<template id="product_price">
|
<template id="product_price">
|
||||||
<div itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer" class="product_price mt16">
|
<div itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer" class="product_price mt16">
|
||||||
<h4 class="oe_price_h4 css_editable_mode_hidden decimal_precision"
|
<h4 class="oe_price_h4 css_editable_mode_hidden">
|
||||||
t-att-data-precision="user_id.partner_id.property_product_pricelist.currency_id.rounding">
|
|
||||||
<span class="text-danger oe_default_price" style="text-decoration: line-through; white-space: nowrap;"
|
<span class="text-danger oe_default_price" style="text-decoration: line-through; white-space: nowrap;"
|
||||||
t-esc="compute_currency(product.website_public_price)" t-options="{'widget': 'monetary', 'display_currency': website.get_current_pricelist().currency_id, 'from_currency': website.currency_id}" t-att-style="'text-decoration: line-through; white-space: nowrap; ' + '' if (compute_currency(product.lst_price) - product.website_price) > 0.01 and website.get_current_pricelist().discount_policy == 'without_discount' else 'display: none;'"
|
t-esc="compute_currency(product.website_public_price)" t-options="{'widget': 'monetary', 'display_currency': website.get_current_pricelist().currency_id, 'from_currency': website.currency_id}" t-att-style="'text-decoration: line-through; white-space: nowrap; ' + '' if (compute_currency(product.lst_price) - product.website_price) > 0.01 and website.get_current_pricelist().discount_policy == 'without_discount' else 'display: none;'"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
The Czech Republic, 18.01.2017
|
||||||
|
|
||||||
|
I hereby agree to the terms of the Odoo Individual Contributor License
|
||||||
|
Agreement v1.0.
|
||||||
|
|
||||||
|
I declare that I am authorized and able to make this agreement and sign this
|
||||||
|
declaration.
|
||||||
|
|
||||||
|
Signed,
|
||||||
|
|
||||||
|
Jiri Zatloukal zatloukal@apitea.com https://github.com/jirizatloukal
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
Algeria, 18/01/2017
|
||||||
|
|
||||||
|
I hereby agree to the terms of the Odoo Individual Contributor License
|
||||||
|
Agreement v1.0.
|
||||||
|
|
||||||
|
I declare that I am authorized and able to make this agreement and sign this
|
||||||
|
declaration.
|
||||||
|
|
||||||
|
Signed,
|
||||||
|
|
||||||
|
Zakria Makrelouf z.makrelouf@gmail.com https://github.com/zakiuu
|
||||||
+1
-1
@@ -214,7 +214,7 @@ def image_colorize(original, randomize=True, color=(255, 255, 255)):
|
|||||||
# generate the background color, past it as background
|
# generate the background color, past it as background
|
||||||
if randomize:
|
if randomize:
|
||||||
color = (randrange(32, 224, 24), randrange(32, 224, 24), randrange(32, 224, 24))
|
color = (randrange(32, 224, 24), randrange(32, 224, 24), randrange(32, 224, 24))
|
||||||
image.paste(color)
|
image.paste(color, box=(0, 0) + original.size)
|
||||||
image.paste(original, mask=original)
|
image.paste(original, mask=original)
|
||||||
# return the new image
|
# return the new image
|
||||||
buffer = StringIO.StringIO()
|
buffer = StringIO.StringIO()
|
||||||
|
|||||||
Reference in New Issue
Block a user