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
1818 */
1919 private $ attribute ;
2020
21+ /**
22+ * Global configuration storage.
23+ *
24+ * @var \Magento\Framework\App\Config\ScopeConfigInterface
25+ */
26+ protected $ globalConfig ;
27+
2128 /**
2229 * AddressUpdate constructor.
2330 * @param \Magento\Sales\Model\ResourceModel\GridPool $gridPool
2431 * @param \Magento\Sales\Model\ResourceModel\Attribute $attribute
32+ * @param \Magento\Framework\App\Config\ScopeConfigInterface $globalConfig
2533 */
2634 public function __construct (
2735 \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
2938 ) {
3039 $ this ->gridPool = $ gridPool ;
3140 $ this ->attribute = $ attribute ;
41+ $ this ->globalConfig = $ globalConfig ;
3242 }
3343
3444 /**
@@ -68,9 +78,10 @@ public function afterProcess(
6878 $ this ->attribute ->saveAttribute ($ invoice , $ invoiceAttributesForSave );
6979 }
7080 }
71-
7281 if ($ orderInvoiceHasChanges ) {
73- $ this ->gridPool ->refreshByOrderId ($ order ->getId ());
82+ if (!$ this ->globalConfig ->getValue ('dev/grid/async_indexing ' )) {
83+ $ this ->gridPool ->refreshByOrderId ($ order ->getId ());
84+ }
7485 }
7586 }
7687 }
You can’t perform that action at this time.
0 commit comments