Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
16 views
Kernel: Python 3 (system-wide)
Setting Odoo Docker
File "/tmp/ipykernel_500/3443610143.py", line 1 Setting Odoo Docker ^ SyntaxError: invalid syntax
# Gunakan base image Odoo FROM odoo:15 COPY . /app # Install dependensi yang diperlukan untuk Code Server RUN apt-get update && apt-get install -y curl # Unduh dan instal Code Server RUN curl -fsSL https://code-server.dev/install.sh | sh # Expose port untuk Code Server EXPOSE 8080 # Jalankan Code Server saat container dimulai CMD ["code-server", "--bind-addr", "0.0.0.0:8080", "."] # docker build -t odoocode.docker
import xmlrpc.client # Ganti URL dan port sesuai dengan konfigurasi Odoo Anda url = 'http://203.194.112.105:8000' db = 'demo-01' username = 'admin' password = 'odooadmin' common = xmlrpc.client.ServerProxy(f'{url}/xmlrpc/2/common') uid = common.authenticate(db, username, password, {}) print(uid)
--------------------------------------------------------------------------- TimeoutError Traceback (most recent call last) /tmp/ipykernel_500/1018343984.py in <cell line: 10>() 8 9 common = xmlrpc.client.ServerProxy(f'{url}/xmlrpc/2/common') ---> 10 uid = common.authenticate(db, username, password, {}) 11 print(uid) /usr/lib/python3.10/xmlrpc/client.py in __call__(self, *args) 1120 return _Method(self.__send, "%s.%s" % (self.__name, name)) 1121 def __call__(self, *args): -> 1122 return self.__send(self.__name, args) 1123 1124 ## /usr/lib/python3.10/xmlrpc/client.py in __request(self, methodname, params) 1462 allow_none=self.__allow_none).encode(self.__encoding, 'xmlcharrefreplace') 1463 -> 1464 response = self.__transport.request( 1465 self.__host, 1466 self.__handler, /usr/lib/python3.10/xmlrpc/client.py in request(self, host, handler, request_body, verbose) 1164 for i in (0, 1): 1165 try: -> 1166 return self.single_request(host, handler, request_body, verbose) 1167 except http.client.RemoteDisconnected: 1168 if i: /usr/lib/python3.10/xmlrpc/client.py in single_request(self, host, handler, request_body, verbose) 1176 # issue XML-RPC request 1177 try: -> 1178 http_conn = self.send_request(host, handler, request_body, verbose) 1179 resp = http_conn.getresponse() 1180 if resp.status == 200: /usr/lib/python3.10/xmlrpc/client.py in send_request(self, host, handler, request_body, debug) 1289 headers.append(("User-Agent", self.user_agent)) 1290 self.send_headers(connection, headers) -> 1291 self.send_content(connection, request_body) 1292 return connection 1293 /usr/lib/python3.10/xmlrpc/client.py in send_content(self, connection, request_body) 1319 1320 connection.putheader("Content-Length", str(len(request_body))) -> 1321 connection.endheaders(request_body) 1322 1323 ## /usr/lib/python3.10/http/client.py in endheaders(self, message_body, encode_chunked) 1276 else: 1277 raise CannotSendHeader() -> 1278 self._send_output(message_body, encode_chunked=encode_chunked) 1279 1280 def request(self, method, url, body=None, headers={}, *, /usr/lib/python3.10/http/client.py in _send_output(self, message_body, encode_chunked) 1036 msg = b"\r\n".join(self._buffer) 1037 del self._buffer[:] -> 1038 self.send(msg) 1039 1040 if message_body is not None: /usr/lib/python3.10/http/client.py in send(self, data) 974 if self.sock is None: 975 if self.auto_open: --> 976 self.connect() 977 else: 978 raise NotConnected() /usr/lib/python3.10/http/client.py in connect(self) 940 """Connect to the host and port specified in __init__.""" 941 sys.audit("http.client.connect", self, self.host, self.port) --> 942 self.sock = self._create_connection( 943 (self.host,self.port), self.timeout, self.source_address) 944 # Might fail in OSs that don't implement TCP_NODELAY /usr/lib/python3.10/socket.py in create_connection(address, timeout, source_address) 843 if err is not None: 844 try: --> 845 raise err 846 finally: 847 # Break explicitly a reference cycle /usr/lib/python3.10/socket.py in create_connection(address, timeout, source_address) 831 if source_address: 832 sock.bind(source_address) --> 833 sock.connect(sa) 834 # Break explicitly a reference cycle 835 err = None TimeoutError: [Errno 110] Connection timed out