Commit Graph
191 Commits
Author SHA1 Message Date
Christophe Simonis e3658d6f56 [MERGE] forward port branch saas-15 up to d44cd77884 2018-06-12 16:31:54 +02:00
Martin Trigaux 0780f10c54 [FIX] portal: use expected ID format
Introduced during forward port at 6a7db305
_company_default_get returns a res.company record, not an ID

opw-1855856
2018-06-06 11:19:37 +02:00
Christophe Simonis 017ee5eab3 [MERGE] forward port branch saas-17 up to 877e709871 2017-08-24 13:17:53 +02:00
Thibault Delavallée ea27c1b7a3 [MOV] website_portal, portal: move customer portal to portal module
This commit moves the whole customer portal to the portal module.
It now completely uses portal and http_routing features and is not
dependent on website anymore.

An override of web controller is added in portal in order to redirect
portal users to /my instead of /web. That way once having the customer
portal installed all share users are correctly redirected to their
account.

All modules defining customer portal templates and controllers are
updated accordingly.
2017-08-08 14:58:49 +02:00
Yenthe V.G 1a685089be [FIX] portal: untranslated error message
And specify which group is incorrect

Closes #17275
2017-05-29 17:01:46 +02:00
Fabien Meghazi 68a9a4ce54 [FIX] portal: fix regression of API migration in the portal wizard
Before the migration, send_mail() used to be called with an untainted
context but after the API migration it inherited the altered context
with active_test=False which caused subsequent calls to
ir.mail_server#connect() to fetch inactive records.
2017-04-11 12:28:34 +02:00
Jérome Maes 2b4eeb908f [MOV] portal,website_portal: move wizard and tests into website_portal
The goal is to prepare the removal of
'portal' module.

Converting a partner into a portal user,
though the wizard is moved in website_portal.

'base' will manage portal user and group, but if
website_portal is not installed, there is nothing
to display for portal user.
2017-03-23 09:59:58 +01:00
Christophe Simonis 6a7db30508 [MERGE] forward port branch saas-11 up to f23394b83a 2017-01-25 15:01:29 +01:00
Stefan Rijnhart d0ea652221 [FIX] portal: set a company for portal without one
The field company_id is not required on the res.partner and is used when the
portal user is created for portal access.
If the partner as no comapny set, the creation crashes (required on the user).

Use system default company, with possibility for overwrite.

Closes #15030
2017-01-24 13:39:47 +01:00
Christophe Simonis 81f59cee2c [MERGE] forward port branch saas-11 up to b844d93889 2017-01-02 14:38:59 +01:00
Christophe Simonis 3805eb620a [MERGE] forward port branch saas-6 up to 7be1a1c55b 2017-01-02 11:42:52 +01:00
Christophe Simonis 7be1a1c55b [MERGE] forward port branch 8.0 up to 2b8fcfc08b 2017-01-02 11:22:45 +01:00
Jairo Llopis 000d8eba12 [FIX] portal: allow to delete res.partner
Do these steps:

1. Create a partner.
2. Grant him portal access through *Actions > Portal Access Management*.
3. Delete the created user.
4. Delete the partner.

You will get this error:

```
Odoo Warning - Validation Error
The operation cannot be completed, probably due to the following:
- deletion: you may be trying to delete a record while other records still reference it
- creation/update: a mandatory field is not correctly set

[object with reference: Portal User Config - portal.wizard.user]
```

This happens because the wizard (which is a transient model) does not let the partner to be deleted.

With this patch, we avoid that bug.

Closes #12608
2016-12-19 17:26:31 +01:00
Christophe Simonis f1cb5179fc [MERGE] forward port branch 8.0 up to c7d9695 2016-08-25 11:07:14 +02:00
Christophe Simonis c7d9695f52 [MERGE] forward port branch 7.0 up to b431e6c 2016-08-25 11:02:01 +02:00
Jérome Maes 77f95a2aca [FIX] portal: bad ensure_one due to migration 2016-08-02 13:46:25 +02:00
Christophe Simonis f670b3b1df [MERGE] forward port branch saas-11 up to 3aea814 2016-07-29 15:33:51 +02:00
Goffin Simon 7e1b0792da [FIX] portal: creating a user portal for a partner
Steps to reproduce the bug:

-Create two companies A and B where A is the parent of B
-Admin is in A
-Demo is in B
-Create a partner P with Demo
-Create a user portal for P with Demo

Bug: Access error due to the fact that the user portal created for
P was created in SUPER_USER with company_ids and company_id set with
the same inforamtions as with Admin.

Fix: company_ids and company_id must be set with the company of Partner P

opw:682930
2016-07-26 13:26:59 +02:00
Christophe Simonis cfb0c0dead [MERGE] forward port branch saas-11 up to 7ae5121 2016-07-25 17:17:15 +02:00
Christophe Simonis 7df4ea5b57 [MERGE] forward port branch 8.0 up to 43cff22 2016-07-25 14:07:50 +02:00
Olivier Dony acc531a9d7 [FIX] portal: avoid users sharing non-portal groups 2016-07-25 13:07:29 +02:00
Olivier Dony 8596a4ccaa [FIX] portal: avoid users sharing non-portal groups 2016-07-25 13:06:31 +02:00
Olivier Dony 3ff242ec0c [FIX] portal: avoid users sharing non-portal groups 2016-07-25 13:05:01 +02:00
Rutul Raval a9d11f1175 [MIG] portal : migration to new api 2016-05-31 14:16:58 +02:00
Jérome Maes d60e040096 [MOV] portal : reorganize module directory 2016-05-31 14:16:58 +02:00
Denis Ledoux 11911fe057 [FIX] portal: portal access management for partners having users
When the partner already had a user,
checking `in_portal` of this partner and applying
the wizard raised the fact there was already a duplicated
user for this email, even if there wasn't.

This is because the system relied on the fact
the field `user_id` of the `portal.wizard.user`
was automatically filled with the partner user if
there was one, but it was not the case:
This `user_id` field is a simple many2one field,
not computed, and the assignation was done nowhere
when the partner already had a user.

The assignation should be done in the `onchange_portal_id` method
of the `portal.wizard` model, like the other fields
`partner_id`, `email` and `in_portal`,
but if we do it know, as the `user_id` field is not
in the view (not even in `invisible`), the
web client will ignore it even if returned by
this `onchange_portal_id` method. It was therefore pointless
to solve this issue by adding the correct `user_id`
in the `user_ids` returned by this onchange method.

We could add `user_id` in invisible in the view,
but existing databases with the current view
will not benefit of the bug fix without updating the according view.

This revision therefore replaces `wizard.user_id` by
`wizard.partner_ids.user_ids[0]` everywhere where it's needed to
know if the partner already has a user or not.

Besides, it takes care about the fact his user could
be disabled (`active` False).

opw-659339
2015-12-14 18:43:56 +01:00
Denis Ledoux dcd8d65fd1 [MERGE] forward port of branch saas-6 up to 6a306a03be 2015-10-28 14:01:10 +01:00
Martin Trigaux 6a306a03be [MERGE] Forward port 8.0 into saas-6 up to rev 2fa8b99e 2015-10-21 13:35:43 +02:00
Denis Ledoux c456d5f1a7 [FIX] portal: access management, do not re-send emails
When confirming the portal access management wizard,
the invitation email was sent to
users already having access to the portal,
while it should be sent only to
the users for who the access has just
been granted.

opw-650357
2015-10-20 14:31:42 +02:00
odoo-tac c033826492 [FIX] portal : Fixed portal wizard view and traceback that occured when giving portal access to a user. (Thx to RCO for the view fix) 2015-09-15 17:10:06 +02:00
Ronak Baxi 393f136509 [IMP] *: Uniformize all modal footers
The main button has classnames btn btn-primary.
Other buttons have classnames btn btn-default.
No more 'or' between the buttons.
2015-08-19 08:10:45 +02:00
fka-odoo 85ca7f57c4 [IMP] portal: convert hardcoded email sent for new
portal users into a mail.template.

A new field is used in the wizard_user model, that is the portal
user itself. It was not stored previously probably because of the
old wizard limitations (links to existing records). Storing it
directly eases the process of retrieving the portal user.
2015-08-11 16:13:31 +02:00
Antony Lesuisse d2a66f171e [REM] share
share is now deprecated by the website /my portal.
2015-07-09 13:50:28 +02:00
Olivier Dony 0bd4545348 [LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate text
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
  automatically in all countries thanks to Berne Convention + WTO rules,
  and a reference to the applicable license is clear enough.
2015-06-02 03:16:04 +02:00
Christophe Simonis fe2b5f35a4 [MERGE] forward port of branch saas-6 up to bf1e999 2015-05-28 14:27:38 +02:00
Christophe Simonis 9c5a1d8231 [MERGE] forward port of branch 8.0 up to cf4d14c 2015-04-27 17:33:44 +02:00
Denis Ledoux cf4d14ce39 [MERGE] forward port of branch saas-3 up to 09b277c 2015-04-27 14:02:52 +02:00
Denis Ledoux d6ae7fb7db [MERGE] forward port of branch 7.0 up to 3e7d3c7 2015-04-27 12:19:43 +02:00
Thibault Delavallée 4b122ad41d [MIGR] mail: migration to the new API 2015-04-27 10:36:15 +02:00
Martin Trigaux 5267e3a158 [FIX] portal: share with group wizard
Correctly creates menu and add implied groups.
Since the conversion from res.portal to res.group, we lost the field
parent_menu_id so a search is needed to find parent menu.
To add the access of existing users to the new groups, implied id rules are
needed. opw 612594
2015-04-23 13:53:08 +02:00
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
Leonardo Donelli 4a0b13ed92 [REF] remove vim modelines and resulting trailing blank lines
Let 2015 be a year without modelines!
cf #4174
2014-12-31 15:52:13 +01:00
rlu-odoo 8b67a7202d [REF] OpenERP --> Odoo in various UI texts
Rebranding has been done in:
- data/demo files
- html templates
- help notices
- comments
- logger messages
- and other various messages

(Commit taken from odoo-dev:8.0-improve-openerp-odoo-rlu at rev 7deaa08)

Closes #1260
2014-07-18 13:45:41 +02:00
Martin Trigaux 90f7eaa094 [FIX] portal: avoid errors during autovacuum
When the cron for autovacuum runs, the osv_memory objects are deleted. The portal.wizard.user object has a required field (wizard_id) linked to another osv_memory object (portal.user) which causes a traceback when the cron tries to delete portal.user object before the portal.wizard.user. opw 609918
2014-07-07 17:12:27 +02:00
Jaydeep Barot 026e38b48f [REM] Unnecessary size parameters on char fields 2014-06-25 17:13:43 +02:00
Fabien Meghazi faa09da325 Removed version="7.0" from form views 2014-06-12 09:09:59 +02:00
Denis Ledoux 6cf9867f15 [REF] *: share field is now a computed field, if the user is in the employee group or not
bzr revid: dle@openerp.com-20140324143558-jqdm33c0i7wna3va
2014-03-24 15:35:58 +01:00
Denis Ledoux 5649e0bbf2 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9770 revid:chs@openerp.com-20140116154645-sy4zhdgqc48xaqbx
bzr revid: dle@openerp.com-20131224112612-5gjit5uu1aaaqstx
bzr revid: dle@openerp.com-20140103094532-mbczi9ssr3gc90o1
bzr revid: dle@openerp.com-20140108105833-gblxqdw3if1gt35k
bzr revid: dle@openerp.com-20140115121441-bskbyxxbc09ubavh
bzr revid: dle@openerp.com-20140115165506-yuux9km39gbv7k4n
bzr revid: dle@openerp.com-20140116161415-0y9m0kgavcytzj9z
2014-01-16 17:14:15 +01:00
Olivier Dony b7fe8e1f8a [FIX] portal: use email_split method to avoid blocking valid emails, rather than obsolete email_re
lp bug: https://launchpad.net/bugs/1199386 fixed

bzr revid: odo@openerp.com-20140115093120-r2u2bmms9y847b93
2014-01-15 10:31:20 +01:00
Christophe Matthieu 9d9e3d2ef8 [IMP] Improve typos in warning (Grammar mistake, Capitalize title, Typos)
bzr revid: chm@openerp.com-20130607113829-1mi6jk18c2v3jjhn
2013-06-07 13:38:29 +02:00