diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-05-29 18:45:00 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-05-29 18:45:00 +0200 |
| commit | 459efb4276597108e9b4c7c96fb5e1e7cbb345a7 (patch) | |
| tree | a9a563b70c007a4c1d56a5c1b7c660ef5cf2e625 | |
| parent | cafe56da80838d597586ca0040aedf05ef0c4a72 (diff) | |
| parent | 2288a89564c95c5060b5e783a00c9417bc74d687 (diff) | |
[MERGE] forward port branch 10.0 up to 2288a89564c
| -rw-r--r-- | addons/mrp/models/stock_warehouse.py | 10 | ||||
| -rw-r--r-- | addons/product/report/product_product_templates.xml | 4 | ||||
| -rw-r--r-- | addons/stock_account/models/stock.py | 2 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/rte.js | 11 |
4 files changed, 18 insertions, 9 deletions
diff --git a/addons/mrp/models/stock_warehouse.py b/addons/mrp/models/stock_warehouse.py index 1036f19c5b1..8f38dfad3c3 100644 --- a/addons/mrp/models/stock_warehouse.py +++ b/addons/mrp/models/stock_warehouse.py @@ -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: diff --git a/addons/product/report/product_product_templates.xml b/addons/product/report/product_product_templates.xml index 8fb2bf122d7..66f9594a529 100644 --- a/addons/product/report/product_product_templates.xml +++ b/addons/product/report/product_product_templates.xml @@ -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&value=%s&width=%s&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&value=%s&width=%s&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&value=%s&width=%s&height=%s' % ('EAN8', product.barcode, 600, 150)" style="width:100%;height:20%;"/> + <img t-else="" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&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"> diff --git a/addons/stock_account/models/stock.py b/addons/stock_account/models/stock.py index 5bb399257c9..e91521e5037 100644 --- a/addons/stock_account/models/stock.py +++ b/addons/stock_account/models/stock.py @@ -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 diff --git a/addons/web_editor/static/src/js/rte.js b/addons/web_editor/static/src/js/rte.js index 595602d6305..564857966b5 100644 --- a/addons/web_editor/static/src/js/rte.js +++ b/addons/web_editor/static/src/js/rte.js @@ -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') |
