diff --git a/modules/document_incoming_wr/document.py b/modules/document_incoming_wr/document.py index 7a056b1..0f95deb 100644 --- a/modules/document_incoming_wr/document.py +++ b/modules/document_incoming_wr/document.py @@ -28,10 +28,7 @@ class Incoming(metaclass=PoolMeta): return super()._get_results() | {'automation.document'} def _process_weight_report(self): - pool = Pool() - WR = pool.get('automation.document') - # Configuration = pool.get('document.incoming.configuration') - # config = Configuration(1) + WR = Pool().get('automation.document') wr = WR() wr.document = self.id wr.type = 'weight_report' @@ -39,6 +36,10 @@ class Incoming(metaclass=PoolMeta): WR.save([wr]) WR.run_ocr([wr]) WR.run_metadata([wr]) + + WeightReport = Pool().get('weight.report') + WeightReport.create_from_json(wr.metadata_json) + return wr # @property