[FIX] point_of_sale: ensure that there is always an order creation_date

Introduced by e9b1254a5c. This commit made
sense but there are certain POS modules that send the order to the
backend before validation and thus depend on there always being a
creation date, even if the order has not been validated yet.

This ensures that we don't end up with an undefined creation_date in the
backend.

opw-680590
This commit is contained in:
Joren Van Onder
2016-06-10 14:31:23 +02:00
parent 02484f899a
commit 298fc213dd
+1 -1
View File
@@ -1607,7 +1607,7 @@ exports.Order = Backbone.Model.extend({
user_id: this.pos.cashier ? this.pos.cashier.id : this.pos.user.id,
uid: this.uid,
sequence_number: this.sequence_number,
creation_date: this.validation_date, // todo: rename creation_date in master
creation_date: this.validation_date || this.creation_date, // todo: rename creation_date in master
fiscal_position_id: this.fiscal_position ? this.fiscal_position.id : false
};
},