Currently no access button is displayed if the email is a discussion and has
no contextual actions like creating a new document, or setting the responsible
of the document. However it leads to emails being sent without access button.
This can be extremely frustrating and make the notification email quite
impossible to use efficiently.
With this commit when an user has access to a document the link to the document
is always displayed in the notification email.
get_formview_action and get_formview_id are methods used notably in a
redirection called from a mail controller used in notification emails.
Those methods however are defined as cr, uid, id and are interpreted
as api.one when called by a new-api style method.
With modules being converted into the new API, those methods are called
as api.one and the result is encapsulated into a list.
To avoid having to take the first element of the returned list we decided
to simplify the call chain and migrate the methods as multi methods, using
ids instead of id. Various addons have been updated accordingly. A temporary
support of ids being an int / long has been added to avoid conflict with calls
using id (for example if javascript is not updated).
Since commit 3d48f2a375, each statement line creates a payment entry if it creates a move. So the code to cancel a statement line must be adapted to keep the old behavior: remove the payment if it was created by the statement line processing; keep the payment if it was registered before the statement line.
Since version 6.1 the functions set and get on ir.values are deprecated.
The overwrite of the function get on "ir.values" didn't set the context
at the right argument.
opw:682883
Since using new api for the website_sale module with commit 788c1334e2,
the website_sale module cannot be installed after the sale_stock module
is installed. The problem has not been detected on the runbot as, by
chance, the website_sale module seems to be installed before.
The problem here is that on installation, the _default_website_sequence
method is called to add a default value for the added website_sequence
field. In this method, a search() is done, ordered by this field values
then a read() is performed. The problem is that the read does not use
the given order value and use always the default one, which uses the
website_published field which happens to not be created at that time.
However the creation order of a model fields is difficult to determine
which is why when sale_stock is not installed, the bug does not appear,
the website_published being created, by chance, before calling the
_default_website_sequence method in that case.
To fix the problem, refactore the method by using a SQL query so that
the website_published field is not used. This also makes the method
easier to understand and more efficient.
Thanks to @rco-odoo
The migration of `website_sale` to the new API at revision
788c1334e2
repeated this problem initially fixed by PR #8795.
A browse_record returned by a cached method will be
broken at the next use, because it is bound to a
closed cursor.
The symptom is weird exception in the middle of a future
request:
```OperationalError: Unable to use a closed cursor.```
(which refers to an old cached cursor, not the cursor of the
current request!)
Solution: workaround the problem by returning IDs in the
method that needs to be cached (`_get_pl_partner_order`),
and re-browse them as needed in caller methods.
In addition, remove the useless extra caching of `_get_pl`,
as all it does is browse() the result of the former method,
and that would trigger the very same bug again.
This is a temporary workaround, which probably deserves
further thinking by @ged-odo, as the root cause
stems from commit 96bf5b2656
The problem is that the list view looked for composite group_by
keys such as "create_date:month" within `fields_get`, which
only contains true fields.
When there is no `color` field on the model
e.g. On invoice line taxes
The color class to apply on the badge was set to
`o_tag_color_undefined`
which doesn't exist. It must be set
from `o_tag_color_0` to `o_tag_color_10`
in order have a color.
Because of this, the taxes in the invoices lines
were not visible, because they were written in white
on a white background.
This has been broken by the below revision:
fe66472e2c
removing the or statement (`||`) to set a default
color for models not having a `color` field.
We choose to set `10` as default value, so the color
remains the same compared to the previous release
(light grey). However, if the new behavior chosen
by the usability is to have these in black, it should then
be changed to `0` again.
This filter must be added in the regular searchview,
and not have his own search view.
Without this:
- view_sales_order_filter_ecommerce is a not search view
for the sale orders, having the same priority than the regular one,
and therefore this view can be loaded by default for other menus
(In this case, this was for the menu Website Admin > Orders).
e.g. Clicking on the `Sales` stat button on a contact no longer
filtered the orders of this contact, but displayed all the orders,
because it was this view which was loaded instead of the regular one.
- In Website Admin > Orders, it was simply not possible to type a string
and search for it in the search bar.
A string attribute value can be translated,
and therefore the inherit broken if the term is indeed
translated.
This was the case for this term "Tracked link" in the Dutch
language, the "Tracked link" term of the inherited view has
been translated, and the inherit was therefore broken as
it couldn't find the given node in the base view due to the
fact this term was translated.
opw-683128
When the schema of a view change (e.g. drop of column), the "CREATE OR REPLACE"
will not be enough and dropping the view is required.
Fixes#12754Closes#12756
When making an advance payment in percent, the function onchange_advance_payment_method
set the Down Payment Product to False. Then each time an advanced payment in percent
was made, a new down payment product was created and set in sale.config.setting in the field
deposit_product_id_setting.
Now the function onchange_advance_payment_method let the Down Payment Product
even if the payment method is in percent.
opw:683167
During module update, we should only consider views of already
loaded modules. This filter is done by searching on xmlids of views.
We should also search for explicit view ids (current module is not yet
marked as loaded)
However, by doing this `OR` condition, the generated query is not
optimal and forbid postgresql to use the composite index
`ir_model_data_model_res_id_index` on `ir_model_data` table.
This is a performance issue for databases with a lot of ir_model_data rows.
Use 2 quicker search() to avoid this problem.
This only affect the module update. Normal view loading is unchanged.
Odoo S.A. invoices only 'non-share' (internal) users; the default
filter on the user list view does the same thing. It makes little
sense for the user counter to count all share users.
Now that the debug URL parameter can be equal to "assets", the session
debug variable has to be updated to not only be true or false. Now, its
value is false if the debug parameter is not specified in the url and
a the URL parameter string value otherwise (or 1 if the value is an
empty string).
Also modify all redirection which kept the debug mode to also keep
=assets. Use the $.param.querystring function.
* switch application flag between `hr_timesheet_sheet` and `hr_timesheet`
* renamed `hr_timesheet` application name from "time tracking" to "timesheets"
* move the icon from `hr_timesheet_sheet` to `hr_timesheet`
* removed unused icon from `hr_timesheet`
* renamed `hr_timesheet_sheet` application name from "timesheets" to "timesheets / attendances"
Return key events don't get redispatched and even if they did, it
wouldn't work because 'fake' keypress events don't trigger native HTML
event handlers.
This should be safe because Return cannot start a valid barcode.
We hide the quants_grp if the stock.move is in the draft state. In this
case normally the value of the string_availability_info will be empty
anyway, because the _get_string_qty_information function skips moves in
the draft state.
This is especially useful on small displays, because on there the string
attribute of the field won't be shown, so you just end up with a
Reserved heading with nothing underneath it.
If two addons path have a common part in the folder name (e.g. `/home/alice/dev`
and `/home/alice/devodoo`), the `get_module_from_path` method may match the
wrong folder.
A file `/home/alice/devodoo/bob/models.py` would wrongly match `/home/alice/dev`
path (due to the lack of separator) and the returned module would be `odoo`
(`"odoo/bob/models.py".split('/')[0]`).
In such scenario, the translations of files (code, static folder, report) would
not be included in the exported translation file.
Force the module path to ends with a folder separator to avoid wrong matching.
Closes#12757
When launching a server with two similar addons path, e.g.:
- /home/alice/dev
- /home/alice/devodoo
launching the server in dev mode may crash due to the poor matching using
`path.startswith(...)` method which may make `/home/alice/devodoo/bob/main.xml`
match in addons folder `/home/alice/dev` and with a non-exitant local path
`odoo/bob/main.xml`.
Instead of relying on the name, use the `os.path.commonprefix()` method to match
on real paths and avoid partial matching.
commonprefix will only work if the folder name ends with the appropriate
separator (which is not guarantee for a user provided addons-path) so force a
trailing `/` using os.path.join(..., '')`.
Closes#12359
Before this rev., the debug manager's state was only updated when pushing a new
action but not when coming back to a previous action using the breadcrumbs.
So when the latter case happened, the debug manager was desynchronized with the
action manager and it allowed to edit an action that wasn't the current action.
Steps:
-Go into Slides (into Website Admin main menu)
-Find the Slide "Odoo Explained"
-Change the channel to "Employee Channel"
-Disconnect or open a private session
-Go to the menu "Presentations" on website
-Click on "Public channel"
Bug:
Error 403
Fix:
When changing the channel_id of a slide, the custom_slide_id of all
the channels using this slide as "Slide to Promote" has to change
in False to avoid access rights errors.
opw:682063
Applying groups (or implied groups) in a multi-company setting
triggers the recompute of the share field; however, if the current
user does not have sufficient multi-company rules on res_users records,
the operation fails with ACLs errors.
Computing this field as sudo prevents this.
Since commit c9e38cae9f in saas-10, the html fields are sanitized in
strict mode by default. This breaks all html fields behaviour when it
is editable in the website editor.
This commit deactivate the sanitization for such HTML fields (like it
was already the case for blogs contents or products descriptions for
example). A more specific sanitization will be implemented in future
versions.
Steps to reproduce:
1. Activate the following options
** Settings > Warehouse > Products > Manage different units of measure for products
** Settings > Accounting > Accounting & Finance > Analytic accouting
2. Desactivate the following option
** Settings > Accounting > Analytic accouting > Sale > Use multiple analytic accounts on sales
3. Create a Sale order
** Add 2 qty of the product iMac
** Add in quote the delivery method "Normal Delivery Charges" and set 2 qty
** Set an analytic account under Contract/Analytic
** Set the field Create Invoice to "On delivery Order"
4. Deliver only 1 quantity of the iMac and then create the invoice
5. Deliver the last quantity of the iMac and then create the invoice
Behavior before the fix:
The first invoice contains 2 qty of the Transport
The second invoice contains 1 qty of the Transport, has no analytic account set, has no UOM set
Behavior after the fix:
The first invoice contains 2 qty of the Transport
The second invoice contains 0 qty of the Transport because it has already been invoiced
Closed#12644
opw:682284
When a procurement needs to create purchase order lines due to
reordering rules and if an empty PO exists for the vendor of the
product, the creation of the PO line will crash since there is
no scheduled date on the PO.
opw-675706