def set_recv_attr(status):
 recvtable = s3db.inv_recv
 ship_status = s3db.inv_ship_status
 recvtable.sender_id.readable = recvtable.sender_id.writable = False
 recvtable.grn_status.readable = recvtable.grn_status.writable = False
 recvtable.cert_status.readable = recvtable.cert_status.writable = False
 recvtable.eta.readable = False
 recvtable.req_ref.writable = True
 if (status == ship_status['IN_PROCESS']):
  recvtable.send_ref.writable = True
  recvtable.recv_ref.readable = False
  recvtable.sender_id.readable = False
 else:
  for field in recvtable.fields:
   recvtable[field].writable = False
 if (status == ship_status['SENT']):
  recvtable.date.writable = True
  recvtable.recipient_id.readable = recvtable.recipient_id.writable = True
  recvtable.comments.writable = True

def set_recv_attr ( status ) : recvtable = s3db . inv_recv ship_status = s3db . inv_ship_status recvtable . sender_id . readable = recvtable . sender_id . writable = False recvtable . grn_status . readable = recvtable . grn_status . writable = False recvtable . cert_status . readable = recvtable . cert_status . writable = False recvtable . eta . readable = False recvtable . req_ref . writable = True if ( status == ship_status [ 'IN_PROCESS' ] ) : recvtable . send_ref . writable = True recvtable . recv_ref . readable = False recvtable . sender_id . readable = False else : for field in recvtable . fields : recvtable [ field ] . writable = False if ( status == ship_status [ 'SENT' ] ) : recvtable . date . writable = True recvtable . recipient_id . readable = recvtable . recipient_id . writable = True recvtable . comments . writable = True
set field attributes for inv_recv table .