This commit is contained in:
2026-01-18 20:52:20 +01:00
parent 6b2d5aebf8
commit 178fb25a2f
2 changed files with 23 additions and 15 deletions

View File

@@ -1,4 +1,7 @@
from trytond.model import ModelSQL, ModelView, fields
from sql import Table
from sql.functions import CurrentTimestamp
from sql import Column, Literal
class FreightBookingInfo(ModelSQL, ModelView):
"Freight Booking"
@@ -18,21 +21,25 @@ class FreightBookingInfo(ModelSQL, ModelView):
@classmethod
def table_query(cls):
return (
'SELECT '
' ROW_NUMBER() OVER () AS id, '
' booking_number, '
' agent, '
' customer, '
' origin, '
' destination, '
' etd, '
' eta, '
' carrier, '
' vessel, '
' container_count, '
' gross_weight '
'FROM public.freight_booking_info'
t = Table('freight_booking_info')
return t.select(
Literal(0).as_('create_uid'),
CurrentTimestamp().as_('create_date'),
Literal(None).as_('write_uid'),
Literal(None).as_('write_date'),
t.booking_number.as_('id'),
t.booking_number,
t.agent,
t.customer,
t.origin,
t.destination,
t.etd,
t.eta,
t.carrier,
t.vessel,
t.container_count,
t.gross_weight
)
@classmethod

View File

@@ -7,6 +7,7 @@
<field name="etd"/>
<field name="eta"/>
<field name="carrier"/>
<field name="vessel"/>
<field name="container_count"/>
<field name="gross_weight"/>
</tree>