Store training tip embeddings in column (attachment=False)

Binary fields default to attachment storage in Odoo 19, but FAISS
embedding vectors need to be loaded in bulk via direct SQL for
performance. Using attachment=False stores them in the table column.

Made-with: Cursor
This commit is contained in:
Talal Sharabi
2026-03-15 01:34:09 +04:00
parent c43b4ae9f2
commit f7c780e7e6

View File

@@ -24,7 +24,7 @@ class EncoachTrainingTip(models.Model):
string="Category",
)
content = fields.Text(required=True)
embedding = fields.Binary(string="FAISS Embedding Vector")
embedding = fields.Binary(string="FAISS Embedding Vector", attachment=False)
def action_compute_embeddings(self):
"""Compute sentence-transformer embeddings for tips missing them."""