Commit Graph
129686 Commits
Author SHA1 Message Date
qsm-odoo 2d64bb58cd [FIX] web_editor: prevent removing a main editable area
When a snippet part is removed, like a column, we check that one of
its ancestor has a snippet editor attached and we remove all the empty
element up to and including that ancestor if possible. This way, if we
remove the last column of most snippet, the whole snippet is removed.

The problem is when that ancestor is a main editable area that should
not be able to be removed.

The case is currently probably never occuring but it could be backported
if needed. This is made in preparation of the mega menu task, during
whose implementation it was discovered.
2019-09-03 15:31:42 +00:00
Odoo's Mergebot d73d7b0724 [MERGE] website_slides: apply various fixes
PURPOSE

Purpose of this merge is to provide fixes and usability fixes or
improvements in eLearning.

SPECIFICATIONS

Improve "New content" modal: upload new course content should be revamped
-------------------------------------------------------------------------
* general layout: https://drive.google.com/a/odoo.com/file/d/1zbNO0Vg1262ijkXA6pwSuenMI0h4NsPm/view?usp=drivesdk
* remove picture tab;
* display as two column with preview on right on change of picture
or document;

Do not put odoobot responsible of demo courses
----------------------------------------------

Do not crash if there is any issue loading quiz
-----------------------------------------------

Do not allow fullscreen to bypass ACLs
--------------------------------------
Currently fullscreen takes all information from categorized slides to
display its menu. In order to avoid calls to server some information
is prepared in DOM to speedup loading. It means slide information is
available even when not being member of a course which leads to some content
leak.

This merge fixes that by correctly checking that a slide can be accessed
before allowing to have access to its information and embedded code. Access
of a slide is either member of a course, either course publisher.

Correctly set sequence of newly added content
---------------------------------------------

Purpose of this commit is to add new content at last position in frontend.
Indeed backend uses last position in embedded list view, frontend should
do the same. Moreover when having a lot of content, having everything at
the bottom of the screen at the same position of Add content / section
buttons makes sens.

Specifications

* when adding a new category: add it as last category;
* when adding a new slide in a category: add it as last slide of the
category;

Specific case of slide without category

* when adding a new slide without category: add it as last slide of the
channel (display it as last) but keep it on top in backend view
(display as first);

Improve content list display in frontend of eLearning

* contents without section are now at the bottom;
* fixed alignment of buttons icon (Add Content and Add Section)
* fixed broken design because of title too long

LINKS

Task 2049640 (website slides back2basics and fiximp)
Task 2058595 (eLearning v13 testing)
Task 2064112 (fullscreen bug report)
Task 2061672 (new content bug report)

Improve backend UI, views and user actions
------------------------------------------

Containing

* channel kanban view tweaking;
* channel form view: some spacing and renaming improvements. Also set
advanced field (new content email, share template) as group no one;

* slide kanban view tweaking;
* removed sections from kanban and list view for contents;
* contents form view: various improvements, with notably

* removed field website_url;
* set publishded date is now readonly, tracked and in group_no_one as
it is automatically set when publishing the lesson, and people should
not update it manually;
* removed the sum "Content" and replaced it by a stat button
* reword quiz constraint error messages;

* rating views improvements:
* revamped the kanban view of rating that were a bit broken;
* added a pivot view in Reporting/Reviews;
* updated graph view in Reporting/Reviews;

This commit also provides some usability fixes

* prevent sending email if new content is category;
* email: Prevent displaying an image if there is no image;

Fixes some display issues in eLearning frontend
-----------------------------------------------
* fix the share button in documentation. It was not working as model was
not correctly placed;
* fix top3 users banners broken in mobile;
* fix left menu of fullscreen being behind content on mobile (image, video);
* removed upload button in training channel aside as there are already
buttons available for that purpose;

Revamp "New Course" menu
------------------------
Purpose of this commit is to change the modal to make it more mobile friendly.
Notably remove the two columns.

Allow website publisher to create forum
---------------------------------------
Security file was buggy and not imported.

closes odoo/odoo#36348

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-09-03 18:18:54 +02:00
Odoo's Mergebot 9aefd9e8c6 [MERGE] stock, mrp and related addons: multi company
Add a `check_company` attribute on relational fields to apply a default domain restricting the records to the one of the record's company or without company.
Add a `check_company` method on Model to ensure these domains are respected.
Add a `check_company_auto` attribute on model to call `check_company` at create and write.

Use this in stock, mrp and related addons.

Joint work with
William Henrotin <whe@odoo.com>
Arnold Moyaux <arm@odoo.com>

task-1985992

closes odoo/odoo#36222

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-03 18:18:29 +02:00
Arnold Moyaux e4d64afc1d [REF] purchase_stock: multi company 2019-09-03 15:05:04 +00:00
Arnold Moyaux a5f07e16ad [REF] purchase_requisition: multi company
Adapt purchase_requisition to the multicompany changes.

task-1985992
2019-09-03 15:05:04 +00:00
Arnold Moyaux 20713735bf [REF] purchase: multi company
Adapt purchase to the multicompany changes.

task-1985992
2019-09-03 15:05:04 +00:00
Simon Lejeune b43b61e13d [REF] stock_landed_costs: multi company
Display company_id on the form.

task-1985992
2019-09-03 15:05:04 +00:00
Simon Lejeune 03925faa48 [REF] product: multi company
Add an optional company_id on product.packaging to be able to share
of restrict them, similar to what's done for product.product.

task-1985992
2019-09-03 15:05:04 +00:00
Arnold Moyaux 13d6f64a73 [FIX] mrp: same method name
Conflict between:
commit ed64250503
commit 16e7a4b4c7
2019-09-03 15:05:04 +00:00
Simon Lejeune ae9ac488ad [REF] website_sale_stock: multi company
Adapt the module to the multicompany changes.

task-1985992
2019-09-03 15:05:04 +00:00
Simon Lejeune 0f3b3e4afd [REF] product_expiry: multi company
Adapt the module to the multicompany changes.

task-1985992
2019-09-03 15:05:04 +00:00
Simon Lejeune 6df0c3ef3c [REF] point_of_sale: multi company
Adapt the module to the multicompany changes.

task-1985992
2019-09-03 15:05:04 +00:00
Simon Lejeune bf81b16c09 [REF] sale_stock: multi company
Ensure proper domains are applied and enforced on relation fields thanks
to the `check_company` attributes.

task-1985992
2019-09-03 15:05:04 +00:00
Simon Lejeune 2b802cd510 [REF] maintenance: multi company
Ensure proper domains are applied and enforced on relation fields thanks
to the `check_company` attributes.

task-1985992
2019-09-03 15:05:04 +00:00
Simon Lejeune 20692736a9 [REF] delivery: multi company
Ensure proper domains are applied and enforced on relation fields thanks
to the `check_company` attributes.

task-1985992
2019-09-03 15:05:04 +00:00
Simon Lejeune 9d4a552690 [REF] mrp_subcontracting: multi company
Ensure proper domains are applied and enforced on relation fields thanks
to the `check_company` attributes.

task-1985992
2019-09-03 15:05:03 +00:00
Simon Lejeune 96406dc2a9 [REF] mrp: multi company
Ensure proper domains are applied and enforced on relation fields thanks
to the `check_company` attributes.

Make sure unbuild have proper sequence for each companies.

The produce wizard and workorders company is the one of the production.
The BoM line company_id is the one of its bom_id.
Added some tests.

task-1985992
2019-09-03 15:05:03 +00:00
Simon Lejeune 4a03178146 [REF] stock_picking_batch: multi company
Ensure proper domains are applied and enforced on relation fields thanks
to the `check_company` attributes.

task-1985992
2019-09-03 15:05:03 +00:00
Simon Lejeune d43d25020e [REF] stock_account: multi company
Ensure proper domains are applied and enforced on relation fields thanks
to the `check_company` attributes.

Adapt `_compute_value_svl` to return the valuation for a specific
company.

Every time a property is read, make sure `force_company` is properly in
the context.

Fixed the ir.rule.

task-1985992
2019-09-03 15:05:03 +00:00
Simon Lejeune 27a4c07187 [REF] stock_dropshipping: multi company
Now that company_id is required on the picking type, make sure we create
as many dropship picking type/rules/sequence as there are companies

task-1985992
2019-09-03 15:05:03 +00:00
Simon Lejeune b6f053b25e [REF] stock: multi company
Ensure proper domains are applied and enforced on relation fields thanks
to the `check_company` attributes.

product.template
- make responsible a property field in order to ensure proper next activities when a product
  is used between multiple companies
stock.putaway.rule
- added a company_id field
stock.move.line
- company_id is not related anymore since a move line can exist without a move until its validation
stock.package_level
- added a company_id field
stock.picking.type
- company_id is now required
stock.production.lot
- added a company_id field, adapted the constraint accordingly
stock.quant
- check the consistency only in inventory mode
stock.quant.package
- company_id is now empty if the package is empty
stock.picking
- company_id is now related to the one of its picking type

Added some tests.
Moved stock_traceability in the `report` directory.
Removed useless /tests/tours/route.js.

task-1985992
2019-09-03 15:05:03 +00:00
Simon Lejeune 504b5fe5a9 [ADD] fields, models: company consistency check
Assigning `check_company=True` to a field will
- set a default domain filtering the companies
- allow to call `_check_company` on the records to ensure the domain is
  respected

Setting `_check_company_auto = True` on a model will ensure
`_check_company` is called at create and write, enforcing the multi
company domain.

Joint work with Raphael Collet <rco@odoo.com>

task-1985992
2019-09-03 15:03:45 +00:00
mcm-odoo 896f649285 [IMP] website_slides: improve "New content" modal
Upload new course content should be revamped

  * general layout: https://drive.google.com/a/odoo.com/file/d/1zbNO0Vg1262ijkXA6pwSuenMI0h4NsPm/view?usp=drivesdk
  * remove picture tab;
  * display as two column with preview on right on change of picture
    or document;

Task 2049640 (website slides back2basics and fiximp)
2019-09-03 15:02:10 +00:00
Thibault Delavallée 4cac01e124 [FIX] website_slides_forum: allow website publisher to create forum
Security file was buggy and not imported.
2019-09-03 15:03:11 +00:00
mcm-odoo e53c398789 [IMP] website_slides: revamp "New Course" menu
Purpose of this commit is to change the modal to make it more mobile friendly.
Notably remove the two columns.

Task 2049640 (website slides back2basics and fiximp)
2019-09-03 15:02:45 +00:00
Michaël Mattiello 37bf69dd9d [FIX] website_slides: fixes some display issues in eLearning frontend
Fix some display issues in eLearning

  * fix the share button in documentation. It was not working as model was
    not correctly placed;
  * fix top3 users banners broken in mobile;
  * fix left menu of fullscreen being behind content on mobile (image, video);
  * removed upload button in training channel aside as there are already
    buttons available for that purpose;

Task 2049640 (website slides back2basics and fiximp)
2019-09-03 15:02:31 +00:00
Michaël Mattiello 8c9473fd78 [IMP] website_slides_{*}: improve backend UI, views and user actions
Purpose of this commit is to perform a back2basics on eLearning backend
views. It helps users in their daily use of eLearning and improve UI.

Containing

  * channel kanban view tweaking;
  * channel form view: some spacing and renaming improvements. Also set
    advanced field (new content email, share template) as group no one;

  * slide kanban view tweaking;
  * removed sections from kanban and list view for contents;
  * contents form view: various improvements, with notably

    * removed field website_url;
    * set publishded date is now readonly, tracked and in group_no_one as
      it is automatically set when publishing the lesson, and people should
      not update it manually;
    * removed the sum "Content" and replaced it by a stat button
    * reword quiz constraint error messages;

  * rating views improvements:
    * revamped the kanban view of rating that were a bit broken;
    * added a pivot view in Reporting/Reviews;
    * updated graph view in Reporting/Reviews;

This commit also provides some usability fixes

  * prevent sending email if new content is category;
  * email: Prevent displaying an image if there is no image;

LINKS

Task 2049640 (website slides back2basics and fiximp)
Task 2058595 (eLearning v13 testing)
2019-09-03 15:02:21 +00:00
laaandMichaël Mattiello c4eba6f5b1 [FIX] website_slides: correctly set sequence of newly added content
Purpose of this commit is to add new content at last position in frontend.
Indeed backend uses last position in embedded list view, frontend should
do the same. Moreover when having a lot of content, having everything at
the bottom of the screen at the same position of Add content / section
buttons makes sens.

Specifications

  * when adding a new category: add it as last category;
  * when adding a new slide in a category: add it as last slide of the
    category;

Specific case of slide without category

  * when adding a new slide without category: add it as last slide of the
    channel (display it as last) but keep it on top in backend view
    (display as first);

Improve content list display in frontend of eLearning

  * contents without section are now at the bottom;
  * fixed alignment of buttons icon (Add Content and Add Section)
  * fixed broken design because of title too long

Task 2049640 (website slides back2basics and fiximp)
Task 2061672 (new content bug report)

Co-Authored-By: Michaël Mattiello <mcm@odoo.com>
Co-Authored-By: Alexis Lacroix <laa@odoo.com>
2019-09-03 15:02:18 +00:00
Thibault Delavallée 3f4bd44075 [FIX] website_slides: do not allow fullscreen to bypass ACLs
Currently fullscreen takes all information from categorized slides to
display its menu. In order to avoid calls to server some information
is prepared in DOM to speedup loading. It means slide information is
available even when not being member of a course which leads to some content
leak.

This commit fixes that by correctly checking that a slide can be accessed
before allowing to have access to its information and embedded code. Access
of a slide is either member of a course, either course publisher.

Task 2058595 (eLearning v13 testing)
Task 2064112 (fullscreen bug report)
2019-09-03 15:02:16 +00:00
Thibault Delavallée 6d22405987 [FIX] website_slides: do not crash if there is any issue loading quiz data
Template displaying quiz should not crash if call to server did not answer
correctly. Minimal fix is to have void data to display. Real issue is that
unreadable quiz should not be displayed. This will be fixed in an upcoming
fix.

Task 2058595 (eLearning v13 testing)
Task 2064863 (quiz bug report)
2019-09-03 15:02:14 +00:00
Thibault Delavallée 1aeba9b900 [FIX] website_slides: do not put odoobot responsible of demo courses
Yeah Odoobot is great but have you tried Admin ?

Task 2058595 (eLearning v13 testing)
2019-09-03 15:02:10 +00:00
Damien Bouvy f6ab2198d7 [FIX] website_sale: don't assert, just check
If the session is unbound before a call to this route, this assertion
will raise. The point of this code is not to crash when the parameters
are incorrect or the session unbound - the point is to avoid leaking
incorrect information.

Simply return an empty object to the JS code, it will stop polling after
a single failed attempt instead of crashing.

closes odoo/odoo#36356

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-09-03 07:38:57 +00:00
svs-odoo 9e100a7d3b [FIX] sale,stock: relabelling
`sale`
Delivery Lead Time  -> Lead Time

`stock`
Assign owner        -> Assign Owner

Task #2058665

closes odoo/odoo#36132

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-03 13:33:30 +00:00
svs-odoo 16ee89a662 [FIX] stock: restart a canceled inventory
When an inventory is canceled, the user is able to edit its locations
and products fields. So, if he/she does and then restart the inventory,
it can have some lines who don't match these fields.

Now when an inventory adjustment is canceled, we delete all its lines.
Its lines will be recreated when the inventory adjustment will be
restarted. Thus, lines will always corresponding to their inventory
`location_ids` and `product_ids`.
Also, a confirmation popup was added to ask if user really want to
cancel the inventory when he/shes clicks on the cancel button (to avoid
users delete their on going inv. adj. by miss clicking).

Task #2058665
2019-09-03 13:31:52 +00:00
svs-odoo d3ef8a958b [FIX] stock: forecast quantity only on warehouse
Before this commit, forecasted quantity in the product stat button and
in graph/grid view wasn't always equals.
The issue was the forecasted quantity is based on quant in location who
is child of warehouse location, and the `report.inventory.quantity` used
in graph/grid view didn't filter on warehouse location (took all
internal location).
So, completes the domain on `report.inventory.quantity` to get only
quantity in the warehouse.
Same change is applied to the Forecasted Inventory report.

Task #2058665
2019-09-03 13:31:22 +00:00
svs-odoo 63852bc1a1 [FIX] product_expiry: add space before "days"
In the product form view, add a space before the "days" word to avoid to
have the value sticked to days.

Task #2058665
2019-09-03 13:31:22 +00:00
svs-odoo 89c09e786d [FIX] stock: reordering rules scheduler message
The informative message about the scheduler on the reordering rules
form view takes now all the width.

Task #2058665
2019-09-03 13:31:22 +00:00
Sébastien TheysandJairo Llopis 1781041f13 [IMP] website, website_event, website_slides: add rel=canonical tag
The canonical tag is important for SEO, indeed it prevents search engines from
indexing duplicate content.

Reasoning
=========

The choice has been made to create the canonical tag automatically depending on
the request path, ignoring the query string, and manually prefixing the
appropriate domain and language code.

Indeed creating it manually for each resource would create a lot of code and
potential mistakes.

It is more dangerous to do it the generic way, but after investigation it
appears that it is an acceptable trade-off since the vast majority of our routes
are well built and already ready for this:

- using query string only for minor features that do not change the main content
- having the models, the ids, the pager and other important features in the path

Override
========

It is still possible to override the default behavior by passing
`canonical_params` manually to the view or to the different methods.

This is done for `/event` because the only way to display Past Events is to add
`date=old`.

Languages
=========

Fix an issue where it was possible for a bot to be on the URL without language
code but to use a language that is not the default language.

Adapt hreflang, because it:
- must only be present on canonical pages
- must always lead to canonical pages
- should not be set if there is no alternate language

Misc
====

task-1958075
closes #12532

Inspired by OCA module `website_canonical_url` courtesy of Jairo Llopis.

closes odoo/odoo#35852

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>


Co-authored-by: Jairo Llopis <jairo.llopis@tecnativa.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2019-09-03 12:11:35 +00:00
Vincent Schippefilt b89e0f6484 [FIX] web: kanban: fix cursor blinking on settings column
When the cursor hovers just above the settings icon that appears when
the cursor is in the column is blinking between the pointer and the
"move column" pointer cursor

Task: 2060825

closes odoo/odoo#36377

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-09-03 12:33:58 +00:00
Pierre Paridans 96f456a226 [FIX] web: don't mock mobile test suite environment
The mobile-specific code relies on the size of the browser <= SM
(currently 767px).

But when phantomjs was used to run the JS tests headlessly there was no
way to force that size for the mobile test suite (e.g. when running from
the command line, runbot...). The only solution was to mock some
variables (isMobile, size_class) in web.config to force them to
mobile-like values (see commits odoo/odoo@9bc5009481 and
odoo/odoo@497dfb6917).

Since the switch to Chrome Headless the browser size is set to a
mobile-friendly size (currently 375x667) when the mobile test suite is
ran. So isMobile is automatically set to true.

The code to mock the web.config has then become redundant.

This commit removes it to only rely on the browser window size for the
mobile test suite execution.

Notes:

When testing manually in the browser it's now required to set the
browser window to a mobile-friendly size. Even if it was already the
case, it will provide a more realistic environment and allows to test
important/behavior-related media queries (e.g. clicking on a button only
visible/present on mobile).

BTW the easiest way to run all tests is to execute them directly using
Chrome Headless (except for debugging of course).

closes odoo/odoo#36328

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-09-03 11:23:56 +00:00
wan ac1876762c [IMP] account: allow to reconcile taking amount from the label of the statement line
Task 2039772

Add a new amount matching mode by taking the amount from the label, based on a regex. The regex must contain a capture group. If multiple groups are matched, there will be an error.
Also add a 'remaining' option for the second line, that puts the remaining amount of the statement in the second line.

closes odoo/odoo#35143

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-09-03 12:12:20 +00:00
wan 3c5c7b4d81 [IMP] account: second line of reconciliation model based on open balance
Part of task 2039772
The second line of reconciliation models (client side) was computed based on the amount of the bank statement instead of the remaining balance, like on the server side.
We also need it to be based on the remaining balance, for the next commit introducing the detection of the amount thanks to a regex on the commuication of the statement.
2019-09-03 12:12:20 +00:00
Arnaud Baes 98fc0733d9 [FIX] repair: batch & grouped invoice creation.
Follow up of fix https://github.com/odoo/odoo/commit/c25803235a6db9d54755bfca5ea417c322a9fcba

TaskID: BugsLogistics

closes odoo/odoo#36311

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-03 11:35:49 +00:00
William Henrotin cadd65bcb4 [IMP] sale_stock: use popover instead of dialog
Commit fff2a30 introduces a dialog to show quantities on hand directly
on sale order line.

This commit replace the dialog by a bootstrap popover

Task 2058670

closes odoo/odoo#36213

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-03 11:26:08 +00:00
Raphael Collet 31764a984a [FIX] fleet: field recomputed with falsy fields
closes odoo/odoo#35910

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-09-03 12:02:45 +00:00
Raphael Collet 95996e5c5c [FIX] sale_mrp: tests should not be run at install 2019-09-03 12:02:45 +00:00
Raphael Collet 34e36e2d71 [FIX] sale_timesheet: unassigned record in compute method 2019-09-03 12:02:45 +00:00
Raphael Collet ea70cefce4 [FIX] mail: special case in mail_activity.res_name 2019-09-03 12:02:45 +00:00
Raphael Collet 2a3e4d2657 [FIX] tests: Form must clear record cache after save/onchange 2019-09-03 12:02:45 +00:00
Raphael Collet d2409ecb5e [FIX] base: ill-defined model 'base.document.layout' 2019-09-03 12:02:45 +00:00