Suppose uploading an attachment with res_id = 0, res_model = 'existing.model'.
Suppose also there a one2many having 'ir.attachment' as co_model and res_id as co_field
in 'existing.model'.
This setup leads to an error since the record with id=0 doesn't exists.
This commit ensures the res_model is not set when uploading the attachment.
closesodoo/odoo#37414
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
* base, web
Google now recommends a TTL of one year for static contents. We used to
use 1 week in almost every case. This commit increases that value to one
year for safe resources, like assets bundles which contain a specific
hash in the URL which changes if the bundle is recomputed anyway.
Note: this commit refactors the code so that both the one week and one
year durations are defined in http.py and used by others apps. Loading
the library "locale" file used to be done with 10-hours-cache, this has
been increased to 1-week-cache by using the http.py STATIC_CACHE var.
closesodoo/odoo#37402
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Implement group_expand for workcenter_id so that all workcenters are
visible in the planning by workcenter gantt.
Implement some constraint on write because anything can be moved in the
gantt view.
When changing the workcenter of a workorder, make sure the leave is now
set on the new workcenter.
closesodoo/odoo#37386
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Go to Accounting > Accounting > General ledger. The view is grouped
by account. There is a layout issue as the first column (date) is
positionned after the group names, leaving a large blank space.
This is because the date field is considered as an aggregated field
(for sorting purpose, in python), but the JS can't (and we don't
want to) display it. This rev. ensures that such field types are
completely ignored by the JS, s.t. they do not impact the layout.
closesodoo/odoo#37113
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
*:board,hr_skills
Hold on tight, this is a tricky one.
Allows *any* readonly list view (only plain lists, not x2manies) to
become partially editable when checking records.
This means that once checked, a record line acts just like it was
in an editable list. You can click on it, edit any of its values as long as
they're not constrained by readonly modifiers, and save them on the fly.
Clicking on an unchecked record will have the same effect as before:
it will open the record, regardless of the other selected records.
You can also check multiple records and edit them all at once by
changing the value of one selected record (just like standard multi edition).
Keyboard navigation is also allowed between selected records (TAB and SHIFT+TAB
to navigate and ENTER to save).
/!\ If a list is only made of records having all of their fields locked by
readonly modifiers, checking a record and clicking on it will do absolutely
nothing. This is to keep consistency with the rest of the specs.
Task 1967602
Setting 'overflow: hidden' on the (hidden) textarea used to compute
the (visible) textarea height ensures that there is no vertical
scrollbar, which would lead to a not so precise computation of the
height. The bug could be observed in sale.order form view, in the
order line x2many (description field), and had been introduced by
ef46378cd3.
Changed the information dipslayed by the confirmation modal in multi edition
in list views.
Before this commit, the modal simply showed a one-line message with the amount of valid records.
Now, there are 3 elements:
- If all of the fields cannot be changed, a first line warns the amount of valid records.
- A second (or first if all fields can be updated) line ensuring that the user is aware of
the occuring changes.
- A table displaying the affected field and the updated value (readonly widget with the new value).
Part of task 1967602
Since the commit allowing all list views to be editable, there are some
views in which we need to ensure that certain fields are always readonly.
Affected modules:
- account
- crm
- product
- purchase
- sale
Task 1967602
In an editable list, select a very long value in a many2one...
Before this commit, the table stretched as much as it needed to to
display all of the columns content.
Now, the largest columns are trimmed in order to keep the table
as wide as the list container (meaning it won't overflow anymore
unless there is a huge load of columns).
Also ensured that values trimmed by this feature are followed
by an ellipsis.
Task 2068261
Co-authored-by: Aaron Bohy <aab@odoo.com>
Before this commit, resizing a column would cause the
list to develop a mind of its own and to grow/shrink random
columns according to its own will.
Now, resizing a column does not "freeze" the list anymore and simply
gives a static width to the resized column.
When the content of an autocomplete dropdown (e.g. many2one field)
was long, the dropdown could overflow the page. For instance, this
was the case of the intrastat_id many2one.
Task 2068261
Let's assume an editable list view with at least two rows. Before
this rev., the column widths were re-computed and frozen each time
a record was switched into 'edit' mode. As a consequence, if the
user clicked on a row, and then on another one, column widths might
slightly change.
Task 2068261
ClassNames 'oe_read_only' (resp. 'oe_edit_only') can be used in
x2many lists to hide columns in 'edit' (resp. 'readonly') modes.
However, before this rev., there were two issues:
1) Having such a className on a <button> tag didn't work well as
the 'display: none' rule didn't apply on the body cell (it only
applied on the button). Same could be observed on <widget>
nodes.
2) Having more than one invisible column (with those classNames)
didn't work either, because the footer cells weren't hidden.
We didn't notice it with one invisible column, because the
footer contained one cell less than the header and the body.
Those two issues could be observed on the mrp.bom form view.
Task 2068261
The tax lock date no longer blocks the user when creating a journal entry priors to it.
Instead, the accounting date is moved automatically during the validation to the next
available date.
This commit also brings more flexibility when dealing with the tax lock date. Indeed,
the error is now shown only when adding something impacting the tax report that was not
always the case before (e.g. adding a new line not affecting the tax report must not
raise something).
Others check has been also refactored to be more consistent with the "fully editable" mindset.
closesodoo/odoo#36304
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
This commit deletes account_cancel module and squash it into account.
The 'update_posted' field is changed by 'restrict_mode_hash_table' field.
If 'restrict_mode_hash_table' is true, you have a hash chain on your account journal.
These hash chains prove the inalterability of your accounting.
l10n_fr_certification module is deleted and all hashing method are moved in account module.
Now, you can download a PDF report about your inalterability in the company settings.
If you have l10n_fr or l10n_post_cert installed you have more information on this report
like the inalterability of pos orders, etc.
Task ID: 2039160
On Mobile the byproduct One2many only empty line.
It's due to default kanban view using the _rec_name
in order to display the byproduct name. On byproduct the
_rec_name is not defined nor the field name so the kanban
is empty.
closesodoo/odoo#37403
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
When a BoM was composed of a phantom BoM, there was mutliple bugs:
- if not routing was set on the phantom BoM, the components were never
consumed
- if no operation was set on the BoM, its components were to be consumed
on the last workorder of the BoM and of the phantom BoM.
closesodoo/odoo#37304
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
PURPOSE:
Default analytic account should be used wherever possible. This wasn't
the case because the module didn't implement a default_get and only
filled the fields on product_id change, which isn't set by the OCR
task-2067097
opw-2068110
closesodoo/odoo#37389
X-original-commit: 2c450015154f8ba2384fb1f0ad1d4075785009c0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Pre-filter lines based on known products.
Closes#36854
opw-2074824
closesodoo/odoo#37383
X-commit: bd3997b79a075a24afce749474fc32b43ac8c03f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Before this commit, 'Go to website' in website module dashboard might not
redirect to the correct website.
It would just redirect to `/` (href) without forcing the website selected in
the dashboard.
task-2063252
Closes#36390closesodoo/odoo#37359
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Before this commit, if one would introduce a scheme or a port in his website
domain, it would make the website selector to crash JS side.
Indeed, it would replace the current url hostname by the website domain.
If the website domain was introduced with `http://` it would lead to
`http://http://mysite.com`.
If port was introduced, `http://mysite:8069:8069`.
Also, by fixing those 2, it also make `localhost` and `127.0.0.1` to work.
(which would not work without `http://`.
Related to #36390
Test import of a file with xml ids.
At the first dry run, the xml id X is associated with id R for each such record.
If some records refer to X via a relational field, then in SQL it reduces
to a query using R as id; but R does not exist since it was a dry run.
As a result, subsequent runs fail.
The cache should be cleared after a dry run, since the xml ids are not reliable.
opw 2068446
closesodoo/odoo#37396
X-original-commit: 1b35294d7b8d07f373eca24977e2952b9cfb2c7d
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
l10n_ch_currency_name is a related field to currency
Without this patch, when creating an invoice, the inverse of the
related field was computed, trying to write the name on the currency
(with the same value).
If a user did not have the required access rights (e.g. a user in the
group Billing can create an invoice but not write on res.currency by
default), he was unable to create the invoice.
Fixesodoo/odoo#31487Closesodoo/odoo#31489closesodoo/odoo#37381
X-original-commit: 5e49fa8002d7581bfad6dacee0f0b75de59817ec
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Currently there is a traceback when trying to leave a course (unsubscribe)
from the frontend on the homepage of a specific course. (when clicking on
"You're enrolled")
This fixes the traceback.
closesodoo/odoo#37384
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Computing quantities of a kit product made only of consumable
failed as the quantities are not initialized.
This commit makes sure this kind of products don't have their quantities set up
in mrp and so are set to 0 in stock
closesodoo/odoo#37382
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
if website_animate is installed.
Website_animate suggests to animate the image when it's selected and
hides the blocks. So we add a click on "Blocks" to ensure we're in
the right menu before continuing.
If website_animate isn't installed, this extra step doesn't alter the
current behaviour.
Technically this should be done in a bridge module depending on
website_sale and website_animate but none exists and it's not worth
creating one for this tiny fix alone.
closesodoo/odoo#37377
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
- Go to Inventory > Reporting > Inventory Valuation
- Run the report
- In the search view, filter on 'Location' or 'Warehouse'
The filter doesn't work.
Actually, the filter can't work. This is a hack introduced in order to
add context keys.
Originally, the function `search` was added to avoid the error log
'Non-stored field %s cannot be searched.'. This happens because the web
client adds the field in the domain on top of adding the context key. By
using `filter_domain`, no domain is added and no error is logged.
opw-2075456
closesodoo/odoo#37347
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Adding a string element to a list with += is not adding the element to the list
but is instead adding every single character of the string as an element to the list.
Building a string using a join method was resulting to an recent history displayed like
H > O > M > E > ( > 8 > : > 4 > 2 > )
--> Should be : HOME (8:42) > Contact Us (8:45)
Apart from that, since the tracking is now ordered by visit_datetime DESC,
to have a chronological order, we need to reverse the list of last visited pages
to have something like :
Home (12:43) > About us (12:45) > Contact Us (12:52)
instead of :
Contact Us (12:52) > About us (12:45) > Home (12:43)
Task ID: 2076190
PR #37340
As since 5b9a81a2c6
website.visitor.name can be null
if the visitor is not linked to a lead or a res.partner,
we cannot use the name anymore to build the name of the mail.channel, etc..
Using display_name will always return the correct value,
and will include the numbering of the visitor,
in order to identify easily the chat windows
(if operator is speaking with multi visitor at the same time)
Task ID: 2076190
PR #37340
This commit fixes the send feedback by creating explicitely the
rating.
Before, we gave to the mail channel the rating values.
But as rating uses res_id and res_model, creating the rating
directly with correct values in res_id and res_model makes the magic.
The rating is correctly linked to the mail channel.
Task ID: 2076190
PR #37340
Before this commit, editing a record e.g. in a form
view and toggling the home menu would cause the discard
warning to be displayed twice when going to the home
menu (in enterprise) and then once again when going to
an other app. This is now fixed.
Task ID: 2043027
closesodoo/odoo#37301
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Co-authored-by: aab-odoo <aab@odoo.com>
Since 2302386d3ea47f3160ca5857425c99e0d4bbf62a the VAT or Codice Fiscale
fields could be empty for non Italians buyers. In that cases the
generated XML must be sent a dummy Codice Fiscale (99999999999), to pass
the extra checks, see
https://www.fatturapa.gov.it/export/fatturazione/sdi/Elenco_Controlli_V1.1_EN.pdf.
opw-2045244
closesodoo/odoo#37346
X-original-commit: 98ea0872efbdb60b9dd04b31dc711b937c2195ec
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Create a lot of event (i.e. 300 via recursive events) with attedees. Sync.
Cancel all the events. Sync again. This and all subsequent
synchronization will take a lot of time to complete. The first time is
normal because odoo will cross-check every deleted event for the "syncing" user
with google to ensure that there is match between OE and GC.
This matching will sistematically fail because the json module cannot
serialize a datetime object, so it will be retriggered again and again
stalling the synchronization for minutes. Formatting the datetime before calling the
dump fixes. Moreover the api usage was wrong as 'originalStartTime' is
not a date but a complex object holding the date.
Note: this could have been avoided via logging but error detection was
suppressed.
opw-2052450
closesodoo/odoo#37335
X-original-commit: 951808b2434717d38ab9d562404eb74d8bd40634
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Before: the address column was 50% wide because of a span in the labels
column which causes its column to be 50% wide.
Now: replaced the span by a label, the columns have the right sizes.
task-2075905
closesodoo/odoo#37331
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
With this commit, the 'update cost' button is always displayed on product.product
whatever the variant count
closesodoo/odoo#37328
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Usecase to reproduce:
- Create a receipt with a quantity of 2
- Receive 1 and create a back order
- Receive 2 in the BO
It will only require the components for 2 units and not 3.
closesodoo/odoo#37305
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>