29.How To Add Compute Field In Odoo || Compute Field and Function
ฝัง
- เผยแพร่เมื่อ 7 ก.พ. 2025
- How to create compute field in odoo. Steps to create a compute field and write its function in Odoo. Steps to write compute function in odoo. Compute value for a field from function in odoo. Odoo 14 development tutorials, working of a compute field in odoo. Odoo Compute function.
Odoo 14 Playlist: • 2. How To Create Modul...
Module: apps.odoo.com/...
Website: www.odoomates....
Github: github.com/odo...
Email : odoomates@gmail.com
Facebook: / odoomate
Twitter: / odoomates
Support Us in Ko Fi : ko-fi.com/odoo...
Hi, I like your video, it helps me a lot. By the way, I can't make the compute field working without the dependencies field. Im trying it in the User Interface.
Hello, if we add this appoinment_count on tree view, it give us singleton error, so it seems that we need to specify field i think. How can we resolve singleton error in tree view?
Hope you get the answer from here: th-cam.com/video/Rv44nFVn_5U/w-d-xo.html
I'm so glad that this was already asked, and a lot more cause it's actually a video about this already. Thanks so much
@@pablocamberoscarvajal1608 welcome brother
hello, I have one question and i will greately appreciate if you answer me, Does compute field stred in base ??
Compute field is stored in db only if store=True attribute is added along with field definition.
10:36 I try to add `appointment_count` on tree view `view_patient_tree`, but it give me an error
XML:
...
...
Error message:
ValueError: Expected singleton: hospital.patient(1, 2, 3, 4, 5)
video no 30 will solve the problem: th-cam.com/video/Rv44nFVn_5U/w-d-xo.html
@@OdooMates Oh yeah thank. After follow your tutorial to iterate the record, the `appointment_count` is shown on tree view, but the output number for `appointment_count` is same. Any help?
I already solve the problem, just need to change `self.appointment_count = appointment_count` to `rec.appointment_count = appointment_count`
@@NMNaufaldo glad that you able to resolve it instantly (y)
I'm curious, is that `appointment_count` field is stored in database?
If store =True is not specified for a computed field, it will.not be saving or creating a field in db
@@OdooMates Yes you right, I just made a change in computer method, and the old field data also change. This mean the data not stored in database. Do you know if there is a cheatsheet for Odoo? If not, I'm willing to help to make that cheatsheet
Thanks Bro for this great video.
Is it possible to pass filter parameters to the search ORM function from fields values entered in the from view?
Yes possible, sample suppose if we have a field named partner_id in out model and if we need to search sales orders of this partner, we can do as follows: self.env['sale.order'].search([('partner_id",'=', self.partner_id.id)])
@@OdooMates this is great. In my case I want to pick up a single field value from another model depending on multiple values entred in a form view of the first model. In this cas, should I decorate the compute function with api.depands ?
@@SamirSELLAMI compute field or onchange function
Hello, I was wondering if ypu know how to use the base_external_dbsource module or if you know a way to use another database's table when accessing certain models. :)
You can install this module and after configuring it right. Once configured, i think, in a scheduled interval it will bring the data from the other db
help plz how i can repalce tax(amount_by_group) by custom mrp_tax in odoo 14 i tried a lot but not getting it
how to create a computed field for subtotal in invoicing, like calculating quantity, tax, price and show in the subtotal field
Using the above method in video, you can achieve this, did you tried it ?