[MERGE] forward port branch 9.0 up to 77be3d8b39

This commit is contained in:
Christophe Simonis
2017-06-09 12:51:31 +02:00
3 changed files with 26 additions and 20 deletions
@@ -901,6 +901,10 @@ class AccountBankStatementLine(models.Model):
# Create the move
self.sequence = self.statement_id.line_ids.ids.index(self.id) + 1
move_name = (self.statement_id.name or self.name) + "/" + str(self.sequence)
# Ensure no duplicate is created
if self.env['account.move'].search([('name', '=', move_name)]):
count = self.env['account.move'].search_count([('name', '=like', move_name + '/%')])
move_name = u'{}/{}'.format(move_name, count + 1)
move_vals = self._prepare_reconciliation_move(move_name)
move = self.env['account.move'].create(move_vals)
counterpart_moves = (counterpart_moves | move)
+20 -20
View File
@@ -225,26 +225,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
@@ -468,6 +468,8 @@ var FieldCharDomain = common.AbstractField.extend(common.ReinitializeFieldMixin,
}
}
}).open();
this.trigger("dialog_opened", dialog);
return dialog;
},
});