Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How to created a Log Note when a particulate field is updated?

Subscribe

Get notified when there's activity on this post

This question has been flagged
Studio
2 Replies
2775 Views
Avatar
Amir

Added a new field in Studio to a Delivery view and I want to record a line in the Log Note on that view every time anyone makes changes to that field.


Is there a way to do this from Studio?

0
Avatar
Discard
Avatar
Chris TRINGHAM
Best Answer

Yes - you should be able to change your new field to be tracked.  You can either find the field directly or from studio:



Then update the field definition:


You can't do this for standard fields, but there is a workaround

 

2
Avatar
Discard
Avatar
David Paw
Best Answer

Creating a log note when a particular field is updated in a system or database involves implementing a logging mechanism within your application or system. The exact steps may vary depending on the technology stack you're using, but here's a general outline of the process:

  1. Identify the Field to Monitor: Determine which field or fields you want to track for updates. This could be a user profile field, a configuration setting, or any other relevant data point.
  2. Database Design: If the field you're monitoring is stored in a database, ensure that your database schema has a structure to store the log notes. This may involve creating a separate table to store the log entries.
  3. Create a Log Table: If you don't already have one, create a table to store log entries. This table should include fields such as timestamp, user ID (if applicable), the field that was updated, the old value, the new value, and any other relevant information.
  4. Implement Triggers (if using a relational database): In relational databases, you can use triggers to automatically execute a set of instructions (such as inserting a log entry) when a specific event (such as an update to a certain field) occurs. Write a trigger that captures the necessary information and inserts a log entry into the log table.
    sqlCopy codeCREATE TRIGGER field_update_trigger
    AFTER UPDATE ON your_table
    FOR EACH ROW
    BEGIN
        IF NEW.updated_field acti https://www.finderlane.com OLD.updated_field THEN
            INSERT INTO log_table (timestamp, user_id, field_updated, old_value, new_value)
            VALUES (NOW(), NEW.user_id, 'updated_field', OLD.updated_field, NEW.updated_field);
        END IF;
    END;
    
    Note: This is just a simple example, and the actual implementation may vary based on your database system (e.g., MySQL, PostgreSQL, SQL Server).
  5. Implement Logging in Code (if not using triggers): If your application logic handles updates, incorporate logging directly into your code. When updating the field, add a step to log the change.
    pythonCopy codedef update_field(record_id, new_value, user_id):
        old_value = get_old_value(record_id)
        update_database(record_id, new_value)
    
        # Log the change
        log_entry = {
            'timestamp': current_timestamp(),
            'user_id': user_id,
            'field_updated': 'updated_field',
            'old_value': old_value,
            'new_value': new_value
        }
        insert_log_entry(log_entry)
    
  6. Testing: Thoroughly test your implementation to ensure that log entries are created only when the specified field is updated.

Remember to adapt these steps based on the specific technologies and frameworks you are using. Additionally, consider security measures, such as only allowing authorized users to update the monitored field and protecting the log entries from unauthorized access.


0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Creating and using an app created with Studio. Solved
Studio
Avatar
Avatar
1
Oct 24
2680
Add table in Tab with Studio
Studio
Avatar
Avatar
Avatar
2
Oct 24
4083
Odoo Studio hide field based on other Field Solved
Studio
Avatar
Avatar
1
Jul 24
3447
How to Add a Serial Number in Purchase Order Line Automatically when adding line in odoo studio (NO Access To Backend)
Studio
Avatar
0
Jun 24
2017
Error On creating field from odoo studio
Studio
Avatar
Avatar
Avatar
2
Feb 24
3739
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now