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.
This commit fixes lots of usability problems in the reporting views.
eg: missing fields in the reports, labelling inconsistencies, broken/outdated/unused filters and group bys...
Detailed changelist
-------------------
account/Invoice Analysis:
- "Product Category" vs "Category of Product": labelling consistency
- group by Analytic Account
account_voucher/Sales Receipt Analysis:
- remove filter on Pro-forma
crm/Lead & Opportunities Analysis:
- "Exp." vs "Expected": labelluing consistency
crm/Phone Calls Analysis:
- remove Todo and My Phone Call filters
- fix My Sales Team(s) filter
crm_claim/Claims Analysis
- remove My Case(s) filter
- fix My Company(s) filter
- remove group by Sales Team
- fix label Creation Month
crm_helpdesk/Helpdesk Analysis
- remove My Case(s) filter
event/Events Analysis
- remove My Events & Show Confirmed Registrations filters
- fix labelling of Attendee / Contact group by
hr_holidays/Leaves Analysis
- remove My Requests filter
hr_recruitment/Recruitment Analysis
- remove My filter
marketing_campaign/Campaign Analysis
- fix labelling
mrp_operations/Work Order Analysis
- add fields Product Template, Product Category, Responsible, Routing
and BoM
- fix labelling group by Planned Month
point_of_sale/Orders Analysis
- add fields Product Template, Invoiced, Point of Sale, Public Category,
Warehouse and Pricelist
- fix Year filter
project/Tasks Analysis:
- remove My Task filter
project/Issues Analysis:
- remove My Issues filter
- remove Task group by
purchase/Purchase Analysis:
- fix quantity field into float
- add fields Product Template, Product Category, Partner Country, Fiscal
Position, Analytic Account and Commercial Entity
- add group by Partner Country and Fiscal Position
- fix labelling "Product Category" vs "Category of product"
sale/Sales Analysis
- fix labelling "Product Category" vs "Category of product"
- add fields Product Template, Paid, # of Paid Lines, Partner Countru
and Commercial Entity
- remove filter My Sales
- add group by Partner Country
sale_stock/Sales Analysis
- fix label name of shipped_qty_1
Credits
-------
Analysis and code courtesy of Sébastien Versailles, Quentin De Coninck,
Yannick Tivisse and Richard Mathot {sve,qdc,yti,rim}@odoo.com
(congratulations if you've read this boring commit message)
- stage model (project.task.type): add fields holding the eventual specific
legends for kanban states and star (priority) management
- project: task now have labels; you may use project to hold trainings
instead of tasks.
- project form: use label field on tasks statinfo to use the label
- project.task form: use kanban state customization using states_legend option;
- project.task kanban: use kanban column and kanban state cuztomization
using group_by_tooltip and states_legend options
- project_issue: issues now have labels, like tasks.
- issue: same kanban custo as for tasks
- update data and demo data
[IMP] web: statinfo widget now take an optional label_field option allowing
to have strings coming from another field present in the form view
Models renamings:
- crm.case.stage becomes crm.stage
- crm.case.section becomes crm.team
Model split:
crm.case.categ has been splitted into:
- crm.phonecall.tag
- crm.lead tag
- crm.claim.tag
- crm.helpdesk.tag
Models removal:
- crm.payment.mode
- crm.segmentation
- report.crm.case
Removal of the crm_profiling module
(all these refactorings have been done in order to ease new API
migrations)
This is a workaround for an ORM limitation. A stored function field is
not updated when it should if the "source" field is also a stored function
field
- project kanban view: dashboard-like view, add sparklines for open tasks
and closed issues
- project: cleaned demo data, less stages
- project: description is now an html field
Indeed using fromkeys with a list / dict as argument leads to the creation
of shared list / dict. This could create some ugly side effects when
used in loops. This commit fixes or cleans this kind of statement to avoid
unwanted side effects.