Commit Graph
52 Commits
Author SHA1 Message Date
Xavier Morel cb3b3f54ca [FIX] auth_signup: bulk signup_url generation
When calling `_get_signup_url_for_action` on more than one partner,
because the `url` input parameter was re-used for the actual signup
URL before assigning to the partners map (in
559bdc976e), from the second iteration
onwards the signup URL will almost certainly get misgenerated to
redirect to the previous signup URL (accumulating).

As `signup_url` is not normally accessed in bulk this should not
usually be an issue.

Reported by Andreas Brückl

closes odoo/odoo#78223

X-original-commit: 4d9b23f60087e0e8ffcb85498f39324854f50cb8
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-10-12 12:56:59 +00:00
std-odoo f3baf3816f [FIX] auth_signup: check user group in "signup_get_auth_param"
Task-2250264

closes odoo/odoo#56569

X-original-commit: 63d21db477e5b29c4c5173f18208348d6df617e0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-08-26 09:38:47 +00:00
Martin Trigaux ba244cef01 [IMP] *: replace to new _() syntax
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))

Old syntax is still compatible but starts the migration to the new
syntax that catches error.
2020-06-18 13:03:34 +02:00
Goffin Simon 0ff961039c [FIX] auth_signup: Server Error when sending message on task with portal
- Let's consider a product P (invocing policy based on timesheet and creating new task)
- Create a quotation with the product P for a customer with portal access CPU
- Confirm it (A new task T is created)
- Go to T and add a follower (who is another portal user PU (third party)) in the task
  but uncheck the box to send him an email
- Connect to the portal with PU
- Go to T and send a message

Bug:

A server error was raised.

opw:2270074

closes odoo/odoo#52689

X-original-commit: 2a924b44f17f7e9574e2b0074d8ce8adb041c67e
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-06-09 11:09:21 +00:00
Goffin Simon 0d569c8117 [FIX] auth_signup: 403 when sending message on task with portal
Steps to reproduce the bug:

- Let's consider a product P (invocing policy based on timesheet and creating new task)
- Create a quotation with the product P
- Confirm it (A new task T is created)
- Go to T and add a follower (who is a portal user PU) in the task
  but uncheck the box to send him an email
- Connect to the portal with PU
- Go to T and send a message

Bug:

A 403 error was raised

opw:2239844

closes odoo/odoo#51953

X-original-commit: c7e864e039dd2c948a5c61df29052313c6a659ce
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-05-27 08:44:58 +00:00
Christophe Simonis d67b2483e5 [MERGE] forward port branch saas-12.4 up to 9ed4872ea0
closes odoo/odoo#37372

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-24 17:45:37 +00:00
Christophe Simonis ac4fc6e7c7 [MERGE] forward port branch saas-12.3 up to bd3e510edb
closes odoo/odoo#37314

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-24 09:44:56 +00:00
Goffin Simon d3d21d2a64 [FIX] auth_signup: Not possible to send message in a task from the portal
Steps to reproduce:
- Let's consider the portal user Pu, the project Pr and the task Ta
- Add Pu as a follower of Pr
- Log as Pu and open Ta
- Try to post a message

Bug:

An access error was raised due to the rule "res_partner: portal/public: read
access on my commercial partner".

opw:2070320

closes odoo/odoo#36960

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-09-17 13:07:20 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
559bdc976e [ADD] website_sale: adds a complete ecommerce tour/flow
This commit adds `website_sale_tour` test which is testing the whole ecommerce
flow.

This tour will test b2b and b2c flow using public user, tests website sale
flows with tax included and tax excluded price. Also test address management.

Also, the signup URL needed to be modified as PhantomJS run all tour on domain
127.0.0.1 but ignup button has absolute URL.
Runbot stores next step to be executed on `localStorage` and due to domain
name change during tour execution, it will lose track and runbot will fail.

Closes: #24179
Task-1829827

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>


Co-authored-by: Ravi Gadhia <rga@odoo.com>
Co-authored-by: Mohammed Shekha <msh@openerp.com>
2019-05-16 05:41:21 +00:00
Christophe Simonis 71faa19af0 [MERGE] forward port branch saas-12.1 up to 2b3296bbf8 2019-03-11 14:42:34 +01:00
Christophe Simonis 2c5c9b8342 [MERGE] forward port branch 12.0 up to c023d0784f 2019-03-08 17:56:14 +01:00
Christophe Simonis 0e7675847f [MERGE] forward port branch saas-12.1 up to 0f4abc5c22 2019-02-22 16:25:02 +01:00
Sébastien Theys c1be1993f9 [FIX] *: share URL on the correct website if possible
* = base, auth_signup, mail, portal, sale, website, website_sale

Before this commit, sending an object by email would always link to web.base.url
even if the object was created from a specific website.

Now if the object has a website, we use the URL of that website if it is set.
The fallback will always be on the web.base.url.

opw-1921030
PR: #30000
2019-02-06 09:50:38 +00:00
Thibault Delavallée 970cb47f57 [IMP] auth_signup: allow direct URL redirection instead of action when computing signup URL
Purpose of this commit is to improve the redirection done after signup.
Currently everything is tailored to create an Odoo action (action, model,
res_id, ...). This action is used to forge an URL that is the redirection
URL after signup. In some cases you would like to directly give the redirection
URL when no Odoo standard action is involved.

An example of use is the redirection when subscribing to take a survey. We
want customers to be back on survey that is a frontend URL, not a backend
URL linked to an action.

This commit is linked to task ID 1932508 and PR #30508.
2019-01-25 13:11:46 +00:00
Christophe Simonis 4b8bd36219 [MERGE] forward port branch saas-11.3 up to bab2a191d2 2018-11-16 15:39:02 +01:00
Christophe Simonis 15f686eef6 [MERGE] forward port branch 11.0 up to 468dab6748 2018-11-15 20:39:10 +01:00
Christophe Simonis 468dab6748 [MERGE] forward port branch saas-15 up to 3c78026dc0 2018-11-15 18:57:09 +01:00
Christophe Simonis 5523e6b1c9 [MERGE] forward port branch 10.0 up to 8a9569b31e 2018-11-15 17:00:52 +01:00
mao-odoo 8a9569b31e [FIX] auth_signup: Error when sending quotation
Fine tuning of this commit:https://github.com/odoo/odoo/commit/7501691da9a9dae832b7d6e78c6a5f57fc983b5c
Fields signup_token, signup_type, signup_expiration are protected
When sending a quotation (mail template 'Sales Order - Send by Email'):
the token needs to be read (and sometimes written)

opw:1907157
2018-11-15 15:28:48 +01:00
Christophe Simonis afe0133302 [MERGE] forward port branch saas-11.3 up to 3e54704e66 2019-03-06 10:59:32 +01:00
Christophe Simonis 3e54704e66 [MERGE] forward port branch 11.0 up to 27081bf6f5 2019-03-05 17:26:04 +01:00
Christophe Simonis f1ff55bca1 [MERGE] forward port branch 11.0 up to de8cefcef4 2019-02-20 13:40:48 +01:00
Toufik Ben Jaa 19b0c7e1c1 [FIX] auth_signup: invalid value on field signup_valid for non superuser
- The field `signup_valid` was computed and stored using the `superuser`
  env, which causes issue since it means the value was computed for the
  wrong environment.

  Using a compute_sudo instead of manually calling `sudo()` fixes the
  issue.

  e.g: reading signup_valid using a regular user (non superuser) will
       always return False, while doing it as the superuser will return
       the correct value.

closes odoo/odoo#30954
2019-02-08 12:52:29 +00:00
Christophe Simonis b81c2bce84 [MERGE] forward port branch saas-11.4 up to 3c108977c1 2018-10-22 16:59:51 +02:00
Lucas Perais (lpe) 4e72669cc8 [FIX] auth_signup: compute signup_valid in sudo
Before this commit, the signup_valid field was miscomputed
probably due to some env mayhem.
Hence the banner with the link to reset the password was never shown

After this commit, the field is well computed, and the banner displays

OPW 1894390

closes odoo/odoo#27901
2018-10-17 14:30:22 +00:00
Toufik Ben Jaa 15f387fbe5 [FIX] auth_signup: invalid value on field signup_valid for non superuser
- The field `signup_valid` was computed and stored using the `superuser`
  env, which causes issue since it means the value was computed for the
  wrong environment.

  Using a compute_sudo instead of manually calling `sudo()` fixes the
  issue.

  e.g: reading signup_valid using a regular user (non superuser) will
       always return False, while doing it as the superuser will return
       the correct value.
2018-10-17 14:54:12 +02:00
Moens Alexandre a874858981 [FIX] auth_signup: incorrect use of compute_sudo
compute_sudo does not do anything when the computed field is not stored.
This fixes an issue where user not part of base.group_erp_manager
couldn't modify res.partner

opw-1942803
2019-02-21 12:59:31 +00:00
RomainLibert 3f2bc7b11f [FIX] various: adapt code to new datetime fields
Some code was still using the date and datetime fields as if they were
strings, but they are now dates and datetimes
2018-08-23 16:03:55 +02:00
Joren Van Onder 4f6ec1cd2a [IMP] website,*: support multiple websites
This implements support to administer multiple websites. Although the
core functionality already existed, managing multiple websites was
fairly technical.

In the interest of database updates and migration this attempts to
keep duplicated data to a minimum. To do this the usual generic
records are rendered unless some website-specific record exists that
replaces it. Copy-on-write (COW) is used to create these
website-specific records. Through this mechanism creating a
website-specific record is delayed until necessary. A COW mechanism
has been implemented on 4 models: ir.ui.view, website.page,
website.menu and ir.attachment. These COW mechanisms are activated
when editing data through the website (aka frontend). These frontend
edits (e.g. with web_editor) will be website-specific, possibly
creating a website-specific record when necessary. When editing data
in the backend nothing special will happen, even when editing a
generic record. Note that because of this mechanism also facilitates
the ability to create new, uncustomized websites because the generic
data is kept.

Support is provided for a website to have any theme. Themes are fairly
complex to handle. Standalone themes can depend on other standalone
themes (e.g. theme_beauty depends on theme_loftspace) and themes
usually modify some data of the themes they depend on. Because a theme
can be installed on multiple websites, using website_id m2o fields
does not work well. It would require duplicate data, making updates
and migration harder. Because of this, data for themes (ir.ui.view and
ir.attachment specifically) have a theme_id m2o. website has a
theme_ids m2m that identifies all theme modules currently installed on
it. Through these fields we figure out what to render. A theme is only
fully uninstalled when it's no longer active on any website. The
advantage of this approach is that upgrading or migrating theme data
is no different from the single-website case.

The website.published.mixin class was modified to handle multiple
websites. A wizard was added in the backend to easily manage this for
multiple website.

Although not used anywhere in this commit, a 'website_id' variable has
been added in the evaluation context of ir.rule. It allows to easily
make any model multi-website aware, all that's needed is a custom
website_id m2o field on a model and a custom record rule.
2018-08-13 19:51:10 +02:00
Christophe Simonis cdef8740ec [MERGE] forward port branch 11.0 up to 252bc396b4 2018-08-09 11:10:38 +02:00
Jigar A d92f17cebe [FIX] signup: allow non-admin to invite portal users 2018-08-08 23:44:40 +02:00
Christophe Simonis efe2dcd7ae [MERGE] forward port branch 11.0 up to ced9156a97 2018-08-07 19:08:07 +02:00
Christophe Simonis 0c5cbbe0bb [MERGE] forward port branch 10.0 up to 692a32e780 2018-08-07 16:54:18 +02:00
Nicolas Martinelli cbce126425 [IMP] auth_signup: hide unusable field from users
The token field is a technical data that the other users are not able to use.
It may be confusing for users to see token on the user interface.
Still show it to administrator for debug reasons.
2018-07-16 14:35:20 +02:00
Nicolas Martinelli 7501691da9 [IMP] auth_signup: hide unusable field from users
The token field is a technical data that the other users are not able to use.
It may be confusing for users to see token on the user interface.
Still show it to administrator for debug reasons.
2018-07-16 14:35:20 +02:00
Christophe Simonis 1655202924 [MERGE] forward port branch 11.0 up to 59a8a1cd8e 2018-05-17 13:19:49 +02:00
Christophe Simonis 9874adebb8 [MERGE] forward port branch saas-15 up to 40e74240e8 2018-05-16 17:48:37 +02:00
Christophe Simonis a1a03792b6 [MERGE] forward port branch 10.0 up to bcf20cfbec 2018-05-16 17:10:28 +02:00
len-odoo 47cc4fbbab [FIX] auth_signup: add missing dependency on the computation of the signup validity
The field signup_valid is a non stored computed field based on signup_token.
The cache is filled with prefetched values, so in a loop the field is read from
the cache and not recomputed due to the missing dependency.

opw 1843442
2018-05-16 09:01:14 +02:00
Richard Mathot a18bd499ac [REF] various: convert res.config.settings to use ir.config_parameter integration
This commit updates the various res config of Odoo addons to use the
newly-introduced config_parameter field attribute.
2018-01-16 13:34:29 +01:00
Olivier Dony 695716efb0 [FIX] P3: remove pycompat.{keys,items,values} helpers
Now that we're closer to switching to P3 for good, these helpers have
outlived their usefulness, and mostly add noise.

All remaining dict.iter*() or dict.view*() must be converted to the
normal keys(), values() or items() calls.

Whenever the result is likely to be used for more than the scope of a
loop, or when the dict needs to be modified during iteration, the calls
must be wrapped in a ``list()``, to protect the new P3 semantics.
Those cases are very exceptional.

Also removed some dead code or improved the API to remove unnecessary
conversions.
2017-08-20 23:25:54 +02:00
Darshan Kalola cfbbc236ae [FIX] auth_signup: access right issues
When another user than administrator opens the mail sending wizard there
is an access right issue. Indeed as sale mail links now contain auth_signup
parameter an access to allow_uninvited config parameter is done. However
this has to be done using sudo because classic users have no access to
config parameters. Fix related to e79eb01a67 .
2017-07-12 09:54:00 +02:00
Denis Vermylen 6977a363e4 [IMP] web, auth_signup: add signup and login values to session
When you receive an url with parameters

 * auth_signup_token: uuid
 * auth_login: login

those will be stored in the session and used

 * when the user will want to sign up in order to be linked to the right
   partner;
 * when he logs in so he's sure to log in with the right account +
   autofill is nice

This commit only adds the support, future commits will support its use.
2017-07-06 12:53:39 +02:00
Denis Vermylen 676022e3af [IMP] auth_signup: display meaningfull and translated error messages
Since 5425316eff errors when signing up will only display two
messages:

 * "Another user is already registered using this email address." or
 * "Could not create a new account."

While Odoo creates a multitude of other comprehensible error messages
such as

 * "Passwords do not match; please retype them."
 * "Signup token '%s' is no longer valid"

This commit now separate UserError and AssertionError from SignupErrors.
Those are still hidden in a general message (see 5425316eff for reasons) while
the other ones are fully displayed.

This commit also improves translations of messages.
2017-07-06 12:53:39 +02:00
Xavier Morel 01e3514147 [FIX] P3: urllib, urllib2 and urlparse
In Python 3, all of these were "consolidated" under urllib(.request,
.parse, .errors) which is inconvenient.

Since we already have hard dependencies on requests and
werkzeug(.urls, which is a backport of Python 3's unicode-aware
urllib.parse) migrate *everything* to that.

A sticking point is urllib2.URLError, those were (mostly) replaced by
the slightly more general IOError which URLError extends.
2017-05-15 12:26:30 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
xmo-odoo 2e6a589f41 [FIX] builtins removed from Python 3
* Reverse wrapper courtesy of @rco-odoo's original P3 branch
* thin compat module stripped down from werkzeug (to augment as needed)

issue 8530
2017-04-27 13:59:33 +02:00
Raphael Collet d0ca2d115e [REF] ir_config_parameter: remove group_ids and simplify
Add `sudo()` to call `get_param` where necessary, and make the web client use a
controller instead of directly accessing parameters.
2017-01-03 16:52:49 +01:00
Jérome Maes 4083f54600 [FIX] auth_signup : fix lost in migration
During the migration of auth_signup module
(https://github.com/odoo/odoo/commit/f0db2d72f71e2133f80c6cef0184029ee8e107bf#diff-0155b28f0b719dae20bc5492cf085c37L67),
when splitting file, a fix was lost
(31dc82face). It
allows portal use to access form view of their
document, using the mail/view controller.

This fix is now back, and will make the portal works again !
2016-04-08 13:46:37 +02:00