These menus are supposed to display the message
to: me / to do that matches the `To Read` filter.
The filter was correctly displayed in the search
view, but the records displayed were not the
result of the search, because the call to
`message_read`, in `message_fetch` was done
too early, with the wrong domain.
This is because `searchview.has_defaults`
& `searchview.ready` have disapeared in saas-6,
with the refactoring of the search view.
opw-659137
Commit 5d1b323. re-enabled the user presence updates and notifications.
Unfortunately, it showed poor performance due to the high frequency of bus
notifications triggered on our instance (~600k users).
In this rev., we don't trigger notifications on presence changes anymore, but
we rather send the presence of users we have a DM open with, at the end of each
poll period. For performance reasons, we ensure not to do that more than once
every 30 seconds.
We also refined the detection of the 'away' status client side. 'Last presence'
timestamps are stored in the local storage, and the current inactivity period
is sent at each poll. Those presence timestamps now rely on browser activity
detection (click, keypress... events) rather than on the focus on Odoo tabs.
Finally, we removed the no more necessary cron introduced in 5d1b323.
The problem was that the matching rule was evaluated before sending the html
page, and the script was inserted in the page according to the matching rule
(it wasn't inserted if the rule was 'hide_button'). However, the matching rule
wasn't re-evaluated if the page was already in the cache. The page content thus
might depend on a matching rule computed for someone else in that case.
Rather than inserting the script according to the matching rule, we insert it
only if there is an operator available. We then ask for the matching rule in
the livechat widget, by RPC, and we reject its willStart deferred if the rule
says so. We also re-check for operator availability in the same RPC.
When uploading an image in the client list in the POS with Firefox an
error was thrown complaining about event not being defined.
jov note: the reason it worked in other browsers like IE and Chrome is
that in those browsers `event` resolves to `window.event`. In Firefox
this doesn't happen which is why JQuery provides us with the event in
the callback function.
closes#10078
The route `/mail/unfollow` is used by the button
`Unfollow` in the mail notification template so a user
can remove himself from the followers of a thread.
To be able to remove yourself from the followers,
you need to have the write access on the thread
(see `message_unsubscribe` in `mail/mail_tread.py`)
which you perhaps do not have, for instance if you
are a portal user.
The unsubscribe of this follower from the thread
should therefore be done as sudo.
opw-659295
This reverts commit 882bbf46e2.
This revision leads to a crash when creating a new user:
Traceback (most recent call last):
File "/home/dle/odoo/9/openerp/http.py", line 643, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/dle/odoo/9/openerp/http.py", line 680, in dispatch
result = self._call_function(**self.params)
File "/home/dle/odoo/9/openerp/http.py", line 316, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/dle/odoo/9/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/home/dle/odoo/9/openerp/http.py", line 309, in checked_call
result = self.endpoint(*a, **kw)
File "/home/dle/odoo/9/openerp/http.py", line 959, in __call__
return self.method(*args, **kw)
File "/home/dle/odoo/9/openerp/http.py", line 509, in response_wrap
response = f(*args, **kw)
File "/home/dle/odoo/enterprise-9/web/controllers/main.py", line 907, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/home/dle/odoo/enterprise-9/web/controllers/main.py", line 899, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/home/dle/odoo/9/openerp/api.py", line 238, in wrapper
return old_api(self, *args, **kwargs)
File "/home/dle/odoo/9/openerp/api.py", line 369, in old_api
result = method(recs, *args, **kwargs)
File "/home/dle/odoo/9/openerp/models.py", line 5998, in onchange
record.mapped(name)
File "/home/dle/odoo/9/openerp/models.py", line 5497, in mapped
recs = recs._mapped_func(operator.itemgetter(name))
File "/home/dle/odoo/9/openerp/models.py", line 5477, in _mapped_func
vals = [func(rec) for rec in self]
File "/home/dle/odoo/9/openerp/models.py", line 5715, in __getitem__
return self._fields[key].__get__(self, type(self))
KeyError: u'in_group_18'
Each time the quantity of a product is changed, the price must
be updated according to the pricelist of the user.
When the price given by the pricelist is less then the unit price
of the product, the reduction of the price must be displayed.
opw:660178
If one set a carrier_tracking_ref on a stock.picking,
but the carrier_id is not set, the button Tracking
will appear but crash as this button calls a method on
the carrier.
opw-660659
When using phantom/kit boms,
`action_confirm` on the move can lead to the move unlink,
as new moves with the different parts of the product have
been created.
See `_action_explode` in `mrp/stock.py`
The method `action_confirm` on `stock.move` returns the list
of remaining moves.
`force_assign` should therefore be performed on this new
moves list, returned by `action_confirm`, rather than
be performed on the moves list sent to `action_confirm`
opw-660722
On the PosTicket receipt (non-ESC/POS receipt) we have a line titled
subtotal. The subtotal was calculated with getSubtotal(). The issue is
that getSubtotal() ends up just using the price of the product. This
doesn't make sense when taxes are included in the price, because then
the subtotal will contain taxes.
It's not an issue on the ESC/POS receipt, because there we don't show
the subtotal at all if we only have included taxes.
fixes#10137
opw-660266
In Discuss, when the user opens a channel, the composer was the same,
regardless of the channel type. This is fine for chat channels, because
we expect mostly small one liners to be written. But for mailing
channels, it is a problem: it is too easy to send a mail to everyone
just by typing ENTER, when the user wanted to go to the next line.
This commit introduces a new widget, the extended composer, to be used
for those channels. It allows the edition of the subject line, and
don't sent messages when the enter key was pressed.
When replying to a question,
there is no possibility to set a title (`name`)
in the answer form, there is no input for the title,
even if the controller `/reply` would accept it.
This revision sets a title for answers so:
- The answers doesn't appear as `False` in the breadcrumb
- The subject of the mail notifications sent
for these answers are set with a meaningful title
opw-659279
When fetching the invoices linked to a sales order,
the system looked for all refunds which had an 'origin'
field that was the number of an invoice of this SO.
That's nice, except that invoices that are not yet
validated do not have a number, which caused sales
order with an uncofirmed invoices to be 'linked' to
all 'out_invoices' that had no origin (which could
be 1000+ for a substantial db) (basically all out
invoices which had the origin field set to false)
This commit simply extends the domain to exclude
refunds that did not originate explicitly from one
of the SO's invoices.
m2m_tags inlist editable view try to get color on validation, the field is invalid because the mutex is pending.
Fix: don't re-render the fields
Issue: steps to reproduce:
- Create a new instance, install "sale"
- Create a product "prepayment", service, invoice on ordered qties
- Create aproduct "project phase", service, invoice on delivered qties, manually track delivered qties
- Create a SO with once prepayment, and twice a line with "project phase". ( the name (description) of the lines should be "phase 1" and "phase 2" )
- Create invoice => The prepayment is invoiced
- Go back to the SO, try to change the delivered qties of the first phase to 1
- Save => error, odoo doesn't let you save.
Missing context in call to render the planner leading to untranslated planner.
Use the session to get the user context as outside of the view manager.
opw 660627
When there is no lang set, format_tz uses server locale to format a
date. If my server is in French, date is formatted using '%B' (full
localized month name). This can lead non-ascii strings like
"décembre"...
When creating a new `account.account`,
or writing on an existing one, changing the
`type`, the source of the related field
`internal_type`, `user_type_id.type`, was
re-written (re-stored) because the field
was not read-only.
In addition, the re-store of the value
of this field triggered the re-store of the related
field `internal_type` on all other `account.account`
records using this `internal_type`, which leaded to:
- Performance issues
- Potential access rights issues, if this leaded
to write operations on records to which the user
does not have the access (multi-company rules, among others)
Forcing the field as read-only allow to not pass the value of this
`internal_type` from the web client to the server when
creating or editing an `account.account`.
Besides, the field is required in the view, to correctly trigger
the according onchange method:
```
@api.onchange('internal_type')
def onchange_internal_type(self):
```
opw-660292
Closes#10143
Analytic accounts are inherited by project.project, and in some cases it is useful to have a link from the account to the project.
This is a usability-fix, not a code-fix
When an expense is recorded and linked to an analytic account, the
associated line will appear in the timesheet.
This fix links prevents linking an account analytic line to a timesheet
sheet if the line is not a timesheet.
Somehow related to a4b6e3a8
opw-657917
If the kanban view is loading grouped records, the dataset of the view
itself is the concatenation of the dataset of each groups.
But when using "Load more..." on a column, these records are not added
in the view dataset which is thus desynchronised. This could lead to an
error down the road.
closes#10156
opw-659016
When inheriting from a view in extension mode created in the same module, this
view was not loaded during check_xml of the last view.
This caused an error when the last view wants to modify elements added
by its direct parent view.
Example :
- View1, created in module "account"
- View2, mode extension, created in module "customer", inherits View1
- View3, created in module "customer", inherits View2
During update of module "customer", when loading View3, the check_xml
call didn't load View2, because it's defined in the same module (and,
obviously, this module has not be totally loaded at this point)
This is fixed by adding direct parent of each loaded view in the
check_view_ids list in context, to force them to be loaded.
Closes#9135
This revision is related to 7be2403cf5
The payment acquirers must be fetched if the quote
needs a payment.
Besides, as explained in the above revision, the state
`manual` no longer exists sales orders, and therefore
this must no longer be used to determine if a quote
needs a payment or not.
opw-660575
1. To change the page title, you now have to call
`set_title` from `require('web.web_client')`
2. Without the `type="button"`, the `Change Password`
button is regarded as a `type="submit"`, therefore
submitting the form, on `web` on click,
and `web` doesn't expect this POST request.
The POST request must be done on
`/web/session/change_password` only.
opw-660567
Each time the quantity of a product is changed, the price must
be updated according to the pricelist of the user.
When the price given by the pricelist is less then the unit price
of the product, the reduction of the price must be displayed.
A not stored computed field is added in model "sale.order.line"
to compute the discounted price because when the module
product_visible_discount is installed the price unit of a SO line
is the full price of the product and the discount related to the pricelist
is written in percent in the field discount(function "product_id_change"
in addons/product_visible_discount/product_visible_discount.py).
opw:660178
- A simple POS user doesn't have the rights to write
on pos.config, not even to write the `current_session_id`,
so it must be done as sudo.
- If no fields is specified to `search_read`, it reads all fields.
The simple POS User cannot access all fields on `account.journal`,
(e.g., the computed fields implying `account.payment` records)
opw-659079
This revision is related to 432f199.
Since the above revision make sure to change the
editable list to `bottom`,
the order of the list should be done on the `date` (asc),
on this view, as this is more likely that, when adding a new line,
that the date set on this new line is
more recent than the dates on the other lines.
The new added line should therefore appear directly at the bottom
of the list, to avoid consufing the user.
Besides, the default order of the model `account.analytic.line`
is set to `date desc, id desc`
opw-659892
After initial implementation CSRF protection had been left poorly
documented tripping up users and developers (#9538, #10139).
Add a warning in the logs for developers, and a more extensive
explanation of the whole thing in the @route docstring (and the official
documentation).
Fixes#10158
user_has_groups is used to check for groups in e.g. view attributes (`@groups`).
When trying to format lists of groups in views, it would break down as it would
pass e.g. `\n some.group` to `res.users.has_group`, which would look for
an xid with the module `\n some` and (oddly enough) not find it.
Theoretically could also handle that inside res.users.has_group but it seems
ever-so-slightly more risky, and has_group is only used programmatically and
should thus already be called correctly.
fixes#9797