Script tersebut tidak akan menghapus semua transient model yang ada, karena hanya menghapus data dari tabel ir_session. Jika Anda ingin menghapus semua transient model, Anda perlu melakukan penghapusan untuk setiap tabel transient model secara eksplisit. Apa Itu Transient Models di Odoo? Transient models di Odoo adalah model sementara yang memiliki properti _transient = True. Data … Continue reading Menghapus semua transient model Odoo 10
Category: Odoo
How can I log all SQL queries on Odoo
OpenERP does not provide a mechanism specifically to log SQL queries, but it has a generic logging feature. By adding --log-level=debug_sql to the command line used to launch OpenERP it will print the normal debugging messages + the sql commands. You can redirect that output to a file if you want. You could also configure PostgreSQL to … Continue reading How can I log all SQL queries on Odoo
Install Odoo 17 on Ubuntu 20.04.6 LTS with Virtual Environemnt
requirements: postgres terbaru python 3.10 library python di file /odoo/requirements.txt Update Libirary : sudo apt-get update sudo apt-get upgrade Install Packages and libraries :sudo apt-get install python-dev python3-dev libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential libssl-dev libffi-dev libmysqlclient-dev libjpeg-dev libpq-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-devsudo apt-get install -y npmsudo ln -s /usr/bin/nodejs /usr/bin/nodesudo npm install -g less … Continue reading Install Odoo 17 on Ubuntu 20.04.6 LTS with Virtual Environemnt
Sample Cek Constraint with psql
@api.one @api.constrains('order_line') def _check_tanggal_rencana(self): query = """ SELECT shl.start_time as tgl_rencana_produksi FROM survey_harian_line shl WHERE shl.survey_id = %s ORDER BY shl.start_time DESC """ self.env.cr.execute(query,(self.id,)) survey_harian_line = self.env.cr.dictfetchall() if survey_harian_line: for s in survey_harian_line: tgl_rencana_produksi = s['tgl_rencana_produksi'] self.tgl_rencana_produksi = tgl_rencana_produksi
Python Openpyxl
Python Openpyxl Introduction Python provides the Openpyxl module, which is used to deal with Excel files without involving third-party Microsoft application software. By using this module, we can have control over excel without open the application. It is used to perform excel tasks such as read data from excel file, or write data to the excel … Continue reading Python Openpyxl
Export – Import XLSX File in Odoo 10
Import XLSX Files in Odoo Using Openpyxl Technical To import data into Odoo, we need to select the file in .csv or .xlsx format and upload it. To know how to import data into Odoo, check out this blog: How to import data in Odoo In this blog I am going to share a simple way … Continue reading Export – Import XLSX File in Odoo 10
How to hide Edit button based on state in Odoo 10
This can be done by inserting conditional CSS. Frist add a html field with sanitize option set to False: x_css = fields.Html( string='CSS', sanitize=False, compute='_compute_css', store=False, ) Then add a compute method with your own dependances and conditions: # Modify the "depends" @api.depends('state_str_modify_me') def _compute_css(self): for application in self: # Modify below condition if application.state_str_modify_me= … Continue reading How to hide Edit button based on state in Odoo 10
Odoo multiple condition in domain
You should also write like this, <field name="x" attrs="{'readonly': [('participate_process', '=', False), '|', ('state', '=', 'fine'), ('state','!=', 'ok')]}" > it will be converted to like this. Where participate_process = False and (state = 'fine' or state != 'ok') https://stackoverflow.com/questions/45506255/odoo-multiple-condition-in-domain-error/45518277 https://www.surekhatech.com/blog/working-with-domain-and-polish-notations-in-od-1
Odoo REST API
This is a module which expose Odoo as a REST APISource => https://github.com/yezyilomo/odoo-rest-api Installing Download this module and put it to your Odoo addons directoryInstall requirements with pip install -r requirements.txt Getting Started Before making any request make sure to login and obtain session_id(This will act as your API key), Send all your requests with session_id … Continue reading Odoo REST API
