This is a backport of saas-13 commit a9bd9ab160.
mail/view controller is a generic controller that redirects the user to a
given view, depending on the record and the user. Users may be redirected
to the backend form view, or to a website view. This is done notably by
calling get_access_action method that gives the action to perform (act_window
or url).
Previously this method was called using SUPERUSER. However it was therefore
impossible to know who the user was. This method is now called using the
current user. Various overrides of get_access_action have been updated to
add some logic and access rights check directly in the method allowing
more fine-grain behavior of the access action.
Since saas-12, when deleting contents, parents are deleted too if they
become empty (while it was not possible to delete contents in that case
before). The problem here was that the history was recorded multiple
times if one deletion made multiple snippets be deleted and this
sometimes could crash.
Now the history is recorded only on first deletion when the user ask
for it.
Following 5c5d0865b9, apparently unused records
are simply deleted after updating existing ones. This causes an issue when a
module is installed or upgraded. The inspection of `ir.model.fields` records
is based on a *partial* registry (not all modules loaded); therefore records
will be deleted and recreated afterwards. This triggers inconsistencies in
other models that refer to `ir.model.fields`, like server actions, base action
rules, mail templates, etc.: many2one fields will be set to null!
An issue originally occurs in the Event module.
- Go to Events >> Reports >> Events
- Add a "Group By" in the search view: "Event Month"
- A mighty traceback pops up
This is because the rows and the columns are grouped by the same field
(`event_date:month`).
In method `_read_group_format_result`, a group_by of type "date" or
"datetime" is replaced by a "(range_start/range_end, label)" tuple. The
first element of the loop on `annotated_groupbys` is handled correctly,
but the next identical element will crash on `value + gb['interval']`,
since `value` is now a tuple and not a date/datetime anymore.
opw-686242
There is a hackish feature in the web_editor which forces the
contenteditable to true on links which are clicked and removes it
anywhere else in the page so that only the link is editable after
click. This allows to add text at the end of a link without adding it
outside of the link by mistake.
The feature was badly implemented because, if the link was editable
without having any parent which is editable, the contenteditable was
forced to true, then immediatly forced to false when forcing to false
every page element. This was the case for lots of t-field. By example
the product categories in eCommerce are t-field links which are in non
editable <li/> elements...
When we are on the page:
/blog/myblog-1/page/2
the link to page 3 is:
/blog/myblog-1/page/3
So we need to give /blog/our-blog-1 as source url of pager.
Previously in this instance, since 4faed0b7 the page 3 url
in this scenario would erroneously be:
/blog/myblog-1/page/2/page/3
opw-688681
Avoid traceback "'int' object has no attribute 'partner_id'"
uid is the id and not the browser record of 'user'
Avoid traceback: Database fetch misses ids (u'<id>') and has extra ids (<id>),
may be caused by a type incoherence in a previous request.
JS call with id as string.
Avoid traceback: Invalid value res.partner(x,y,z) in domain term ('partner_id', 'in', res.partner(x,y,z))
Search in new api return browseRecord now
Avoid to write on a lead without the right on it.
Tree view was removed to hide the different view types display in enterprise as it was "cleaner" for a dashboard. Re-adding for import button.
Future versions will not display departments as dashboard but employees anyway.
Since the below revision:
32b5515a8f
It was no longer possible to create a payment
for a pos order without picking.
Indeed, if `picking_type` is not set,
`picking_id`, which is initialized to `False`,
remains as `False`, and you therefore can't
ask it's `.id` (`picking_id.id`).
opw-687597
If the title was 'true' or 'false', the export failed, because we are tying to
concat bool and str. TypeError: cannot concatenate 'str' and 'bool' objects
How to reproduce, install sale, be sure to have one order with delivered = True
In Reporting / Sale analysis, add a group by 'shipped' filed to have 'true' as
title.
This commit closes issue odoo/odoo#13425
When a custom field is created, it now appears in `ir.model.fields` on the
model's children models (by `_inherits`). This makes the reflection more
accurate (inherited custom fields are visible), although not perfect (they
appear as "base" fields and thus cannot be overridden).
The reflection of fields in `ir.model.fields` has been improved to deal with
custom field creation, modification and suppression.
Note that custom fields are still not inherited through `_inherit` relations.
opw-687626
opw-645065
Before migration:
'phone': customer and customer.phone or lead.phone,
After migration:
'phone': customer.phone if customer else self.phone,
So if a customer exists and that it has no phone, the phone
on the lead need to be preserved during convertion in opp.
This commit reverts the API change introduced in b3302398bc
that changes `ir.qweb#render()` to return a unicode string instead of a utf8
encoded bytestring.
Returning a unicode string is undoubtedly cleaner and a step in the direction
of python 3 but still is an API change that can break third party modules.
Let's wait the migration to python 3 before breaking other people's toys.
When a pad is created programmatically (e.g. through a project task or a
note), the pad is empty when it is first displayed. It is necessary to
edit the record and save it in order to be able to see the content.
This is because the pad is normally initialized by the JS layer, at the
first edition, thanks to a call to `pad_generate_url`. Therefore, a
programmatic pad creation won't initialize it.
opw-685826
Before this commit, we check everytime the subtype.
In some case (eg: portal user on the forum) don't have access to subtype of
type internal.
This commit fixes opw-688403
This commit closes#13510
When a modal was opened, the system seemed slower because a web_tour
callback was called every 500 ms.
This was because of jQuery. Using the "find" method on a jQuery element
will temporary set an ID on this element for some jQuery reason. So,
when a modal opened, a DOM mutation was caught by the web_tour observer
which then called the "update" method in which a $modal.find
is done... and so an ID was set and a new DOM mutation was caught again.
The solution here is to provide an unique ID on each modal in odoo so
that the find function has not to set an ID, and so does not trigger
any DOM mutation.
The dashboard instantiates an action manager for each view it has to display.
It then replaces the do_action() function of those action managers by its own
one, forgetting to pass the second argument 'options'. Thus, when do_action was
called by a view of the dashboard (e.g. a button in a list view), it was called
without the options.
Makes it easier to later reconcile payments with
bank statements. For eCommerce orders the payment
transaction happens before the creation of the invoice,
so the invoice number is not sufficient to quickly
find a match for reconciliation.
The system was lost with the editor refactoring which came with saas-10
and commit bf39884a5c.
Indeed the show() method of the BuildingBlock class was removed as the
widget is now always showed but the show_blocks() method it called was
not removed (and thus was not called anymore).
As a fix, the show_blocks method is now called again, on snippets
initializations and each time a snippet is dropped or removed.
The quantity event handler is not correctly unbound when its action
is deleted, resulting in multiple window.prompt asking the quantity
of the products if you go mulitple times trough a view when a widget
implementing the barcode thing is used.
There seems to be a bug in the framework ("barcode_scanned" events
are registered the same way than the "keypress" one on core.bus
but they don't have suffer from the same issue).