The function _onchange_partner_id must be triggered when the field 'company_id'
is modified like with function _onchange_partner_id in addons/account/models/account_invoice.py
In this way, the account_id is set in 'account.invoice when the 'company_id' is changed.
opw:652918
Non-trivial port because 9.0 has rescue sessions that kind of try to
solve the same problems, however:
- they do not automatically put orders into a compatible, newly opened
session because it explicitly searches for rescue sessions. So if
you open a new session and create a new order in a POS associated to
a closed session you will end up with two open sessions (one rescue,
one regular).
- they throw exceptions with cash control enabled
- they're a bit more complicated because they introduce the idea of
'rescue' sessions, which the 8.0 fix does not (it just uses regular
sessions).
So this reverts bed409322d without
changing the database and while still ensuring that databases with
existing POS rescue sessions don't break.
The `parent_id` field was mis-aligned in the `res.company`
form view, making the input away for its label.
We moved the field to the General information tab, to not
overcrowd the headers.
opw-653373
First 'key' and 'website_id' fields must be checked to retrieve
the right view.
Then if no view is found, it falls back on xml_id.
To choose the right ir_ui_view, _view_obj must take into account
the 'website_id' set in the context.
Inspired from function "get_view_id" in addons/website/models/ir_ui_view.py
* when getting the src of an uploaded attachment we have to use src which
is by default url,
* in a MediaDialog the pager is shared between the document and image
dialog, but when changing page, it was done for both (even if not
displayed),
* select the image after uploading it in the ImageDialog.
closes#9284
opw-653061
opw-653167
The issue occurs for example in the Sale dashboard, when the user
changes the target amount. If the user changes the value, then directly
clicks outside of the field, the method on_change_input will be called
twice: the first time because of the event 'change input', the second
time because of the event 'blur input'. This makes an unnecessary write,
which can cause an error due to concurrent access.
This prevents the execution of the write related to the event 'change
input' in this case. If the user changes the value but clicks on
'Enter', the focus is still on the field so the update is done
correctly.
Courtesy of Quentin Smetz (qsm@odoo.com)
opw-653086
When a selection field with widget="radio" is False, the form view display the previews value for this field.
1 - Create a selection field (ex: [("1", "1"), ("2", "2")]), and display it on a form vue.
2 - Go to the form view (all the record have False value for this field).
3 - Change the value of this field for one record.
4 - In readonly mode, all other records now wrongly display this value (still False in DB or when "edit").
#opw-652002
Regression introduced with 71c624163c.
If the discount column is not added in the `tbody`
when not part of the group `sale.group_discount_per_so_line`,
the head column should not be added either in the `thead`
opw-653242
When several accesskey with the same key, are defined on elements, the
last one (even if not displayed) is the one which will be actioned and
the key sequence is pressed.
This caused an issue since the "Pager" template is shared between all
elements, even the x2many relational widgets.
Also there was shortcut for Create/Save/Discard on the form view, but
those shortcuts should also be enabled in the list and kanban view.
closes#9267
opw-652888
People sometimes have an open POS client (/pos/web) which is associated
to a closed POS session. This causes multiple issues. The most important
problem occurs when a user closes the session and opens a new session
without refreshing the POS client. When doing this new POS orders will
become part of the old, already closed session and no new accounting
entries will be generated.
In order to fix this we make sure to check that the session that's
associated with the order that we get from the client is still open. If
it isn't we'll try to find a new, compatible session and add the order
there. If we cannot find a compatible session we'll create a new one
based on the old, closed one. When creating this new session we bypass
the opening_control phase which normally takes care of opening cash
control.
opw-652356
Commit 7636b51 modifies the route from JSON to HTTP by mistake. Indeed,
the route /quote/accept is called from an ajax.jsonRpc request, not from
the `method="POST" t-attf-action="/quote/accept` which can be found in
website_quotation.xml.
The t-attf-action is actually only used to recover the order_id and the
token in website_quotation.js.
opw-652874
Closes#9227Fixes#9226
Assets are now split in multiple files and there is not a route which
always leads to the last version of an asset. This commit adapts theme
customization (without reloading) to these new features.
When clicking on a breadcrumb taking us to a previous view, we should
restore that view action and not keep the current one.
closes#9075
opw-652039
note: no forward-port needed
This is possible to have a child menu without URL.
The condition checking if the `active` class
must be added or not must take that into account.
opw-653132
The method `compute_all` of `account.tax` in api.v8
expects a currency browse record, not a currency id.
It's the `compute_all` of api.v7
that expects a currency id.
opw-653106
`vals[tax_ids]` can be a command triplet,
see:
https://www.odoo.com/documentation/master/reference/orm.html#openerp.models.Model.write
Doing
`tax_ids = map(lambda tax: tax[1], vals['tax_ids'])`
to resolve the command doesn't work for all triplet types,
for instance it doesn't work for triplet `(6, 0, [...])`
To resolve properly a 2many commands, `resolve_2many_commands`
should be used.
opw-653106
The two above revisions had to be adapted between 8.0 and 9.0:
- There is no longer any `draft` state on `account.bank.statement`,
it's now `open` or `confirm`.
- There is no longer two views, for bank statement & cash regiters.
There is only one. No need to duplicate the inherited views to add
the cancelling buttons.
opw-653106
Complements b99ef3b125.
The index definitions have changed, so we need distinct names
and existence tests to make sure they get properly created/altered
on older databases.
The below revision:
275234c067
Makes the multi-companies record rule disabled by default,
meaning the user can see contacts from other company than
his current company.
Nevertheless, to read the computed field `currency_id` on
the `res.partner` model, the user need the read access
on the contact `company_id` field, that the user does not have
if the partner company is not a child of the user current company.
opw-653103
The method _webiste_product_id_change now properly browses the product
as it is done in the method product_id_change of the sale module. Prices
are now updated according to the pricelist.
o2m editable list open a form view and can put command as default value (record[this.name] for o2m in a o2m) for the editable fields.
When the onchange is triggered, get_value create a wrong command of command.
step to reproduce issue:
* edit a quotation with at least on sale order line
* change the pricelist
* change the quantity of the sale order line
todo : remove _on_load_record in version > 9.0 and use new dataset implementation with to_delete attribute