Despite the fact there is a `company_id` field
on `account.payment.term`, there is no multi-company
record rule on this model. The payment terms
are therefore shared by default accross companies,
even if the company is filled on the payment term.
In addition:
- The `company_id` field on `account.payment.term` is required
- The field is invisible on the payment term form
- The default value is the user company
Adding the record rule would imply to change:
- The fact the `company_id` field is required,
as you probably would like to share some payment
terms accross companies, by leaving empty this field
on the payment term form
- The field should be visible in the form for users
having the multi-company group, so the admins can
create payment terms for other companies than the one
they are currently in.
This cannot be done in a stable release, such as 9.0.
This is for master.
In the mean time, we keep the behavior as it was in 8.0:
We consider that the payment terms are shared among companies,
and the `company_id` field is simply ignored.
This implies that choosing a payment term from another company
in an invoice must not lead to multi-company access rights issues,
as it was the case before this revision: If a user other than
the admin chose a payment term from another company, the on change
on the payment term leaded to access rights issues, as it needed
the read access on the company of the payment term, to get
the currency decimal places.
From this revision, the currency is took from the invoice directly,
through the context, and if not passed in the context, the company
of the user is used instead of the company of the paymen term.
It makes more sense anyway to take the currency from the invoice
instead of the currency of the payment term company to retrieve
the currency decimal places.
opw-659818
project_time_mode_id is the timesheet UoM. However, all timesheet
widgets assume that project_time_mode_id is hours, therefore it is not
supposed to be changed.
Commit fde3a529 unlinks the product and the timesheet. Although we don't
want to use the cost of the product in the timesheet, we still want to
link the timesheet to the product for reporting.
Before this, selecting the pricelist from the order form view was
throwing the traceback as there is no 'type' fields exist in
product.pricelist anymore. It was removed in
e4dc50bf58.
Opening a view (kanban or list) in a dialog thanks to a target=new
action did not work anymore (only in community).
The cause was the 'search_view' action flag which was set to false
in case of a popup (preventing the view to search the records and so
to display them). This commit sets this flag to true if the popup
has to display a list/kanban view.
Backport of aab enterprise work.
The chatter composer extends the basic composer to, among other things, add
a button to open the full composer next to the button to add an attachment.
In a recent commit, the basic composer template has been slightly changed and
the buttons have been extracted in a sub-template, which seems to break the
template inheritance (the xpath refers to one of those buttons).
This solution simply removes the sub-template and duplicates the code.
When uploading a text document, the indexing was done based on a wrong mimetype
('application/octet-stream'). This was due to the result of mimetype.guess_type
being erased by the following guess_mimetype call.
opw 659328
This commit introduces native notifications (if available) to the
discuss application.
Those notifications will only appear if the user grants the permission
for that. A notification bar will appear in the discuss application if
necessary to prompt the user.
Also, it always is the master bus that will be the one sending the
notification.
For this change, it was necessary to be able to detect if the user has
the focus on some other odoo tabs. For this reason, the bus was
extended.
Since monetary values are stored as float, use the method intented for float
comparison using the maximum number of digits a currency can use.
Until V9, the number of digits used was fetched from table decimal.precision,
but as of V9, the accounting module stopped using it in favour of the digits
number defined on currencies.
When rendering QWeb reports, the user is being browsed without the
context, which means that any translatable field being accessed
through it will be in English.
should be the length of the recordset of connected users, not the recordset
itself, which is always evaluated as True (thus, the im_livechat script was
always embedded in the html pages).
geoip is set by the website module. If website is not installed,
request.session.geoip won't exist. Because all the geoip logic is in the
website module this means that if you don't install the website module
all of your tracked links will have an undefined country. This isn't
that big of an issue, because as far as I can tell the only default view
that displays this country is in website_links.
Ideally, the geoip should perhaps be moved to base, but for now this
will do.
The FieldTextHtmlSimple widget would focus on itself when changing its
value not by direct user interaction. But if this change was coming
from next/previous record, or an onchange that was breaking the
"autofocus" heuristic for field in Odoo.
With this commit:
- the autofocus heuristic is kept,
- if focused, selection is set at the end if it is possible on the
browser, else (old internet explorer and not visible field) the
selection is at the beginning.
opw-660486
When you go to /pos/web and there is no open session that belongs to the
current user the controller redirected to an old action called
action_pos_session_opening that was removed in
48ab50ed0d. This replaces that action
with action_client_pos_menu which just redirects to the POS dashboard.
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.
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
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
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.