100 Commits
Author SHA1 Message Date
Martin Trigaux (mat) aa84ccfa61 [ADD] test_translation_import: export source terms
Add a test for exporting the source terms of modules.
This will allow automated scripts to fetch latest terms

Backport save_test_file with a parameter on date_format to have
predictable filenames

closes odoo/odoo#159373

X-original-commit: e7246ea48828746471a2e3a485bee30687eeee80
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2024-03-29 07:53:00 +00:00
Martin Trigaux (mat) d0cd86bd14 [FIX] mail: harmonize computed field
Avoid accessing inconsistent data based on the user

closes odoo/odoo#157098

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2024-03-12 10:34:49 +00:00
Martin Trigaux 04587e1916 [IMP] base_setup: enable disabling default user rights propagation
When installing a new module, the access of the Default Template User
is propagated to any existing employee (introduced at
aefb05eb497a8a16a). This can be problematic in companies that don't
want all their employees to become manager by default.  Allow to
disable this behaviour in a settings.

This is the version of the patch targetting stable version that is not
configurable through the interface, manually creating an ICP
base_setup.default_user_rights_minimal=True as the way to change the
behaviour.

Closes odoo/odoo#149224
Task-id 3685856

closes odoo/odoo#154816

X-original-commit: 70f66f147bb0c133be6ae3fd2b11438afe2366a5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2024-02-21 11:28:00 +00:00
Martin Trigaux 6f4dad6f28 [FIX] website_slides: do not subscribe portal user
Everytime somebody leaves a review, it sends a message to every
follower of the subtype "Discussion". Portal users were subscribed
without realising it.

Issue 1:
When subscribing via the controller, a user was subscribed to the
"Discussion" subtype instead of "Presentation Published".

Issue 2:
When requesting access, if there is no responsible for a channel, the
activity_schedule method fallback on the current user (portal) and
subscribe him to the channel at the same time.
If there is no responsible, there is nobody to request access to.
Disable the o_wslides_js_channel_enroll to hide the request access
popup and skip the activity_schedule if the method was called anyway
(i.e. fix for stable without updating the view)

DELETE FROM mail_followers_mail_message_subtype_rel r
 USING mail_followers f,
       res_users u
 WHERE u.partner_id=f.partner_id
   AND r.mail_followers_id=f.id
   AND r.mail_message_subtype_id=1
   AND f.res_model = 'slide.channel'
   AND u.share = true;

closes odoo/odoo#145742

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-01-20 02:42:51 +00:00
Martin Trigaux 9a666bc8f0 [I18N] *: export 17.0 translations
There were a few errors

closes odoo/odoo#148315

Related: odoo/enterprise#53724
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2024-01-05 15:14:38 +00:00
Martin Trigaux 2d75cc8d90 [FIX] website: do not use shared category
The website_page_controller_expose is a technical model for portal and
public, not for employee

The side-effect of the change was that, before this commit, the
category Website was no longer a selection but a list of boolean only
accessible in debug mode

closes odoo/odoo#144342

Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
2023-12-01 17:08:03 +00:00
Martin Trigaux 072f49fad2 [ADD] base: add es_419 flag
The language was added at dccc8f39d0
419.png as odoo thinks it's a country...

closes odoo/odoo#143439

X-original-commit: 3bb58958c8f5f98da21bdac411bd226d03e1591b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-11-24 23:57:33 +00:00
Martin Trigaux c838944646 [CLA] remove duplicated file
Was already signed in pallavisrivastavaa.md

closes odoo/odoo#142426

X-original-commit: d586acc0d08e8fc2f2221c4e8b6ff6fc2577e81b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-11-20 04:58:31 +00:00
Martin Trigaux 3caf279c04 [FIX] base_setup: correct domain
Comparing integer and string does not have the expected result

closes odoo/odoo#142462

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-11-20 03:46:44 +00:00
Martin Trigaux 9429986b63 [FIX] base: join correctly the path
os.path.join(..., <absolute>) returns <absolute> path

closes odoo/odoo#142307

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-11-17 04:35:40 +00:00
Martin Trigaux 3135699792 [IMP] *: update links to 17.0
closes odoo/odoo#141622

Related: odoo/enterprise#50472
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-11-08 13:34:06 +00:00
Martin Trigaux bb1984d915 [FIX] mass_mailing: correctly compose the Markup message
Was logging
<ul>&lt;li&gt;Test mailing successfully sent to foo@example.com&lt;/li&gt;</ul>

closes odoo/odoo#141327

X-original-commit: e382f505b2061e5043bfb79a5c0f2787e40fae8b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-11-07 21:02:29 +00:00
Martin Trigaux 1e06577306 [FIX] mass_mailing: don't show inactive mailing lists
Those are no longer used and should never be displayed

Source: feedback of users that were wondering why they are subscribed
to very old unrelated mailing lists while those are all inactive

closes odoo/odoo#139442

X-original-commit: 35203a93dbb002e2e8c6943073c14acdfc5f90f1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-26 05:13:31 +00:00
Martin Trigaux aae9c99f02 [IMP] *: convert to the new simpler syntax
closes odoo/odoo#139316

Related: odoo/enterprise#49379
Related: odoo/documentation#6189
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-24 21:09:58 +00:00
Martin Trigaux 0a1abb5e45 [IMP] tools: allow to use Markup and gettext
Before this commit escape was needed to use a Markup object as a
parameter, hence loosing the fallback mechanism in translations

>>> escape(_("Order %s has been confirmed")) % Markup("<a>%s</a>") % order.name
Markup("Order <a>SO42</a> has been confirmed")

Now it is possible to explictly give a Markup object to the gettext call

>>> _("Order %s has been confirmed", Markup("<a>%s</a>") % order.name)
Markup("Order <a>SO42</a> has been confirmed")

Part-of: odoo/odoo#139316
2023-10-24 21:09:58 +00:00
Martin Trigaux e77cf7477d [I18N] l10n_it_edi: update Italian translations
Courtesy of Marianna (cima)

closes odoo/odoo#139239

X-original-commit: 3152a5029dcf676f723241b099196a8e8cb42720
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-20 09:35:25 +00:00
Martin Trigaux 3314ec94e5 [FIX] website_event: avoid double indexing
Similar to d2edee2f6a6

Before this commit, web crawlers may endlessly index pages with tags,
the number of combinations were very large very quickly and could lead
to thousands of requests

opw-3525473

closes odoo/odoo#138718

X-original-commit: 953ac4bde2258d31c2d2f3f6233fb00c802b6e7f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-10-14 03:27:11 +00:00
Martin Trigaux 613da5dfb5 [FIX] point_of_sale: translate journal accounts
closes odoo/odoo#138465

X-original-commit: aac2f4ca2cd3155daaeadecc901936416f3c21f9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-12 14:44:56 +00:00
Martin Trigaux 75858d3509 [IMP] *: use correct indentation in manifest summary
The summary is a short char field. It should not contain carriage
returns.
The description is the longer text field.
Remove unnecessary spaces in both.

Automatically dedent the description to avoid this issue poping up
again in future modules.

closes odoo/odoo#138214

Related: odoo/enterprise#48695
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-11 08:18:49 +00:00
Martin Trigaux 6d872cbc1c [ADD] base: add en_NZ language
To avoid using the default en_US (which has different locale settings)

closes odoo/odoo#137722

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-10 14:07:12 +00:00
Martin Trigaux 22ab49e343 [IMP] *: use file_path and file_open
Replace all the calls to get_resource_path to the better file_path or
directly use file_open when not needed

Doing both a get_resource_path and file_open means checking twice that
the file exists.
Doing a simple path concatenation before a file_open is safe.
If given to another method (e.g. etree.parse), calling file_path is
the prefered method.

Note that get_resource_path used to return False when the file does
not exists while file_path/file_open raises a FileNotFoundException

closes odoo/odoo#135607

Related: odoo/upgrade#5187
Related: odoo/enterprise#47475
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-06 14:33:43 +00:00
Martin Trigaux 9e253bbe63 [IMP] module: deprecate get_resource_path
file_path is superior and can replace every (often unnecessary) calls
Merge check_resource_path that is no longer needed

Part-of: odoo/odoo#135607
2023-10-06 14:33:43 +00:00
Martin Trigaux 07fd6277f9 [FIX] module: use file_path
The method get_resource_path is redundant with file_path but without
all the checks.
The method will be deprecated in master but make it use file_path in
stable.

closes odoo/odoo#136272

X-original-commit: 64ab4a6914dadd741cfe61d9bd1959ae4509a1ca
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-09-23 14:24:13 +00:00
Martin Trigaux bf81596aa7 [IMP] base: use es_419 and not es_MX as reference
And load only two languages, not three.
Faster to load and avoids ambiguity when a Mexican sees es_ES content

closes odoo/odoo#134785

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-09-18 22:17:02 +00:00
Martin Trigaux dccc8f39d0 [ADD] base: add Spanish Latin America
Before es_MX was informally considered as the "reference spanish" as
we have an office in Mexico.
Create a new language that will be used by all the local variations of
Spanish and that we can push without overlapping with es_ES content.

Part-of: odoo/odoo#134785
2023-09-18 22:17:02 +00:00
Martin Trigaux fac931cb0c [I18N] l10n_din5008_repair: correct the translation
closes odoo/odoo#135443

Source: Larissa (lman)
X-original-commit: 9b8fb3e0eeb7b3b8411f32984b8626d15529724c
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-09-14 17:07:58 +00:00
Martin Trigaux 7f4da03e36 [IMP] mail: allow posting HTML message via RPC
Since 69f911d994 it was no longer possible to post an HTML
message via a script. Allow to do it but log a warning to discourage
doing so. Markup object should still be the propoer way to do it.

closes odoo/odoo#130883

X-original-commit: a890db49935813d0794765492c057404592e5977
Related: odoo/documentation#5273
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-08-04 16:34:58 +02:00
Martin Trigaux 360915b3f0 [FIX] base: remove wrongly untranslated term
The label was already Status on the field but not in the search view.
"State" is always used for the meaning location.
Sharing the same term meant it was not possible to have two different
translations.

closes odoo/odoo#130444

X-original-commit: 70fcdf30fc842410aafa9e61d2a1903589a15311
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-08-02 14:41:18 +02:00
Martin Trigaux 935857e01d [FIX] base: do not remove groups added in implied groups
If a user goes from "Access Rights" (base.group_erp_manager) to
"Settings" (base.group_system) he gets an error telling him he did not
belong to Access Rights group.

The reason was that the modification of accesses on the user profile
page was doing
write({'sel_groups_2_4': 4})
which was transled, after the _remove_reified_group call into
write({'groups_id':[(UNLINK, [2, 4]), (LINK, [4]]})
so the user was temporary in a state where he was in the group_system
but no in group_erp_manager.
When the implied groups where computed, an access error was raised as
the administrator was not allowed to modify res.users record (need
group_erp_manager).

Simplify the _remove_reified_group call to only convert the call to
write({'groups_id':[(LINK, [4])]})

closes odoo/odoo#129335

Task-id: 3265053
X-original-commit: 0ed2fa018a7716f0fb3abe587983209403445fc8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-07-24 15:52:05 +02:00
Martin Trigaux 884a56c239 [FIX] test_access_rights: adapt tests
Make the user be in at least one of the group employee, public or
portal to be more coherent with Odoo

closes odoo/odoo#125216

Related: odoo/enterprise#42628
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-07-11 22:33:47 +02:00
Martin Trigaux c68fa610d4 [FIX] *: correctly search record without user
If a user is not present in the request, he is in no group at all and
can not access any model, including the one available for public
users.
Avoid ambiguity by using sudo or add a user specifically.

Part-of: odoo/odoo#125216
2023-07-11 22:33:47 +02:00
Martin Trigaux cd2f330bec [IMP] *: remove glocal ACL
Specify explicit route for each ,, line
This is part of task 3230280 where global ir.model.access will be
forbidden.
The goal is to make access to public/portal explicit. Too often,
global access was granted with only employees in mind.

Remove ,,0,0,0,0 lines

mail:
employee already had read access to mail.group
still needed to subtypes as in ir.rule domain

mail_group: employee already had read access
pos_mercury: only needed for employees

membership:
move public access for website_membership as needed in the controllers

website_customer: employee already had read access

website_event_booth: no need for category
website_event_exhibitor: retrieved in sudo
website_event_track: not needed for location

Part-of: odoo/odoo#125216
2023-07-11 22:33:47 +02:00
Martin Trigaux 35a118eff5 [IMP] base: move helpers to tools
closes odoo/odoo#67316

Signed-off-by: Rémy Voet (rvy) <rvy@odoo.com>
2023-06-08 12:11:07 +02:00
Martin Trigaux f4d5752724 [IMP] tools: load also es_MX
The translations on Spanish (Mexico) are more active than on Spanish
Moreover, most other countries speaking a variant of Spanish are
located in Latin America and are closer to es_MX than es.
To solve this, when installing for instance es_AR, the translations
will be loaded in the following order:
1 es
2 es_MX
3 es_AR

In case a term is translated in both es and es_MX (and not es_AR), the
later will be used

closes odoo/odoo#121415

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-07-28 17:53:53 +02:00
Martin Trigaux 1da6f82bb9 [I18N] sale_timesheet: remove duplicated entry
closes odoo/odoo#125595

X-original-commit: f6eb3e1033e1376096faf27c00cdba0508c2c19a
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-19 23:16:55 +02:00
Martin Trigaux 604a47ead8 [IMP] *: remove global ACL
THese are rarely intended for all users but often intended only for
employees.

account:
account.incoterms: only used within internal business models
account.journal.group: same as account.journal, add sudo in computed field

account_edi: need access to accounting objects

base_address_extended:
res.city: only employees should access address data

board: only employees uses this (old) module

crm:
crm.stage: internal users business object

hr_recruitment: employees can read

im_livechat: apply same as for the steps

l10n_ar: used on partner, not only invoices
l10n_ec: accessed only through account.move
l10n_latam: accessed on res.partner

mail:
publisher.warrenty.contract: no data, only static models
mail.channel: group_user has already his own rule
mail.group: group_user has already his own rule
mail.message.subtype: group_user has already his own rule
mail.message.all: remove, already has a portal and employee rule

partner_autocomplete: no interaction with public

project:
project.tags: only needed for project sharing

sale_management:
sale.order.option: same as sale.order

utm: employee already has write access

web_editor: test models that have nothing to do here
web_tour: only employees uses tours

website_sale:
product.ribbon: add sudo for access

base:
ir.default: only employees uses set (could probably be converted to group_system)
ir.ui.view.custom: same as ir.ui.view, add sudo when needed
report.*: portal users don't configure reports
res.users.log: create in sudo, no access needed (adapt test to use another model)
res.lang: still needed for public

closes odoo/odoo#118701

Related: odoo/enterprise#41285
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-12 22:39:26 +02:00
Martin Trigaux 53ca9840d8 [IMP] base: remove read on ir.default
And make get private

Part-of: odoo/odoo#118701
2023-06-12 22:39:25 +02:00
Martin Trigaux 2afdda2576 [I18N] *: export saas-16.3 source terms
closes odoo/odoo#123046

X-original-commit: 137f5ca0cb703ee953cb01db525362f7a778e6bd
Related: odoo/enterprise#41703
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-01 11:43:51 +02:00
Martin Trigaux 077bbd0b0b [I18N] *: export master source terms
closes odoo/odoo#121563

Related: odoo/enterprise#41140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-17 10:34:00 +02:00
Martin Trigaux 69f911d994 [IMP] *: enforce usage of Markup in mail
When using message_post, the body format must be explicitly specified.
If html is expected, a Markup object should be used.
If text is given, the content will be escaped.

Before this PR:
message_post was unaware if the content of a message was HTML or
text. This lead to multiple situation where the content was
incorrectly considered as HTML and led to display errors.
In
  self.message_post(body="Hello %s!" % self.name)
if the name contained HTML, it would be evaluated.

In
  self.message_post(body="Contact Raoul <raoul@caramail.be>")
the email would not be displayed as considered as unknown HTML and
discarded by the sanitizer

Now each call must explict the type of content.
Use the escape() helper to properly combine Markup and translations.
It would also be acceptable to use Markup() to wrap a static
translation but escape is better as one can not guarantee the content
of a translation.

closes odoo/odoo#111850

Related: odoo/documentation#3612
Related: odoo/enterprise#36728
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-04-13 16:39:48 +02:00
Martin Trigaux 826fee8b02 [FIX] mail_group: reference new MailCommon class
TestMailCommon was an empty class in test_mail kept for backward compatibility
while MailCommon is in mail. This is needed as we plan to move test_mail in
another addons path in order to isolate test addons.

Task-3263512

Part-of: odoo/odoo#117606
2023-04-04 20:08:36 +02:00
Martin Trigaux 1be5eae8ef [I18N] *: remove nl_BE files
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.

closes odoo/odoo#115845

X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-20 16:51:30 +01:00
Martin Trigaux d805349855 [FIX] base,mail: properly remove the user from an implied group
In mail, changing the setting "Restrict mail templates edition and
QWEB placeholders usage" to false should remove all users but admins
from the group, including the template user.
Before this commit, you could have weird behaviou such as

1. Disable the restrictiong (group_mail_template_editor in
   group_user.implied_ids)
2. Install mass_mailing (group_mail_template_editor in
   group_mass_mailing_user.implied_ids)
3. Create a user test with minimum employee roles (still has
   group_mail_template_editor as employee)
4. Check the box "Restrict mail templates edition and QWEB
   placeholders usage"

-> test still has the template group nothing implied it

The issue was a combinaison of recomputation of implied groups
https://github.com/odoo/odoo/blob/b2f760cae74201d1622e56a0027dae67dcff9e33/odoo/addons/base/models/res_users.py#L1292-L1295
that triggered the synchronisation of groups on template user
https://github.com/odoo/odoo/blob/b2f760cae74201d1622e56a0027dae67dcff9e33/odoo/addons/base/models/res_users.py#L611-L616

By removing the users already in a group, we avoid falling into the
condition added at 121cd0d608 where the default user gets a
group removed, readded, hence added for everybody.

closes odoo/odoo#115108

X-original-commit: 6398dd287f07641c85807f291d9fe078fcb8a231
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-16 13:07:52 +01:00
Martin Trigaux a17e44aad3 [I18N] l10n_it_edi: correct translation
Courtesy of Marianna (cima)

closes odoo/odoo#113595

X-original-commit: b8f65c0ecb1680c3f30c007454f92b6d135f585f
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-24 11:11:43 +01:00
Martin Trigaux cd10bee519 [FIX] transifex: still support old .tx/config format
If one of the theme was not migrated to the new tx api, still support
the previous notation.
Happened on the design-theme repository

closes odoo/odoo#113571

X-original-commit: a8355ba3dddb5f3c8a8e8e777aff85d558410971
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-24 11:11:40 +01:00
Martin Trigaux 93af90cc1d [IMP] hr: better log message
Before this commit the message was only containing a message 'Personal
information update.' but it was not clear why the person was receiving
this message nor why he was receiving it.

closes odoo/odoo#113550

X-original-commit: de0061326bbd9e2fc5319c05448395afa5b71afe
Related: odoo/enterprise#37492
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-24 08:12:04 +01:00
Martin Trigaux e130d8a1db [FIX] *: stop importing tests code
When loading a module, the code in the tests directories should not be
loaded.
One does not need freezegun on a server without running the tests.

closes odoo/odoo#113536

X-original-commit: 705c5d5dd9b76850638bd5d36b8395314ba78248
Related: odoo/enterprise#37481
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-23 18:29:11 +01:00
Martin Trigaux ae2de8101d [I18N] migrate to the nex transifex API
Tansifex is deprecating it's client and switches to a go-based
solution in its API v3

The new client is still backward compatible with the old format but
the v2 API is going to be phased out.
See https://github.com/transifex/cli to install the deplyments using
the tx client

This PR is the result of the "tx migrate" command

closes odoo/odoo#112402

Transifex: adapt to new URL format
X-original-commit: 7ca55aec4f1faa8bc2ad80d730a7f0771df3998e
Related: odoo/documentation#3534
Related: odoo/enterprise#36950
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-10 16:49:15 +01:00
Martin Trigaux 8872acaede [IMP] base: clarify groups_id label
Using the word "Security" as a label may bring some wrong expectations
on what the value does.
Only on server action does this value is actually enforced at run
time. For window actions and menu, it is only for UX purpose.

closes odoo/odoo#111954

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-07 10:39:42 +01:00
Martin Trigaux a349b0a89b [IMP] test_new_api: move logger to top level
closes odoo/odoo#111764

X-original-commit: ca83a7879aed132ad2ff216405f745b5bd2ebb80
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-03 09:28:38 +01:00
Martin Trigaux d3b3a30c84 [FIX] mail: remove group when unchecking the box
When activating the option "Restrict Template Rendering" the employee
group no longer gets the group automatically via the Implied Groups
field. However this did not have much effect because
- all the existing employees still had the group
- new users had the group via the template user

Remove the group with active_test=False to include the Default
Template User in the list.

Before this commit it was a bit confusing that new users still got the
group by default, even after deactivating the option in the settings.

closes odoo/odoo#110900

X-original-commit: ea0f674ac15964aaeb3def31758cec558b354a99
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-26 12:19:12 +01:00
Martin Trigaux 776689b0f4 [I18N] *: export saas-16.1 source terms
closes odoo/odoo#110752

X-original-commit: 56b2b52287a8f2192d80ea417c7efac80a87c0a9
Related: odoo/enterprise#36173
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-24 10:20:30 +01:00
Martin Trigaux eaa39012ba [FIX] base: allow calling install_lang in RPC
This method is used in Transifex synchronisation scripts and needs to
be called in RPC.
It was the case before 727ef9e0a2ca9308

closes odoo/odoo#110087

X-original-commit: 3b7e4535d358e554f7b089828efb82bc6b0a40e3
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-17 11:34:25 +01:00
Martin Trigaux fde3f4d4b9 [I18N] *: export 16.0 source terms
closes odoo/odoo#102163

X-original-commit: 011d7aac5aacedb3ab373f247471ba69d67f50f3
Related: odoo/enterprise#32288
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-10-06 14:56:52 +02:00
Martin Trigaux eba7ed6e9c [I18N] *: translate fr_BE based on fr
Automatically translate "avoir" into "note de crédit"

closes odoo/odoo#102002

X-original-commit: 69b141d8ec613e101b8a7050da057bfe5a74af50
Related: odoo/enterprise#32220
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-10-04 07:28:57 +02:00
Martin Trigaux e856beb782 [I18N] *: export 16.0 source terms
closes odoo/odoo#101659

Related: odoo/enterprise#32040
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-09-30 09:31:52 +02:00
Martin Trigaux e1af8cd69c [IMP] *: correct tyspo and erors
Also clarify messages

Part-of: odoo/odoo#101659
2022-09-30 09:31:52 +02:00
Martin Trigaux 5150d003fd [I18N] *: export 16.0 source terms
closes odoo/odoo#101053

X-original-commit: 7d4c9d9736cc2ff0ee91dc17ea0f952c9a3dc65a
Related: odoo/enterprise#31752
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-09-24 15:00:56 +02:00
Martin Trigaux ffbd1ff062 [IMP] tools: do not export attribute content
Nodes like
<attribute name="t-on-dragenter.stop.prevent">() => state.dropzoneVisible = true</attribute>
should not be exported in the translations files but
<attribute name="string">Hello World</attribute>
should be kept

It was already the case in the xml processing method for server side
templates.
Since 16.0, client side QWeb views also use the same inheritance
mechanism than the one on the server side so the exception needs to be
replicated.

X-original-commit: e05d1192481935b2cd7aae7e939f98e60e002899
Part-of: odoo/odoo#101053
2022-09-24 15:00:56 +02:00
Martin Trigaux ee5a5807fe [I18N] tx: correct config file
Did not contain all modules

X-original-commit: 21f8237fd96c64c85e19958662e22303bc663727
Part-of: odoo/odoo#101053
2022-09-24 15:00:55 +02:00
Martin Trigaux 1a8772769e [I18N] *: export 16.0 source terms
closes odoo/odoo#100573

Related: odoo/enterprise#31507
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-09-20 13:48:49 +02:00
Martin Trigaux 4224566a61 [I18N] hr_contract: export source terms
Avoid duplicated entry

closes odoo/odoo#99516

X-original-commit: 47f4f036202e778bc181d6dbf8609b658f4a53b8
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-09-03 08:13:38 +02:00
Martin Trigaux b821961236 [I18N] *: sync fr_BE translation terms
Only for terms containing Credit Note and expenses

closes odoo/odoo#97840

X-original-commit: 1754b094a66476a0bdb29fe60dc5583c03336c3f
Related: odoo/enterprise#30262
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-08-10 03:11:53 +02:00
Martin Trigaux ffc525419a [IMP] base: avoid render with env mixup
The render API was confusing as mixing the access to the report and
the rendering env.

The ambiguity was present for code such as
`report.sudo()._render(record_ids)` where it was not clear if the
`sudo()` is needed to access to `report` or to `record_ids`. For low
priviledge users (such as portal or public), it was common to use
`report.with_user(SUPERUSER_ID)._render(record_ids)`.

This PR changes the render methods signature to be `api.model`. The
`report_ref` can be:
- ir.actions.report external id
- ir.actions.report id
- ir.actions.report recod
- `report_name` value

This will allow to call the report methods with any user and no longer
need to use `with_user(1)` to render reports as public user.

Task-id 2670865

closes odoo/odoo#91341

Related: odoo/upgrade#3650
Related: odoo/enterprise#27323
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-08-02 11:48:46 +02:00
Martin Trigaux d3cc71db72 [FIX] auth_totp: remove outdated trusted devices
The trusted devices are valid for maximum 90 days (TRUSTED_DEVICE_AGE).
No need to keep them in the list of trusted device, it may even be
confusing.

closes odoo/odoo#95796

X-original-commit: 49130e60a3c43fa3df0adddbd3359e437f5bc0b2
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-07-12 06:21:03 +02:00
Martin Trigaux 9458eedbd6 [I18N] *: create a saas-15.3 specific project
Until know, Transifex projects were organised as:
- odoo-14
- odoo-15
- odoo-master

with odoo-master changing frenquently to reflect the
last used saas version, to prepare the future odoo-16 version.

This was ok as most people used stable versions at that time.

Now the saas versions are frequently released and many users of
odoo.com are running these versions, the quality of translations is
more important and preparing for the future version is not the only
goal.

Having only one project synchronised with a saas version is not enough
as we frenquently have to support multiple versions in parallel
(e.g. saas-15.2 for users and saas-15.3 for odoo.com).

Switch to a project for each saas release to be more flexible.
Hopefully, it won't be too much additional work for translators thanks
to TM.

New organisation
- odoo-14
- odoo-15
- odoo-s15-2
- odoo-s15-3

and delete projects when it is no longer supported

closes odoo/odoo#94010

X-original-commit: bb071a903d5f0b2de4c3f945ed5f4ed7d13b1e94
Related: odoo/enterprise#28588
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-06-20 11:15:02 +02:00
Martin Trigaux ad5e6f1111 [FIX] mail: send emails only once for each batch
If a list of emails is bigger than 500, the email was sent several
time to some people.
The mail_values content was not reset between each batch, so if 1200
emails are sent, 3 mail.mail records were created for the emails in
the first group.

closes odoo/odoo#93658

X-original-commit: f838a0cc36e51e0f47daeec6522df8e9832aad2c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-15 10:00:20 +02:00
Martin Trigaux 515b178535 [I18N] *: cleanup deleted modules
Remove leftover translations from some modules that no longer exists.

closes odoo/odoo#93572

X-original-commit: d16d24a360ffe1a703e012746fb95efbe16536ad
Related: odoo/enterprise#28352
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-06-14 14:53:38 +02:00
Martin Trigaux 52b420febd [I18N] web_editor: translate the editor lib content
The js content of the odoo-editor is located into the
web_editor/static/lib/web-editor directory.
Only the js code located into */static/src/* is considered for export
of translations. This is done to avoid poluting translations for code
not managed by Odoo.

The best solution is to move the odoo-editor code inside static/src
but as a workaround in stable, we can add the terms manually in the
.pot file.
This has the drawback of being lost in the next export of translations
so should be considered as a temporary solution.

Fixes odoo/odoo#93258

closes odoo/odoo#93360

X-original-commit: d2e40ea2b36df8488402ec3401bd1bb3669dc05c
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-06-11 16:12:57 +02:00
Martin Trigaux 5acb6db891 [I18N] *: export saas-15.4 source terms
closes odoo/odoo#93246

X-original-commit: 5ff6d185f70650c26c28a6aef7dd37c859ab58d2
Related: odoo/enterprise#28218
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-06-10 07:27:26 +02:00
Martin Trigaux 2617b3f072 [FIX] base: include model_terms in check
Translations of type model_terms are similar to model and the access
rights can be checked on the referenced record instead of
ir.translation

closes odoo/odoo#90101

X-original-commit: 992a919d09c3ba224a64241f4a6c16c1a086eb4b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-04-29 13:13:00 +02:00
Martin Trigaux 158b537c28 [I18N] *: export saas-15.2 source terms
closes odoo/odoo#89225

X-original-commit: 5925a83d87fa4702f4c0f22346304dc2da47c728
Related: odoo/enterprise#26435
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-04-23 08:33:43 +02:00
Martin Trigaux 02395d7e86 [I18N] l10n_*: export translations
Localisation modules are converted to English and published in a
separated project on Transifex
https://www.transifex.com/odoo/odoo-15-l10n

Every localisation module will progressively be converted to have the
source in English and translated via Transifex.
This will allow developers to improve the localisations without having
to work with translators directly.

closes odoo/odoo#88439

X-original-commit: e5dfe8613723ba522e20334568c5637188ff2252
Related: odoo/enterprise#26091
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-04-12 15:48:58 +02:00
Martin Trigaux 1d8f6a5bcd [REF] base: new report methods api.model
That use report references and no recordset.
This avoids mixing environment of rendering and access to the report object.

Part-of: odoo/odoo#85110
2022-03-29 10:56:16 +02:00
Martin Trigaux a9db04a719 [FIX] base: make _prepare_html a api.model
It is used in account.tour.upload.bill without a record

Part-of: odoo/odoo#85110
2022-03-29 10:56:16 +02:00
Martin Trigaux f41ec39abe [IMP] base: get_view_id becomes private
Add new helper get_view
Remove dangerous documented comment

Part-of: odoo/odoo#85110
2022-03-29 10:56:16 +02:00
Martin Trigaux 9f1240531e [FIX] core: python 3.10 support of collections
collections.Set was deprecated since 3.6 and removed at 3.10
https://github.com/python/cpython/blob/3.9/Lib/collections/__init__.py#L62-L65

closes odoo/odoo#85969

X-original-commit: 744e64a2b29c8491c124498dda0d4093a6de74fc
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-03-08 06:09:05 +00:00
Martin Trigaux 91366e5256 [FIX] base: do not overwrite the overwrite value
The signature of the _load_module_terms was changed at ac63556e23 to
pass explicit parameters instead of values hidden in the context

The previous code used working on a copy of the context when modifing
the 'overwrite' key. This was no longer the case after ac63556e23.

In case multiple languages are updated at the same time (as when a
module is updated), the 'overwrite' value is set to True after the
first loop.

To reproduce:
1. Create empty db with language English and without demo data
2. Activate languages fr_FR, fr_BE and fr_CH
3. Install module "note"
4. Now change in the fr.po the msgstr for this msgid:
   "By sticky note Category" -> "Par catégorie de note collante FR"
   and in the fr_BE.po the msgstr for this msgid:
   "By sticky note Category" -> "Par catégorie de note collante BE"
5. Now update the module note without overwriting translations
   (--i18n-overwrite option not set)
Observed behaviour:
The translations are overriden

opw-2760359

closes odoo/odoo#85768

X-original-commit: 37b98d413debabcd966718b2834d34f349e3cfbc
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-03-03 16:17:59 +00:00
Martin Trigaux e3a7aa5bd0 [IMP] test_mail: add test for ce342f42f21cad3
Without ce342f42f21cad3 the new test fails because copying an
attachment requires write access to mail.template

closes odoo/odoo#85271

X-original-commit: d5ceaa13a36e86e97f14e870ade477f62234b304
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-02-24 10:15:55 +00:00
Martin Trigaux 99901f003e [I18N] l10n_fr_fec: synchronise translations
msgmerge with .pot file

Fixes odoo/odoo#83457

closes odoo/odoo#84802

X-original-commit: 462982d8c3ad4df3ceef8787492ea7737c0d68d1
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-02-17 16:41:51 +00:00
Martin Trigaux 9fbf706ba8 [I18N] *: export saas-15.2 translations
closes odoo/odoo#84475

X-original-commit: 8ea2605fbfec6277d7a01b6e73548a9585866c61
Related: odoo/enterprise#24289
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-02-14 10:44:50 +00:00
Martin Trigaux ea3608ef46 [FIX] website_sale_digital: translate help message
closes odoo/odoo#83556

X-original-commit: 02321b861a3ea3670bf49de586c1bf304a56a670
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-01-28 11:27:42 +00:00
Martin Trigaux ae3629e6b9 [FIX] base: better copy of attachment
It was not possible to set a different value via the field datas
Add tests

closes odoo/odoo#83175

X-original-commit: b1f047430c97ad4c0da028c1654ce640378e2f51
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-01-21 15:04:21 +00:00
Martin Trigaux 16119a07f9 [FIX] mail: skip empty emails
When trying to identify the user sending an email, do not match anyone
without email.
Sometimes we get an email without a valid From address (spammers or
bugs), the previous code was trying to find users with this email.
In historical databases, we often have many users without an email
address, they should not match the search.

This commit fixes two bugs:
_mail_find_user_for_gateway:
No longer match on the first res.users with no email when identifying
the user using the gateway. This was not problematic (as we have a
fallback on self._uid anyway) but it is more accurate for tracebality
of emails.

_find_members
This method is called from _alias_get_error_message to verify that the
sender is indeed in the group with the followers restriction. On large
mailing list, it is not uncommon to have members with empty emails
(migration, historical reasons,...). Sending an email without any From
was matching on these subscribers without email and the email was
accepted.
These emails are invalid and should not be accepted.

closes odoo/odoo#83122

X-original-commit: 8ec7b92467da2856a496210af1f2232eba6bafb4
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-01-20 17:39:20 +00:00
Martin Trigaux d9091ed043 [FIX] point_of_sale,base,: skip store_fname
The store_fname is calculated based on the checksum, as for file_size

and checksum, skip during create/write
Avoid replacing in place the attachments in base as this breaks some
tests reusing the vals_list content (e.g. test_complete_me

Set datas in the copy to keep the content when duplicating a record
(e.g. test_14_duplicated_css_assets fails without this)
running twice because of @warmup share the same self.vals)

closes odoo/odoo#82919

X-original-commit: 611e6794376b0d60291dec085485bb2fb4e31a33
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-01-18 10:09:59 +00:00
Martin Trigaux 9c16f38fd5 [FIX] microsoft_calendar: use recent dates
Test was failing since 2022-01-16, probably a max 2 years sync

FAIL: TestSyncOdoo2Microsoft.test_restart_synchronization
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/mock.py", line 1325, in patched
    return func(*newargs, **newkeywargs)
  File "/data/build/odoo/addons/microsoft_calendar/tests/test_sync_odoo2microsoft.py", line 21, in patched
    return func(self, *args, **kwargs)
  File "/data/build/odoo/addons/microsoft_calendar/tests/test_sync_odoo2microsoft.py", line 84, in test_restart_synchronization
    self.assertMicrosoftEventPatched(event.microsoft_id, {
  File "/data/build/odoo/addons/microsoft_calendar/tests/test_sync_odoo2microsoft.py", line 40, in assertMicrosoftEventPatched
    MicrosoftSync._microsoft_patch.assert_called_once()
  File "/usr/lib/python3.8/unittest/mock.py", line 892, in assert_called_once
    raise AssertionError(msg)
AssertionError: Expected 'mock' to have been called once. Called 0 times.
Calls: [call._constrains(calendar.event(2049,)),
 call._constrains().__iter__(),
 call._constrains().__len__()].

closes odoo/odoo#82849

X-original-commit: 86911c4e9b9f86f3b9a5625b973e78103a7b0286
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-01-16 12:33:08 +00:00
Martin Trigaux 94ac3165e1 [FIX] website: do not translate code
Header of XML files should not be translated.
Before this commit, some users may translate the XML header and get
invalid XML if translating words like "encoding"

Fixes odoo/odoo#82155

closes odoo/odoo#82439

X-original-commit: aaac6fc04f4e5aa4c9ad68d9e844f3e786044800
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-01-10 13:52:53 +00:00
Martin Trigaux 5169fc0c20 [FIX] web: add record id when uploading
Before that, uploading a file from a kanban was adding res_id=0
Was missing from 5e81850ea6

closes odoo/odoo#82101

X-original-commit: 6b4b68a2682a233ca058f3b89ea0aa096061c0eb
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-30 20:46:52 +00:00
Martin Trigaux cfb9967d37 [FIX] website_forum: set return content-type
The request being of type http, the returned Content-Type was
text/html while the select2 request exepected json in the dataType
2021-12-20 13:55:00 +01:00
Martin Trigaux 4107d17b01 [FIX] website_profile,forum: avoid relative links
The origin parameter must be an absolute link (starting with a /)
To be consistent and always have a leading slash (and avoid relative
links if the developer forgot to add a leading slash)
2021-12-20 11:39:03 +01:00
Martin Trigaux bf460685fc [FIX] mail_group: display the date of the message
This will avoid spending half hour hunting why an inactive employee
was sendig a spam before realising it was from 2 years ago (true
story)

Modify the tree view to be coherent

closes odoo/odoo#81219

X-original-commit: cb3e34db1b2ce6ffe82ee15cc21ded9bbac91062
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-10 12:49:55 +00:00
Martin Trigaux 4226b3b4d0 [FIX] web_editor: use helper
A designer may not have access to ir.model.fields, use the fields_get
helper instead

Fixes odoo/odoo#80948

closes odoo/odoo#81123

X-original-commit: 826100a5b5ecaf62dfe6870bf5ad48a37cd2d7f7
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-09 12:05:03 +00:00
Martin Trigaux d99cfd9416 [I18N] *: export saas-15.1 source terms
closes odoo/odoo#80964

X-original-commit: 0663892a34896980008eb0de69aeb58019a67e89
Related: odoo/enterprise#22759
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-07 13:48:53 +00:00
Martin Trigaux b36e784ff2 [FIX] website: allow redirection to external websites
Before this commit, the redirections were only possible localy
(e.g. making a redirection to
https://www.bloggiflette.com/potimarroniflette on https://www.odoo.com
was redirecting to https://www.odoo.com/potimarroniflette)

It is safe to allow external URLs as only Website Designers can modify
it.

closes odoo/odoo#80874

X-original-commit: 133424025b22454fa88252806282f647e158d390
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-04 06:35:51 +00:00
Martin Trigaux b50a705d04 [FIX] base: ensure all attachments are in sudo
>>> u1 = self.sudo(False).browse(1)
>>> u2 = self.sudo().browse(2)
>>> (u1 + u2).env.su
False
>>> (u2 + u1).env.su
True

Ensure all attachments are always in sudo

Before this commit, a portal user could not go in debug asset

Introduced at 3a98996eed

closes odoo/odoo#80807

X-original-commit: 9f0ce611b2acf5927a7703a7811081c4adbc3f41
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-03 07:27:40 +00:00
Martin Trigaux 8519df849e [FIX] website_sale: allow public user to print cart
When the public user is connected, allow him to print the report of
the open cart.
Since 61b4b6777d64 the sudo is not enough but with_user(1) is
required.

closes odoo/odoo#80803

X-original-commit: a4021965f1f049c69186e1f2acbc55ae59ee8730
Signed-off-by: Olivier Dony <odo@odoo.com>
2021-12-02 18:40:13 +00:00
Martin Trigaux aa07f93ef7 [IMP] package: update lxml version
Update the version to benefit from the fix for
https://github.com/advisories/GHSA-pgww-xf46-h92r
https://nvd.nist.gov/vuln/detail/CVE-2020-27783

This vulnerability is reproducible in Odoo with
html_sanitize(..., sanitize_tags=False) which does NOT happen for
user-facing content.

Remove old compatibility check (lxml 3.1 was released in 2013)
and cleanup global variables only used once

closes odoo/odoo#64248

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-12-01 14:07:47 +00:00
Martin Trigaux cd464d84d7 [FIX] sale: render the report as superuser
Same as 5dde19c92ecee, sudo is not enough but the report needs to be
rendered with the user 1.
The access token proves the user has the access, the fact that he is a
portal, employee or public should not change the result

closes odoo/odoo#80491

X-original-commit: 66ab2ae213f05b055a032d0810de1de9334741ac
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-26 20:37:46 +00:00
Martin Trigaux a0548c65b5 [FIX] mail_group: avoid "Re: False" reply
If the subject is not set, the wizard set the subject as "Re: False"

closes odoo/odoo#80372

X-original-commit: 169775419e0f14723c19ff5f14e0907c179721d9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-25 10:51:45 +00:00
Martin Trigaux a8e50921af [FIX] *: correct typos and English errors
closes odoo/odoo#80181

X-original-commit: efd178daee689192d4e930a075475587038b3e0d
Related: odoo/enterprise#22439
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-22 14:48:04 +00:00