d28f8f704f carefully clears only the
relevant bit of the cache (only the top-level object which we're
exporting), however the commit did not considert that _export_rows
calls itself recursively for relational fields, and thus when
exporting relational fields the relation would become the new
top-level and get cache-cleared on every iteration, significantly
slowing down cases where such records are shared and would need to be
re-fetched every iteration, even more so if they're somewhat/somehow
expensive.
OPW-1833545
OPW-1836361
While c059e7b93c64b9dd9bc96eeb6ee5cadf significantly lowers the cost
of generating xids, a safety invalidate cache can regress cases
significantly e.g. 18s -> 430s (7mn) for some recursive exports of
xids as the cache would be completely cleared *after each record*
requiring complete fetching & recomputation of the following records.
Fix by only clearing the cache if we've actually had to create
xids *and* only for ir.model.data records.
It's possible that clearing the cache isn't even necessary at all (?),
check with @rco-odoo
OPW-1835226
When Odoo display a phone number number, on phone or if VOIP is
installed a invisible `­` character was added from 9.0 up to
saas-11.2 so an applications such as skype would not be concerned with
the number.
But if someone copy-pasted from this to somewhere else in Odoo, we would
get incorrect number with this invisible caracter. So this change make a
special case for the "FieldPhone" so the character is removed from data
saved.
opw-1834858
closes#24223
Before this rev., a crash occured when a default_get returned a
command 0 (CREATE) for a one2many, with a value for a date(time)
field (e.g. [0, false, {some_date_field: '2018-12-08'}]). This
was because the related values (inside the commands) weren't
parsed. This only impacted date and datetime fields, for which the
parsing converts the string into a moment instance.
Fixes#23672
The built-in Odoo profiler can be used directly into the logs. This
information was not given in the documentation. This commit add it. An
example on how to use is shown as well as the produced result.
Have the create_date field displays on a one2many list
Try to add a record onto the list
Before this commit, when the virtual record is added onto the list
it crashes because the datetime field is undefined and cannot be parsed
After this commit, It doesn't crash though the value would have to wait the save on the main record
to be updated (because it is the create_date)
OPW 1834250
closes#24097
- Go to Timesheets > Add a Line (grid view)
- The view opened is `view_timesheet_form`
- Add a description with several lines
- Go to Project, and display the timesheet entries.
- Print the report "Timesheet Entries"
The lines in the description are merged into one single line.
Since it is possible to write a description on several lines, the report
should keep the formatting.
opw-1830703
The former version of the tax adjustment wizard was copying the selected tax on both the credit and debit line of the created journal entry. Although it was fine for the belgian use case (since the report was taking only the sum.debit or sum.credit to gather data for grid 61/62), this was a stupid limitation as it was preventing to use that wizard to touch any grid using sum.balance (as both lines would be taken into account and cancelling each other).
To enhance/fix this, we introduce a fields.selection in the wizard to depict if the tax needs to be copied on the debit OR the credit line.
Inspired by ticket 1826242.
In arabic, with the version localization of bootstrap we use the week
starts on saturday. But the version of bootstrap-datetimepicker we use
in 10.0 and saas-14 is 3.0.3 which only fully supports week starting
on sunday and monday.
Thus in arabic, the column title in the date picker would be:
Sunday <- Monday (ﻥ, ﺙ, ﺭ, ﺥ, ﺝ, ﺱ, ﺡ)
Instead of what the numbered days in the calendar are shown as:
Friday <- Saturday (ﺱ, ﺡ, ﻥ, ﺙ, ﺭ, ﺥ, ﺝ)
This issue doesn't happen in saas-15, 11.0 and over since the library
has been updated with ad6fd5f8 and the as of version 4 supports any
starting day of week, with this change:
https://github.com/Eonasdan/bootstrap-datetimepicker/commit/557b657
opw-1825640
closes#24200
In 93147fb4 the issue that only one page of barcode were printed was
solved.
But there is still an issue since the container element is itself a
page, we got an additonal page with all barcode on it.
To solve this we use a 'report.html_container' instead of
'report.basic_layout' which doesn't wrap the content with a
`<div class="article" />` element.
opw-1827673
closes#24201
Seems like this tour crash randomly due to default 10000 ms.
This button, in some case, seems to take more than 10000ms (slow server? slow
connection ?) to validate the order (cretae invoice, generate PDF, send mail, ...)
It is a test to see if increase the timeout could decrease the risk of false
positive on the runbot.
The sale_note field is translated according to the language of the customer in a SO.
This fix applies the same behavior on the customer invoice.
Inspired from this commit: 978b8f64ec
opw:1830838
Before this commit, an error was raised when you tried to create a
new bill of material on a new manufacturing order.
In fact, the name_create RPC returned 'false' and slow_create()
wasn't executed.
By adding _rec_name (as in 10.0) on the corresponding model, the RPC
call will raise an error that will be caught by quick_create and
forces slow_create().
Closes#9761
Inside the cell of a table, indenting had several behaviors:
- if the selection is contained in several nodes elements: indent the
element child nodes of common ancestor
- if the selection is contained in one or more list items: indent these
list items
- if the selection is contained in one 'content block': indent the whole
cell content
The two first behaviors are expected, but the third one is a little odd
and unexpected next to other existing editors behaviors.
With this commit, the third behavior becomes:
- if the selection is contained in one `content block`: indent this
content block
note: 'content block' is defined as p, pre, h1, h2, ..., blockquote, td
opw-1824647
closes#24182
The website_url wasn't defined on the project.project model.
However the website pager expected this field to be defined on every model it
worked on.
Without it, the webite frontend would throw an error 500 while trying to access
this field.
Note that the website_rating_project_issue would add this field anyway to
project.project by making it inherit website.published.mixin. The bug would thus
only appear if this module was not installed.
opw 1832994
Properly change the color of the note using variables and avoid getting
50 shades of grey in the less variables.
Increase a bit the border bottom to mark the difference.
The note vs message rendering should still probably be improved as changign the
background is a bit confusing but in the meantime, the difference is visual
enough.
If a user is in an early timezone (e.g. UTC-5), an order made on the
...-01 19:15:00 or, converted to UTC, as ...-02 00:15:00
fields.Date.today() returns the days ...-02 instead of ...-01
Use context_today to convert in the right timezone.
This slightly change the return format of _payment_fields to return a date
instead of a datetime.
Followup of 7272abe0e3 that was adding the timezone in the context
Closes#22651
Before this commit, the field validity_date was missing from the
default quotation report. Historically this field was added in
module website_quote but it was then moved to sale in
77bd5181f7
The modification on the quotation report related to validity_date
were missed at that time.
This commit adds validity_date to the default quotation report.
The commit 1ba4fbe640 did not match the specs of the task, but
was merged anyway. Reverting the commit, and check by default so the
user is not confused with missing fields.
opw-1824074
Consider the following scenario involving a one2many list (non
editable) inside a form view:
- click on 'Add an item', a model opens,
- fill the fields and click on 'Save & Close',
- reopen the freshly created record,
- maybe make some changes (this is optional, but makes sense),
- click on 'Save & New',
- fill the fields and click on 'Save & Close',
-> the second created record isn't added to the list.
The problem comes from the fact that when the dialog is opened for
the second time (in this case by clicking on a record), the 'save'
handler registers an 'UPDATE' command. While this is correct for
the 'Save & New' click (as we update an existing record), this
isn't for the second record which doesn't exist yet, and thus
requires an 'ADD' command.
This rev. ensures that the two cases are handled in the 'save'
handler given to the dialog.
OPW 1829723
The gray-lighter was modified at 88881e9f to make it lighter (#F9F9 instead of
Restore the previous grey and increase contrast.
To quote "The Non-Designer's Design Book by Robin Williams":
> Contrast is created when two elements are different. If the two elements are
> sort of different, but not really, then you don't have contrast, you have
> conflict. That's the key–the principle of contrast states that if two items
> are not exactly the same, then make them different. Really different.
opw-1835722
Before this commit, a partner in a company could have a fiscal position belonging
to another company
Namely, the search view on the field property account position displayed every fiscal position
This could create problems afterwards, when managing an invoice from a restricted rights user
(with an access right error raising)
After this commit, we soflty constrain the choice of the fiscal position to the ones
belonging to the same company of the partner
OPW 1833848
OPW 1827831
closes#24056
When clicking on a stock.picking form
a modal appeared,
Before this commit a checkbox on the lines was present to update the PO
Since one needed to click on span to put the line in edit mode and edit the boolean
It seemed that the boolean was not editable.
After this commit, we add the toggle_boolean widget to handle the field
It is interactive even if the line is not in edit mode.
OPW 1818700
closes#24138
In a kanban grouped by many2one with a progressbar, after emptying a column
by moving all records, the column wasn't correctly updated. This was causing,
in the best case, a record duplication or, in the worst case, a traceback.
This issue comes from the fact that, with a progressbar, a read_group is
performed each time a record is moved. When the group (column) becomes empty,
the read_group won't return this group even though the group still appears in
the kankan. When moving back the record in this empty column, there is a
desynchronization between the kanban controller data and the model.
To fix this issue, an option `keepEmptyGroups` is passed when performing the
mentioned read_group ; this mimics the kanban display that keeps empty groups
displayed and there is no desync anymore.
Fixes#23982
Due to historical reasons the amount on a statement line is used to
find it again so the credit card information can be added to it.
Doing a search directly on 'amount' will fail in rare cases when
the currency rounding doesn't result in a float with the same amount
of decimals as the rounding specifies. E.g.:
>>> currency = env['res.currency'].browse(3)
>>> currency.rounding
0.01
>>> currency.round(74.85000000000001)
74.85000000000001
When that happens the credit card information is not saved in the
backend. To avoid this we do the float comparison properly with
float_compare afterwards.
PS. Ideally the logic in add_payment should be moved to an override of
_prepare_bank_statement_line_payment_values. This way we wouldn't have
to do these awkward things to find the statement line. But this
approach is not suited for a stable release.
opw-1832156
Add controller to remove (archive) an item from the wishlist.
Rpc cannot be used because user can be public
Adding tour test
task-1834888
This commit closes#24135
web (tagged with `openerp-web`) translations are loaded in the backend, in
`odoo.addons.web.controllers.main.WebClient.translation(mods=None, lang=None)`
method (through `/web/webclient/translations` controller).
In website, the controller `/website/translations` is called used, fetching
the translations from modules with the (fragile) clause `name ilike 'website'`
This commit fixes two bugs:
1. Install `website_sale`, activate discussion on products
-> the chatter is not translated as the portal translations not loaded in the
`/website/translations` controller
2. Install `helpdesk` but not `website`, go to portal view of a ticket
-> the heldesk chatter is not translated as the `/website/translations`
controller is not called (only provided by the website module)
This patch implements a modular approach to translate the web resources of the
right modules only.
The controller /website/translation is moved to http_routing and each module
override the new _get_translation_frontend_modules_domain method to adds its
translatable module
Closes#23618Fixes#23610
These translations were for the first company only ('1_' part)
The process_translation part in l10n_multilang is enough to propagate the
translations of the templates to the accounts
de_CH was not available before, people migrating will not get their CoA
translated.
Rename the translation file so it is loaded by any de_* language
Add multiple spoken_languages to be sure to load each one via the
process_translation mechanism.
Fixes#24037
In list view, the carret was not correctly positioned in empty cells (i.e.
handle widget in readonly).
This rev. ensures that the position rules are only applied if the cell is not
empty.
Fixes#23984
Before this patch, when a user was editing a website page containing a form
and he clicked "Send", for some reason, the form tried to be sent.
Now, the button behavior is disabled when entering editable mode.
Closes#23852
- Use 'baseline' to ensure that the priority icon will align to the
parent's baseline
- Align the favorite icon in dashboards
- Align the statusbar's caret in form views
Since procurement group is passed by the optional values
in the procurement proccess it should be considered as optional
MPS do not use procurement group because they will add the
planification in an existing RFQ it will fail because purchase search
for the key 'group_id' in values
opw-1833060
Note: this should normally not be the case by design as for most
values there is enough space for the numbers not to wrap. While
waiting for a better implementation, the white-space:nowrap CSS
rule will enforce the behavior.
Thank you to @Jerther for the original commit.
Closes https://github.com/odoo/odoo/pull/24100
Urls like `/page/website.XXX` are redirected to `/page/XXX`.
Before this commit, the redirection would not keep query strings:
`/page/website.XXX?rde=1` would redirect to `/page/XXX`.
Now, we keep the query strings:
`/page/website.XXX?rde=1` will redirect to `/page/XXX?rde=1`
Closes#24140
Courtesy of @MTantin
Backported fixes:
1. [IMP] web: GraphView: remove hack to render in DOM
- ref. 166319fa4a
- fully backported.
This commit backports the fix that removes the hack for rendering graphs
(delay in a setTimeout), so that the graph is rendered when it is in the DOM.
2. [IMP] web: restore scroll position
- ref. 4e204ed223
- partially backported: only keeps `on_attach_callback`
and `on_detach_callback` in the abstract_controller
and in the abstract_renderer.
This commit backports the use of the hooks methods `on_attach_callback` and
`on_detach_callback` in abstract controller and renderer, so that the
controller of any view warns the renderer when it has been attached in
(or detach from) the DOM.
Also, this commit adds `on_attach_callback` and `on_detach_callback` for the
dashboard app, so that the graph view is correctly rendered.
Fixes#24092
- When validating an invoice, the create method of the model account.asset.asset is called.
Accountant have the access rights to create account.asset.asset object, but they do not have the rights to write on them.
The issue here is that the create of the account.asset.asset is done, but right after a right is done in the same object, which trigger an AccessError.
To fix this issue, we make the write using the admin env. This doesn't cause security issues since the user needs the create accesses.
OPW-1832797
Indeed in website_sale this option is used in templates, meaning public and
portal users should be added or removed from that group accordingly.
This commit is related to task ID 1746668. Closes#22753.
- When creating a Stripe charge, we have the possibility to send the customer email.
This is then used by Stripe to send a payment notification (receipt) to the customer.
This was never done by Odoo, this commit introduce this feature.
OPW-1829945
To reproduce the error, go to Accounting > Import Statement, then
Cancel. An error occurs because `belongs_to_company` is not in the data.
Indeed, it is directly set on the action
`open_account_journal_dashboard_kanban`.
Commit 9961bbf4eb re-evaluates if a record should be displayed in the
Kanban view after applying an action (in particular, archive a record).
However, the domain evaluated might contain values which are not in the
data. This is for example the case if there is a domain on an action.
Fixes#24142
opw-1835216
opw-1835123
Steps to reproduce:
-Create company A
-Create company B
-Admin user with both companies but currently in company B
-Create Demo user only with company B
-Create fiscal position A to company A
-Create fiscal position B to company B
-Create vendor with fiscal position A with company A and the same vendor with fiscal position B in company B
-Create product and add the vendor created before
-Set like Create a draft purchase order
-Logging with Demo user
-Create sale order with one sale order line with route make to order
-Validate sale order
Bug:
The purchase order created by sale order had the fiscal position company A.
Closes#23561
opw:1825098