[MERGE] forward port branch saas-11 up to b9374d5c21

This commit is contained in:
Christophe Simonis
2017-01-23 13:56:18 +01:00
11 changed files with 36 additions and 10 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ class StripeController(http.Controller):
tx = request.env['payment.transaction'].sudo().browse(
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))
if response:
request.env['payment.transaction'].sudo().form_feedback(response, 'stripe')
+3 -1
View File
@@ -81,7 +81,7 @@ class PaymentAcquirerStripe(models.Model):
class PaymentTransactionStripe(models.Model):
_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())
charge_params = {
'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
if tokenid:
charge_params['card'] = str(tokenid)
if email:
charge_params['receipt_email'] = email
r = requests.post(api_url_charge,
auth=(self.acquirer_id.stripe_secret_key, ''),
params=charge_params,
+1 -1
View File
@@ -1217,7 +1217,7 @@ class Export(http.Controller):
info = {}
fields = self.fields_get(model)
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
# 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.on('warning', this, function(e) { // In case of a one2many, we do not want any warning which comes from the editor
e.stop_propagation();
this.on('warning', this, function(e) { // In case of editable list view, we do not want any warning which comes from the editor
if (this.editable()) {
e.stop_propagation();
}
});
},
do_add_record: function () {
@@ -403,6 +403,7 @@ var DataExport = Dialog.extend({
},
add_field: function(field_id, string) {
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) {
$field_list.append(new Option(string, field_id));
}
+1 -1
View File
@@ -42,7 +42,7 @@ class WebsiteCustomer(http.Controller):
if tag_id:
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)
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;
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('.');
formatted[0] = utils.insert_thousand_seps(formatted[0]);
+1 -2
View File
@@ -584,8 +584,7 @@
<template id="product_price">
<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"
t-att-data-precision="user_id.partner_id.property_product_pricelist.currency_id.rounding">
<h4 class="oe_price_h4 css_editable_mode_hidden">
<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) &gt; 0.01 and website.get_current_pricelist().discount_policy == 'without_discount' else 'display: none;'"
/>
+11
View File
@@ -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
+11
View File
@@ -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
View File
@@ -214,7 +214,7 @@ def image_colorize(original, randomize=True, color=(255, 255, 255)):
# generate the background color, past it as background
if randomize:
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)
# return the new image
buffer = StringIO.StringIO()