Quantity:
diff --git a/addons/point_of_sale/static/src/js/chrome.js b/addons/point_of_sale/static/src/js/chrome.js
index 92c1316fcb7..88ca9e8e4fa 100644
--- a/addons/point_of_sale/static/src/js/chrome.js
+++ b/addons/point_of_sale/static/src/js/chrome.js
@@ -8,6 +8,7 @@ var models = require('point_of_sale.models');
var core = require('web.core');
var ajax = require('web.ajax');
var CrashManager = require('web.CrashManager');
+var BarcodeEvents = require('barcodes.BarcodeEvents').BarcodeEvents;
var _t = core._t;
@@ -606,10 +607,9 @@ var Chrome = PosBaseWidget.extend({
$(window).off();
$('html').off();
$('body').off();
- $(this.$el).parent().off();
- $('document').off();
- $('.oe_web_client').off();
- $('.openerp_webclient_container').off();
+ this.$el.parent().off();
+ // The above lines removed the bindings, but we really need them for the barcode
+ BarcodeEvents.start();
},
build_chrome: function() {
diff --git a/addons/point_of_sale/static/src/js/db.js b/addons/point_of_sale/static/src/js/db.js
index caf64ca72e4..e8ec348288b 100644
--- a/addons/point_of_sale/static/src/js/db.js
+++ b/addons/point_of_sale/static/src/js/db.js
@@ -235,10 +235,12 @@ var PosDB = core.Class.extend({
for(var i = 0, len = partners.length; i < len; i++){
partner = partners[i];
- if ( this.partner_write_date &&
+ var local_partner_date = (this.partner_write_date || '').replace(/^(\d{4}-\d{2}-\d{2}) ((\d{2}:?){3})$/, '$1T$2Z');
+ var dist_partner_date = (partner.write_date || '').replace(/^(\d{4}-\d{2}-\d{2}) ((\d{2}:?){3})$/, '$1T$2Z');
+ if ( this.partner_write_date &&
this.partner_by_id[partner.id] &&
- new Date(this.partner_write_date).getTime() + 1000 >=
- new Date(partner.write_date).getTime() ) {
+ new Date(local_partner_date).getTime() + 1000 >=
+ new Date(dist_partner_date).getTime() ) {
// FIXME: The write_date is stored with milisec precision in the database
// but the dates we get back are only precise to the second. This means when
// you read partners modified strictly after time X, you get back partners that were
diff --git a/addons/product/models/product.py b/addons/product/models/product.py
index 61704ad44f8..d0aed74bc66 100644
--- a/addons/product/models/product.py
+++ b/addons/product/models/product.py
@@ -542,7 +542,7 @@ class ProductProduct(models.Model):
history = self.env['product.price.history'].search([
('company_id', '=', company_id),
('product_id', 'in', self.ids),
- ('datetime', '<=', date or fields.Datetime.now())], limit=1)
+ ('datetime', '<=', date or fields.Datetime.now())], order='datetime desc,id desc', limit=1)
return history.cost or 0.0
class ProductPackaging(models.Model):
diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py
index c2497b7f2ad..24b35183f68 100644
--- a/addons/sale/models/sale.py
+++ b/addons/sale/models/sale.py
@@ -803,7 +803,7 @@ class SaleOrderLine(models.Model):
def create(self, values):
values.update(self._prepare_add_missing_fields(values))
line = super(SaleOrderLine, self).create(values)
- if line.state == 'sale':
+ if line.order_id.state == 'sale':
msg = _("Extra line with %s ") % (line.product_id.display_name,)
line.order_id.message_post(body=msg)
# create an analytic account if at least an expense product
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js
index f2cacb3327f..ae3080b3b8e 100644
--- a/addons/web/static/src/js/fields/relational_fields.js
+++ b/addons/web/static/src/js/fields/relational_fields.js
@@ -534,14 +534,17 @@ var FieldMany2One = AbstractField.extend({
* start/end of the input element. Stops any navigation move event if the
* user is selecting text.
*
- * TODO this is a duplicate of InputField._onNavigationMove, maybe this
- * should be done in a mixin or, better, the m2o field should be an
- * InputField (but this requires some refactoring).
- *
* @private
* @param {OdooEvent} ev
*/
- _onNavigationMove: basicFields.InputField.prototype._onNavigationMove,
+ _onNavigationMove: function (ev) {
+ // TODO Maybe this should be done in a mixin or, better, the m2o field
+ // should be an InputField (but this requires some refactoring).
+ basicFields.InputField.prototype._onNavigationMove.apply(this, arguments);
+ if (this.mode === 'edit' && $(this.$input.autocomplete('widget')).is(':visible')) {
+ ev.stopPropagation();
+ }
+ },
/**
* @private
* @param {OdooEvent} event
diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js
index f21db07f088..fe98eaaeab2 100644
--- a/addons/web/static/tests/fields/relational_fields_tests.js
+++ b/addons/web/static/tests/fields/relational_fields_tests.js
@@ -572,6 +572,38 @@ QUnit.module('relational_fields', {
form.destroy();
});
+ QUnit.test('many2one field and list navigation', function (assert) {
+ assert.expect(3);
+
+ var list = createView({
+ View: ListView,
+ model: 'partner',
+ data: this.data,
+ arch: '
',
+ });
+
+ // edit first input, to trigger autocomplete
+ list.$('.o_data_row .o_data_cell').first().click();
+ list.$('.o_data_cell input').val('').trigger('input');
+
+ // press keydown, to select first choice
+ list.$('.o_data_cell input').focus().trigger($.Event('keydown', {
+ which: $.ui.keyCode.DOWN,
+ keyCode: $.ui.keyCode.DOWN,
+ }));
+
+ // we now check that the dropdown is open (and that the focus did not go
+ // to the next line)
+ var $dropdown = list.$('.o_field_many2one input').autocomplete('widget');
+ assert.ok($dropdown.is(':visible'), "dropdown should be visible");
+ assert.ok(list.$('.o_data_row:eq(0)').hasClass('o_selected_row'),
+ 'first data row should still be selected');
+ assert.ok(!list.$('.o_data_row:eq(1)').hasClass('o_selected_row'),
+ 'second data row should not be selected');
+
+ list.destroy();
+ });
+
QUnit.test('standalone many2one field', function (assert) {
assert.expect(3);
var done = assert.async();
diff --git a/addons/website_event/views/event_templates.xml b/addons/website_event/views/event_templates.xml
index e75627f7ee2..714c2f6342d 100644
--- a/addons/website_event/views/event_templates.xml
+++ b/addons/website_event/views/event_templates.xml
@@ -241,6 +241,7 @@
+
@@ -249,6 +250,7 @@
"widget": "contact",
"fields": ["name", "address", "phone", "mobile"]
}'/>
+
diff --git a/addons/website_event_track/views/event_track_templates.xml b/addons/website_event_track/views/event_track_templates.xml
index bb90835df5e..9d5bee401ba 100644
--- a/addons/website_event_track/views/event_track_templates.xml
+++ b/addons/website_event_track/views/event_track_templates.xml
@@ -42,6 +42,7 @@
+
+