Menghapus semua transient model Odoo 10

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

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

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