Information was already present, let us use it instead of having access issues
on membership.
Commit linked to task ID 1941250 and PR #31708.
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When displaying a channel content all its slides are displayed in a
list view or cards view. Even slides current user cannot read because
he is not member of the channel are displayed, even if there is no link
(and access rights prevent them for effectively accessing the slide).
Purpose is to display a channel content without giving access through
ACLS at its slides.
However this domain computation was not correctly matching real use case
* publishers should see everything;
* public users should not see unpublished slides;
* members not publishers should not see unpublished slides unless they
uploaded it;
Commit linked to task ID 1941250 and PR #31708.
Purpose of this commit is to have a method allowing to fetch slides
and have them ordered by category with some info on the category. It
fully supports uncategorized slides.
This commit also fixes the lessons list view of a training course. When
having rights to edit the channel the category name was not editable.
We now use a real browse record allowing to edit the category names
directly in this reorderable list view.
Commit linked to task ID 1941250 and PR #31708 .
Display
* improve color of trophy displayed on top of course main page (success if
course done, warning while working on it);
* correctly fetch and display karma/xp points on course lesson list. It is
either gain of next try, either awarded points depending on slide
completion;
* fix control buttons in course main page (prev, next, set done,
set completed, fullscren), notably correctly set them disabled;
Linting / Code
* put demo in no update;
* rename some parameter in website_slides_survey to avoid conflict between
quiz (on a slide) and certification (a survey);
Commit linked to task ID 1941250 and PR #31697.
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In order to se the 'next rank card' and the user karma on user's profile page,
not only the first rank is needed but also higher ranks. Otherwise everyone
will be 'Newbie', even the admin.
Moreover it is easier to update existing data for things like rank than having
to figure out how it works.
Task ID : 1941250
PR #31697
This commit sets the completed flag to True for a slide of type certification
when this certification is succeeded (quizz_passed set to True).
Also, the Download certification button has been added to the fullscreen mode
if the certification is passed by the user.
Task ID : 1941250
PR #31697
If there are too much users to show on the page and to avoid performance
issues, a pager is now applied on the all users page.
A new pager based on website_pager is added in order to ease the navigation
through the potential high number of pages. 'Go to first page' and 'Go to last
page' buttons have been added and the design of the pager have been adapted
to be more integrated into the new eLearning platform.
Also add the pager on the slide page if search category is applied. The pager
was already computed in the controller but not displayed.
Task ID : 1946160
PR #31697
Purpose
=======
This commit adds a stat button on the survey form view showing the amount
of answers with the quizz_passed field set to True.
It allows to quickly see people that have been granted the certification.
On click, the stat button redirects to the answers list view with the "Quizz passed"
filter defaulted to True.
Purpose
=======
The quizz_passed field is now more important because it determines whether
a certification has been successfully taken or not.
This commit adds the quizz_passed field in:
- The search view of user_input
- The list view of user_input
- The form view of user_input (along with the score)
Purpose of this commit is to perform a cleaning and upgrade of the lesson
view in front-end when not using the fullscreen mode. This page had not
been updated since eLearning addition.
A method is added on slide model to have a protected method computing quiz
related information on a given set of slides, notably potential karma gain,
gained karma and number of attempts. It is mainly a code move from controllers
now working in batch.
Some linting is also done, notably a badly-named file.
See original eLearning task for main specifications [1].
Commit linked to task ID 1941250 and PR #31657.
[1] See task ID 1902304
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
To avoid exception:
TypeError: Mixing apples and oranges: gamification.badge() - gamification.badge.user(1,)
when rule_auth of a badge is set to `having`.
opw-1945440
closes#31436closes#31595
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Since f8b38f64d dictionaries "groupbys" are the same object between the
pivot model instance and the headers menu.
But this causes an issue in 12.0 since when there is no results, the
headers menu groupbys is truncated and now being the same object, the
pivot model instance is also truncated.
So succedding search that find results would possibly have lost the
groupbys which is unexpected and breaks some 12.0 tests not expecting
it.
With this changeset, the groupbys are not truncated anymore.
Without the change, the added test fails with:
Column groupby not lost after reload after empty results
expected: { "pivot_column_groupby": [ "customer" ],
"pivot_measures": [ "__count" ], "pivot_row_groupby": [] }
result: { "pivot_column_groupby": [], "pivot_measures":
[ "__count" ], "pivot_row_groupby": [] }
closes#31644
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Since those taxes are missing a sequence and they're at the bottom of
the data, they're being taken as the default ones for the mexican chart
of accounts. However, the default taxes for sales and purchases should
be IVA 16%.
closesodoo/odoo#31651
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The generation of the deffered revenues took initially 471s.This
improvement permit to reduce the time to 72s (behave Cprofiler).
The issue was related to the fact that all the message post and logs
invalids the cache. It results that several read requests were
repeated multiple times.
closesodoo/odoo#31750
Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
To reproduce:
1. go on list view
2. open record in form view
3. come back on list view
4. switch to kanban
5. open record in form view
6. click on breadcrumb
Before this rev. we were back on the list view, and not the kanban view.
This is due to the fact that the breadcrumb was not updated when switching view,
(if a controller was already existing) so the form view control panel breadcrumb
was still referencing the wrong (list) controller.
This bug appeared with the control panel refactoring, which is now managed by
the view itself (and not the action manager as previously).
Task 1932646
closesodoo/odoo#31598
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
- Since the commit 5fcf891e07 an issue has
been introduced in the `analytic.account.analytic` name_search method.
In some cases searching through analytic accounts will return no
results when it should.
The issue is due to a bug in `expression.py` that doesn't correctly
handle the fields in `auto_join`.
The issue is described here https://github.com/odoo/odoo/issues/25175
and will be fixed by the ORM team.
closesodoo/odoo#31628
Signed-off-by: Christophe Simonis <chs@odoo.com>
Inline (base64) embedded images are not supported by most mail
clients (gmail on top of them), this fix save those images as
attachments and replace the src tag with the url of the
generated image so the image correctly renders.
opw-1929940
closesodoo/odoo#31532
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
- `hr.leave` and `hr.leave.allocation` should have the same record
rules, otherwise leave approval behavior can be unpredictable.
As a Holidays Team Leader:
For example you could see the approve button on a leave but cannot
approve it because the `_check_holidays` fails
closesodoo/odoo#31620
Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
- Allow users with the "Holidays Team Leader rights" to approve the
leaves of the employees they manage.
closesodoo/odoo#31586
Signed-off-by: "Christophe Simonis (chs)" <chs@odoo.com>
This commit introduced a regression in web_studio, discovered at opw-1947380
A fix in web_studio will be integrated too but the regression is the proof this
commit should not have been integrated in 11.0.
While the new behaviour introduced at d855e3911f makes more sense, it is still
a change of behaviour that should not target a stable version.
For the problem raised at opw-1887162 that d855e3911f was trying to fix, a
workaround should be used instead.
For instance, setting a widget='html_frame' allows to translate in the website
editor that handles this correctly.
In master, the new behaviour can be maintained and eventual regressions will be
investigated there.
closesodoo/odoo#31585
Signed-off-by: "Martin Trigaux (mat)" <mat@odoo.com>
* rewording of XML naming section
* remove the convention of suffixing inherited XML ids
with `_inherit_my_module, as the information is in the
complete XML id name (prefixed by module name). This will
avoid too long XML ids.
* extend convention for the name of groups, views, ...
Task-1817988
This commit
* removes deprecated guidelines for static file and assets struture;
* fixes some typo and mistakes;
* correctly links JS guidelines section;
* adds a running example to ease understanding;
* adds missing section about security files;
* adds text blocks for each directory to show directly the
expected result of each section;
* perform some rewording;
Thanks to @pedrobaeza for its review.
Task-1817988
Render from payment//payment_acquirer.py promises:
All templates will receive:
'feedback_url', 'return_url', 'cancel_url', 'error_url'
However they are all in -> FIXME.
After 6 years in FIXME, this promise is still a lie.
It is unfortunate since the Adyen payment provider requires 'return_url' to work.
Before, this function was called by _get_shop_payment_values,
which provided a value for it.
We copy the value that was given there directly as a default in render,
so that it doesn't crash no matter what method calls it.
opw 1928918
opw 1944142
closesodoo/odoo#31814
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
A numpad in right-to-left language is not right-to-left.
So with this change we keep numbers in the order:
1 2 3
4 5 6
7 8 9
and not how it was currently with RTL support:
3 2 1
6 5 4
9 8 7
We used the directive `/*rtl:ignore*/` that prevent rtlcss to mirror a
rule but this also could have done with eg.
.o_rtl .pos .numpad button { direction: right; }
.o_rtl .pos .popup-numpad { direction: rtl; }
so when the reversed is reversed (only in rtl) we get back the original.
opw-1950001
closes#31888
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
- Install `account_cancel`
- Create a vendor bill for Partner A, cancel it
- Create a new vendor bill for A
The 'Auto-Complete' suggest a bill with an empty name, and only an
amount. It corresponds to the canceled bill.
On a canceled bill, the `number` field is empty, and consequently the
`name` is empty as well.
Whatever is the state of the bill, displaying a bill is useless is only
the amount is shown. Therefore, we make sure to only display the bills
with a number set.
opw-1950846
closesodoo/odoo#31863
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
1. Encapsulate `show_visible` to avoid duplicate same code in filtered and to
make it more easy to read.
2. When GEOIP is enabled, `_get_pl_partner_order` would retrive the available
pricelists for that country group.
We should also ensure the returned pricelists are also available on that
website
3. Rewrite the `country_code` condition in one line thanks to 1.
4. !! Do not use `property_product_pricelist` in the method as it is not cached
and now it depends website. Anyway it was useless as it was a duplicate of
`partner_pl`.
5. Add `is_public` to the if condition as it was actually implicit as if not
public it and no pricelists it would go in previous condition and set the
pricelist from `property_product_pricelist`.
6. The last if condition (`not country_code`) has always been subject to fixes
and always broke a flow to fix another one (see 60300fc2 and e11908d42, both
were wrong).
This condition refactoring should still preserves the beavior fixes
mentionned in both commits and fix the flow where a logged in user would not
get selectable pricelists if he has a partner_pl (property_product_pricelist)
before entering the all_pl filtered.
closesodoo/odoo#28301
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit, when accessing an user's pricelist, it would raise a 500
error in multi-company environment.
Indeed, when doing `self.env.user.partner_id.property_product_pricelist`, even
if self.env is not un sudo mode, the compute from `property_product_pricelist`
is executed as sudo. Since this method is then doing a `search()`, it won't use
the multi-company pricelist ir.rule. It will return all the pricelist,
including the ones from other companies.
Then, when trying to read that pricelist, it will raise an access error.
Now, we correctly execute the compute (and so the search) in the user env, it
won't get pricelists from other companies.
Before this commit, if the website's company was different than the user
company, the ecommerce would use the user's company instead of its own
pricelists.
Step to reproduce:
- Set company2 to website1
- Create a pricelist1 for company1 and a pricelist2 for company2
- With an user from company1, visit the website1.
- The pricelist used will be the one from the user, pricelist1 and not the
pricelist2 from company2 which is the website1 company.
Before this commit:
1. Non Public User would get the main company pricelist returned when calling
`get_current_pricelist`. As this is saved in an `ir.property`
(`property_product_pricelist`) that is not website dependant, that pricelist
would always be returned on every website.
This is a problem if that pricelist is website limited, you should not be
able to use it on other websites.
2. Public User would not have a valid pricelist on other website than the
default one. Indeed, every pricelists are restricted that default website.
It would result in prices shown as "0" (without currency symbol) on the shop
3. Pricelists set as selectable without a website_id set would not be
selectable
4. Public User would not get a fallback pricelist when reading its
`property_product_pricelist`. Indeed, the public user's partner is not
active and since the refactoring of this field compute method to be a multi,
it would end up doing a search() instead of a browse(). Thus, it would find
a pricelist for the public user but it would not set it.
This commit:
1. We override and check that pricelists returnes by the `ir.property` are
indeed available on the current website.
2. Remove the website restriction on `Public Pricelist` so other websites have
at least one pricelist available.
3. `pricelist_ids` on `website` now return all available pricelists including
the ones that are generic (no website set)
4. We search for inactive partners too.
Part of this commit fixes part of 27861
Github-25109
The `_get_pl()` method introduced with bcb395616 was replaced by
`_get_pl_partner_order()` in afe1d20dac.
After that, it looks like this method was never called again.
Plus, add a missing ensure_one() (not critical).
Before this commit, at multiple places to check if we were in a frontend
context we would check if `request and hasattr(request, 'website')` and
then access `request.website`.
Now, we call an utility method to get that website if we are in a frontend
context. If not the method will return False.
This method will be usefull for incoming pricelist fixes & tests.
Indeed, we will have more check of that kind and this will be easier to mock as
mocking this method will be enough, instead of mocking every method doing that
if condition to simulate a frontend context (to do website tests in python
wihout having to go frontend with a tour).
In the case of attachment_ids, comodel._fields[inverse] can be res_id,
an integer field. Such fields do not have a default ondelete attribute.
opw 1945926
closesodoo/odoo#31864
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
- Create 2 companies A & B
- Set the superuser in A
- Create a product P:
Product Type: 'Service'
Service Tracking: 'Create a task in a new project'
Project Template: set one for both companies
- Switch to company B
- Create a SO with P, validate
- Access the project through the stat button 'Project(s) Overview'
An `AccessError` is raised.
In case no 'Project Template' has been set for company A, the project is
created without the specified template.
This is because the new project is created as `sudo`, and the
`project_template_id` field is a company-dependant field. Therefore, a
project template from company A is used to create a project in company
B.
opw-1953011
closesodoo/odoo#31883
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Was forward-ported
This is problematic as it has the old translation syntax, trying to import a
model:ir.ui.view entry can crash (should be model_terms)
Export mass_mailing where the string "Update my subscriptions" is now present
(no longer in website_mass_mailing as in 10.0)
closesodoo/odoo#31868
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Create an event with a price.
Create a pricelist with a different price for the event.
Add the pricelist to the Public user.
On the website, open the event to register.
Before this commit, the shown price is the one of the event, and not the
one of the pricelist.
Now, the price is shown correctly and take into account the pricelist.
opw-1951252
closesodoo/odoo#31848
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When sequentially paying multiple SO with wire transfer, the user was
always redirected to the first paid SO.
This commit fixes this issue by redirecting to the most recent one.
Technical choice:
payment_transaction rows are ordered by id desc so we can trust the
first one will be the most recent on the client side (in the scope of
this diff).
opw-1949629
Closes#31754
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
In 11.0 f8b38f64d improved the column group by managment when reloading
several times by having the same "groupbys" dictionaries between the
pivot model instance and the header menu.
This has been reverted in 12.0 (with c6e7adfb95) because the following
pivot tests failed with the change:
- 'rendering of pivot view with comparison'
- 'export data in excel with comparison'
The failure is because now that the "groupbys" dictionaries are the same
object, the truncated dictionary of a header truncate the one of the
model instance.
So if we search something that has no results, then something with
results, the groupbys could be lost.
This behavior has no reason to be and is changed in 11.0 with #31644,
this commit is the forward-port of f8b38f64d and #31644.
closes#31627
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Since https://github.com/odoo/odoo/commit/5a030db3eb77b6d80187f8ae1a64303b2f50391d
the HTML editor displayed the translated versions of the templates it
allows to customize. So if the user edited and saved such a template,
the non-translated version was saved with translated-version content.
The behavior before the mentioned commit was:
1) Load all views the HTML editor allows to edit
2) Each time a view is displayed, re-make a RPC to load the view again
The mentioned commit made this simpler by making:
1) Load all views the HTML editor allows to edit
2) Each time a view is displayed, simply show the previously loaded view
... the problem was that the step (2) of the old behavior was
explicitly saying (client-side) to load the view's untranslated content.
This commit makes step (1) always load the untranslated versions of the
views (server-side).