www.numberspeaks.com

BLOG

Whitelist / Blacklist Amavis SpamAssassin Zimbra 8.6

Sometimes SpamAssassin scores email as False Positive spam, to avoid incoming emails to get junked, we can define globally in the config file /opt/zimbra/conf/amavisd.conf.in domain with a initial score. To whitelist a domain we add domain with a negative score: To blacklist a domain we add domain with positive score: To apply the modification restart Amavis: Now from the source of incoming emails we can see when it’s coming from mydomain.com the initial score is -3 and spammer.com is 5.

Create scheduled actions Odoo 9

Scheduled actions can be set by adding this code in your xml file. This exemple will call the function schedule_action from the model hr.employee and send a notification by email if the boolean enable_send_notification is True. This model inherits hr.employee and defines 1 additional field, and 2 additional functions. send_notification is sending email based on the the template my_module.email_hr_employee_notification, see this post how to create email template with xml, schedule_action is the function called by the scheduler.

Add menu in dropdown list on tree view – Odoo 9

To add an additional menu in action dropdown list on tree view, we need to register “ir.actions.server” and “ir.values” on the qweb/xml file as follow. Note that code field name is using old Odoo python API. In your sale order model create the method as bellow with Odoo new API. Restart odoo and upgrade your module, you’ll have now cancel menu on your sales order tree view.

Additional measure in Odoo graph view

  This article will help you to add measures in graph view, my exemple is based on sale order model, for all additional computed fields, attribute store must be set to True, otherwise you won’t be able to choose it from the dropdown list measure in graph view. When grouping, you might want to calculate on some fields the average instead of the sum, if so, you need to use group_operator = ‘avg’ directly in your model file, see margin_percent field bellow. Find the view_id of your graph view and inherit from it. then place your new field as measure …

How to use datetime in Python

  Exemple 1 : subtract 2 dates run the command. Exemple 2 : add or subtract days to a date run the command. Exemple 3 : today date Exemple 4 : convert string to datetime Exemple 5 : convert datetime to string