For a first iteration, Russian translations were done using DeepL using
1 large .pot file of all the standard modules to translate (e.g. no
localizations, no test modules, etc). Unfortunately for some reason
doing a msgmerge with the existing ru.po files didn't seem to work, so
old "Translators" metadata at top of files were lost (maybe they will be
re-added during next Transifex sync?)
Part-of: odoo/odoo#152285
do not compare types, for exact checks use `is` / `is not`,
for instance checks use `isinstance()`Flake8(E721)
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
Fixes a large number of cases where strings are translated then
formatted, instead of letting `_()` do the formatting internally,
which allows it to recover from incorrect translations (missing,
broken, or extra placeholders).
Also
- removes translation markers entirely when there's nothing to
translate e.g. `_("%s - %s")` is not useful
- fixes a few messes which lead to only partial translatability
(DRY is generally a bad idea when translations are involved, even
more so when you don't make the variable part translatable)
- fixes a few nearby issues noticed at the same time
- replaces a few `"%s"` by `%r`, which should automatically quote
strings relatively appropriately
- fixes translated strings which use `\` to escape a newline (in order
to fill-paragraph): `\` escapes only the newline, if the
continuation string is indented this results in a bunch of spaces
ending in the string to translate, which is pretty garbage for the
translator, using implicit concatenation works much better
Note: some of the updates revert f-string parameters to %, because
babel (2.9) apparently has trouble with f-strings and blows up trying
to extract them.
Not in scope:
Helping translators fix translatable strings e.g. any translation
string with more than one placeholder probably should use keyword
placeholders
- Provides more context / data to the translator to make sense of the
sentence.
- Allows reordering the translated terms, which can be necessary
depending on the sentence and language.
closesodoo/odoo#139314
Related: odoo/enterprise#49311
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
To avoid developers to update the dict of `_events`
in their overrides, to not alter by mistake
the default behavior.
Using a frozendict will force them to create a copy
of the dict.
closesodoo/odoo#123261
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
When a user tries to access the URL directly, at that time the value of
dictionary `kw` is not available. The error will be generated.
Error : KeyError: 'state'
This commit will prevent the traceback.
sentry-3947033806
closesodoo/odoo#127162
X-original-commit: a05c8732440257eef31767b579793f3e5eb8a141
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.
This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).
closesodoo/odoo#121629
Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.
closesodoo/odoo#115845
X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.
The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.
closesodoo/odoo#114533
Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit: if a different `web.base.url` is set with
`web.base.url.freeze`, during the first synchronization of Google
calendar it will show a mismatch URL error. The problem is that we
send the `redirect_uri` based on the `web.base.url` in the
`_get_authorize_uri` function.
The solution is to use the request root URL instead.
opw-3175539
closesodoo/odoo#114482
X-original-commit: 8f94f2ec864bdb54e3deb9b853a2720c5c92f592
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Keep the manifests as light as possible, to easily see custom behavior/content.
Complete the work of previous commits cleaning the manifests content:
* 42bad1a6d2
* ef7005f524
and make sure this kind of cleanup commit is not necessary in the future
because it is now automatically verified by a dedicated test.
closesodoo/odoo#107735
Related: odoo/enterprise#34903
Signed-off-by: Julien Castiaux <juc@odoo.com>
Before this commit, _do_request can either receive json or dict as parameters.
requests.request param value can also be a string or a dict.
When the params is a string, the code tries to copy it with the copy method
which is only available on the dict, resulting in an error.
TaskId-2999194
X-original-commit: 75f889ca013d41939c669f07035e39d056d581d7
Part-of: odoo/odoo#101492
Rename from google_cal_account_id to google_calendar_account_id, to have
the complete 'service' name into the field and allow to use it from a
generic way in oauth2callback from google_account e.g.
task-2497212
pr-95744
closesodoo/odoo#95744
Related: odoo/upgrade#3673
Signed-off-by: Christophe Simonis <chs@odoo.com>
This commit removes outdated method no more used since we delete oog
apps like gdrive.
This commit remove the logging of sensitive infos.
This commit allows to override easily api key.
task-2497212
pr-95744
Part-of: odoo/odoo#95744
* fetchmail, google_gmail, fetchmail_gmail
Purpose
=======
Improve the usability of the outlook modules.
Specifications
==============
Remove the checkbox "Use Outlook" and instead use the
smtp_authentication and the server_type, to be consistent with Gmail.
Hide the password field for Outlook / Gmail mail servers.
Add constraints on the outgoing mail server to force the user to use
the right configuration (e.g. the from_filter, so the sending does not
fail).
Add an option in the mail module to install Outlook.
Show a message for the outgoing mail servers to explain each
authentication methods.
Task-2811567
Part-of: odoo/odoo#88215
Purpose
=======
Less secured apps are no longer supported by google, therefore, we need
to transition to the OAuth2 authentication system.
Specifications
==============
1. User will need to fill their Gmail API credentials in the main
settings page
2. Then, in the incoming / outgoing mail server form view, they will
need to tick the Gmail support checkbox
3. A link will be available to be redirected to Gmail and accept the
permission
4. The user can now copy / paste the authorization code in Odoo, set
his email as "login" and then send / receive emails with Gmail
Task-2170676
closesodoo/odoo#83424
X-original-commit: ff223afc5300b2421b8ce935bb468f503c938c5d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, several token related data were stored on the res_users table. During event sync, the table could be locked and this commit aims to move these data to a dedicated table to avoid bottleneck effets.
Taskid: 2484335
Part-of: odoo/odoo#68700
No need to keep it, it's useless and can confuse translators
closesodoo/odoo#74782closesodoo/odoo#74832
X-original-commit: 40c74e686f23c10e35000be583716d0c093ce3b3
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.
closesodoo/odoo#74245
Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
This branch adds request.redirect on all requests.
In case of a front end request, we do an url_for to the location.
We removed redirect_with_hash that was only for retro compatibility
local_redirect has been renamed to redirect_query, and param keep_hash has been
removed and moved.
Default code for redirect is 303 now instead of 302.
Now redirect and redirect_query make local redirect by default, you need to
pass local=False to make external redirect.
All werkeug.utils.redirect has been replaced by request.redirect.
Http.redirect now use an http.Response type, and it become easy to add an
override like 'set_cookies' e.g.
Dispatch of a website.page return an http.response too, so we first need to
check if it is a cached version before to check if it is an Odoo Response.
Migrate your code:
http.redirect -> request.redirect(location, code, local)
http.local_redirect -> request.redirect_query(location, query, code, local)
http.redirect_with_hash -> request.redirect
Courtesy of odony for help and review ;)
closesodoo/odoo#72599
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Each time the calendar view of event.calendar is loaded,
the synchronization with google calendar was launched
and if a user open many tabs, it can lead to deadlock
Solution: Check for lock before launching the synchro,
if the transaction cannot acquire the lock, it's proably
because another synchro already started
closesodoo/odoo#69540
X-original-commit: 101598fae6fc32a49bb6d422a82b621a81201cb5
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Issue
-----
- Currently the cron can take too much time and timeout.
In case of timeout process data are rollback.
The sync per user also crash and stop the process for all user and make
the transaction rollback
In both case we cannot ensure that all user will end up synchronized
- The real time sync can end up in deadlock:
If you create a holiday, it trigger a write on the user and the
creation of an event that will be synchronize with google
The synchronization may ask for a new token if this request fail
a new cursor is create to empty on the user the refresh token.
2 cursor that are trying to write on the same record => Deadlock
- Bad refresh token management
When the refresh token is not anymore valid it's erased but
the calendar_token and validity are kept. Is odoo consider
the token valid it will try to sync an event with google|microsoft
despite the refresh token is not valid anymore. Of course this lead to
an error and the impossibility to create an event anymore without
manually wiping the calendar_token and calendar_token_validity
- Error 401 are handled in context manager
(google|microsoft)_calendar_token, but get_*_calendar_token never raise
http error only user error.
Solution
---------
- Improve cron resilience
- Commit between each user and rollback in case of issue for a user
- Solve the issue when stop < start
- Solve issue with rrule not being the first element in the list
of recurrence
- Improve perf when searching for organizer
- In order to limit the volume during the first synchronization, we only
synchronized event from x days in the past to x days in the future with
x = 365 by default
- Limit the number of event to synchronize to google each time to 200,
since this operation is time consuming (1 request is sent per event)
- Avoid deadlock
A new cursor is not needed, we only need to ensure that write on the
user is done with a clean cursor and will be commited despite the error
raise. So rollabck before the write and commit explicitly afterwards
- Erase properly all the token and the token validity if the refresh token is not valid anymore
- For google calendar, erase also the token in case of 401
error: Wrong client id, this mean the database parameter have been
change and all the user should reconfigure the synchronization
- Directly handle error 401 with error 400 in refresh_token method
closesodoo/odoo#66250
X-original-commit: 486f69abad6226e5ce016ad89a0eeb103d709a3f
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit refactors calendar synchronization between Odoo and Google after the
main calendar application refactoring.
This refactoring takes advantage of two new features from the Google API:
- New way of synchronizing resources efficiently[1]
Incremental sync is performed repeatedly and updates Odoo with all the changes that
happened ever since the previous sync. Each time, Odoo provides the previous sync
token it obtained from Google and stores the new sync token from the response.
- Event metadata[2]
Ability to set hidden key-value pairs with an event, called extended properties.
These extended properties are used to store the related odoo event id and the Odoo
owner id (see known limitations)
Known limitations
=================
- Let A and B be two new users (no tokens available). A creates an event in Odoo and
invites B. A is the owner of the event (user_id). Now B authenticates to his Google Calendar
account and synchronizes his calendar. We cannot send the event to A's calendar since we
don't have any access to his Google Calendar. Hence the event his sent to B's calendar.
This leads to data de-synchronisation: The owner is A in Odoo but B in Google.
The "real" owner (user A) is stored in the Google event's metadata to be able to
reconcile the owner for following synchronizations.
- Let A and B be two users of Odoo and Google Calendar. And let the Google Calendar of B
be private (e.g. if A creates an event in Google Calendar and invites B, B won't see the
event in his calendar). If A creates an event in Odoo and invites B. The event is synced
to Google Calendar of A. Now B can see the event in Odoo but he can't see it in his
Google Calendar.
Task 2126717
PR #42031
PR Enterprise odoo/enterprise#8006
[1] https://developers.google.com/calendar/v3/sync
[2] https://developers.google.com/calendar/extended-properties
Purpose
=======
The current kanban view is messy. It is difficult to identify which
apps are installed or not. The user can completely miss a module
that might have interested him. A search panel would make things way
more readable.
closesodoo/odoo#44401
Taskid: 2181557
Related: odoo/enterprise#8144
Related: odoo/upgrade#879
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Following changes needing ir.model.access on transient models too.
Remove groups declaration on the action to move it to ir.model.access
when possible.
Rules are strict by default with no unlink access by default and high
priviledge asked. Adaptations may be needed later.
Write access is given as a wizard may need to be modified in case the
action triggers an error and the user has to correct a value
account*: use account.group_account_user for all transient by default
remove account.print.journal relic
stock*: use stock.group_stock_user by default
survey: survey user can send invitations
mail: allow any employee to execute wizards
additional verifications are made to ensure they are executed
only on the documents the user has access to you
give portal access to mail.compose.message as portal still does
some actions like posting messages on the forum
add ir.rule to avoid reading somebody else messages
increase the query count because of undeterminist count
crm: saleman for lead2opp, manager for massmailing
partner manager for actions linked to partners
avoid a write in test_lead_lost
sms: any employee can send sms
mrp: mrp user can execute wizards
give unlink access as making write during do_produce operation
base_import: employees can import files
delivery: stock user can deliver
event_sale: sale user can configure the wizards
event user inherit from sale rights
gamification: employee can give badge
google_service: resolve FIXME
hr: add specific rights
manager can set a plan according to group on button
anyone who can write on an employee can register a departure
hr_expense: set rights based on buttons
hr_holidays: an approver can make a summary report
hr_recruitment: recruiter can refuse a candidate
hr_timesheet: can use the wizard if can create a timesheet
l10n_eu_service: managers can create fiscal positions
mass_mailing: same group as on mass.mailing.list
membership: accountant can create invoice from membership
payment: accountant can create a link
as the source is an account.move
keep the payment.acquirer.onboarding.wizard to system user
only as it is called during company configuration
point_of_sale: PoS manager only can use wizards
never create closing_balance_confirm_wizard records
product_expiry: stock user has rights on stock.picking
product_margin: access from accounting menus
repair: same rules as for above models
sale: set ir.rule for self wizard only
add rule from model introduced in payment to add salesman group
sale_crm: saleman can create a quotation from a lead
sale_coupon: any saleman can generate coupon
add self ir.rule
sale_product_configurator: salesman can select product variants
snailmail: employee can send letters
website: designers can write on website
website_crm_partner_assign: same rule as group on action
website_sale: sale ACL as for payment.acquirer.onboarding.wizard
website_slides: anyone can send invitation
base: base.language.*: allow employee (cf lang_install)
change.password.user: can not read change password wizard of
other users
test.*: no access is needed
Courtesy of Damien Bouvy, William Andre and Antoine Prieëls for review
of acl
Before this fix, when a refresh of the google token was triggered
and error 400 where returned, if the user did not have write rights
on res_users, an access rights was raised
Now, the write is done and the real error is raised for the client.
Part of OPW-2123045 (needed to further investigations)
closesodoo/odoo#41777
X-original-commit: b4f794c55bdfbf2a5482b7ee30780fdef8d4978f
Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
Followup of a425695e
The terms were back in 12.0
Courtesy of Juan José Scarafía
closesodoo/odoo#41624
X-original-commit: 85d0c7001a997748d7691205bbb8d066597591a5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>