17.03.26
This commit is contained in:
@@ -98,6 +98,19 @@ class AutomationDocument(ModelSQL, ModelView, Workflow):
|
|||||||
ShipmentIn.save(sh)
|
ShipmentIn.save(sh)
|
||||||
doc.notes = (doc.notes or "") + "Id returned: " + request_id
|
doc.notes = (doc.notes or "") + "Id returned: " + request_id
|
||||||
|
|
||||||
|
so_payload = {
|
||||||
|
"ServiceOrderKey": sh.service_order_key,
|
||||||
|
"ID_Number": request_id
|
||||||
|
}
|
||||||
|
|
||||||
|
response = requests.post(
|
||||||
|
"http://automation-service:8006/service-order-update",
|
||||||
|
json=so_payload,
|
||||||
|
timeout=10
|
||||||
|
)
|
||||||
|
response.raise_for_status()
|
||||||
|
doc.notes = (doc.notes or "") + "SO updated: " + response.json()
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
doc.state = "error"
|
doc.state = "error"
|
||||||
doc.notes = (doc.notes or "") + f"OCR error: {e}\n"
|
doc.notes = (doc.notes or "") + f"OCR error: {e}\n"
|
||||||
|
|||||||
@@ -449,6 +449,7 @@ class ShipmentIn(metaclass=PoolMeta):
|
|||||||
returned_id = fields.Char("Returned ID")
|
returned_id = fields.Char("Returned ID")
|
||||||
result = fields.Char("Result",readonly=True)
|
result = fields.Char("Result",readonly=True)
|
||||||
agent = fields.Many2One('party.party',"Booking Agent")
|
agent = fields.Many2One('party.party',"Booking Agent")
|
||||||
|
service_order_key = fields.Integer("Service Order Key")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
@@ -815,6 +816,7 @@ class ShipmentIn(metaclass=PoolMeta):
|
|||||||
data = sh.create_service_order(so_payload)
|
data = sh.create_service_order(so_payload)
|
||||||
logger.info("SO_NUMBER:%s",data.get('service_order_number'))
|
logger.info("SO_NUMBER:%s",data.get('service_order_number'))
|
||||||
sh.result += f" / SO Nb {data.get('service_order_number')}"
|
sh.result += f" / SO Nb {data.get('service_order_number')}"
|
||||||
|
sh.service_order_key = int(data.get('service_order_key'))
|
||||||
sh.save()
|
sh.save()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<page string="Weight Report" col="4" id="wr">
|
<page string="Weight Report" col="4" id="wr">
|
||||||
<label name="controller"/>
|
<label name="controller"/>
|
||||||
<field name="controller"/>
|
<field name="controller"/>
|
||||||
|
<newline/>
|
||||||
<label name="controller_target"/>
|
<label name="controller_target"/>
|
||||||
<field name="controller_target"/>
|
<field name="controller_target"/>
|
||||||
<button name="send" string="Send email to controller"/>
|
<button name="send" string="Send email to controller"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user