Commit Graph
129659 Commits
Author SHA1 Message Date
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
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
Raphael Collet cb2117a487 [FIX] models: compute-onchange 2019-09-03 12:02:45 +00:00
svs-odoo 0518b23127 [IMP] mrp: add production_id in search filter
Add a filter for `production_id` in mrp.workorder search.

Task #1965962

closes odoo/odoo#36014

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-03 11:28:38 +00:00
mgh-odoo 1b1a1373d9 [FIX] stock: unable to create new manufacturing order in mobile
some fields are not added to mobile kanban that creates an issue
for a new manufacturing order

task-2056421

closes odoo/odoo#36171

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-03 11:27:03 +00:00
mgh-odoo 713e0fa577 [FIX] stock: not possible to add a line in detailed operations
task-2056421
2019-09-03 11:27:03 +00:00
Pierre Paridans 685c40aec9 [FIX] web: remove unused swipe code in FormView
Remove code left behind after commit odoo/odoo@9f7e6bb798

closes odoo/odoo#36333

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-09-02 12:40:51 +00:00
Christophe Monniez c96dc453b0 [FIX] account: deactivate reconciliation tour
Temporary tour deactivation until the test is fixed.
The test is also tagged 'to_fix' in order to execute them separately on
the runbot.

closes odoo/odoo#36364

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-09-03 09:38:27 +00:00
Xavier-Do 6d98f83857 [FIX] core: fix translation of selection fields with dashes
When a selection field has a dash the parsing was failing only returning the
begining of this selection, leading to a mismatch fot the ir_model_fields_selection.

This was discovered because "iot.trigger" add multiple selection fields element with name
only differing by the post dash part:

print
print-op
print-slip

This was leading to a failure of the ON CONFLICT DO UPDATE (ir_translation line 120)
since multiple EXCLUDED where similar in mrp_workorder_iot/i18n/fr.po(same res_id).

closes odoo/odoo#36347

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-09-02 15:24:11 +00:00
Jinal Patel 5a1fb85ef6 [FIX] web: support oe_read_only and oe_edit_only in x2m list
Back-ported from the master,
commit ca9a733b27

Before this rev., classNames 'oe_read_only' (only display in
readonly mode) and 'oe_edit_only' (only display in edit mode)
didn't work in x2m lists inside form views (only the cells in the
tbody were hidden, but not the header). This rev. makes this work.

Task 1949618

closes odoo/odoo#36117

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>

closes odoo/odoo#36285

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-30 13:55:56 +00:00
50464f5461 [IMP] web,mail: kanban progressbar: filter on falsy value
This rev. makes the part of the progressbar corresponding to falsy
records 'alive': the user can now click on it to filter on records
whose value is false for the progressbar field.

Task 1952430

closes odoo/odoo#35100

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>


Co-authored-by: Mohammed Shekha <msh@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2019-09-02 08:53:42 +00:00
Aaron Bohy 3978a0838f [IMP] project: tasks kanban: allow to filter on grey tasks
The user can now click on the grey part of the progressbar, to
filter on task on the 'Grey' state.

Part of task 1952430
2019-09-02 08:00:43 +00:00
Odoo Translation Bot 86809804f9 [I18N] Update translation terms from Transifex 2019-09-01 01:28:13 +02:00
Adrian Torres 957c78b98f [IMP] base: optimize create on models with property fields
Before this commit, creating a record of a model with at least one
property/company_dependent field would trigger the field's inverse
method regardless of whether an actual value was being passed in for the
field or not.

This means that if no value was given or if the value was the same
as the default value, we would waste precious time in the property
field's inverse method.

With this commit, we do not call the inverse method if:

1) there is no value for it in the vals dict (use default)
2) the value in the vals dict is the same as the default value

As an example, when creating a res.partner record while having account
installed (which introduces a property field in res.partner), the
creation time goes from 24ms to 14ms.

closes odoo/odoo#36267

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-08-30 16:16:17 +00:00
Odoo's Mergebot 3d0b42045f [MERGE] rating, website_slides: apply various rating / slides fixes
See sub commits for more details.

Task ID 2058595
PR #36281

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-30 18:21:29 +02:00
Thibault Delavallée 10804f1e4b [FIX] (website_)rating: synchronize rating feedback with message body
Purpose is to set review message on both message and rating so that reviews
are correctly displayed in eLearning backend as well as correctly displayed
in chatter frontend.

Task ID 2058595
PR #36281
2019-08-30 15:06:00 +00:00
Thibault Delavallée 3c95299018 [FIX] website_slides: always initialize computed fields
Creating channels and slides in backend was leading to warnings and/or crashes
because of computed fields not being always updated. With new computed fields
coming from 9920f20e4c this cannot be done anymore.

Task ID 2058595
PR #36281
2019-08-30 15:06:00 +00:00
Thibault Delavallée a6a6795305 [FIX] rating: allow rating deletion
Purpose of this commit is to

  * delete rating when deleting message. Otherwise rating coming from
    frontend portal review chatter are lost in the void;
  * allow system users to delete ratings;

Task ID 2058595
PR #36281
2019-08-30 15:06:00 +00:00
Thibault Delavallée d3f6c3b579 [FIX] mail: set an integer widget on many2one_reference field
Commit 9920f20e4c introduced a new field type in the ORM. However
it is not referenced in various JS parts, leading to crashes. Notably list view
of messages and activities crashes.

As this is basically an integer field, easy fix is to use an integer widget
on those fields.

Task ID 2058595
PR #36281
2019-08-30 15:06:00 +00:00
Thibault Delavallée bf3cdac628 [FIX] website_slides: avoid display error messages twice in quizz completion
Purpose of this commit is to avoid having error message replacing the
cross used to close the container of the error message.

Task ID 2058595
PR #36281
2019-08-30 15:05:59 +00:00
Alexandre Kühn dc31884dcf [FIX] base, tools: add pre_locate to apply_inheritance_specs
Revision on https://github.com/odoo/odoo/commit/fc5878ecc668ee83cd1a374474f0b21bf6a51940

Commit above introduced server-side inheritance of static XML.
To do so, it made some changes to the way inheritance of view
templates is applied, such as moving this logic outside of the record
`ir.ui.view`.

This change, however, removed the feature to overwrite these methods.
Studio did that in order to correctly apply `group_ids`[1][2].

This commit fixes the issue by introducing an optional callback
`pre_locate` as parameter of the methods `apply_inheritance_specs`.
When set, this function is called just before locating a node during
the application of inheritance of the view. Studio can make use of
this callback to handle group_ids properly, again.

[1] https://github.com/odoo/enterprise/commit/b56101200ac35dae3eadbc0bdf4ba17461f33907
[2] https://github.com/odoo/enterprise/commit/38f7eb8153df8406498fa58eb809271db778e6d8

Related to: https://github.com/odoo/enterprise/pull/5321

Task-Id 2047439

closes odoo/odoo#36200

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-08-30 11:41:12 +00:00
svs-odoo ec9b365b18 [FIX] stock: don't show mrp_operation picking type
When creating a picking and selecting an Operation Type, can't no more
select operation type of `mrp_operation`.

Task #2060793

closes odoo/odoo#36262

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-08-30 13:08:15 +00:00
Pierre Masereel c95acd624e [IMP] point_of_sale: Send ticket by email.
When you select a customer in the front end, you can send him an email with the receipt as an image.
If you decided to send the mail and you'd like to print the receipt anyway, you have to click on the
When you're offline, the order will be queued and the ticket printed. You'll receive an error message
When invoicing, the invoice will be in attachment of the email.

TASK-ID: 1922660

closes odoo/odoo#35812

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-30 12:28:47 +00:00
Yannick Tivisse 8fad800dd8 [FIX] hr_work_entry: Remove 'confirmed' state
Zizizuseless

closes odoo/odoo#36276

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-30 11:03:33 +00:00
Yannick Tivisse 1c0de2fc19 [FIX] hr_work_entry: Remove warning banner on conflicts 2019-08-30 11:03:33 +00:00
Yannick Tivisse cf9eb7e02d [FIX] hr_holidays: Misc layout fixes + leaves_stat widget 2019-08-30 11:03:33 +00:00
Pierre Paridans 81d0f39480 [FIX] web, base: MockServer should have the same behavior as the server
An RPC call using an empty array of fields has not the same behavior on
the MockServer and the actual server:

- the MockServer returns only the 'id' field
- the actual server returns all the fields for the model

This is due to the fact that an empty array evaluates to a falsy value
in Python and evaluates to a thruthy value in JavaScript.

This commit restores the parity between the two.

closes odoo/odoo#36278

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-30 09:09:48 +00:00
Ankita Raval 92b647611e [IMP] mrp: label should be in one line.
In this commit alignment in bom structure & cost report
display in proper manner.

task-id : 2059697

closes odoo/odoo#36225

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-08-29 09:57:12 +00:00
Hardik PrajapatiandMohammed Shekha 2581076a09 [IMP] survey: do not set a question type on question being section
This commit header is quite fun. If a question is not a question it should
not have a type. Maybe it should not be a question but, hey, you don't always
do what you want. That's life my dear Lucette.

In this commit we remove required attribute from python field definition of
question_type and make it required conditional based. Real questions have a
type, unreal questions have no type.

Alss update Questions menu entry to display only real questions, not unreal
questions.

Most of this commit message makes no sense, but remember who asked to push
this model.

Task 2053833

closes odoo/odoo#35835

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>


Co-authored-by: Hardik K Prajapati <hap@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2019-08-30 11:09:21 +00:00