26.01.26
This commit is contained in:
@@ -2,6 +2,8 @@ from trytond.model import ModelSQL, ModelView, fields, Workflow
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Eval
|
||||
from trytond.wizard import Button
|
||||
from trytond.transaction import Transaction
|
||||
from sql import Table
|
||||
import requests
|
||||
import io
|
||||
import logging
|
||||
@@ -203,6 +205,35 @@ class AutomationDocument(ModelSQL, ModelView, Workflow):
|
||||
ShipmentWR.save([swr])
|
||||
doc.notes = (doc.notes or "") + f"Shipment found: {sh[0].number}\n"
|
||||
|
||||
t = Table('freight_booking_lots')
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute(*t.select(
|
||||
t.BOOKING_NUMBER,
|
||||
t.LOT_NUMBER,
|
||||
t.LOT_NBR_BALES,
|
||||
t.LOT_GROSS_WEIGHT,
|
||||
t.LOT_NET_WEIGHT,
|
||||
t.LOT_UOM,
|
||||
t.LOT_QUALITY,
|
||||
t.CUSTOMER,
|
||||
t.SELL_PRICE_CURRENCY,
|
||||
t.SELL_PRICE_UNIT,
|
||||
t.SALE_INVOICE,
|
||||
t.SELL_INV_AMOUNT,
|
||||
t.SALE_INVOICE_DATE,
|
||||
t.SELL_PREMIUM,
|
||||
t.SALE_CONTRACT,
|
||||
where=(t.BOOKING_NUMBER == sh[0].bl_number)
|
||||
))
|
||||
|
||||
rows = cursor.fetchall()
|
||||
if rows:
|
||||
#Purchase & Sale creation
|
||||
Purchase = Pool().get('purchase.purchase')
|
||||
PurchaseLine = Pool().get('purchase.line')
|
||||
for row in rows:
|
||||
#Lots creation
|
||||
pass
|
||||
# if cls.rule_set.ocr_required:[]
|
||||
# cls.run_ocr([doc])
|
||||
# if cls.rule_set.structure_required and doc.state != "error":
|
||||
|
||||
Reference in New Issue
Block a user