[MERGE] forward port branch saas-14 up to 459efb4276

This commit is contained in:
Christophe Simonis
2018-05-29 19:02:43 +02:00
4 changed files with 18 additions and 9 deletions
+5 -5
View File
@@ -29,12 +29,12 @@ class StockWarehouse(models.Model):
return result
def _get_manufacture_route_id(self):
manufacture_route_id = self.env.ref('mrp.route_warehouse0_manufacture').id
if not manufacture_route_id:
manufacture_route_id = self.env['stock.location.route'].search([('name', 'like', _('Manufacture'))], limit=1).id
if not manufacture_route_id:
manufacture_route = self.env.ref('mrp.route_warehouse0_manufacture', raise_if_not_found=False)
if not manufacture_route:
manufacture_route = self.env['stock.location.route'].search([('name', 'like', _('Manufacture'))], limit=1)
if not manufacture_route:
raise exceptions.UserError(_('Can\'t find any generic Manufacture route.'))
return manufacture_route_id
return manufacture_route.id
def _get_manufacture_pull_rules_values(self, route_values):
if not self.manu_type_id:
@@ -17,7 +17,9 @@
<tbody>
<tr style="width: 1in;">
<td style="border: 2px solid black;text-align: center; vertical-align: middle;" class="col-xs-5">
<img t-if="product.barcode" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', product.barcode, 600, 150)" style="width:100%;height:20%;"/>
<img t-if="product.barcode and len(product.barcode) == 13" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', product.barcode, 600, 150)" style="width:100%;height:20%;"/>
<img t-elif="product.barcode and len(product.barcode) == 8" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN8', product.barcode, 600, 150)" style="width:100%;height:20%;"/>
<img t-else="" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', product.barcode, 600, 150)" style="width:100%;height:20%;"/>
<span t-field="product.barcode"/>
</td>
<td style="border: 2px solid black; text-align: center;" class="col-xs-7">
+1 -1
View File
@@ -226,7 +226,7 @@ class StockMove(models.Model):
# product_obj = self.pool.get('product.product')
if any(q.qty <= 0 for q in move.quant_ids) or move.product_qty == 0:
# if there is a negative quant, the standard price shouldn't be updated
return
continue
# Note: here we can't store a quant.cost directly as we may have moved out 2 units
# (1 unit to 5€ and 1 unit to 7€) and in case of a product return of 1 unit, we can't
# know which of the 2 costs has to be used (5€ or 7€?). So at that time, thanks to the
+9 -2
View File
@@ -326,9 +326,12 @@ var RTE = Widget.extend({
});
// start element observation
$(document).on('content_changed', '.o_editable', function (event) {
$(document).on('content_changed', '.o_editable', function (ev) {
self.trigger('change', this);
$(this).addClass('o_dirty');
if (!ev.__isDirtyHandled) {
$(this).addClass('o_dirty');
ev.__isDirtyHandled = true;
}
});
$('#wrapwrap, .o_editable').on('click.rte', '*', this, this.onClick.bind(this));
@@ -357,6 +360,10 @@ var RTE = Widget.extend({
this.__saved = {}; // list of allready saved views and data
$('.o_editable')
.destroy()
.removeClass('o_editable o_is_inline_editable');
var defs = $('.o_dirty')
.removeAttr('contentEditable')
.removeClass('o_dirty oe_carlos_danger o_is_inline_editable')