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>
If the zipfile contains some garbage directories (e.g. leftover empty
directories from git, `__MACOSX` metadata folder, …) it seems
unnecessary to log an error, just skip the directory and don't mark it
as a proper / successful module.
closesodoo/odoo#31639
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
The default PoS picking sequence should not be reset.
Losing custom configuration can lead to errors.
For instance:
- A customer initially uses the default sequence until POS09999
- he changes it to another one of his own taste starting the
sequence over, like: WH/POS/00001
- In a module update, the sequence is reset and then we get the POS
prefix again.
- In the next picking, we could have a duplicated name, and an error
would raise in the Point of Sale.
opw 1962302
closes#32299closesodoo/odoo#32842
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Have a partner which is only a company
Print "Due Payments" report
Before this commit, the name of the company was shown in double
this was because both `name` and `contact_address` are shown in that report
but in the case of a company, or child of a company, the company's name
is included in contact_address
After this commit, the name appears only once
OPW 1970581
closesodoo/odoo#32838
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Have a SO with a partner in another language
Apply a quote template to a SO
Customize the portal view to show website_description of a product on the template
Translate it
Show the SO on the portal
Before this commit, the description of the product was not translated
This was because the field was not included in the onchange of template_id
causing that field to never have changed, that is, it kept the description
done injected with the first write
After this commit, the description is changed according to the partner's lang
OPW 1960977
closesodoo/odoo#32825
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
To reproduce:
0. Start an odoo v10 instance with --load=saas_worker,web
1. Install ecommerce.
2. Enable "Allow external users to sign up" and "Enable password
reset from Login page" from General Settings.
3. Open different session then signup a new user.
4. After successfull signup, the new user will be redirected
to the backend (/web).
Facts to consider:
1. odoo.addons.auth_signup.controllers.main.AuthSignupHome and
odoo.addons.website.controllers.main.Website both inherit
odoo.addons.web.controllers.main.Home
2. When instantiating an odoo instance *without* saas_worker,web,
the mro is the following:
( <class 'odoo.http.Home (extended by Website, AuthSignupHome)'>
, <class 'odoo.addons.auth_signup.controllers.main.AuthSignupHome'>
, <class 'odoo.addons.website.controllers.main.Website'>
, <class 'odoo.addons.web.controllers.main.Home'>
, <class 'odoo.http.Controller'>
, <type 'object'>
)
while the mro *with* saas_worker,web loaded is:
( <class 'odoo.http.Home (extended by AuthSignupHome, Website)'>
, <class 'odoo.addons.website.controllers.main.Website'>
, <class 'odoo.addons.auth_signup.controllers.main.AuthSignupHome'>
, <class 'odoo.addons.web.controllers.main.Home'>
, <class 'odoo.http.Controller'>
, <type 'object'>
)
You can notice that depending on how the instance is instantiated,
the order of inheritance is different.
The problem occurs when saas_worker is loaded, so this bug can be
experienced by saas clients.
Explanation of the fix:
Notice that the original code calls web_login of its super in its
web_auth_signup method. This is technique is used normally during
optimization (according to RCO). If website is installed, the
portal user should be redirected to '/' instead of '/web' and this
is defined in web_login of website. However, the web_login of
"website" is not called after signup because "website" is not super
of "auth_signup" when saas_worker is loaded (see the mro above).
Calling self.web_login will make sure that web_login is called from
top to bottom, and regardless of the order of website and auth_signup,
web_login of "website" will be called and makes sure that the
new portal user is redirected to the '/' and not to '/web'.
opw-1956980
closesodoo/odoo#32741
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The computation of hash integrity depends on the field
`tax_ids_after_fiscal_position`. However, this field is computed, but
not stored.
It means that if one modifies a fiscal position used in the POS, the
computation of `tax_ids_after_fiscal_position` will change.
Consequently, the hash computation of the order will be modified, and
the hash integrity of the journal will be corrupted.
We prevent the modification of the taxes implied in a fiscal position if
any POS order use it.
Closes#32665
opw-1969009
closesodoo/odoo#32701
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.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>