When confirming a move for a kit, it is basically unlinked and replaced
by moves for its component. The link to the purchase line was kept in
v10, but since rev[1] it is not anymore. Make an helper to get the
values and override it in purchase_mrp to add the purchase line link.
[1] https://github.com/odoo/odoo/commit/8248f0e153ae5fcc1449d0d05149b61df615ad4f
opw 779497
A return should be valued at the standard price. As the `price_unit`
field is not set as copy=False and a return move is a copy of the
original move, the valuation was wrong.
opw 779803
Only looking on the stock move to determine if a move should create
accounting entries is not enough: it is possible that sublocations
implement some strategies that impact the valuation (example: a move
between stock and stock where the move lines move things to a scrapped
location).
We now look on the move line and if any of the move lines is IN, the move
is IN, if any of the move line is OUT, the move is OUT, if there's a
mix, the move is invalid.
We can imagine a scenario into which the main stock location (wh/stock)
is set as a view location to force people to put things in the
sublocations. Since the stock_account refactoring, only the location of
the stock move is considered to know if the locations should be valued
and, if so, the quantity to value. It is problematic since a view
location shouldn't be valued, but if its move lines put or take things
to or from a valued location to a non valued one, the valuation
mechanism should run.
We now introduce these specifications to handle this kind of usecase
correctly:
- the authority to get the price_unit is on the stock move
- the authority to now how much quantity should be valued is delegated
to the move lines.
The initial condition was too naive, it only checked the presence of
company_id on the concerned locations. This is problematic because
people need to create, for instance, multile inventory loss locations
once they have multiple companies, as the accounts set on the locations
are not property fields.
We also use the same condition to determine if the move is IN or OUT on
the move valuation mechanism and the accounting entries creation
mechanism.
The logic was not the same in function _compute_product_pricelist and in function
_inverse_product_pricelist.
The function _get_partner_pricelist must check the default pricelist for the company when
no pricelist is given for the specific partner(res_id) because the function set_multi doesn't
set a specific pricelist to the partner if the pricelist set and the default one are the same.
opw:779808
Go to Report -> Operator Analysis -> Apply group_by 'Creation date
(hour)' => traceback.
`start_date_hour` is implemented for Livechat Support Report on
Channels, but not on Operators.
opw-782255
Before this commit, when you had a lead coming from your website form, you
had no informations from where it was located.
It was especially painful for USA which should add customer their location to
know their timezone and know at which time they could call him.
Now, the state code is added to the created lead. It is easy to figure what
timezone the user is on without contacting him first to ask.
This closes#20424
task-29784
When choosing inventory at specific date the default value
is the start time of the server instead of the current time.
When using fields.Datetime.now as default value, will set the function
as default and future object will need to evaluate the funcion each time an
object without default is created. fields.Datetime.now() will evaluate the
function once at the server start and use the retun value as default value
for future objects.
Use case to reproduce:
- Sell 1.1 unit
- Validate the picking with 1 unit
- With or without backorder the initial demand is 0.999
- The backorder initial demand is 0.101
It happens because _compute_quantites uses 'UP' by
default. Since 1.1 - 1.0 equals 0.10000000000000009
we face the problem.
This commit uses an 'HALF-UP' instead. It should not generate
any problem since float_compare in order to decide if we need
a back order or not use a float_round on the same precision_digits
When you have another module installed before sale, and ever changed
some settings, a record of res_config_settings exists and when you
install sale, it cannot set a value for the required new column
'sale_show_tax' for existing records.
To fix this, we have set back the default values on the required field
'sale_show_tax' that has been removed in commit: https://github.com/odoo/odoo/commit/71e5c8b0b5bb10f571030a25875e33b25cda073d
... gives wrong values due to the timezone.
For instance, let's assume that the browser timezone of the user
is UTC+2, and the user types 10/09/2017 10:00:00 in a searchview
with a datetime field in its arch (i.e. which autocompletes on a
datatime field). Before this rev., the suggested value was
10/09/2017 12:00:00, i.e. the timezone offset was added to the
value.
opw 779832
... gives wrong values due to the timezone.
For instance, let's assume that the browser timezone of the user
is UTC+2, and the user types 10/09/2017 10:00:00 in a searchview
with a datetime field in its arch (i.e. which autocompletes on a
datatime field). Before this rev., the suggested value was
10/09/2017 08:00:00, i.e. the timezone offset was substracted from
the value.
- Delete the tax corresponding to the default 'Sales Tax'
- Access the Accounting settings
Error since record could not be found.
In the case of an `ir.config_parameter` referring to a record ID
(i.e. Many2one), the deletion of this record is not propagated to the
associated `ir.config_parameter`. Therefore, the system tries to access
a deleted record without fallback.
It's not really possible to solve it globally in a stable version, but
we can manually handle these cases by providing a fallback (usually
return `False`).
opw-781864
Without this patch, default images for themes are not used automatically
in themes' templates when one is chosen for the 1st time. This was not
inducing any bug in standard 10.0 but with custom-made templates, you had
to put the correct themes images in the defined template. This allows to
just `t-call` snippets instead of having to fully hardcode them in theme
templates.
We do not take CSS seriously enough, but it has an impact on rendering
speed. The rule removed in this commit slowed down the Qunit JS test
suite by a considerable amount:
With a fresh db with no extra addon installed, community version:
- in chrome, before this commit: 103.2s, with this commit: 54.8s
- in firefox, before this commit: 194.9s, with this commit: 117.7s
This is due to the way rendering is done in web browser. They start
checking css rules from the right, so the *:nth-last-child(2) rule was
checked for every element in the dom, each time it was added/modified.
Note that the rule just above (*:first-child) had no noticeable impact,
but I still think that the universal css selector should still be
avoided in general.
The fun part is that I did not find the place where this rule was
supposed to be applied. I assume that it is just a dead rule. If this
is not the case, we can reintroduce the margin-top with the class mt0,
applied on the specific element.
Before this rev., the widget was hidden when the value of its
corresponding field (move_check) was falsy. However, it should
always be visible, regardless its value.
opw 781628
The JournalDashboardGraph requires nv, which is lazyloaded. Before
this rev., a crash occurred when this widget was instantiated and
destroyed before the loading of the lib was complete (because a
function of the lib was called in destroy()).
For instance, press F5 (to ensure that nv isn't already loaded),
activate some throttling in the network tab, go to Accounting and
as soon as the dashboard shows up, click on another menu.
opw 781628
Before this rev., the widget was hidden when the value of its
corresponding field (move_check) was falsy. However, it should
always be visible, regardless its value.
opw 781628
Before this rev., sorting groups in list views wasn't supported. It
hadn't been implemented in the new views.
This rev. activates the feature, so groups can now be sorted on
their aggregates again. It also implements a basic (first level
only) sorting in mockReadGroup, in the mock server.
opw 781288
Before this commit, if you go on /shop/cart and your cart is empty, it will
show the coupon text.
Now, we will hide this if your cart is empty.
This closes#20612