/shop/pricelist_payment was only defined in coupon module from enterprise.
Add optional r param in pricelist controller to allow to redirect into a specific page
Currently when scheduling activities, duplicate logs are created. Indeed
a message is posted when scheduling an activity, editing it and marking it
as done. This leads to a lot of noise being created on records.
This commit remove logs when scheduling and updating an activity. A sole
message is posted when the activity is marked as done.
This is a partial backport of commit 26940f8de4 targetting saas-15.
When an automated action triggers for an action of a public/portal
user session, the server action is executed with the session
credentials. As of 4a18d5744e
only employees can access model fields, including the model name,
so a temporary sudo() elevation is necessary to find the model name.
The `model` and `record` action context parameters are however still
provided with the credentials of the session, not the super-user.
Make sure the widget won't crash when no `terminology` option
is passed.
Also for the translation extraction system to work, each literal
term needs to be enclosed in its own _t() call:
// No
var trans = _t(term || "Default term");
// Yes
var trans = _t(term) || _t("Default term");
The _t() function supports `undefined` arguments so the second
form is equivalent to the first form at runtime, but supports
proper term extraction.
Finally, simplified the implementation a little bit,
requiring `hover_true` and `hover_false` "action descriptions"
to be provided explicity in custom terminologies.
Previously we tried to reuse the values from `string_true` and
`string_false`, but they describe a state rather than an action,
so they are hardly ideal.
All the fields defined in model "product.product" from module product_margin
are computed and not stored with the same function which is _compute_product_margin_fields_values.
This function has a deprecated argument which is field_names and this agrument is only used in
function read_group overwritten in this module in model "product.product. This overwrite of
read_group uses a variable "fields_list" with almost all the fields defined in "product.product"
in this module (excepted: date_from, date_to and invoice_state which are read from the context).
Each time, the fields total_margin, expected_margin, total_margin_rate, expected_margin_rate,
date_from, date_to, invoice_state were needed, nothing was returned due to the empty argument
field_names passed to this method. For example, when opening product.margin.form.inherit form
view.
In old API, it works because the compute was called with the list of the fields and in new API, it is not the case.
Closes#15604
opw:709962
The timezones are already managed in the JS.
So on the attendance check in/out screen when a user clocked out
after 8 hrs he got a message saying that he has been in for more than 12 hrs.
opw:710161
In case an exception (programming, out of memory or any other unexpected
failure), the cron_thread would crash and not recover until server restart.
Issue #15666 was an example of failure.
Courtesy of Nils Hamerlinck
If postgresql database is temporarly down, the cron thread may fail.
The cursor creation fails when trying to connect to the server which leads to
the cron thread to die (uncatched exception) and will not restart when postgres
is back.
Fixes#15666
The fuzzy search score algorithm is quite simple, but had an interesting
problem: for the search string 'AB DEF', the result 'XXAXXBXXXXXXX DEF' had
a higher score than the result 'ABX X DEF", because it has 4 consecutive
matching characters.
This commit slightly tweak the algorithm to take space into account, but
to make sure they are not used to compound the score for a string. This
means that space characters are not ignored, but are not really
as important as a normal character.
The signature _check_recursion already exists in odoo/models.py
So calling _check_recursion, the function which checks the constraint on
associate_member overwrote _check_recursion in "res.partner" model and
the function _check_parent_id defined in "res.partner" was completely
wrong because it needs _check_recursion defined in models.py
opw:710524
Fine tuning this commit: 95038f0bf3
standard_price is company dependent.
Writing the standard price in sudo because a warehouse manager may not
have the right to write on products.
opw:709329
Steps to reproduce in runbot 10.0:
1.Create a new sale order and use the Odoo Monthly quotation template.
It will set the Odoo SAAS product on the sale order.
2.Go to the Odoo SAAS product form view, check "Can be expensed",
then on Invoicing tab, choose "At Cost" for the "Re-Invoice Expenses" field.
3.Confirm the sale order so it is in done (Locked) state.
4.Create an invoice, try to validate it, a UserError is raised:
'The Sale Order SO0158 linked to the Analytic Account must be validated before registering expenses.'
This UserError only makes sens when new SO lines are created.
NB:Now it's possible possible to update an analytic line linked to SO in other state than 'sale'
but it's still forbidden to create a SO line when the state is different than 'sale'.
opw:708661
As message_post is defined on mail.thread abstract class its api.returns
is not automatically added on overridden versions of the method. This
commit add missing api.returns on all overrides of the method.
Change the condition from
[...] and debit != and credit != 0
to
[...] and (debit != or credit != 0)
as at least one of debit or credit may have an unaffected value
Without this patch a past unpaid entry will not be included in the report.
Closes#15550
The separator in the debit/credit columns of the report must contains coma
instead of dots for decimal separator (fr).
All the other columns (cf SQL query) contains coma but not this one.
Inverse the currency sign of the credit column. Otherwise the credit is negative
and sum of the balance is wrong (sum credit != debit)
Closes#15550
When computing the discount in product_id_change, before the fix
discount was equal to (new_list_price - line.price_unit) / new_list_price * 100
But line.price_unit was already rounded so the discount computed was not the
discount set in the pricelist due to rounding error.
opw:709704
The _message_post_helper() method historically allowed
passing a `sha_in` signature to let an unauthenticated
user post a message on a record.
This option is unused and an alternative is preferred:
passing a `token` value that matches the value of a
given field of the record.
In light of the increasingly grim future of SHA-1
as a cryptographic hash function, we consider it
better to entirely remove this specific option.
It has been unused for a while, and a simple
alternative exists.
The `object_shasign` method itself will be dropped
in master.
Template "sitemap_index_xml":
<loc><t t-esc="url_root"/>sitemap-<t t-esc="page"/>.xml</loc>
should be:
<loc><t t-esc="url_root"/>sitemap-<t t-esc="website_id"/>-<t t-esc="page"/>.xml</loc>
The fix in python is not elegant but allow to fix without -u of website.
A company should have at least a pricelist having the same currency, that's common sense.
This was causing problems in tests on 10.0-nightly, where the main pricelist was created
in EUR, then the localization module was setting the right currency on the company without
any reflection on the pricelist.
To avoid this problem, when we write the currency on a company, we reflect that change on
the main pricelist if it's the only company in the system. Otherwise as we can't decide
which pricelist modify, we just create a new one, which should be ok.
When get_price() is called during tests, a ValidationError was returned but not catched
correctly due to the unavailability of delivery service.
Because this method is called during the creation of new sale order, it leads to some
operational error (broken cursor).