diff --git a/addons/delivery/models/stock_picking.py b/addons/delivery/models/stock_picking.py
index 583bdb16398..1fed701dd78 100644
--- a/addons/delivery/models/stock_picking.py
+++ b/addons/delivery/models/stock_picking.py
@@ -56,7 +56,7 @@ class StockPicking(models.Model):
@api.one
- @api.depends('move_line_ids')
+ @api.depends('move_line_ids', 'move_line_ids.result_package_id')
def _compute_packages(self):
self.ensure_one()
packs = set()
@@ -66,7 +66,7 @@ class StockPicking(models.Model):
self.package_ids = list(packs)
@api.one
- @api.depends('move_line_ids')
+ @api.depends('move_line_ids', 'move_line_ids.result_package_id', 'move_line_ids.product_uom_id', 'move_line_ids.qty_done')
def _compute_bulk_weight(self):
weight = 0.0
for move_line in self.move_line_ids:
diff --git a/addons/hw_blackbox_be/controllers/main.py b/addons/hw_blackbox_be/controllers/main.py
index 36efed12e59..34dc06369e5 100644
--- a/addons/hw_blackbox_be/controllers/main.py
+++ b/addons/hw_blackbox_be/controllers/main.py
@@ -92,7 +92,7 @@ class Blackbox(Thread):
def _send_and_wait_for_ack(self, packet, serial):
ack = 0
- MAX_RETRIES = 1
+ MAX_RETRIES = 1 # no more than 9
while ack != 0x06 and int(chr(packet[4])) < MAX_RETRIES:
serial.write(packet)
@@ -104,7 +104,7 @@ class Blackbox(Thread):
# message so it's safe to do it. Also it would be a pain
# to have to throw this all the way back to js just so it
# can increment the retry counter and then try again.
- packet = packet[:4] + str(int(packet[4]) + 1) + packet[5:]
+ packet[4] += 1
if ack:
ack = ord(ack)
@@ -141,11 +141,11 @@ class Blackbox(Thread):
if stx == chr(0x02) and etx == chr(0x03) and bcc and self._lrc(response) == ord(bcc):
got_response = True
- ser.write(chr(0x06))
+ ser.write(chr(0x06).encode())
else:
_logger.warning("received ACK but not a valid response, sending NACK...")
sent_nacks += 1
- ser.write(chr(0x15))
+ ser.write(chr(0x15).encode())
if not got_response:
_logger.error("sent " + str(MAX_NACKS) + " NACKS without receiving response, giving up.")
@@ -173,4 +173,9 @@ if isfile("/home/pi/registered_blackbox_be"):
@http.route('/hw_proxy/request_serial/', type='json', auth='none', cors='*')
def request_serial(self):
- return subprocess.check_output("ifconfig eth0 | grep 'ether.*' | sed 's/://g' | awk '{print $2}'", shell=True).rstrip()[-7:]
+ try:
+ with open('/sys/class/net/eth0/address', 'rb') as f:
+ return f.read().rstrip().replace(b':', b'')[-7:]
+ except IOError as e:
+ _logger.warning("eth0 network interface MAC address could not be found")
+ return b''
diff --git a/addons/payment/static/src/js/payment_form.js b/addons/payment/static/src/js/payment_form.js
index 8ccb48ec0de..97f49ddf2f2 100644
--- a/addons/payment/static/src/js/payment_form.js
+++ b/addons/payment/static/src/js/payment_form.js
@@ -36,6 +36,18 @@ odoo.define('payment.payment_form', function (require) {
$('[data-toggle="tooltip"]').tooltip();
},
+ disableButton: function (button) {
+ $(button).attr('disabled', true);
+ $(button).children('.fa-lock').removeClass('fa-lock');
+ $(button).prepend('');
+ },
+
+ enableButton: function (button) {
+ $(button).attr('disabled', false);
+ $(button).children('.fa').addClass('fa-lock');
+ $(button).find('span.o_loader').remove();
+ },
+
payEvent: function (ev) {
ev.preventDefault();
var form = this.el;
@@ -90,10 +102,7 @@ odoo.define('payment.payment_form', function (require) {
return;
}
- $(button).attr('disabled', true);
- $(button).children('.fa-plus-circle').removeClass('fa-plus-circle')
- $(button).prepend('');
-
+ this.disableButton(button);
var verify_validity = this.$el.find('input[name="verify_validity"]');
if (verify_validity.length>0) {
@@ -128,14 +137,10 @@ odoo.define('payment.payment_form', function (require) {
}
}
// here we remove the 'processing' icon from the 'add a new payment' button
- $(button).attr('disabled', false);
- $(button).children('.fa').addClass('fa-plus-circle')
- $(button).find('span.o_loader').remove();
+ self.enableButton(button);
}).fail(function (error, event) {
// if the rpc fails, pretty obvious
- $(button).attr('disabled', false);
- $(button).children('.fa').addClass('fa-plus-circle')
- $(button).find('span.o_loader').remove();
+ self.enableButton(button);
self.displayError(
_t('Server Error'),
@@ -200,6 +205,7 @@ odoo.define('payment.payment_form', function (require) {
}
}
else { // if the user is using an old payment then we just submit the form
+ this.disableButton(button);
form.submit();
return $.Deferred();
}
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 097e3e7cd7f..8ad90c368d0 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -904,6 +904,9 @@ exports.PosModel = Backbone.Model.extend({
}}).done(function () {
invoiced.resolve();
done.resolve();
+ }).fail(function (error) {
+ invoiced.reject({code:401, message:'Backend Invoice', data:{order: order}});
+ done.reject();
});
} else {
// The order has been pushed separately in batch when
diff --git a/addons/website_sale_delivery/static/src/js/website_sale_delivery.js b/addons/website_sale_delivery/static/src/js/website_sale_delivery.js
index 28a50c96c5e..e1562b746be 100644
--- a/addons/website_sale_delivery/static/src/js/website_sale_delivery.js
+++ b/addons/website_sale_delivery/static/src/js/website_sale_delivery.js
@@ -16,7 +16,7 @@ odoo.define('website_sale_delivery.checkout', function (require) {
var $amount_untaxed = $('#order_total_untaxed span.oe_currency_value');
var $amount_tax = $('#order_total_taxes span.oe_currency_value');
var $amount_total = $('#order_total span.oe_currency_value');
- var $carrier_badge = $('#delivery_carrier input[name="delivery_type"][value=' + result.carrier_id + '] ~ .badge.d-none');
+ var $carrier_badge = $('#delivery_carrier input[name="delivery_type"][value=' + result.carrier_id + '] ~ .badge:not(.o_delivery_compute)');
var $compute_badge = $('#delivery_carrier input[name="delivery_type"][value=' + result.carrier_id + '] ~ .o_delivery_compute');
var $discount = $('#order_discounted');
diff --git a/addons/website_sale_delivery/views/website_sale_delivery_templates.xml b/addons/website_sale_delivery/views/website_sale_delivery_templates.xml
index 5394f344e5a..59f3c72f42c 100644
--- a/addons/website_sale_delivery/views/website_sale_delivery_templates.xml
+++ b/addons/website_sale_delivery/views/website_sale_delivery_templates.xml
@@ -27,8 +27,14 @@
-
- Free
+
+
+
+
+
+ Free
diff --git a/doc/cla/corporate/tecnativa.md b/doc/cla/corporate/tecnativa.md
index 9f3601d16a0..5249fe08571 100644
--- a/doc/cla/corporate/tecnativa.md
+++ b/doc/cla/corporate/tecnativa.md
@@ -17,7 +17,7 @@ Rafael Blasco rafael.blasco@tecnativa.com https://github.com/rafaelbn
Sergio Teruel sergio.teruel@tecnativa.com https://github.com/sergio-teruel
Carlos Dauden carlos.dauden@tecnativa.com https://github.com/carlosdauden
Jairo Llopis jairo.llopis@tecnativa.com https://github.com/yajo
-Vicent Cubells vicent.cubells@tecnativa.com https://github.com/cubells
-Luis Montalba luis.montalba@tecnativa.com https://github.com/luismontalba
David Vidal david.vidal@tecnativa.com https://github.com/chienandalu
-Cristina Martín cristina.martin@tecnativa.com https://github.com/cristinamartinrod
+Cristina Martín cristina.martin@tecnativa.com https://github.com/cristinamartinrod (up to 2019-04-30)
+Ernesto Tejeda ernesto.tejeda@tecnativa.com https://github.com/ernestotejeda
+Alexandre Díaz alexandre.diaz@tecnativa.com https://github.com/Tardo
diff --git a/doc/reference/qweb.rst b/doc/reference/qweb.rst
index a55765551ba..2954d0bf167 100644
--- a/doc/reference/qweb.rst
+++ b/doc/reference/qweb.rst
@@ -99,7 +99,7 @@ Extra conditional branching directives ``t-elif`` and ``t-else`` are also
available::
-
Happy bithday!
+
Happy birthday!
Welcome master!
Welcome!
diff --git a/odoo/addons/base/models/ir_model.py b/odoo/addons/base/models/ir_model.py
index a1692e20cec..e024222efa6 100644
--- a/odoo/addons/base/models/ir_model.py
+++ b/odoo/addons/base/models/ir_model.py
@@ -639,11 +639,17 @@ class IrModelFields(models.Model):
for view in views:
view._check_xml()
except Exception:
- raise UserError("\n".join([
- _("Cannot rename/delete fields that are still present in views:"),
- _("Fields: %s") % ", ".join(str(f) for f in fields),
- _("View: %s") % view.name,
- ]))
+ if not self._context.get(MODULE_UNINSTALL_FLAG):
+ raise UserError("\n".join([
+ _("Cannot rename/delete fields that are still present in views:"),
+ _("Fields: %s") % ", ".join(str(f) for f in fields),
+ _("View: %s") % view.name,
+ ]))
+ else:
+ # uninstall mode
+ _logger.warn("The following fields were force-deleted to prevent a registry crash "
+ + ", ".join(str(f) for f in fields)
+ + " the following view might be broken %s" % view.name)
finally:
# the registry has been modified, restore it
self.pool.setup_models(self._cr)