From 4c79aa8d9d57a4e7e5cde083d3f8fb755e0a8693 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 13 Mar 2017 15:56:45 +0100 Subject: [PATCH 1/3] [FIX] sale: translate default name at creation When a sale order is created from the interface, the name field is read-only so not given in the create call. However, if the create values are filled with the default value, the string 'New' is translated and the condition is not met in the create method. This commit makes the create consistent with the default `lambda self: _('New')` Fixes #15839 --- addons/sale/sale.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 83dcb3111df..22418745668 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -224,8 +224,8 @@ class SaleOrder(models.Model): @api.model def create(self, vals): - if vals.get('name', 'New') == 'New': - vals['name'] = self.env['ir.sequence'].next_by_code('sale.order') or 'New' + if vals.get('name', _('New')) == _('New'): + vals['name'] = self.env['ir.sequence'].next_by_code('sale.order') or _('New') # Makes sure partner_invoice_id', 'partner_shipping_id' and 'pricelist_id' are defined if any(f not in vals for f in ['partner_invoice_id', 'partner_shipping_id', 'pricelist_id']): From a873890f2842cb238152717d83739465898acd68 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 14 Mar 2017 16:19:04 +0100 Subject: [PATCH 2/3] [FIX] mass_mailing: link in kanban - Go to Mass Mailing > Configuration > Mail Templates - In the Kanban view, find a template which contains a link (http, mailto, whatever) - Click on the link You are redirected to the link instead of being redirected to the record. opw-706047 --- addons/mass_mailing/static/src/css/email_template.css | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mass_mailing/static/src/css/email_template.css b/addons/mass_mailing/static/src/css/email_template.css index f0b25ba612d..edd9c0c3f0d 100644 --- a/addons/mass_mailing/static/src/css/email_template.css +++ b/addons/mass_mailing/static/src/css/email_template.css @@ -9,6 +9,7 @@ } .kanban_html_preview { + pointer-events: none; width: 600px; -webkit-transform: scale(.50); -ms-transform: scale(.50); From e542b450a34d5c3723c92cb95d7132a288c46e60 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 16 Mar 2017 13:15:46 +0100 Subject: [PATCH 3/3] [FIX] sale_stock: duplicate qty - Create a stockable product, create a SO selling 1 unit. - Confirm the SO, validate the Picking 1 => delivered qty is 1 - Return Picking 1 and validate Picking 2 => delivered qty is 1 - Return Picking 2 and validate Picking 3 => delivered qty is 2 The delivered quantity should remain 1. opw-715685 --- addons/sale_stock/sale_stock.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py index 63f03f4a64f..2f817e09978 100644 --- a/addons/sale_stock/sale_stock.py +++ b/addons/sale_stock/sale_stock.py @@ -197,7 +197,8 @@ class SaleOrderLine(models.Model): #Note that we don't decrease quantity for customer returns on purpose: these are exeptions that must be treated manually. Indeed, #modifying automatically the delivered quantity may trigger an automatic reinvoicing (refund) of the SO, which is definitively not wanted if move.location_dest_id.usage == "customer": - qty += self.env['product.uom']._compute_qty_obj(move.product_uom, move.product_uom_qty, self.product_uom) + if not move.origin_returned_move_id: + qty += self.env['product.uom']._compute_qty_obj(move.product_uom, move.product_uom_qty, self.product_uom) return qty @api.multi