Issue: when the inverse method writes on a dependency of the first record, it
invalidates the cache of the field for the other records... Solution: simply
evaluate the inverse method one record at a time.
In test_mail there are performance tests involving several followers and give
counters for some heavy real-life-like use cases. Purpose of this commit is to
have more basic performance tests for main mail features, like simple post,
simple subscription of one follower. It allows to have an idea of the basic
cost of various features.
Adding use cases for message_post includes
* posting without followers (aka, no notification)
* posting with a ping (by email or by inbox)
* logging a note with optimized method _message_log or with message_post
Adding use cases for activities includes setting an activity as done. This
action posts a message and is therefore interesting to evaluate.
Adding use cases for subscription includes
* adding and re-adding one follower, with default or specified subtypes
* updating responsible field triggering a simple tracking and an assignation
email or notification (not completely supported in saas 11.2 meaning this
counter will increase when forward-ported)
* note that some subscription tests have already been added at a01933c9b4
Finally some heavier tests are added for assignation and tracking based
on QWeb view.
This commit is related to task ID 1824965 . This one is an ongoing task
and several commits may be linked to that task.
The ChatManager has been refactored in saas-11.2 to make it fully
(and more easily) testable. This means that tests involving
messaging stuff written in previous versions need to be slightly
adapted when being forwardported to saas-11.2. In particular, the
3 tests adapted in this commit broke because of an include done in
the voip addon. Those tests have been added in 3809fc891.
Actions loaded from the url are flagged with 'pushState: false', to
prevent them from pushing their state back to the url, thus
producing an infinite loop. However, if the state of a loaded
action changes in the future (e.g. load an action in kanban view,
then switch to a form view), this state should be pushed to update
the url. Before this rev., this wasn't the case.
Changing it is not needed and generated missmatch against existing
entries (created by l10n_generic_coa demo data, thus depending on module
install order).
This could (should?) be considered a refactoring, but this is actually
trying to restore lost functionality. In v10, the custom form widgets
were created with access to the node element that define them. We lost
that in v11, with the new views.
However, it is actually very useful for generic widgets. Since this is
not really a risky fix, I think that it can be done in 11.0.
Note: this feature was already reintroduced in master in commit
https://github.com/odoo/odoo/commit/b7aa439826df6b3e442b3f60bb593ff28efc8679
As of v11, project tasks and project issues have been merged.
Issues used to be ordered by:
priority desc, create_date desc
whereas Tasks had the following historical ordering:
priority desc, sequence, date_start, name, id
(where `date_start` corresponds to the creation date of the task, or the
time where task work began)
After the merge, the Task order was kept, but it became difficult to
understand for users, especially for converted issues.
This commit modifies the default order to a more obvious common order:
priority desc, sequence, id desc
With the following goals in mind:
- the ordering does not change without obvious actions of the user
(starring a record moves it at the top, manually reordering records
reorders them within the same "stars category), and creating new
records adds them at the top, where they are visible
- the ordering is easy to grasp, based on stars and chronological
order, while still allowing manual reordering when really necessary
(by default all records will have the default sequence of 10)
- sorting by "id desc" is similar to the previous "create_date desc"
but it can be sorted more efficiently by the database
One could argue about sorting on chronological or reverse chronological
order. Like blogs and timelines, everyone has their preferences.
The latter option was selected because our UI for quickly adding records
is at the top of the kanban view, so it is more natural to see new
records at the top, instead of having them disappear at the bottom
immediately.
Hopefully this will not disrupt user workflows too much, and will remain
intuitive enough.
The validation transactions introduced in
7d428c871b were not working properly for
Ogone, due to several problems:
- The refund requests when being sent via the orderdirect.asp API, which
does not support refunding previous transactions, according to the
Ingenico helpdesk. It only support creating independent refund
transactions, which is something that requires special pre-approval
from the payment acquirer, and generally not permitted.
In order to cancel/refund a previous transaction, the direct
maintenance API must be used instead[1].
- Maintenance requests to refund a previous transaction fully should use
the RFS code, as explained in the API documentation [1], and should
always mention the PAYID of the refunded transaction.
- Such maintenance requests must always be SHA-signed, as usual.
- The various transaction status codes for refunded transactions need to
be taken into account as well (typically those beginning with 8)
This commit fixes these various problems.
[1]
https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/directlink
(5.2 Direct Maintenance)
As of today, Ingenico platform 4.125 has non-uniform handling of the
PARAMPLUS parameters that can be passed as part of transaction metadata.
This parameter is documented as being parsed[1] as a series of
parameter-value pairs, to be passed as extra parameters to the feedback
transaction. Based on this, it seems that the PARAMPLUS value should not
be urlencoded globally, but each field value should be urlencoded, as
the Ingenico side will have to be able to parse and re-emit these
individual parameters.
In one case we were missing this urlencoding step, so this commit fixes
it.
Without this, the querydirect.asp API would return invalid XML data when
we retrieve the status of a transaction that used a PARAMPLUS value with
an '=' sign!
For example with PARAMPLUS passed as
return_url=/payment/confirm?tx_id=123
the value returned by querydirect.asp would contain the following:
(note the invalid extra quote character in the `return_url` param)
```
<?xml version="1.0"?>
<ncresponse
(...)
ED="1234"
return_url="/payment/confirm?tx_id="123"
SCORING=""
SCO_CATEGORY="G">
</ncresponse>
```
Url-encoding the value of the return_url in PARAMPLUS fixes this
nonsensical result.
However, the Ingenico API then fails to decode the parameter value when
passing it to the feedback URL, such as the ACCEPTURL we depend on.
As a workaround, since we only pass a single parameter inside
PARAMPLUS, we'll url-unquote it afterwards.
[1]
https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/e-commerce#feedbackparameters_variablefeedbackparameters
Before this commit:
When editing a page URL through page properties it would redirect to that new
url afterward. If the url was not starting with '/' and had multiple level
before and after edition (eg: page/action to page/realaction) it would then
redirect to a wrong relative URL.
Now, we ensure that we redirect to the correct URL: the one slugified and
cleaned in the backend.
Step to reproduce:
- Create a page '/page/action'
- Go to that page and open Page Properties
- Edit the URL to 'page/someaction'
- You will be redirected to the incorrect relative URL /page/page/someaction
When the type of a product is changed by a user of company A, if this
product has been sold previously by company B, the user receives an
access error.
opw:1824548
Configurations uses an onchange to populate the fields visible to the
user. However, the related fields are by default called sudo, when it is
an onchange, there may be a missmatch in the cache, the cache used being
empty, there is no value to return (cache fix is not currently possible).
Before this fix we must use 'related_sudo=False' to use the good cache but
it's an inconsistent fix because in some case we must use sudo to avoid
access error.
opw-1823363
When looking for the move line associated to a quant, make sur to return
the move lines that took from the package or that put something in the
package.
opw-1824578
Before this commit, images in kanban view of the Contact app were not displayed
on non-latin languages, such as Russian.
This was caused by the is_bin_size helper that wrongly assumes that a certain
string is not a binary size, although it is (e.g. 64.2 Кб).
This commit fixes the issue by including such strings as valid binary sizes.
Bug found and fixed by @true-datura
Test by @alexkuhn
closes#23526closes#22519
When a chatter is displayed and the document is accessed with a valid
access_token, the message related to the document are searched in sudo.
This bypass valid filtering we may down the line.
This change apply the filtering so note type messages are not displayed
for user who are not employees.
note: before 11.0 this logic was in 1b5c2ced. In future version it would
probably be better to have a method eg. _get_domain_based_on_user
that would be called before sudo and if not sudo.
opw-1819702
closes#23544
There was an issue with the control panel in mobile since rev.
7b6056a. In the enterprise webclient, by default, the search view
is hidden, and a search icon should be displayed on the top right
corner of the control panel so that the user can toggle the
searchview.
Before this rev., the icon was invisible at the first rendering of
a view, and only appeared once the view was reloaded.
The change in rev. 7b6056a that produced the issue is that the
control panel is now updated twice when a view is rendered (once
by the view itself with the buttons, searchview..., and once by
the ActionManager with the breadcrumbs). The control panel didn't
handle correctly that scenario.
A test case will been added in web_enterprise.
Before this rev., the field widget 'mail_activity' kept an internal
cache of fetched activities (like the 'mail_thread' and
'mail_followers'). However, for activities, this cache may cause
issues.
For instance, create a new lead in 'My pipeline', schedule a
'Meeting' activity on that lead (it opens the Calendar view so
that real meetings can be created), create a meeting 2 weeks from
now, go back to the lead form view: the activity still diplays that
the meeting is today (when the view is refreshed, the correct date
is displayed).
This rev. removes the internal cache for this field widget, as the
activities can easily be updated in business flows (unlike messages
or followers).
This rev. also fixes a bug in the BasicModel, where the res_ids of
a list datapoint was altered in place to return a list of x2many
commands instead of the list of ids when being stringified. This
caused a traceback when opening a lead with activities, as soon
as the internal cache had been removed.
Steps to reproduce the bug:
- Set your company in anglo-saxon
- Create a product P in a category which is in real price and perpetual
- Create a PO with P at 500$ and validate it
- Change the unit price of P in the PO line and set 100$
- Receive the product
Bug:
The two journal entries generated for the goods were created with the price unit
500$ instead of 100$.
Fix:
Now the right price is taken into account to generate the journal entries.
opw:1813946
Before this commit, model that create ir_ui_view via _inheritS was ignored in --dev xml
The arch_fs was not set. Because it was not ir.ui.view, and because xml_id was suffixed by _ir_ui_view.
Now we manage the case of inherits. So if model model.name inherits ir_ui_view
class MyClass(models.Model):
_name = 'model.name'
_inherits = {'ir.ui.view': 'view_id'}
view_id = fields.Many2one('ir.ui.view', string='View', required=True, ondelete="cascade")
...
<record name='model.name' xmlid='pok'>
<field name='arch' type='xml'>content</field>
</record>
will be read from xml in dev mode.
parsing the xml file for xml_id pok_ir_ui_view and pok.
The orm by default will add this suffix.
The 'dynamic' view created when we update the groups is a special case, which we don't want the arch_fs
for dev mode because the xml only contains by default and an empty container and btw the imd was wrong
since we had the res.group model a xml_id into the _inverse_arch.
The page create via a template (method new_page) will automatically remove the arch_fs since we don't
want to see the empty container if we are in dev_mode.
When the inventory adjustement has been validated, changing accounting_date has no
impact on the stock moves created by the inventory adjustement.
This behavior cannot be changed in stable version.
opw:1817813
Revision on https://github.com/odoo/odoo/commit/a87d761fdbf345ada5dc93e0a686b08a0f5a0417
From the UX/UI changes above, we also changed the style for empty
inbox and starred in Discuss.
There are two issues with the empty boxes message:
1. The text is not centered at all (one word per line,
and everything is stuck on the left-side of the screen)
2. The style is inconsistent with nocontent message on search
In this commit, inbox and starred use the same style as the no_content
message from a search. The style of the nocontent from a search has been
slightly changed to mimick the intended style for inbox and starred:
- centered text
- title is in bold 125% font size
- other text is not in bold, 115% font size.
When a pricelist was set on the public user that was different from that of the
website, the prices were displayed using the public user default currency,
but the currency symbol displayed was the website default currency.
The issue was that in the template, the currency was accessed as a computed,
related field of website while the price was obtained using a function call.
In the first case the field was obtained using sudo, and thus the call would not
get the public user pricelist.
opw-1817761
When a user returns a tracked product in the POS, it is not possible to
register the serial number. In case a customer returns 2 units of a
tracked product, the following error occurs:
'Cannot set the done quantity from this stock move...'
Since the serial number were not set, `qty_done` remains equal to zero
and `pack_lots` is empty. Therefore, we are trying to set a zero value,
which is actually useless.
opw-1817695
In a multi-company environment,
if a user in company A
created a Payslips batch for an employee in the company B
and used the `generate payslips` button,
the created payslip was set with the user company (A) while
it must be the employee company (B).
opw-1820138
When changing the employee to None in an allocation,
this onchange raised an error because it attempted
to set an employee browser record (empty but still)
in a department many2one.
- Create a new leave allocation
- Try to change the field Mode (holiday_type) from "By Employee" to "By Employee Tag"
Fixes#23345
opw-1820069
Revision on https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498
From the refactoring above, some snake_case attributes have been
converted into camelCase. That was the case in discuss.js, but
we missed to propagate the changes in discuss_mobile.js.
This commit fixes the traceback that came from the mistake above.
When there were no status widget in the form view statusbar, the left
buttons appeared without any vertical space around them in a smaller
statusbar.
There also was a 1px mistake that made the buttons appear non-centered.
Now they appear centered in any case and a row of buttons is always
forcing the correct statusbar height.
Closes https://github.com/odoo/odoo/pull/22053
opw-(1)813479
Before this commit:
Expense emails title are parsed to find a product that match the given [CODE].
For example, an email title like '[CARD] Graphic Card $900' will create an
expense for the product having 'CARD' as internal reference.
Since the search is done with an 'ilike' and with no 'limit', it could return
multiple product: all the one containing the CODE in their internal reference.
This would throw a singleton error when trying afterward to read product.id.
Then, the mail would not go through the mail.thread flow and it would return
a Mail System Delivery fail saying the address does not exist.
Users would get stuck with this, having no way to understand where the error
comes from.
Now, we ensure to find only 1 product.
To avoid breaking the ilike behavior that could be used by users only typing
the first caracters of a long CODE, we still use ilike but force exact match if
there is multiple results.
Closes#23419
opw-1816340
The following bugs in detailed operations have been fixed in this
commit:
- Avoid to edit reserved quantity on move lines. When a picking is set
in 'UNLOCK' mode you are able to edit the reserved quantity of move
lines, even if it doesn't really causes problems it create confusion
on what is the reserved quantity.
- Avoid to edit the product_id on a move if there is a move lines linked
to it. This will cause inceonsistencies by having move lines with
product_id different than the related moves.
- Avoid to edit the product_id on a move line if it has a linked move for
the same reasons as above. We also avoid the edition when picking is
done to avoid issues with the stock valuation
- Remove call to 'force_assign' method on demo data as this method is
not used anymore and set some pickings in wierd states
- Adding a move line in the detailed operation view does not create an
associated move.
- Don't allow editing moves when we are in detailed views and state is
done, even if picking is unlocked.
TASK-1817931
Allow the user to set the quantity with barcode
scanning. This functionality was present in v9 but
didn't work in v11.
The code in order to make it work was already present in
_quantityListener however it makes a check on setQuantityWithKeypress
key on the obejct activeBarcode. Howver the key was never set during the
activeBarcode event.
This commit set the key on the activeBarcode if passed in the event data.
It also allow to trigger a barcode if the user is inside a modal.