main #7
@@ -2,6 +2,8 @@ from trytond.model import ModelSQL, ModelView, fields
|
|||||||
from sql import Table
|
from sql import Table
|
||||||
from sql.functions import CurrentTimestamp
|
from sql.functions import CurrentTimestamp
|
||||||
from sql import Column, Literal
|
from sql import Column, Literal
|
||||||
|
import logging
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class FreightBookingInfo(ModelSQL, ModelView):
|
class FreightBookingInfo(ModelSQL, ModelView):
|
||||||
"Freight Booking"
|
"Freight Booking"
|
||||||
@@ -24,7 +26,7 @@ class FreightBookingInfo(ModelSQL, ModelView):
|
|||||||
def table_query(cls):
|
def table_query(cls):
|
||||||
t = Table('freight_booking_info')
|
t = Table('freight_booking_info')
|
||||||
|
|
||||||
return t.select(
|
query = t.select(
|
||||||
Literal(0).as_('create_uid'),
|
Literal(0).as_('create_uid'),
|
||||||
CurrentTimestamp().as_('create_date'),
|
CurrentTimestamp().as_('create_date'),
|
||||||
Literal(None).as_('write_uid'),
|
Literal(None).as_('write_uid'),
|
||||||
@@ -43,6 +45,8 @@ class FreightBookingInfo(ModelSQL, ModelView):
|
|||||||
Column(t, 'NumberOfContainers').as_('container_count'),
|
Column(t, 'NumberOfContainers').as_('container_count'),
|
||||||
Column(t, 'ShippingInstructionQuantity').as_('quantity'),
|
Column(t, 'ShippingInstructionQuantity').as_('quantity'),
|
||||||
)
|
)
|
||||||
|
logger.info("*****QUERY*****:%s",query)
|
||||||
|
return query
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
|
|||||||
Reference in New Issue
Block a user