Hi @oscarQ .. thank you.. I just test it and all messages printed in console.. by the way.. this next question may out of this topic:
I try to extend a base method for creating a new record in db like this:
@classmethod
def create(cls, record):
"""
Override the save method to add custom logic before saving records.
"""
logger.info(">>>>>>>>>>>>>>>> SAVING USER TIMESHEET", record)
And it throws error, maybe because I override the model’s create method.. my question:
How can I override this method to implement my new logic.. but still continue its function which is creating new record in table?
Sorry for this newbie question
It would be helpful if you could share the specific error message you’re encountering; this would make it easier to understand the issue and assist you effectively.
That said, the approach to overriding the create method depends on the version of Tryton you’re using. In recent versions, the method for customizing record creation has evolved.
You can find more details in this discussion:
Additionally, this commit illustrates the transition from the old method to the new approach:
Let me know your Tryton version, and I can provide more specific guidance.
Also, since this topic differs from your original question about console logging, it might be beneficial to start a new discussion thread. This approach keeps topics organized and makes it easier for others to follow and contribute.