Fix retrieving of margin info when invoice created automatically from order (used by workflow module)
Merge pull request #1187 from altatof/3.4

Fix retrieving of margin info when invoice created automatically from order.