All the translation files from the email_template module are merged into the mail module.
Comments are untouched because there are extracted from the .pot file
crm_lead:
overwritte create and write from crm_lead to force assign_date to be computed according to the field user_id is updated.
Else when the assignation was done manually, this field was not updated and so the lead not added in the instant pipe from the saleman (section_user)
sales_team:
Add context when assignation is done by cron to avoid to spam the sales. Notification of assignation will be only done via a log on the lead/opportunity.
Don't force to write assign date since write of crm_lead is overwritted to do it
Misc improve - check that leads exists before to make useless call to browse/write on nothing
Move section_user before the use of this one in a many2many, else demo data are not installable because field id is never created in db. (same 'issue' that https://github.com/odoo/odoo/issues/2386)
Add a cron to compute score each hours
Add merge pageview and merge (clean) score when we merge opportunities via merge_opportunities/merge_dependencies
Score the lead after the assignation to salesteam. Because when we assign to salesteam, sometimes we call the method merge_opportunities which one delete old scores on this lead, all score rules needs to be recomputed since the fields have been updated. So we compute now the score not at starting, but between assignation to salesteam and salesman.
Avoid messing up actual output with logs. Useful when using odoo shell in a
pipeline. Example:
echo "for i in env['res.partner'].search([]): print i.email" | ./odoo.py shell -d master | xargs -n1 echo cmd
Unify and refactor exception handling in framework and addons.
The generic `except_osv` is now deprecated, and replaced by more specialized exception subtypes:
- `UserError` (renamed from Warning, as it conflicts with the built-in `Warning`) raised when a non-technical error occurs during a business operation. It could be a missing information in the data provided by the user, or a misconfiguration.
- `AccessError`: raised when any operation is denied because the user conducting it does not have the required access rights.
- `AccessDenied`: raised when an operation that requires authenticated access is attempted via an unauthenticated request.
- `MissingError`: raised when an operation is attempted on a record that does not exist.
- `ValidationError`: raised when an operation violates a SQL or Python constraint.
- All other exceptions are internal errors due to a system problem or bug, and raised untouched to the client-side, which should display a traceback.
All exceptions take a single message argument.
The `test_exceptions` module has been updated to showcase both new and old (deprecated) exceptions.
A great many old `except_osv` had a useless title with "Error!" or "Warning", those have been removed, as this is handled by the client-side widget that displays the messages.
This commit introduces a more consistent policy for logging errors and warnings:
- All messages that do not require administrator attention should be logged at INFO level or lower. This includes all errors that are notified to the user in a friendly manner, even for access right problems or validation errors during business operations.
- All messages that indicate a likely misconfiguration or malicious use by the users should be logged at WARNING level, as they typically require administrator attention.
- All other unhandled internal errors cannot typically be handled by the user and should be logged at ERROR or higher level, as they require immediate administrator attention.