When a new message arrived in a non pinned DM, the unread counter was
incremented twice ; once because the channel info (along with its unread
counter) was fetched from the server as the channel wasn't in the JS cache yet,
and once when adding the message in the JS.
With this rev., we only increment the unread counter when a new message arrives
if its channel is already in the JS cache.
Two problems occured:
- when the user hadn't seen any messages of a channel, the seen_message_id
was null and doing seen_message_id < msg.id to retrieve all messages
received after the last one seen didn't return any message (null < x is
always false)
- messages sent by visitor on the livechat doesn't have any author_id, so,
again, doing msg.author_id != partner_id is always false, and as a
consequence, server-side, the messages sent by visitors were always
considered as read
Problem occured when the first call to get_channel_preview was directly
followed by others, before the channels_preview_def was resolved. In that case,
the other calls all returned an empty array, as only the channels_preview
array was only filled with the RPC result for the first call to
get_channel_preview (the one which initiated the RPC).
Those items might have been rendered and inserted into the DOM before the chat
manager initialization was completed. As those items rely on chat manager's
data, they should wait for it before executing their action (inbox redirection
and channels preview display).
- discuss notifications are always sent natively if possible
- clicking on native notifications focus the tab
- clicking on native notifications closes them
- granting notification permissions will display a confirmation
notification
The sanitizer escapes email addresses contained in its source html to
avoid having it being discarded. Indeed the lxml cleaner considers them
as invalid tags and remove them.
However this escaping does not take into account email-like patterns
contained in cite attribute present on blockquote, del, ins or q.
This could lead to blockquote tags being escaped and therefore wrongly
displayed. This is now fixed.
In sale.config.settings, the method get_default_sale_config has api.multi decorator.
However, the method definition should be def get_default_sale_config(self, cr, uid, fields, context)
(see https://github.com/odoo/odoo/blob/9.0/openerp/addons/base/res/res_config.py#L534 ).
The api.multi decorator results in the model being browsed with fields as ids, which results in that kind of queries:
select * from sale_config_settings where id in ('generate_sales_team_alias')
This change corrects the method definition to fix that.
In IE11 the values can be not string (for example a number and so not
have .indexOf method), but then there will no be !important bits and we
can just ignore this feature (which check if an overriding rule has an
!important flag).
There was another edge case when getting a "" set style, we get undefined.
opw-667917
When connected as a website manager,
in another language than the default
website language,
it was not possible to use the optimize
SEO feature, because it needed
variables that were not available if the website
was considered as translatable only,
not editable. This is the case
when you are in any other language
than the default website language,
`editable` is `False`
and
`translable` is `True`.
This is a change of behavior compared to Odoo 8.0,
where `editable` was considered to `True`
even if you were only editing the website translations.
opw-668632
Copied from _get_delivered_qty in addons/sale_mrp/sale_mrp.py
When a product with a BOM is delivered, the delivered qty must
be the produt qty set in the PO line.
PS: There is no dependencies between mrp and purchase
opw:668572
There was a domain on the action to display only the leaves and not
the allocations. Because of this, it was impossible to display the
used leaves, the allocated leaves and the remaining leaves on the same
view, which is frustrating for a HR when he wants to reports some leaves
from a legal year to another
pos_restaurant creates temporary orders when splitting the bill. This
ensures those are never saved to persistent storage. As soon as the user
clicks on the pay button, the order is not considered temporary anymore
and will be saved.
Closes#10767Fixes#10350
opw-666141
In new api, the context in encapsulated and propagated with 'env'. There is no need to add in the signature. Method decorated with api.multi/api.model replace method(self, cr, uid, context).
The payment method code is not supposed to be changed
from an `account.payment`.
Besides, this field is only used for technical reasons,
as stated:
```
Technical field used to adapt the interface to the payment type selected.
```
There is therefore no reason to not set it as readonly.
Not setting it as reandonly could lead to a `write`
operation on the `account.payment.method` with the value
of the code, even if this is already that one set, and
such an operation could be prevented by the access rights.
opw-668624
A missing feature in discuss was the possibility to directly reply to a
message from a channel without opening the document. This commit add
that feature. Now, there is a small 'reply' icon in channels (including
inbox/starred) if the message comes from another document. This icon
opens an extended composer, which will post the message in the document
chatter.
This controller was very slow as not providing a pricelist computed the price of
all products of all pricelists.
Instead only fetch the prices for the useful products.
Could incorrectly rename the stock.location.path objects, and in case
the route has push_ids but no pull_ids would crash the method entirely.
closes#10747
In a multi-company environment, a user from company A which is a parent
of the company B has access to taxes from both companies. The
consequence is that the method _set_taxes will automatically add the
taxes from both companies.
Method `is_css_preprocessed()` introduced by #9978 at revision
79f13a2aaf might fail when the
user/visitor did not have sufficient access rights to read
the cached assets (depending on ir.attachment ACL)
In addition an empty cached asset could trigger a corner case.
While the signature makes sense in an old API context (sort-of) it's
very easy to misuse in a new API context as one'd expect `has_group` to
use the subject (recordset), not the user in the environment, compounded
by ``env.user`` being browsed as administrator, resulting in the
"obvious" ``env.user.has_group(foo)`` checking if the
administrator (rather than the current user) has the specified group.
Adds a divergent v8 version of has_group which first checks if it's
called on a non-empty recordset, and in that case use the recordset id,
otherwise fallback on the context user (to handle new API conversions
which used the "correct" call convention rather than the obvious one).
fixes#9649
Mainly by moving the authority to handle the ir.attachments records
for Less and SassStylesheetAsset from the asset to the bundle.
We introduce a method `is_css_preprocessed` that will check if the
less/sass assets contained in a bundle already have ir.attachments
records. On top of that, it'll check if these existing records
need to be invalidated by comparing the last modified date of the
file and the __last_updated field on the record. If it is the case,
we chose to unlink all the less/sass attachments from the same
bundle.