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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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?
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
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:
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).
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)
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.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Oct 24
|
1695 | ||
|
2
Oct 24
|
3047 | ||
|
1
Jul 24
|
2302 | ||
|
0
Jun 24
|
1179 | ||
|
2
Feb 24
|
2737 |