[MERGE] forward port branch saas-11 up to 1d7260cbcb

This commit is contained in:
Christophe Simonis
2017-06-09 13:08:51 +02:00
2 changed files with 22 additions and 20 deletions
+20 -20
View File
@@ -226,26 +226,26 @@ class DeliveryCarrier(models.Model):
if record.delivery_type == 'fixed':
PriceRule.search([('carrier_id', '=', record.id)]).unlink()
line_data = {
'carrier_id': record.id,
'variable': 'price',
'operator': '>=',
}
# Create the delivery price rules
if record.free_if_more_than:
line_data.update({
'max_value': record.amount,
'standard_price': 0.0,
'list_base_price': 0.0,
})
PriceRule.create(line_data)
if record.fixed_price is not False:
line_data.update({
'max_value': 0.0,
'standard_price': record.fixed_price,
'list_base_price': record.fixed_price,
})
PriceRule.create(line_data)
line_data = {
'carrier_id': record.id,
'variable': 'price',
'operator': '>=',
}
# Create the delivery price rules
if record.free_if_more_than:
line_data.update({
'max_value': record.amount,
'standard_price': 0.0,
'list_base_price': 0.0,
})
PriceRule.create(line_data)
if record.fixed_price is not False:
line_data.update({
'max_value': 0.0,
'standard_price': record.fixed_price,
'list_base_price': record.fixed_price,
})
PriceRule.create(line_data)
return True
@api.model
@@ -465,6 +465,8 @@ var FieldCharDomain = common.AbstractField.extend(common.ReinitializeFieldMixin,
}
}
}).open();
this.trigger("dialog_opened", dialog);
return dialog;
},
});