Вот пример переопределения использования метода Odoo
@api.model
def create(self, vals):
print "Values: ", vals
res = super(student_student, self).create(vals)
print "Result: ", res
audit_log_data={"user_id":self._uid,
"date":datetime.today(),
"student_info": self.id and (str(self.uni_no) + " " + str(self.name)),
"status": "create"}
# Create a student.audit.log object
self.env["student.audit.log"].create(audit_log_data)
return res
, но почему мы используем переопределение здесь:
res = super(student_student, self).create(vals)
В коде нет методов создания, уже объявленных с помощьюто же имя, это первый метод, так почему использовать переопределение