From a9bf7be2693e6c7390928d2c9e2c3f63e0666a87 Mon Sep 17 00:00:00 2001 From: Swapnesh Shah Date: Sat, 23 May 2020 18:20:25 +0000 Subject: [PATCH] [FIX] account: edit tax on draft invoice only Before this commit, Edit pencil on the widget `tax-group-custom-field` was visible on canceled Invoice as well. Now, Edit pencil will be visible on Draft invoices only. closes odoo/odoo#53680 X-original-commit: c5a02d3587c33fcf1bd6a0c78f97772a95652801 Signed-off-by: Quentin De Paoli (qdp) --- addons/account/static/src/js/tax_group.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/static/src/js/tax_group.js b/addons/account/static/src/js/tax_group.js index 5c6735aaa2b..a9de7f9f587 100644 --- a/addons/account/static/src/js/tax_group.js +++ b/addons/account/static/src/js/tax_group.js @@ -91,7 +91,7 @@ odoo.define('account.tax_group', function (require) { // Display the pencil and allow the event to click and edit only on purchase that are not posted and in edit mode. // since the field is readonly its mode will always be readonly. Therefore we have to use a trick by checking the // formRenderer (the parent) and check if it is in edit in order to know the correct mode. - var displayEditWidget = self._isPurchaseDocument() && this.record.data.state !== 'posted' && this.getParent().mode === 'edit'; + var displayEditWidget = self._isPurchaseDocument() && this.record.data.state === 'draft' && this.getParent().mode === 'edit'; this.$el.html($(QWeb.render('AccountTaxGroupTemplate', { lines: self.value, displayEditWidget: displayEditWidget,