File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
app/code/Magento/Sales/Model/Order/Invoice/Plugin Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -18,17 +18,27 @@ class AddressUpdate
18
18
*/
19
19
private $ attribute ;
20
20
21
+ /**
22
+ * Global configuration storage.
23
+ *
24
+ * @var \Magento\Framework\App\Config\ScopeConfigInterface
25
+ */
26
+ protected $ globalConfig ;
27
+
21
28
/**
22
29
* AddressUpdate constructor.
23
30
* @param \Magento\Sales\Model\ResourceModel\GridPool $gridPool
24
31
* @param \Magento\Sales\Model\ResourceModel\Attribute $attribute
32
+ * @param \Magento\Framework\App\Config\ScopeConfigInterface $globalConfig
25
33
*/
26
34
public function __construct (
27
35
\Magento \Sales \Model \ResourceModel \GridPool $ gridPool ,
28
- \Magento \Sales \Model \ResourceModel \Attribute $ attribute
36
+ \Magento \Sales \Model \ResourceModel \Attribute $ attribute ,
37
+ \Magento \Framework \App \Config \ScopeConfigInterface $ globalConfig
29
38
) {
30
39
$ this ->gridPool = $ gridPool ;
31
40
$ this ->attribute = $ attribute ;
41
+ $ this ->globalConfig = $ globalConfig ;
32
42
}
33
43
34
44
/**
@@ -68,9 +78,10 @@ public function afterProcess(
68
78
$ this ->attribute ->saveAttribute ($ invoice , $ invoiceAttributesForSave );
69
79
}
70
80
}
71
-
72
81
if ($ orderInvoiceHasChanges ) {
73
- $ this ->gridPool ->refreshByOrderId ($ order ->getId ());
82
+ if (!$ this ->globalConfig ->getValue ('dev/grid/async_indexing ' )) {
83
+ $ this ->gridPool ->refreshByOrderId ($ order ->getId ());
84
+ }
74
85
}
75
86
}
76
87
}
You can’t perform that action at this time.
0 commit comments