[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) <qdp@openerp.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user