Hi thank you for the video. Can you explain the difference between the default_get fuction and the create fuction (above the def default_get in the patient.py)? Because as I see, the create function also sets the default value of 'note' field to 'New Patient' and sequential value for 'reference' field. Are these fuctions similar?
Oh I might understand now, correct me if I'm wrong. The default_get function gives us default value of a field when we click the 'Create' button in UI and we still can change that value before saving it. On the other hand, the create fuction gives us default value of a field when we click the 'Save' button, right?
What if you have a complex calculation to get the default value? For example like field One2many, you can't use the default attribute field. The default_get function can solve that problem
thank you for your videos it is amazing, i face a problem when i use default_get method @api.model def default_get(self, fields): print("override default get") error -----------------> (AttributeError: 'NoneType' object has no attribute 'get') can you explain why this error please.
Thank you for the good tutorial brother 🙂
welcome 😍😍😍😍
Hi thank you for the video. Can you explain the difference between the default_get fuction and the create fuction (above the def default_get in the patient.py)? Because as I see, the create function also sets the default value of 'note' field to 'New Patient' and sequential value for 'reference' field. Are these fuctions similar?
Oh I might understand now, correct me if I'm wrong. The default_get function gives us default value of a field when we click the 'Create' button in UI and we still can change that value before saving it. On the other hand, the create fuction gives us default value of a field when we click the 'Save' button, right?
@@hoangvunhat3600 thats right
you are right
What is the different with using default attribute in field model ?
What if you have a complex calculation to get the default value? For example like field One2many, you can't use the default attribute field. The default_get function can solve that problem
can you explain how to disable ACTION button for a group of users?
I cant change the default_get value in form
What issue you are facing ?
thank you for your videos it is amazing, i face a problem when i use default_get method
@api.model
def default_get(self, fields):
print("override default get")
error -----------------> (AttributeError: 'NoneType' object has no attribute 'get')
can you explain why this error please.
can i see the code that you have added
@api.model
def default_get(self, fields):
print("override default get")
Over ride it, I mean use super and add print in it
@@OdooMates
@api.model
def default_get(self, fields):
res = super(HospitalPatient, self).default_get(fields)
print(res)
---------------------------------------------------------------------------------
error still apear
@@OdooMates thank you very much for helping me, the cause of error is that i missed return statement