In an attempt to ease the error reporting, some Google Error were raised
as UserError so they are shown on screen and the user can take immediate
action when the error is their side.
As shown by the different commits bellow, the introduced changes had
some bad side effects. Empty request body, empty response body, non-json
response. The resulting code got complicated.
Apart from the Google API itself, some Odoo module (i.e.
google_calendar) excepted HTTPErrors on some endpoints that are now
raised as incompatible UserErrors. There are no straightforward
solutions for those endpoints.
This commit reverts:
- da13c704
- 9c369a44
- 85ab9238
opw-2000950
closesodoo/odoo#34532
Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
Using studio, add a file field on a form. Using the web form builder,
append that field on a form. Upload a file, `x_field_filename` is left
empty thus the filename is lost.
opw-2028071
closesodoo/odoo#34491
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Detected with OPW 1920765
Reproduce : set multi-companies, install accounting. The due amount for all companies is the sum of the due amount for every single company
Cause : the context for company_id is not set in account.move.line:_query_get
Solution : set it in res.partner:_credit_debit_get in case _query_get is used elsewhere
closesodoo/odoo#30463closesodoo/odoo#34486
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Let contacts be shared in a multi-company setting.
Make a filter on 'Total receivable', e.g. greater than 0.
All contacts that correspond to this clause are show,
even if their Total receivable is nonzero in another company.
It follows that a partner can be shown by the filter with a value 0.
The inconsistency was created by 017184331b, which adapted the compute method
to the multi-company setting, as before the two were summing all companies.
opw 2028660
Steps to reproduce the bug:
- Create two variants V1 and V2 for procuct template V
- Set supplierinfo on V
- For V1, assign "vendor X" with a minimum order quantity= 10 and price = $10
- For V2, assign "vendor X" with a minimum order quantity= 2 and price = $1
- Create a RFQ for vendor X
- Set V1 on a PO line
Bug:
The minimum quantity of V2 was automatically set (10) instead of the minimum quantity
of V1 (2)
opw:2028527
closesodoo/odoo#34523
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
1. Create a purchase tax of 24 %;
2. Set rounding to "Round globally";
3. Create a new purchase receipt with two lines; unit price $115.98 and
unit price $69.98 and add 24 % tax on both lines.
Before this commit, the total was wrong $203.60, which generates also an
error message when trying to validate the receipt.
Now, the total is correct $203.59 (115.98 + 69.98 + tax 44.63).
opw-2031731
closesodoo/odoo#34560
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
In the editor, when you write a letter at the end or beginning of a link
it is written outside the link. But if you press "Enter", we get on a
newline with an empty link duplicated on the new line.
This is caused by the custom code handling "Enter" keypress.
With this changeset, in this situation we place the range just before
the beginning or after the end of a link.
opw-1724606
opw-2042097
closes#35188
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Running the following 12.0 tests: https://github.com/odoo/enterprise/blob/b7768337d88990e403338c39e461ecb1796413ab/l10n_mx_edi_landing/tests/test_landing.py#L126
raise the following error using anglo-saxon:
```bash
File stock_account/models/account_invoice.py, line 60, in invoice_validate
File stock_account/models/account_invoice.py, line 89, in _anglo_saxon_reconcile_valuation
File 10n_mx_edi/models/account_move.py, line 12, in reconcile
File account/models/account_move.py, line 957, in reconcile
File account/models/account_move.py, line 948, in _check_reconcile_validity
odoo.exceptions.UserError: ('Account Mercancías en tránsito (115.05.01) does not allow reconciliation. First change the configuration of this account to allow it.', '')
```
closesodoo/odoo#34463
Signed-off-by: Josse Colpaert <jco@openerp.com>
The production.move_raw_ids usually contains only one move per bom_line_id;
it might not always be the case, as ccbd6712f6 used move[0] to get a singleton.
The following calls to _get_document_iterate_key, _log_activity_get_documents,
also require move to be a singleton, so we use replace move by move[0].
opw 2042099
closesodoo/odoo#35206
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Before this commit, the unit price in the so's portal, had the same
decimal precision as the currency and not the one specified for the unit
prices.
Now, the portal shows the unit prices with their specific decimal
precision.
related to : a1e6a0f0c5
opw-2042089
closesodoo/odoo#35171
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
The "lots & serial numbers" feature can be deactivated at any point.
If there are active products that are tracked, either by lot or serial number,
it can be confusing since deactivating it will hide the relevant fields.
Therefore we raise a warning at onchange if there are tracked active products.
opw 2036173
closesodoo/odoo#35108
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
- To enable loop on a video, only setting the 'loop' URL parameter
to 1 will not work anymore. We also need to set the playlist parameter
to the video ID.
- Sound is no longer allowed in autoplay because of new autoplay
policies of most browsers. To make autoplay work, the video must be
explicitely muted.
closesodoo/odoo#34323
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Previous versions of this action were setting a domain. Removing the
domain field, instead of setting it to empty value, have not the same
result for upgraded databases.
closesodoo/odoo#34454
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
The bank account field is set up by the default_get of invoice.
Similarly to the application of the onchange in the create,
we add it in the create if it is not already part of the given values.
This will set the bank account for invoices created e.g. from subscriptions.
Note that we extract it in a function to avoid duplicating the logic.
opw 2030562
closesodoo/odoo#34558
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Create a Binary field through the interface.
Try to import records through CSV like file, with a url as the value of that new image field
Before this commit, the url was saved in DB, leading to an error when trying to get
the image at read time (/web/image)
This is due to the fact that before 66f0e26f6f (saas-12.2) , Binary fields
were not attachments by default, thus did not enter the condition that db403e6dd7
introduced
After this commit, the special case of manual fields with url at import is correctly handled
OPW 2024822
closesodoo/odoo#34489
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
When an `IntegrityError` is raised, the user receives a cryptic error
message which doesn't provide much valuable information in order to
solve the problem.
However, such an error is raised in 3 cases:
1. A mandatory field is not provided at creation/update.
2. The deletion of a record makes a mandatory Many2one field NULL on a
referenced table (`ON DELETE SET NULL` on a not nullable field).
3. The deletion of a record raises a `ON DELETE RESTRICT` foreign-key
constaints.
In the first and second cases, we provide the table and field on which
the `NOT NULL` constaint is raised. We also suggest to archive the
record in case of a deletion.
In the third case, we provide the table and the constraint raised. We
also suggest to archive the record.
Notes:
- The IDs of the records causing the issue is not provided since the
information is not provided by PostgreSQL.
- Although cases 2 and 3 have a different root cause, the error
message raised is very similar. Indeed, from an end-user perspective
the solution is identical: archive the record. Another solution would
also be to manually edit the records raising the error, but most of
the time this is not an option: these records are locked and cannot be
edited anymore.
task-1970853
Closes#32949closesodoo/odoo#33922
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Co-authored-by: Sapan Zaveri <sza@odoo.com>
Co-authored-by: Pragya Ladda <pla@odoo.com>
When an email is sent and is related to a record, there is a header with a
button link to access the record.
Before this commit, that button href was always linking to the base_url URL.
That was an issue on multi-website, since we need to use the website url and
not the base_url if the record is related to a website.
That's the case for a SO eg, after checkout you receive a confirmation email.
In a multi-website environment, we need to access the record website.
To do so, a previous imp/fix was done with c1be1993f9.
But this occurence still needed to be replaced.
Fixes#34309closesodoo/odoo#34397
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Future runbot improvement may share sources between build,
meaning that sources will be readonly to avoid any interaction.
_touch() was supposed to handle ro filesystem but
f7130556 introduced a new test that was not working
in this case.
Instead of trying to touch file and pseudomocking the result
if the filesystem is readonly, this commit add a real patch
on getmtime.
closesodoo/odoo#34710
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Follow up to:
- commit 4cdcab43ee
- commit cb4afb263b
- commit fb1839fa17
In order to be able to edit a done raw move after the production
and having a correct cost report with consistent values. The
simple rule that a done move should have its quantity equals to
its initial demand. Since report is based on initial demand it
should follow this rule and it's also a good practice because a
lot of computation are based on it (easier than quantity done
because it's already set on the correct quant uom).
opw-2033259
closesodoo/odoo#34695
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Steps to reproduce the bug:
- Create an invoice I
- Set the invoice date in the past and add payment terms
- Validate I
- Create refund from I
Bug:
The invoice date is set as today but the due date was set in the past.
opw:2033438
closesodoo/odoo#34692
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
If a test is failing with assertRecordValues, the comparison and the error
logging were not computed the same way.
The _compare_candidate was accessing the record via
record[field_name]
which uses the cache
While the _format_message was doing
records.read(...)
which queries directly the database.
If the test was failing (correctly) because of a wrong cache invalidation
(e.g. update the value directly in SQL without invalidating the cache),
the error message would look like:
AssertionError: Record doesn't match expected values at index 0.
Current values:
{'id': 42, 'name': 'Foo'}
Expected values:
{'name': 'Foo'}
closesodoo/odoo#34589
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
It's currently possible for binary downloads to be missing an
extension entirely. Generate an extension from the mimetype and use
that. Also ensure the existing extension (if any) matches the
mimetype.
Warning: this may require adding new mimetype/extensions pairs to the
local mimetype database similar to
f413d155df.
Also fix missing or incorrect filenames on records without a filename
field: in some Odoo versions the client would send a filename of
"null", resulting in a download of e.g. "null.pdf" instead of the
attachment or inferred name.
Task 2025716
closesodoo/odoo#34299
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
purpose of this commit is to show modal with proper height
before this commit:
currently, the modal structure was not correct, so it is displaying
modal-content twice in the modal that's why it shows modal with full height.
after this commit:
correct modal structure to show it properly, so payment modal in the portal view
looks like as expected.
task-2025869
closes: https://github.com/odoo/odoo/pull/34334closesodoo/odoo#34334
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
As a portal user, complete some steps within a course
Completing all of them makes the course completion to 100 %
Now, in the backend, unpublish one of these steps
Before this commit, the completion was not taking into account
that a step did not "exist" anymore i.e. has been unpublished,
leading to a completion > 100%
After this commit, we search only for steps that are published
The completion cannot exceed 100%
OPW 2033553
closesodoo/odoo#34800
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Fix a bug that can be reproduced like so:
- Insert list
- Type char
- ENTER
- TAB
- Type char
The character gets inserted _after_ the `br` instead of replacing it.
closesodoo/odoo#34805
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
Before this commit, sometimes it was difficult to delete many2many
tag because of X sign not being displayed due to long text of tag.
After this commit, if text is long then it will have ellipsis and
we will always have X icon to delete tag.
task-1986017
closesodoo/odoo#34316
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This fix is far from perfect as you still can break things if
you clicked on the menu and change company afterwards
But it should work the first time you click on it
closesodoo/odoo#34488
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Since changes made on Promises in rev: 5f3b5f0a9d
If a user scans his badge, it's pin code if he has any, is not asked,
and he's imediatly connected to it's employee.
To avoid this behavior, we are handeling correctly the Promise to avoid
this connection shortcut.
closesodoo/odoo#34449
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>