From 0ab71f124797912b3df39e748552741df430e4fc Mon Sep 17 00:00:00 2001 From: len-odoo Date: Tue, 7 Aug 2018 10:26:50 +0200 Subject: [PATCH 1/4] [FIX] stock, sale_stock: copy the to_refund field when splitting a move The to_refund attribute is set to copy=False. However when splitting a move to create a backorder, a new move is created as a copy with the remaining work to do. This attribute is needed so that the backorder refund is consistently applied. Essentially a backport of commit: https://github.com/odoo/odoo/commit/c5ffca151160f9d99bec036330def108e4e91e0b opw 1865324 --- addons/sale_stock/models/stock.py | 5 +++++ addons/stock/models/stock_move.py | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/addons/sale_stock/models/stock.py b/addons/sale_stock/models/stock.py index 054b070b152..c9514a22084 100644 --- a/addons/sale_stock/models/stock.py +++ b/addons/sale_stock/models/stock.py @@ -40,6 +40,11 @@ class StockMove(models.Model): subtype_id=self.env.ref('mail.mt_note').id) return result + def _prepare_move_split_vals(self, defaults): + defaults = super(StockMove, self)._prepare_move_split_vals(defaults) + defaults['to_refund_so'] = self.to_refund_so + return defaults + class StockPicking(models.Model): _inherit = 'stock.picking' diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 352392ccb7d..c170d2cc5fa 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -938,6 +938,10 @@ class StockMove(models.Model): new_move_prop = self.move_dest_id.split(qty) new_move.write({'move_dest_id': new_move_prop}) + def _prepare_move_split_vals(self, defaults): + # hook to add values in default vals in other modules + return defaults + @api.multi def split(self, qty, restrict_lot_id=False, restrict_partner_id=False): """ Splits qty from move move into a new move @@ -967,6 +971,9 @@ class StockMove(models.Model): 'move_dest_id': self.move_dest_id.id, 'origin_returned_move_id': self.origin_returned_move_id.id, } + + defaults = self._prepare_move_split_vals(defaults) + if restrict_partner_id: defaults['restrict_partner_id'] = restrict_partner_id From 8ff138a0daf6fcec4a122ec4e98ce3e5000611ed Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 7 Aug 2018 15:00:27 +0200 Subject: [PATCH 2/4] [FIX] barcodes: ok PageUp/Down/Home/End in firefox Same reason as 8d948d92. In firefox if barcode is installed, for example on a form view the keys to navigate the possible scrolling PageUp/PageDown/Home/End don't work at all. This is caused by the interface barcode catching and differences of the key event handling between firefox and other browser. So in this change, we add these keys so they are not catched by barcode. note: aso backport 5bc29744c so the code is the same between 10 and 11. related to opw-706352 closes #26219 --- addons/barcodes/static/src/js/barcode_events.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/barcodes/static/src/js/barcode_events.js b/addons/barcodes/static/src/js/barcode_events.js index bff05aa4636..287989d0efa 100644 --- a/addons/barcodes/static/src/js/barcode_events.js +++ b/addons/barcodes/static/src/js/barcode_events.js @@ -115,7 +115,9 @@ var BarcodeEvents = core.Class.extend(mixins.PropertiesMixin, { e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "Escape" || e.key === "Tab" || e.key === "Backspace" || e.key === "Delete" || - /F\d\d?/.test(e.key)) { + e.key === "Home" || e.key === "End" || + e.key === "PageUp" || e.key === "PageDown" || + e.key === "Unidentified" || /F\d\d?/.test(e.key)) { return true; } else { return false; From c61cddf814c2bddaab0a3aa415ea6934521ff140 Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Wed, 8 Aug 2018 07:57:33 +0200 Subject: [PATCH 3/4] [FIX] hr_gamification: csv space EoL Can cause some issues with importing the files --- addons/hr_gamification/security/ir.model.access.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_gamification/security/ir.model.access.csv b/addons/hr_gamification/security/ir.model.access.csv index 9ace96f7139..78979d89de5 100644 --- a/addons/hr_gamification/security/ir.model.access.csv +++ b/addons/hr_gamification/security/ir.model.access.csv @@ -2,4 +2,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink challenge_officer,"Challenge Officer",gamification.model_gamification_challenge,hr.group_hr_user,1,1,1,1 challenge_line_officer,"Challenge Line Officer",gamification.model_gamification_challenge_line,hr.group_hr_user,1,1,1,1 badge_officer,"Badge Officer",gamification.model_gamification_badge,hr.group_hr_user,1,1,1,1 -badge_user_officer,"Badge-user Officer",gamification.model_gamification_badge_user,hr.group_hr_user,1,1,1,1 +badge_user_officer,"Badge-user Officer",gamification.model_gamification_badge_user,hr.group_hr_user,1,1,1,1 From 6ded4d9ce89465a4a83f8bca4a1c01d995995bc1 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 7 Aug 2018 14:43:21 +0200 Subject: [PATCH 4/4] [FIX] payment_stripe: disable button - Create an order from the eCommerce - Choose to pay with Stripe - Enter the credit card info, validate There is a short window of time (before the reload of the page) where the user can click on 'Pay Now' again. This is because the HTML is completely replaced, including the button. We restore it when necessary. opw-1866332 --- addons/payment_stripe/static/src/js/stripe.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/payment_stripe/static/src/js/stripe.js b/addons/payment_stripe/static/src/js/stripe.js index c1ddb41351b..2701edf015e 100644 --- a/addons/payment_stripe/static/src/js/stripe.js +++ b/addons/payment_stripe/static/src/js/stripe.js @@ -92,7 +92,10 @@ odoo.define('payment_stripe.stripe', function(require) { so_id: so_id, so_token: so_token }, {'async': false}).then(function (data) { + var $pay_stripe = $('#pay_stripe').detach(); $form.html(data); + // Restore 'Pay Now' button HTML since data might have changed it. + $form.find('#pay_stripe').replaceWith($pay_stripe); handler.open({ name: $("input[name='merchant']").val(), email: $("input[name='email']").val(),