Faircot process
This commit is contained in:
@@ -7,6 +7,9 @@ from trytond.modules.document_incoming.exceptions import (
|
||||
DocumentIncomingProcessError)
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
import json
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class IncomingConfiguration(metaclass=PoolMeta):
|
||||
@@ -39,12 +42,22 @@ class Incoming(metaclass=PoolMeta):
|
||||
return super()._get_results() | {'automation.document'}
|
||||
|
||||
def _process_weight_report(self):
|
||||
logger.info(
|
||||
"DOCUMENT_INCOMING_WR_START incoming=%s name=%s type=%s "
|
||||
"data_size=%s",
|
||||
getattr(self, 'id', None), getattr(self, 'name', None),
|
||||
getattr(self, 'type', None),
|
||||
len(getattr(self, 'data', None) or b""))
|
||||
WR = Pool().get('automation.document')
|
||||
wr = WR()
|
||||
wr.document = self.id
|
||||
wr.type = 'weight_report'
|
||||
wr.state = 'draft'
|
||||
WR.save([wr])
|
||||
logger.info(
|
||||
"DOCUMENT_INCOMING_WR_AUTOMATION_CREATED incoming=%s "
|
||||
"automation_document=%s",
|
||||
getattr(self, 'id', None), getattr(wr, 'id', None))
|
||||
WR.run_ocr([wr])
|
||||
WR.run_metadata([wr])
|
||||
WR.run_pipeline([wr])
|
||||
|
||||
Reference in New Issue
Block a user