Commit Graph
130232 Commits
Author SHA1 Message Date
Julien Castiaux 1b057dd76b [REF] mail,test_mail: prefer EmailMessage over deprecated Message
[PEP 594][1] is going to depreciate legacy `email.message.Message` API in
PY3.8 in favor `email.message.EmailMessage`.

All `email.message_from_x` constructor functions take an optional
`policy` argument. The policy can either be `policy.compat32` to
generate an `email.message.Message` instance, either be `policy.SMTP`
to generate an `email.message.EmailMessage` instance.

The [current][2] default policy is `policy.compat32` but will change in
a future version of python. It is recommended to always specify the
policy.

[1]: https://www.python.org/dev/peps/pep-0594/#email-legacy-api
[2] https://docs.python.org/3.7/library/email.parser.html#email.parser.BytesParser
2019-09-17 11:20:13 +00:00
Julien Castiaux a7a63bdb4a [REF] doc: remove deprecated modules
[PEP 594] is going deprecates the `imp` standard modules in
PY3.8 in order to completely remove them in PY3.10.

The `imp` module provides the `new_module` function. It returns a new
module created solely using its name. The `types.ModuleName` is a
drop-in replacement.

Task: 2003936

[PEP 594]: https://www.python.org/dev/peps/pep-0594/\#imp

closes odoo/odoo#36463

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-09-11 08:10:51 +00:00
Gwenaël SERRE 2e48410454 [CLA] Signature for Bikibi
closes odoo/odoo#36747

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-09-13 11:55:12 +00:00
Julien Castiaux 4f03a5f136 [FIX] *: remove old deprecated modules/functions
PEP-594 is deprecating a bunch of modules. As part of the cleanup, we
are also dealing with long deprecated modules, functions and aliases.

* `assert_` -> `assertTrue`
* `assertEquals` -> `assertEqual`
* `assertNotEquals` -> `assertNotEqual`
* `assertAlmostEquals` -> `assertAlmostEqual`
* `assertRaisesRegexp` -> `assertRaisesRegex`
* `assertRegexpMatches` -> `assertRegex`
* `base64.encodestring` -> `base64.encodebytes`
* `base64.decodestring` -> `base64.decodebytes`
* `inspect.getargspec` -> `inspect.signature`
* `inspect.formatargspec` -> `inspect.signature`
* `logging.warn` -> `logging.warning`

closes odoo/odoo#36863

Task: 2003936
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-09-17 11:36:42 +00:00
Christophe Simonis 6c948c36bb [MERGE] forward port branch saas-12.5 up to 197474e5b9 2019-09-13 18:07:59 +02:00
Robin Heinz 197474e5b9 [FIX] point_of_sale: Clean tax regime domain
There was an useless domain on the tax_regime_selection in the xml field, now it's removed.

closes odoo/odoo#36859

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-09-13 12:06:00 +00:00
svs-odoo 1ad8b88fba [FIX] stock: reordering rules count by company
Before this commit, the reordering rules computed quantity fields wasn't
computed by active company but for all companies. So, set `compute_sudo`
on false for `nbr_reordering_rules`, `reordering_min_qty`,
`reordering_max_qty` of products and product templates to avoid to
search with sudo active and to search by company.

closes odoo/odoo#36856

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-13 12:41:16 +00:00
svs-odoo 5d75d07bad [FIX] mrp: product quantities by company
Before this commit, the product/product template computed mrp quantity
fields wasn't computed by active company but for all companies.
So, set `compute_sudo` on false for the different computed mrp quantity
fields of products and product templates to avoid to search with sudo
active and to search by company.
2019-09-13 12:25:25 +00:00
svs-odoo d57a22035a [FIX] stock: product quantities by company
Before this commit, the product/product template computed quantity
fields wasn't computed by active company but for all companies.
So, set `compute_sudo` on false for the different computed quantity
fields of products and product templates to avoid to search with sudo
active and to search by company.
2019-09-13 11:32:14 +00:00
Martin Trigaux 73e70673e7 [I18N] *: export saas-12.5 source terms
closes odoo/odoo#36853

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-09-13 11:38:37 +00:00
Martin Trigaux 5afcc9a42d [FIX] *: typos, wording 2019-09-13 11:15:43 +00:00
Joseph Caburnay b2f94014d8 [FIX] point_of_sale: prevent opening session if no chart of accounts
Before this commit, a user can create a Point of Sale record and
proceed on launching a new session. If the user ignored the warning
message regarding the installation of Chart of Accounts, the opened
session will not work properly and the session can't be closed.
This commit prevents the user from launching a new session if there is
no Chart of Accounts installed for the current company.

closes odoo/odoo#36777

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-09-13 09:30:27 +00:00
Yannick Tivisse 3eb06a27da [IMP] res_config: Apply groups to users accross companies
Purpose
=======

When enabling/disabling a group, the modification is only applied
to the users from the enabled companies.

It should be applied to all the users.

closes odoo/odoo#36744

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-13 11:34:50 +00:00
Xavier-Do 48503fcf08 [IMP] core: improve logging in case of subtest failure
closes odoo/odoo#36787

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-09-12 13:20:54 +00:00
jbm-odoo 7d623a75a2 [FIX] hr_holidays: Time unit in time off summary
If time off type is in hours, I want to have hours as unit in the summary
(upper my personnal calendar).

closes odoo/odoo#36421

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-12 07:39:05 +00:00
fja-odoo 424adb63e3 [IMP] gamification, *: remove KarmaError
* = stock, test_website, web, website_forum, website_slides, base

Replace KarmaError with AccessError and remove the related override made
on crash_manager and ir_http.

task-2069890

closes odoo/odoo#36655

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-09-12 13:49:02 +00:00
Christophe Simonis 5a273e74f0 [MERGE] forward port branch saas-12.4 up to fe59754c52
closes odoo/odoo#36721

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-13 13:32:51 +00:00
Josse Colpaert dc5f83b633 [FIX] l10n_lu: use correct xml_id
Somehow this xml_id was not updated.  Logically,
the tags for the refund should be the inverse
of those in the normal invoice.

closes odoo/odoo#36842

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-09-13 10:14:10 +00:00
Aurélien Warnon 4e39a89944 [IMP] survey: use default filter instead of different action
When accessing answers (survey.user_input) through the survey form view, we used a separate action
to hide the test entries.

This could be confusing when you actually wanted to see the test entries for that survey.

This commit changes that to use a default filter instead, leading to the same visual behavior.

Task #2058598

closes odoo/odoo#36835

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-09-13 11:29:13 +00:00
Aurélien Warnon 4e712fc2f9 [IMP] survey: mark certification documents of test entries as "specimen"
When a user tests the Survey, he should not get a valid certification document when he succeeds.
To avoid that, we add a "specimen" watermark on the background when the user_input is a test_entry.

In addition, we also don't send the mail containing the certification for test entries.

Task#2058598
2019-09-13 11:28:04 +00:00
Xavier Morel 66df3f0479 [ADD] web: make export FAYT also match technical names
Previously only matched the label / user-visible name.

closes odoo/odoo#36472

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-09-13 10:59:24 +00:00
Xavier Morel 39d66dba59 [FIX] base_import: improve image feedback & remove image URL restriction
* If the item is not an acceptable URL, check if it's base64 and
  return an error if it's not, otherwise it just ends up blowing later
  when the content of the field is assumed to be base64 and explodes
* The URL having to contain png or jpg or tiff or gif or bmp doesn't
  make much sense (especially in this modern world where
  placekitten.com doesn't add extensions, not to mention this doesn't
  actually check for extensions). After discussing with odo it doesn't
  seem to have any security impact, the only thing this filter does is
  annoy people for no reason.
2019-09-13 10:15:20 +00:00
Xavier Morel f58368210c [ADD] base_import: batching (& some other features)
various UI changes
------------------

* renamed "test import" button to "test"
* move relation fields thing to debug mode
* remove "Defer parent/child computation" option as it was deprecated
  / removed from the backend in
  80f1ac3599, turns out this checkbox
  existed inactive for longer than it's been of any use (added in
  68cb2ade09 on 2017-11-29, made
  non-operating on 2018-01-24, that's so sad)

batching
--------

* add support for batching imports (skip & limit parameters)
* modify client to use batched imports & properly adapt responses so
  it still looks like a single import for the client (more or less)
  e.g. update row numbers in error messages, etc...
* properly handle partial imports though
* disable usual loading throbber to have a single progress
  notification displayed continuously throughout all the batches: the
  normal throbber only shows after 3s of waiting for an RPC response,
  so it would keep flashing in and out (appear 3s into a batch's
  import then disappear at the end only to reappear 3s into the next
  batch's loading)

NOTE: the limit is row-wise. If a record straddles the limit (because
of nested O2M records), the record is imported in full and the "next
row" is whatever row follows the record. This means a limit of 10 can
lead to an import of 17 lines, and as the progress indicator is in
records# the increments can jump around.

Task 2059448
2019-09-13 09:45:29 +00:00
Gert Pellin 71e9c4dc7a [FIX] point_of_sale: close session in multi company
Close a rescue PoS Session from another company triggers this error:
"Please define income account for this product: "Office Chair" (id:5).

property_account_income_id on product is company dependent but no
company was forced before this fix.

closes odoo/odoo#36280

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-09-13 10:05:44 +00:00
Gert Pellin 20c097996e [FIX] point_of_sale: pos_payment group on session
TRACEBACK on pos.payment list view > Group By : Sessions
https://pastebin.com/cKESKmP6

session_id was not a stored field.
2019-09-13 10:05:44 +00:00
Gert Pellin d61be86bf0 [FIX] point_of_sale: pos_paiment breadcrumb
when consulting a pos.payment record, in form view, you get a "False" in
the breadcrumbs = the label is empty. Anything we could do about it ?
https://nimb.ws/sB7GEQ (NB : it works for returns (=negative amounts)
https://nimb.ws/M6QHJm )

This fix sets the breadcrumb to show the payment_id, the only field that
is unique for every payment and always has a value.
2019-09-13 10:05:44 +00:00
Gert Pellin 2d36eb8baa [FIX] point_of_sale: open payment form from list
Impossible to open a pos.payment form through the session. Go to PoS >
 Sessions > open a session > Payments > you have the list view, and the
 form view doesn't open if you click on a line. Demo :
 https://drive.google.com/file/d/1IUFSsUGRhnbHAniSh6pldfSlPqRh8_JE/view
2019-09-13 10:05:44 +00:00
Gert Pellin 6f950482d3 [FIX] point_of_sale, pos_restaurant: merging products
Before this fix product lines did not merge on adding a same product
after transfering an order or re-opening an order that was synced.
To verefy if lines can be merged an unused field 'type' was compared.
Removing this field fixes the problem.
2019-09-13 10:05:44 +00:00
Gert Pellin bc863ef4a5 [FIX] pos_restaurant: transfer empty order
Before this fix, if an empty order gets transfered to another table, the
screen gets stuck on the floorplan until the window is refreshed.
With this fix the new table is opened.
2019-09-13 10:05:44 +00:00
Gert Pellin ff4e4d8985 [IMP] point_of_sale: Connected devices strings
replace 'Other Devices' with 'Connected Devices'
2019-09-13 10:05:43 +00:00
Gert Pellin c32558e5e4 [FIX] pos_sale: traceback on installing sales
If a pos session is started in the automatically created pos config and the sales app is installed afterwards,
a traceback will be shown. This is because pos_sale tries to make
changes to the config, which are not allowed.

We removed the hardcoded team in data, and manage the default value
in an onchange on the company_id to keep a consistant team.
2019-09-13 10:05:31 +00:00
Simon Lejeune e4cba4d037 [FIX] purchase_requisition: supplier info
When a blanket order is opened, a supplier info is created and should be
used in priority over a regular supplier info with the same values.

That's what rev [0] tried to do but there was some mistakes: the
`purchase_requisition_id` field added in the order is ignored since it
isn't stored and the test didn't failed because the created blanket has
a lower price unit than the regular supplier info, meaning it is used in
priority. Setting the same price unit (50) result in the new purchase
order line merged in the first one.

Do not re-implement the same order.
Adapt the test now that we know the order didn't work (see rev[1]). The
user has to manually set a higher priority to the supplier info
generated by the purchase requisition.

[0] e85838d358
[1] 2ac4f2ee0f

closes odoo/odoo#36840

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-13 10:09:40 +00:00
Simon Lejeune 3f0ed7d045 [FIX] product: _select_seller
With the new ORM, x2m records are not ordered by default.

The _select_sellers implementation requires to loop on the supplier info
records ordered by their _order. We fix that by sorting with a lambda
with the same order set on the model. Simply using .sorted() isn't
enough since it does a sort in sql, so newId records are completely
removed from the resulting recordset.

This is related to task 1947351 and PR 34049.

We move the tests into purchase_stock and actually implement the tests
proposed in the task.
2019-09-13 10:08:48 +00:00
RomainLibert 4c9624db9d [FIX] web: add context to /report/download
This commit fixes the /report/download route in multicompany

Since the multi company revamp (a5b6f31cf2)
the multi company rules depend on the context.

However the route /report/download was not forwarding any context, this meant
that when trying to read some fields on a record in a company that is different
than the default one, it would crash with the multi company ir.rule

Forwarding the context from the session in the Javascript call is quite simple
however since (521f7d36c1) it also requires to change
the signature of the `report_download` method in order to pass the context to the final
method.

As there was already some code allowing the adding of some context in `report_routes`
this PR reuses this code by simply passing the context as a kwargs.

closes odoo/odoo#36839

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-13 10:00:34 +00:00
Simon Lejeune f6d88a2e8d [FIX] stock: put in pack without showing the reservation
rev[0] added the possibility to put in pack without setting any done
quantity on move lines but when the reserved move lines are hidden
(thanks to rev[1]) it got confused on which move lines to work on.

[0] e03c1a836f
[1] ffd5d5a097

closes odoo/odoo#36832

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-13 09:37:32 +00:00
wan 8d7837c035 [FIX] account: removing a line produced by a model
If a line was produced by a reconciliaion model, it shouldn't be put back
in the reconciliation propositions because a rpc request would not give
it back. Also, the line is not correctly formatted.

closes odoo/odoo#36826

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-09-13 08:57:17 +00:00
wan afb352cf8b [FIX] account: focus and click concurency in reconciliation widget
When trying to edit the amount of a proposition of an inactive
statement, the focus of the line tried and the edition of the amount
were racing one against each other causeing flickering and making it
hard to edit the line.
We removed the focus as it was intended for the keyboard navigation but
it was not fully usable, so we also removed the accesskey needed for the
focus.
2019-09-13 08:43:59 +00:00
RomainLibert 247df46453 [FIX] hr: remove duplicate group
This duplication was introduced by a forward port

closes odoo/odoo#36841

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-13 10:13:21 +00:00
Odoo's Mergebot d0e6c5fb37 [MERGE] survey, website_slides: fix various issues
PURPOSE

Fix various issues in eLearning application after new round of testing
and bug hunt. Some surveys fixes are included as they are used a lot
in eLearning.

SPECIFICATIONS

[FIX] mail: remove channel and partner default context keys when creating
  followers
[FIX] survey: fix another crashing computed field
[FIX] survey: set email_from on certification mail template
[FIX] website_profile: fix another broken image thingy
[FIX] website_slides: make content stat button redirection match counters
[FIX] website_slides: remove unnecessary action
[FIX] website_{slides, profile}: fix display of not square user image
[FIX] website_slides: avoid admin being twice member of courses in demo data
[FIX] website_slides: still another fix of computed fields
[FIX] website_sale_slides: synchronize publish status of a channel and its
  product
[FIX] website_slides_survey: create certificates with scoring by default

See sub commits for more details.

LINKS

Task 2065425 (avatar ratio badly displayed)
Task 2067324 (counters / action on content mismatch)
Task 2067872 (eLearning internal testing)
Task 2058598 (survey internal testing)

closes odoo/odoo#36756

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-09-13 13:10:57 +02:00
Thibault Delavallée 6e5b211f4e [FIX] website_slides_survey: create certificates with scoring by default
Certificate field is not sufficient, scoring type should be set by default
to avoid creating non certificates without knowing it.

Task 2067872 (eLearning internal testing)
Task 2058598 (survey internal testing)
PR #36756
2019-09-13 10:05:43 +00:00
Thibault Delavallée 0b4d052bb5 [FIX] website_sale_slides: synchronize publish status of a channel and its product
Currently when creating a payment-based channel with its product and then
publishing the channel public users cannot browse the channel as the product
is not readable.

This commit fixes that by synchronizing the publish status of channels and
their products.

Task 2067872 (eLearning internal testing)
PR #36756
2019-09-13 10:05:43 +00:00
Lucas Lefevre 290341b455 [FIX] website_slides: still another fix of computed fields
This commit fixes 2 issues coming from the recent ORM changes: records are
new records in onchange and compute methods must assign a value for all records.

In an onchange method, self.ids is a list of integer (real records)
whereas self.id is a NewId (virtual record)

Here a result dict was built using the reals ids as keys but later NewIds
are used as keys. Solution is to use record._origin to access the real record.

Moreover, the two dicts `result` and `type_stats` are the same. Assigning one
into the other is useless.

Task 2067872 (eLearning internal testing)
PR #36756
2019-09-13 10:05:43 +00:00
Thibault Delavallée 0eec4d22a2 [FIX] website_slides: avoid admin being twice member of courses
Since admin is responsible of all created demo channels and then re-added
manually as member in demo data of slide.channel.partner he is actually
twice member of some channels. This commit fixes that by resetting its
membership status before adding membership demo data.

PR #36756
2019-09-13 10:05:43 +00:00
Thibault Delavallée 98f847be3a [FIX] website_{slides, profile}: fix display of not square user image
When having not square images for user avatar several issues appear

  * website_slides: heroes of the week banner is broken as circles are not
    circles anymore. They look more like UFOs or funny snowmen;
  * website_slides: my user status / leaderboard / achievements card display
    is broken as image may take much more width than planned;
  * website_slides: channel page view displays user avatar when having joined
    it, and it is broken;
  * website_profile: user avatars in top 3 of users karma ranking is broken.

In this commit we apply strict rules on width / height combined to an object
fit in order to always have a bioutifoul displayed circled image.

Task 2065425 (avatar ratio badly displayed)
PR #36756
2019-09-13 10:05:15 +00:00
Thibault Delavallée 477b73ed31 [FIX] website_slides: make content stat button redirection match counters
Course content counters count only published content while content stat button
redirects to all contents. Solution to this mismatch is to apply a search
filter on button action to display published ontent by default.

Also remove unnecessary action. Using a type="edit" seems sufficient, no need
to define a python method just for that purpose.

Task 2067324 (counters / action on content mismatch)
PR #36756
2019-09-13 10:05:15 +00:00
Thibault Delavallée 1dbeaddeae [FIX] website_profile: fix another broken image thingy
As image fields have been renamed recently [1] we have to update controllers
of profile in order to write on image_1920, not image anymore.

Task 2067872 (eLearning internal testing)
Task 2058598 (survey internal testing)
PR #36756

[1] See 58a2ffa26f
2019-09-13 10:05:15 +00:00
Thibault Delavallée 65c3be37fd [FIX] survey: set email_from on certification mail template
Otherwise public users cannot receive their certification. Indeed email_from
will be the one of public user which is probably not set.

Task 2067872 (eLearning internal testing)
Task 2058598 (survey internal testing)
PR #36756
2019-09-13 10:05:15 +00:00
Thibault Delavallée e3828ec9cd [FIX] survey: fix another crashing computed field
Still due to some recent ORM changes: finding a real ID, assigning values
even in create mode with default values.

Task 2058598 (survey internal testing)
PR #36756
2019-09-13 10:05:15 +00:00
Thibault Delavallée 93c6f77799 [FIX] mail: remove channel and partner default context keys when creating followers
Purpose of this commit is to avoid conflicts when creating new followers
with existing context keys. Indeed some actions may propagate a default
partner id or channel id that is not wanted. Example if when inviting someone
on a slide.channel in eLearning, a default_channel_id is set in context
that clashes with follower creation, thinking it is a mail.channel.

Task 2067872 (eLearning internal testing)
PR #36756
2019-09-13 10:05:15 +00:00
Pierre Masereel a96048afcc [FIX] delivery: remove radio button
This commit (https://github.com/odoo/odoo/commit/6173dd21415ab441caaf4404bf812ce2413e29f0) put a radio widget on the carrier selection
which makes no sense, so we removed it.

closes odoo/odoo#36824

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-09-13 08:41:46 +00:00