[FIX] When using "--stop-after-init", set the return code correctly. A non zero return code reflect the number of databases that fail to load/update

Backport of 2c4e370b766db6280d38a4d3535e07de604b1922 and
33ce0e73dba7c23d004a278f61943be8052e7f37
[IMP] config: Test that the config file is readable

Fixes #3237

cherry-pick of 8e72049
[FIX] product: pricelist, uom and price_surcharge

The price_surcharge attribute must be computed based on the reference unit of measure (divided by the factor).
This is to make sure than 12 units and 1 dozen have the same price after pricelist computation (opw 599727).

Added test checking the correctness of pricelist computation based on unit of measures.
[FIX] product_visible_discount: discount with different unit of measures

The computation of the price without pricelist should take care of the unit of measure.
e.g. if computing discount for objects in dozen (on a product with price in unit), returned unit price should be (price*12) where 12 is the factor to go from dozen to unit.
Otherwise the compared prices (with and without pricelist) would not use the same unit of measure and the comparaison would be inconsistent. (opw 599727)
[FIX] product: reference in test
[FIX] mail: read more show original message

Instead of html cleaned html, to allow display blockquotes

opw-614729
[FIX] account: limit search for fields_view_get to one result

+ use ir.model.data get_object_reference method for better performance (cached result)

opw-616616
[FIX] product_visible_discount: use on_change result for product value

At the end of the onchange call product_id_change, the uom may have changed (e.g. if product in different category).
To compute the quantity, we need to use the new uom and not the first one (that may be Unit, default value)
[FIX] stock: forbid adding new lines when processing picking

Source and destination locations are required and not displayed in the form view.
Adding new items when recieving a picking can not be easily guessed as we can put different locations for each line, using default locations may not be the expected result.
Instead should modify the original picking or create new one.
Fixes #2074, opw 612768
[FIX] sale_margin: cost price uom

When computing the cost price to display, take the uom into account. The cost of 1 Unit or 1 dozen should not be the same. opw 599727
[FIX] hr_timesheet_invoice: warning in report generation

When generating the report 'Timesheet Profit', got a warning "The domain term '('user_id', '=', [...])' should use the 'in' or 'not in' operator."
This warning is due to the use of the '=' operator to compare the field 'user_id' while the reports sends a list of ids.
Fallback to still accept a single id in case of customised reports.
[FIX] account: partner balance general totals

General totals were not computed at all, due to the condition "if not self.ids" which was always true as self.ids wasn't set.

Besides, a parameter allows to display only partner with balance greater than 0, which was completely ignored by the totals computation methods: The totals always included all partners, even those having balance equals to 0
Revert "[FIX] mail: read more show original message"

This reverts commit 0790682296e43989e4e232189009c3ba380e32ba.

This fix is not yet ready. See PR #3295
[FIX] sale: trigger all_lines signal when all lines are invoiced
[FIX] sale: when invoicing on lines, set order in progress when all lines invoiced

This fix is related to rev. b1df5aab6e529e9667bb97c96c9196e1a4e5e0ce
[FIX] stock: UoS quantity in stock.picking

Implements the UoS TODO items on stock.picking.do_partial() to fix #1432.
Add a new method _compute_uos_qty() on product.product to computes
product's invoicing quantity in UoS from quantity in UoM.

The created invoice will use the product_uos of the stock.move, meaning keeping
the quantity specified on the partial picking and the unit of measure of the
original stock.move (e.g. recieving 1 dozen from a 12 unit picking should either
get uos=dozen, uos_qty=1 or uos=unit, uos_qty=12, not a mix of both)

Fixes #1432, opw 611479
[IMP] .gitignore maintenance migration scripts
[FIX] base_action_rule: Make sure model exists before trying to wrap hooks

In certain cases, before running an update unregistered models will try to
register hooks. Trying to wrap create and write on these will cause
AttributeError on model_obj which would be None

Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
[FIX] project_issue: explicit store attribute for the progress function field

This is a workaround for an ORM limitation. A stored function field is
not updated when it should if the "source" field is also a stored function
field
[IMP] stock: avoid errors with picking without quantity

When a line is not present in the partial delivery wizard, computation variables are initialized with generic values (zero quantity, zero price,...). Instead of setting the uom to False, keep the quantity of the move.
This makes a difference only when the quantity of the move is 0. That means that the move will be marked as complete and can be processed.
This avoids trying to update the stock.move with a uom at False. opw 616844