Code Monkey home page Code Monkey logo

Comments (15)

hbrunn avatar hbrunn commented on July 18, 2024 2

Ask your favorite Odoo programmer to quote this new feature for you, and let them do it if you like their offer

from server-tools.

sebalix avatar sebalix commented on July 18, 2024

Hi Wim,

If you do not need to log everything starting from a specific method, you can control the log creation with the context key auditlog_disabled. Auditlog itself uses it to not log its own operations (https://github.com/OCA/server-tools/blob/8.0/auditlog/models/rule.py#L213).

Another feature I would like to add is to choose the log level for each rule:

  • Full log: make a snapshot of the data before/after the CRUD operation and logs the difference, as it is now. It is slow, but even computed fields are logged if they change.
  • Fast log: just log the vals dictionary for write and create operations. There is no snapshot of the data before/after, so it should be very fast.

from server-tools.

wim-a avatar wim-a commented on July 18, 2024

Thanks, Sébastien, I'll change my own module for auditlog_disabled.

I like fast log feature (certainly for some of the models), would it be a big change to the existing module?

About the full log and computed fields, do you mean that also not-stored computed fields are logged?

from server-tools.

hbrunn avatar hbrunn commented on July 18, 2024

@wim-a technically, he does a read() on all records twice, so yes, if you have expensive computed fields, they are probably the culprit. If you have control over the code and are not interested in the computed fields anyways during logging, check for the context key @sebalix mentions in your function and do nothing then.

Make sure you use a version with #301 (merged to main branch three weeks ago) merged, this eases the pain already a lot in some cases.

The fast log sounds like a very good idea, I don't think that costs more than a couple of hours to implement.

from server-tools.

wim-a avatar wim-a commented on July 18, 2024

Thanks for the info, Holger. How can we proceed for having the fast log feature available?

from server-tools.

wim-a avatar wim-a commented on July 18, 2024

Sébastien, Holger,

I've modified the code of the auditlog module on my server for fast logging.

In this version, it works as follows:

  • The auditlog_rule table has an additional field action_rule in which the system administrator can define if this model is full or fast logged.
  • For each action (create, read, write, unlink), there are now 2 patch methods defined, one for full logging, and one for fast logging.
  • In case of fast logging, only the vals data is written to the log line.

After making this change, and defining all of my logged models as fast logged (which is currently the default value), my own process, which was running 90 minutes with full logging, is getting back to 2 minutes (as with the auditlog module uninstalled).

I'll send you a tar file with this version of the module. If you want, you can apply these changes also in published version of the module.

Best regards,

Wim

from server-tools.

hbrunn avatar hbrunn commented on July 18, 2024

@wim-a how about a PR? It's simple, just follow steps 4 and following from https://odoo-community.org/page/code

from server-tools.

sebalix avatar sebalix commented on July 18, 2024

I received your tar.gz (but no time to look at it now). If you are not familiar with Git/GitHub process, I will create it later with your development.

Thank you

from server-tools.

wim-a avatar wim-a commented on July 18, 2024

I’m not familiar with it. It would be good that you also review the code. Maybe you want to do some things another way.

From: Sébastien Alix [mailto:[email protected]]
Sent: Wednesday, January 27, 2016 11:05 AM
To: OCA/server-tools [email protected]
Cc: Wim Audenaert [email protected]
Subject: Re: [server-tools] Odoo runs much slower with auditlog module installed (#339)

I received your tar.gz (but no time to look at it now). If you are not familiar with Git/GitHub process, I will create it later with your development.

Thank you


Reply to this email directly or view it on GitHubhttps://github.com//issues/339#issuecomment-175523994.

from server-tools.

sebalix avatar sebalix commented on July 18, 2024

Indeed, there will be a code review, this step is mandatory to push updates to OCA modules.

from server-tools.

hbrunn avatar hbrunn commented on July 18, 2024

I didn't receive any code, but if @sebalix has it, that's good enough. You should give explicit permission to publish your code as AGPL with the OCA modifications (cf https://odoo-community.org/page/faq, heading 'Licenses & CLA'), otherwise, we can't integrate it with the standard code

from server-tools.

hbrunn avatar hbrunn commented on July 18, 2024

meanwhile, I close this issue as it seems to be resolved

from server-tools.

wim-a avatar wim-a commented on July 18, 2024

I give you permission to publish my code.
Best regards,
Wim

from server-tools.

dreispt avatar dreispt commented on July 18, 2024

@wim-a I think signing the CLA is mandatory: https://odoo-community.org/page/cla
You should considering investing few hours trying a Git PR. As a programmers these are skills that you will need sooner nor later. Remember that we are here to help.

from server-tools.

vcloud9ray avatar vcloud9ray commented on July 18, 2024

FYI #974 - auditlog - log_id on table auditlog_log_line is missing an index - DELETE WON'T FINISH due to missing index.

from server-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.