Commit Graph
87 Commits
Author SHA1 Message Date
Goffin Simon 0fd773a486 [IMP] Cleanup and refactoring of exception handling
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.
2015-01-16 17:15:18 +01:00
Julien De Coster d88c34d11e [IMP] Mass mailings send in cron
1. The merge of the "email_template" module into the "mail" module.
2. The send action of the mass mailing has been moved from the frontend to a cron, because it was too slow to send over 10,000 mails (the user's browser was blocked for 15 - 20 minutes). Mass mailings have now their own process in the kanban view.
3. Mails sent from the mail form are sent immediatly instead of from the mail queue (for instance, when you go to sales > customers > list view > select 2 -3 customers > More > Partner Mass Mailing).
4. Users have now the choice from which mailing list they want to unsubscribe when they click on the unsubscribe link at the bottom of the mail.
5. Mass mailings inherit from their campaign UTMs and mass mailing campaigns are linked to an UTM campaign.
6. Many little improvements
2015-01-07 18:01:58 +01:00
Denis Ledoux 32f8a18dbf [FIX] auth_signup: refresh is no longer needed with the new api
Besides, it leads to a invalidation of the cache, which is not needed here.
2014-10-20 17:06:30 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
Olivier Dony 4d74d9ef53 [FIX] auth_signup: discard signup values that may overwriting existing info 2014-06-30 12:02:35 +02:00
Christophe Simonis d93b79e6f4 [MERGE] forward port of branch saas-3 up to revid 9345 dle@openerp.com-20140324110349-e82t1bmmtjqbl85k
bzr revid: chs@openerp.com-20140324133811-4az1kvbznd26seow
2014-03-24 14:38:11 +01:00
Fabien Meghazi 9684f07735 [FIX] signup_url_for_action(), use redirect url parameter and bring back action in fragment
bzr revid: fme@openerp.com-20140311205337-9vasnqx5cudbk3f3
2014-03-11 21:53:37 +01:00
Fabien Meghazi 2868e9a6ac [MERGE] upstream
bzr revid: fme@openerp.com-20140227101725-7egd9xq859jasnhj
2014-02-27 11:17:25 +01:00
Christophe Simonis 266adaa44c [FIX] auth_signup: wrap the creation (copy) of the user inside a savepoint to keep the cursor alive in case of postgresql exception
bzr revid: chs@openerp.com-20140218124115-39j7vi3l8z6qqh2u
2014-02-18 13:41:15 +01:00
Christophe Simonis 35439fc864 [FIX] auth_signup: duplicated login must not generate 500 errors
bzr revid: chs@openerp.com-20140218121726-sm266vfhe44qsfro
2014-02-18 13:17:26 +01:00
Fabien Meghazi bce084bac2 [IMP] Seperate signup and reset into two controllers and templates
bzr revid: fme@openerp.com-20140205183232-fmlin6kiycu6bu0j
2014-02-05 19:32:32 +01:00
Raphael Collet d6855c0bcb [FIX] auth_signup: fix wrong use of ir_model_data.get_object()
bzr revid: rco@openerp.com-20140123112014-0np3ayfhgk8nk5jv
2014-01-23 12:20:14 +01:00
Fabien Meghazi fff55213b5 [IMP] auth_signup converted to server side module
bzr revid: fme@openerp.com-20140121152027-7wch4r7dt2ew0did
2014-01-21 16:20:27 +01:00
Fabien Meghazi c3f7ab7ddd [WIP] auth_signup
bzr revid: fme@openerp.com-20140117141806-r6f1dejdcg7ii1e0
2014-01-17 15:18:06 +01:00
Thibault Delavallée d9343e2d27 [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20131213094016-ylqkilyo4190g81w
2013-12-13 10:40:16 +01:00
Christophe Matthieu fd2821086f [MERGE] sync with trunk
bzr revid: chm@openerp.com-20131202150925-eqsi0uu0fqtwimhj
2013-12-02 16:09:25 +01:00
Fabien Pinckaers ed7623fc45 [IMP] Performance improvement: improved cache with context, better get_object
bzr revid: fp@tinyerp.com-20131130154659-uqis34x2cemmocly
2013-11-30 16:46:59 +01:00
Christophe Simonis 06e0b3045a [FIX] auth_signup: no alias for signuped users
bzr revid: chs@openerp.com-20131129130958-e89ex1psthcckcgt
2013-11-29 14:09:58 +01:00
Christophe Simonis 1e2cf5c245 [FIX] auth_signup: do not send set_password email at user signup
bzr revid: chs@openerp.com-20131126161658-9yvocjcrvbvqc51l
2013-11-26 17:16:58 +01:00
Olivier Dony c02afb45fa [MERGE] Forward-port of bugfixes from saas-1 series up to rev.8759 rev-id: odo@openerp.com-20130820152607-0p0fx87v1rqhk3vy
bzr revid: odo@openerp.com-20130820165258-3mjzbo990xg44dfu
2013-08-20 18:52:58 +02:00
Olivier Dony 788eb29237 [MERGE] Forward-port of 7.0 bugfixes up to rev.9369 rev-id: launchpad_translations_on_behalf_of_openerp-20130820051502-deoiql3lru7goosd
bzr revid: odo@openerp.com-20130820152607-0p0fx87v1rqhk3vy
2013-08-20 17:26:07 +02:00
Denis Ledoux 6c25b2df25 [FIX]auth_oauth: auth_oauth handle oauth error 3, auth_oauth_signup raise accessdenied instead of signuperror, auth_signup use literal_eval instead of safe_eval
bzr revid: dle@openerp.com-20130809145506-agzyvk8m1pr858jf
2013-08-09 16:55:06 +02:00
Martin Trigaux ccb38117ee [MERGE] Forward porting of saas-1 until rev 8739
bzr revid: mat@openerp.com-20130605090453-e4mg37kms5j1r18n
2013-06-05 11:04:53 +02:00
Thibault Delavallée 27839fead3 [CLEAN] auth_signup, mail_mail: better management of exceptions when sending emails, delegated to mail_mail.
bzr revid: tde@openerp.com-20130604151508-7bd8gxhkr86fuybp
2013-06-04 17:15:08 +02:00
Thibault Delavallée 87ca825ae1 [IMP] auth_signup: now manage assertionerror, especially when having a login / email that is not valid.
bzr revid: tde@openerp.com-20130531092606-q2gwhtd8j2lva3yo
2013-05-31 11:26:06 +02:00
Thibault Delavallée c93c8935ad [IMP] mail: now may raise exception instead of just logging it. They are used in auth_signup to avoid having the process considering the invite/reset password email was sent when it was not.
bzr revid: tde@openerp.com-20130524114857-8wy5uob23i2d6b6p
2013-05-24 13:48:57 +02:00
Olivier Dony 710d2a37cc [MERGE] auth_signup, portal: fix error handling when granting portal access + always send notification message including signup URL
bzr revid: odo@openerp.com-20130522105332-nl2gq346nb95wbru
2013-05-22 12:53:32 +02:00
Thibault Delavallée 16ea25646e [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20130515083000-3b033tyihxmubykh
2013-05-15 10:30:00 +02:00
Thibault Delavallée a027590d6e [CLEAN] Some code cleaning about context management
bzr revid: tde@openerp.com-20130515082939-oediun6cb9wd87lh
2013-05-15 10:29:39 +02:00
Quentin (OpenERP) 429ef87172 [MERGE] accounts* modules: forward port of revision 9033 of addons v7 that was passing 'account_period_prefer_normal=True' in the context in each and every call to account_period.find(). The behaviour is modified in order to search only on normal periods by default
bzr revid: qdp-launchpad@openerp.com-20130418094147-q2ks4w47sn4fxdv2
bzr revid: qdp-launchpad@openerp.com-20130418103907-0qom5yfcq8osnovp
2013-04-18 12:39:07 +02:00
Christophe Matthieu 329459237f [FIX] auth_signup: if not context: context = {}
bzr revid: chm@openerp.com-20130416103002-sdbrpbnwxkx0qcpw
2013-04-16 12:30:02 +02:00
Olivier Dony 05d0c3cb48 [FIX] auth_signup: upon signup of new user, the company_id[s] of the corresponding partner must be used
The default was to use those of the template user,
which may not be correct in multi-company cases.

bzr revid: odo@openerp.com-20130415173901-sevyy27244m6iks0
2013-04-15 19:39:01 +02:00
Christophe Matthieu 177f51cb54 [IMP] auth_signup: change reset_password to no_reset_password context value
bzr revid: chm@openerp.com-20130410130244-3ef6mpw6s09xjn75
2013-04-10 15:02:44 +02:00
Christophe Matthieu 53c1b28ace [IMP] res_user: Don't raise if there are no outgoing server
bzr revid: chm@openerp.com-20130327132101-fxbgemek27hv93li
2013-03-27 14:21:01 +01:00
Quentin (OpenERP) 2b64c79c3d [MERGE] forward port of fixes made in v7 addons branch up to revision 8872
bzr revid: qdp-launchpad@openerp.com-20130318122717-qptmntn26bx4wn8r
2013-03-18 13:27:17 +01:00
Fabien Meghazi 659c5f0059 [REM] Removed one state
bzr revid: fme@openerp.com-20130314160141-5hrurkcy4w3wc4ca
2013-03-14 17:01:41 +01:00
Fabien Meghazi dbfff7d213 [MERGE] 7.0
bzr revid: fme@openerp.com-20130314155944-hhfaoiu31i8716tn
2013-03-14 16:59:44 +01:00
Fabien Meghazi 3c8dbf0ad5 [FIX] Fixed infobox attrs
bzr revid: fme@openerp.com-20130314115028-f2x6is15jmicaumc
2013-03-14 12:50:28 +01:00
dle@openerp.com 410bb553c2 [IMP]auth_signup: state wording
bzr revid: dle@openerp.com-20130314114130-ljeha8ys7vhdmf4y
2013-03-14 12:41:30 +01:00
Fabien Meghazi 38e9b66af9 [REM] Removed reset_password notification
bzr revid: fme@openerp.com-20130313162651-614fv1kefo46jszw
2013-03-13 17:26:51 +01:00
Fabien Meghazi 00eb6837dd [ADD] Added res.users auth_signup infobox for reset password
bzr revid: fme@openerp.com-20130313162045-zuzl2p2ooijjmvl6
2013-03-13 17:20:45 +01:00
Antonin Bourguignon 75f80571df [IMP] introduce two examples of use of the new get_config_warning() helper
Typical use: self.pool.get("res.config.settings").get_config_warning(cr, _("Excpt message"), context)
More documentation and examples in res_config.py doc (see method get_config_warning())

bzr revid: abo@openerp.com-20130214173413-lm4jm86eolinwz69
2013-02-14 18:34:13 +01:00
Antonin Bourguignon 496a580335 [IMP] let the code breathe
bzr revid: abo@openerp.com-20130214173156-e2o3ovrg6t8et90g
2013-02-14 18:31:56 +01:00
dle@openerp.com bd2aa9bc32 [FIX]Bug: Forgotten password Nonetype has no object get
bzr revid: dle@openerp.com-20130131120834-czexk26wrmvk99i2
2013-01-31 13:08:34 +01:00
dle@openerp.com b1c6ae39a2 [FIX]Set password mail on user create (auth_signup)
bzr revid: dle@openerp.com-20130122145925-xmf04tevib4fj4lc
2013-01-22 15:59:25 +01:00
Thibault Delavallée c7a865754d [IMP] auth_signup: added a model parameter for generating URLs. Portal: improved code and url generation for links in send emails.
bzr revid: tde@openerp.com-20130104113241-z4go3ac6qtl23ke8
2013-01-04 12:32:41 +01:00
vta vta@openerp.com 8a27d3d138 [IMP] Show notification when sending a reset password mail
bzr revid: vta@openerp.com-20130102101805-xnh9ixoo8b3yc14i
2013-01-02 11:18:05 +01:00
vta vta@openerp.com 821ac67536 [FIX] Do not raise exceptions in action_change_password
bzr revid: vta@openerp.com-20121231153850-v9tncegddfruohsi
2012-12-31 16:38:50 +01:00
vta vta@openerp.com a9e53f724f [FIX] Fix reset password token issue
bzr revid: vta@openerp.com-20121231150239-oeuvnwbpsvyzh5v5
2012-12-31 16:02:39 +01:00
Antony Lesuisse 6e0cd39df6 [MERGE] auth password wizard
bzr revid: al@openerp.com-20121220170950-hyrws7c67qjgpxl5
2012-12-20 18:09:50 +01:00