When an asset is set as Prorata Temporis, with a one month period, the
first depreciation amount is computed on the basis of the remaining days
in the purchase year. This doesn't make sense for a monthly
depreciation.
This commit makes the distinction between a monthly and a yearly
depreciation. In the case of a monthly depreciation, the remaining days
in the purchase month are taken into account.
opw-690034
The javascript tour (test) will verify the total amount based on sale
price of the product without taking taxes into account.
However, if any l10n_* module is installed and defined a default value
for product taxes, the test will fail this check.
As of f814dd9908, debug
mode causes an extra X-Debug-Mode header to be sent
by the rpc() JS method.
This custom header was not whitelisted in the accepted
CORS headers, therefore any cross-origin call to a route with
`cors=True` would fail in debug mode, with a console error
along those lines:
"Request header field X-Debug-Mode is not allowed by
Access-Control-Allow-Headers in preflight response"
This would prevent loading the POS GUI in debug mode,
for example.
This commit is necessary in the 8.0 branch because
the POSBox is currently based on a 8.0 server and may
be accessed by a 9.0 POS or later, thus with the extra header.
'issue_ids' has a domain, so all the issue a folded
stage are not taken into account for statisfaction
percentage.
So replacing the field with a search call solve the
problem.
When a user has access to a quote (because he is follower) but he is not
in the same company than the customer, an access error can occur on the
the rendering of the partner field.
We use the tokenized link instead, which will read the SO as a superuser
to avoid this situation.
opw-691740
Currently when using a language on the website, the following is done in
this order to choose which one will be used:
1) use a language code if present in the url (eg. /fr_BE/),
2) use a language similar to the one in the url,
3) use a previously choosed language (saved in cookie),
4) use the browser language if available on website,
5) use a language similar to the browser language,
6) use the default website language
When a bot is requesting a page, he could either not specify a browser
language (en_US is set as default) or sometimes specify english
erroneously.
In these instance, we will then never use the default website language
if an english language is installed.
This fix changes this behaviour so if a bot is visiting a page, the 4th
and 5th steps are skipped and the default website language is used
instead of using the browser language.
closes#14033
opw-690910
When pasting, the paste event is cancelled and done back with the
corrected data.
This works fine on firefox, but this can have unwanted results on other
browser like pasting two times or copying the end of the line at the
beginning.
This commit replace completely the summernote functionality with our
small implementation of pasting corrected text.
closes#14043
opw-690814
Steps to reproduce :
1. Create a new customer
2. Create an invoice with an amount of 50.- for this new customer and validate it
3. Create a refund with an amount of 70.- for the same customer and validate it
4. Create a Customer Payment for this customer and validate it. The Invoice will be paid with 50.- of the refund. 20.- are still on residual in the refund.
5. Create a new invoice with an amount of 50.- for the same customer.
6. Create a new Customer Payment for the same Customer and validate it.
The Full Reconcile Boolean stays checked inspite of "Open Balance" of Refund amount is less than the Invoice amount.
After the fix:
Full Reconciliation Boolean doesn't get checked and Allocation amount on invoice journal item line should be same
as Open balance of the Refund Journal Item. So Invoice stays open with Balance amount.
opw:691577
Before this fix, the tz was ignored in the search. So the group by counter
was not especially the number of blog post displayed.
The month display was wrong, date_begin was localized.
Start was eg (in Europe/brussels) : 10/31/2016 22:00:00.
So if we don't localize this time with babel, we got October as displayed
month instead of November
The Archive was not sorted by year desc, now it is.
Old behaviour was strange:
2015: December, Octobre
2016: December, Octobre
=> Year asc, Month desc
A field shared across registries is normally never setup from scratch, except
when its full setup cannot complete. This happens when a registry reuses that
field but fails to load, because the base and full setup of fields look like:
def setup_base(self, model, name):
if self.setup_full_done:
# optimization: keep base setup (1)
self.setup_full_done = False
else:
# do the base setup from scratch (2)
...
def setup_full(self, model):
if not self.setup_full_done:
# complete full setup (3)
self.setup_full_done = True
When the field is reused for the first time, its setup state `setup_full_done`
is reset to `False` (1), and it should be set to `True` again after completion
of full setup (3). However, because the full setup fails, the field remains
with `setup_full_done` equal to `False`.
In that situation, when the same field is reused again, it base setup will be
done from scratch (2), and therefore some attributes (like `column`) are reset
to their initial value. Because the full setup fails again, those attributes
are lost for other registries that share the field.
Fix this crap by precising the setup states: `None`, `'base'` and `'full'`.
When a field is reused, its setup state is reset to `'base'` instead of `None`,
and consequently it will never be setup from scratch again.
When a user uses Strip and clicks on "Pay & Confirm", a "Bad Request"
error can pop-up. This is because it tries to reload the page, while it
should only display the Strip pop-up.
This is simply due to a `preventDefault` done after the event is
performed, and not before.
opw-692341
When a user tries to pay a website quote thanks to Stripe, the button
spins and nothing happens.
In the case of a quote, the jQuery selector is not correct.
opw-692341
Depending on the version of dateutil, rule._bynweekday can either be
a tuple or a set (see https://github.com/dateutil/dateutil/pull/54), which,
in the case of a set, breaks the access by index (see related issue:
https://github.com/dateutil/dateutil/issues/24).
By casting it into a list, we make sure that we can access [0] in both case.
Credits to jke ; closes opw-690761.
When a quotation is opened from the frontend, set the SO id in the
request. This is necessary in the following use case:
- Receive a website quote
- Pay thanks to Stripe
After commit da82a6b705, we call the route
`/shop/payment/transaction/` manually. However, this route expects to
retrieve the SO id thanks to a call to `sale_get_order`. Since we are
not going through the webshop and the user might not be connected, the
method is unable to retrieve the SO id.
opw-692341
One of the behavioural divergences between "create or replace" view and
DROP; CREATE turns out to be that "create or replace" can only add
columns *at the end* of the view, and can not change the name or type of
the view during replacement, which can break migrations.
closes#14028
In v9, the creation of a product doesn't set a `valuation` or a
`cost_method` by default. It means that the corresponding fields of the
product category is selected instead.
In v10, this is the other way around: a default value is set on these
fields, and therefore the value on the product is selected. This is
obviously a change in behavior, and moreover the field is invisible in
the product view, meaning that it cannot be changed.
This is due to the new API conversion. In the new API, the methods
`_compute_valuation_type` and `_compute_cost_method` are called through
the 'onchange' mechanism. This sets the associated fields, which are
then copied in their `property_` counterpart thanks to the inverse
function.
opw-691231
Before, when we consumed 3 instead of 1 in a production order, it
gave a traceback. It was because it created moves
with negative quantities. So, something was wrong with
the quantity_done/product_uom_qty set when creating the extra moves
When creating an extra move because of the procurement,
but you still need to split afterwards (e.g. procurement 10, production order 12, you do 11),
then you should have a difference between quantity_done and product_uom_qty
in the extra move and not try to change it on the original.
That way, we make sure we pass the correct quantities.
We support 'returns' in the POS frontend by allowing the user to
specify a negative quantity. Before this patch however, the backend
would always generate a single picking per pos.order. This is
problematic when a pos.order contains both lines with a positive and
negative quantity. The generated move lines would not all have the same
source and destination location and so could not be added to the same
picking.
This commit creates an extra 'return' picking when required and assigns
the generated moves to the correct picking.
opw-690812
Closes#13929
Forward-port of 19cca50e7c
Underscore method _.each expects an array like object when a "length"
property is present.
This was an issue with a record having a numeric "length" field set to a
non-negative value. When changing a line the change would not appear on
blur.
This issue was fixed with 0e664c9e9 but introduced back with f0e331e00.
opw-691070
Forward-port of 5d17749ff4 which has been
forgotten during previous forward-port.