Prevent crash if `stock_valuation_layer_ids` is an empty recordset. Note
that the original issue is solved with #43017, but requires an upgrade
of the module.
opw-2172049
closesodoo/odoo#43289
X-original-commit: 8a1ce12aee326b59f33f48804a4cfca61dab7506
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
length is a reserved attribute in JavaScript, and may cause problems
when returning the object to the JS framework.
This commit is to rename the field.
PR
Task 2152050
closesodoo/odoo#43222
Related: odoo/enterprise#7686
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
And use "Margin (%)" for the recently added margin_percent field
computing the margin in % and not in money.
closesodoo/odoo#43130
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
PURPOSE
Allow multi-edit for calendar event and utm campaigns. Indeed it gives
flexibility to users when they have to edit several records at once.
SPECIFICATION
Enable multi-edit in each of the following views
* calendar.view_calendar_event_tree
* utm.utm_campaign_view_tree
Set the fields not editable to be readonly.
LINKS
PR #42786
Task 2078662
Related: odoo/enterprise#7553
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Query counts weren't adapted to recent performance changes.
This commit updates the different query counts to make sure
any commit changing the query counts knows it and does it on purpose.
Some query counts may vary between community and enterprise
and therefore have a higher value than needed in community version.
closesodoo/odoo#43202
Related: odoo/enterprise#7682
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce the bug:
- Install Sales
- Configure Paypal payment acquier
- Add extra fees such as 10€ of domestic fee
- Create a customer C with an email E and with no country
- Create a quotation Q of 100€ for C and send it by email to C
- Go in the email box of E and click on the link
- Click on 'Sign and Pay' button
- Sign Q and click on 'Pay'
- Choose Paypal as payment acquier
- Process the payment with Paypal
Bug:
An error log was displayed saying:
Paypal incorrect data:
mc_gross received 100 instead of 110
PS: the domestic fee was not counted because the partner_country_id
was not set in function render defined in model payment.acquirer
Inspired from function create defined in model payment.transaction
(addons/payment/models/payment_acquirer.py +961) where the domestic fee
is counted.
opw:2167104
closesodoo/odoo#43265
X-original-commit: 581020c733044b52cacd0d41a6a8eb8708671d0d
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Issue
- Install Projects & Studio
- Go into projects app
- Edit a project (... => Edit)
- Click on x attachments stat button
You can't edit with studio
Cause
Writing the action manually instead of using the base one
result with an empty xml_id (and a lot of missing data).
Solution
Use base.action_attachment like others modules do (e.g. helpdesk).
OPW-2146741
closesodoo/odoo#43263
X-original-commit: 856b09d7055ebbfebbe3b5dc3093e429c8c930ff
Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
d06e67e748 introduces tools to use owl renderer
for a view. However, on_attach_callback and on_detach_callback were not
called on super (AbstractController), so not applied to the controlPanel
and searchPanel.
This commit fixes this issue
Task-ID 2171436
closesodoo/odoo#43165
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
d06e67e748 introduces tools to use owl
renderer in a view. However, this owl renderer is never destroyed.
This commit fixes this issue.
Task-ID 2171436
order_lines_layouted() can not work due to layout_category_id no longer existing
closesodoo/odoo#43118
X-original-commit: de7a717b195f93f94a9794029eb10b2fa92c8701
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Purpose
=======
If check company is set on a field and if the user has no access
right to the field value (example: address_id on an expense sheet
could be set to a private res.partner, on an onchange method when
setting the employee), then the check_company mechanism will
raise an AccessError when trying the validate the companies on
the different records.
Specification
=============
As we only wish to validate the new record values and not the
access rights, the validation could be done as a superuser to
avoid unecessary errors.
closesodoo/odoo#43240
Taskid: 2170006
X-original-commit: 37a9b6c63dcbc268013fbe1a890cf9390eb8e223
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Issue
- Install eCommerce
- Select Zap theme
- Go on a product in the shop
The quantity is hidden behind the buttons
The quantity height is not the same than the buttons
Cause
By default, there is a max width of 125px on the div containing
the buttons and the quantity label. As this theme increase the
button size, the quantity is hidden.
The quantity label has `.form-control` class who override
his height, so it's not using flex anymore.
More details from QSM in design-themes closed PR #199:
Bootstrap is not correct about input-group form-control height
-> bootstrap_review.scss fix for the height of input-group
form-controls
Our max-width on css_quantity is not right, it should be a
max-width on the internal input
Solution
Restore the initial height in bootstrap_review for input-group form
control
Set the max-width only on the internal input.
OPW-2166311
closesodoo/odoo#43099
X-original-commit: 81e06ec43fdf90758556a654cedd75001ff654c1
Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
Before this commit, chatter without messages did not display
attachment counter, even though attachments could be uploaded from
attachment box.
This commit now displays the attachment counter in this case.
Task-Id 2149348
closesodoo/odoo#42672
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
In the SSF, o2m updates get initialized with no values (1, id,
{}). The record data is only fetched when the "record" gets updated
explicitly from which updates will hopefully get properly tracked &
saved.
However if the "record" was first initialized through an onchange
values which are updated by the onchange (diverging from the db) those
would not get tracked and thus wouldn't get saved when the record is
saved.
* use more specific placeholder (None) for "o2m records to update but
we don't have values yet"
* once we have values, always store them as an update-tracking dict
* if we don't have values yet for an o2m and an onchange is trying to
write to it, initialize with values from database first (might
eventually be a good idea to initialize upfront though there's the
question of what happens for default values and recursive views)
* mark anything coming back from the onchange and differing from local
values as changed (so they get sent out on save)
* properly reify parent values for onchange instead of sending them
as-is
* the evaluation context for contexts (and domains) needs properly
formatted values so use `_values_to_save` to get them, however it
cares about neither required-ing nor filtering out e.g. unmodified
fields, therefore add an awful toggle to handle this
Task 2150302
Probably todo in the future:
* better UI for change-tracking dict, should have "snapshot"
support (to freeze / discard previous changes)
* cleanup save, it's unclear that it properly resets the form
closesodoo/odoo#43235
X-original-commit: 6c99fe3ffec3aeb8d210e3b943ccef81d62d44ce
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Open Employees>[DEMO]. Go to HR Settings and generate badge id
Now go to POS Settings, enable "Login with Employees". Now open
the session and login by scanning the [DEMO] employee badge.
The badge will not be recognized, this is caused by the fact that the
badge is 8 digits randomly generated, while the parser recognize
cashiers only if the barcode has a prefix of 041.
Fixed the badge id generation, and adjusted the length to other barcodes
in the system
opw-2151942
closesodoo/odoo#43228
X-original-commit: 90bcda64ba6058169b48ff8214e7c2a98eb9a0f8
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Steps to reproduce:
- install website and crm
- install a second language and translate website
- go to website > create a new page > add a form builder
> create a new opportunity > add a new custom field (selection or m2m)
Previous behavior:
default fields and some messages are not translatable
Current behavior:
more fields are translatable
opw-2168786
closesodoo/odoo#43224
X-original-commit: 2b1359f2d2f85772c98988be5714f31163b70a23
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Steps to reproduce:
- install crm
- set your computer timezone to GMT-6 (Mexico city)
- go to crm > change the view to activity view
Current behavior:
all activities are one day off from their actual deadline
(an activity set to be due on the 7th of January shows as
6 Jan on the view)
Current behavior:
activities are displayed properly according to their due date
opw-2162579
closesodoo/odoo#43223
X-original-commit: 0735547086aaab819369b1a08e6810baeac3783d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Steps to reproduce:
- install sales
- go into debug mode
- dev tools > start tour > sale_tour
Previous behavior:
tour would fail after creating the "Agrolait" partner.
the test would not wait for the return value of the
customer selection.
Current behavior:
the test waits for the customer to be fully selected and does not fail.
closes#40569
opw-2091797
closesodoo/odoo#43221
X-original-commit: c4b6273c9df5d8e3f3a5ee3cf52541741526280e
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
In this commit,
-The behaviour of drag and drop is blocked when grouping the
operation type and warehouse on inventory dashboard.
closesodoo/odoo#43229
Task-id: 2167610
X-original-commit: 5e8bcd3a5bfff9a5dc740287605d4ff661a701f7
Related: odoo/enterprise#7689
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Purpose
=======
To have a better UX, the transition between questions in a survey should not be done by loading another page, but by loading next questions in AJAX.
Specifications
===========
Do the transition in ajax, no more page loading:
- During submit, load and display next questions in a smooth transition (fade in / fade out).
- Include start and end screen of the survey inside the survey form (same process, load next screen in smooth transition)
- Integrate timer and start only after start survey.
- Integrate breadcrumb and handle manually (at frontend) transition about clickable / active / inactive breadcrumb item. Make the survey breadcrumb a widget to ease the navigation transitions and updates.
- Validate questions at frontend before sending data for submit. (to avoid fading out then fading in the same questions with error messages)
Also include some improvements and fixes :
- Save questions on time limit reached, to take into account unsubmitted answer (if user does not have time to click on submit)
- Block submit if survey has been already completed by the user.
- Do not use previous id on one page mode (fix)
- Remove display mode for simple choice question : that will prepare the next redesign of survey and allow to handle simple choice in a more standard way for all kind of question types.
See sub commit for more detail.
Task ID : 2152223
closesodoo/odoo#42908
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
To have a better UX, the transition between questions in a survey should not
be done by loading another page, but by loading next questions in AJAX.
This will allow to fade out / fade in the next question and improve the user
experience, as well as prepare the work for the complete survey redesign.
SPECIFICATIONS
General
=======
This commit refactors the way the questions are loaded.
To go to next question(s), instead of redirecting to a new page containing
the next question(s), the submit process is loading the next question(s)
using ajax. The template of the question is prepared at server side and is
given in html string to the client that display the next question in a smooth
transition (fade in / fade out).
This commit includes also the start and the end screen of the survey inside
the survey form in order to perform smooth transition between start screen
and first question(s) and between last question(s) and end screen.
Only one master template (survey form) is now used to display every part of
the survey : start + questions + end screens.
The answer_done error is now handled by the _prepare_survey_data itself.
If the user wants to display an already_done survey, the returned template
is the end screen.
This commit handles page transition for the survey results. When submitting
survey, the survey result widget is initialized and attached to the survey
result section.
A new route has been added : /survey/begin/.
If the user arrives on start screen, the state is 'New'. Once the user clicks
on Start button, an rpc call is made to survey/begin that will call the
survey_prepare_data to render the first question page and set the state to
in_progress and the start_datetime of the answer.
Validation
==========
Add the validation of all types of questions directly in the frontend.
This allows to reduce the latency before the survey is validated and was
necessary to go along with our new fade out / fade in mechanism.
The client does not need to wait the validation answer from the server to
display validation error messages.
The current questions are only faded out if the frontend validation has passed.
The server still makes this validation before submitting answers and loading
next question(s) to avoid direct rpc calls that would mess up the answers.
Error messages are now displayed with a slide down transition, for a wonderful
wow effect !
Timer
=====
As the survey form works with ajax to display start screen, question(s) and
end page, the timer has to be started only after the start screen.
This commit display and start the timer only after start survey button is
clicked.
Breadcrumb
==========
As the survey form now works in ajax to display in same page start screen,
question(s) and end page screen, the breadcrumb has to be controlled not only
on page loading but also manually between transition from a screen to another.
To ease the breadcrumb management, breadcrumb is now a widget that will reload
a js template, mainly depending of the current page id.
The js form initialize or update this widget giving this new page id.
On breadcrumb item click, the widget triggers a onclick caught by the form
that calls the submit with the given target.
This commit handles page transition for the breadcrumb. When going forward or
backward (next or previous page), the breadcrumb activates, deactivates and
links elements are reinitialized depending of the target page.
LINKS
Task ID: 2152223
PR #41453
Co-authored-by: Aurélien Warnon <awa@odoo.com>
Previously when the BoM on a product do not have components but only
services. Then during scheduler a log was posted on the product explaining
that components are required.
However since this process is possible in another usecase it should be
possible with procurement. The only difference is that procurements
confirm records in order to propagate. In this case since there is
no components and services are not propagate with procurements, it's
not needed to confirm the MO.
closesodoo/odoo#43133
Task: 2170845
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Since a refactoring (it was working at some point), `title` attribute on `we`
elements would be lost when rendering actual DOM elements.
We had 2 occurences of `title` on `we` elements:
1. s_countdown > What Should Happ.. > Show Message > fa-eye icon has a title
(in next version 13.2)
2. data-js `BackgroundPosition` (section) > fa-arrows has a title
Also, incoming Cookies Bar task/PR will add a title on 'Hide For' option.
closesodoo/odoo#43199
X-original-commit: 230a84edcea139bc7df44a4d1a27761e74038257
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Example:
User 1 has access to company A
User 2 has access to company B
Customer 1 is shared, has user 2 as their Salesperson
Try to create a SO for Customer 1 as User 1
=> access rights issue, the quote is trying to set User 2
as the salesman of the quote but cannot because of
base.res_users_rule
This commit makes this flow possible by sharing users
if they're not portal.
closesodoo/odoo#43190
X-original-commit: ebc8d85d383643c1d4d2aa6723bc7a589c7d1c68
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Before this commit, there were some tests checking
how long it took to compute a bunch of templates
Those asserted a time limit, which is undeterministic
After this commit, those performance tests
are not executed as standard anymore
Moreover, only asserts on ratios between computations is done
and deemed relevant.
closesodoo/odoo#43189
X-original-commit: 329fdf3961ea9e6eddbcba7a78d72102d2d08ac1
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit enables archived mail channels.
Archiving one also removes it from channel list in Discuss.
Task-Id 2155386
closesodoo/odoo#42743
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit adds "Next Activities" on kanban card of partners,
like on the app Contact.
Task-Id 2152180
closesodoo/odoo#41793
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This removes the measure_type field which has become unused and
causes issues when users try to add new uom categories.
Task-2043927
closesodoo/odoo#41056
Related: odoo/enterprise#6945
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit prepares the complete redesign of survey.
Simple choice question type will only use the radio button display mode.
So the dropdown display mode is deleted.
Task ID: 2152223
PR #41453
Purpose
=======
If the timer goes to 00:00, the form is automatically submitted but the answers
are not saved. The form should be submitted, validation should filter out
invalid answers to avoid showing validation errors on the form, and save
answers.
If the answer is not in the correct format : skip the question
If the answer is required but there is no answer : skip the question
This way, we can still compute score.
Specifications
==============
This commit removes the invalid answers from the question to save, only if the
timer is not over, to be able to compute score on not finished survey.
In order to avoid being able to submit answers when the survey is marked as
done, a check was added to return an error for that use case.
Also, to avoid frontend timer hacking, an extra buffer of 10 seconds has been
added. If the time limit is reached and the submit occurs 10 seconds after the
maximum stop time (start time + time limit), no answer can be submitted.
Task ID: 2152223
PR #41453
Before this commit:
If neither Invoicing nor Accounting are installed, users are stuck with menus
items to create bank-related informations (Banks and Bank accounts). They won't
be able to set these information directly on their contacts.
After this commit:
The Bank Accounts part of the Invoicing tab has been moved from the `account`
module to `base`, so it's now visible in the partner form even when only
`contacts` is installed
Task ID: 2126832
closesodoo/odoo#40563
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
If a user changes the company of a product, we should make sure that the
product was not sold in another company in the past; otherwise it could
make some orders un-invoiceable.
closesodoo/odoo#43187
X-original-commit: 069f04935ebc22c15b4903b526401ebf0df830a3
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
It happens that people modify the product on done stock.move.line
(it's not possible without customisation, at least allow to import or
to modify product and lot_id in the same view).
During the write on stock.move.line only the lot,locations,package and
owner are update on the quant. Not the product since it's not suppose to
be modify. It leads to a stock.move.line with a correct information but
a total mess on the quants with a lot updated and the previous product.
Since the product is not modified, the product on the quant and the
product on the lot linked to the same quant are different.
closesodoo/odoo#43180
Task: 2119471
X-original-commit: f2a4f7013742cc2cd45264daddaae8b457ca0eb6
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
When switching a invoice to a refund, the bank account to which the move
should be paid should be removed: while it (might) contain the partner's
bank account before, when becoming a refund it makes no sense to keep
the partner's bank account as the recipient.
closesodoo/odoo#43176
X-original-commit: e94234f435622b7de00c917ca7c6302fd6c92881
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Before this commit, the invoice creation flow of a sales order checked
if the amount of the generated invoice was positive or negative - if it
was negative, then the invoice would be converted to a refund instead.
Unfortunately, this check was done before the move was actually created
\- meaning that the only way to compute the total of the move was to
multiply the quantities and unit prices of what was about to be included
in the move - ignoring taxes altogether. Since taxes would then be
applied during the move's creation, you could in fact have a refund that
ended up being negative because some products would end up with
different taxes.
A simple (although weird) example would happen if you registered a
down payment that was actually greater than the subtotal of your
quote (but lower than the total with taxes included).
Example:
Create a quote for a 100$ product with 15% tax
Register a downpayment of 105$ and validate that invoice
Invoice the rest:
=> you end up with a refund of -10$, while you should have a 10$
invoice instead.
Since the downpayment did not have taxes, the second invoice was
computed as being negative (100$ for the product - 105$ to deduce the
down payment), even though after the 15% tax gets applied on the product
(but not on the downpayment), the invoice is actually positive.
This commits moves the switch from invoice to refund to *after* the move
actually gets created, ensuring taxes are taken into account.
X-original-commit: eefe27b112e2ffd35a834f03a188625a5d6ea5f2
Before this commit: all dialogs would go through the static method (OwlDialog.hide)
when destroyed, regardless of wether they had been opened or not.
Now, only dialogs having an 'el' property set (= having been opened) will use
the 'hide' method.
Task 2170705
closesodoo/odoo#43124
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit, the test 'all messages in "Inbox" in "History"
after marked all as read' had non-deterministic failures.
More precisely, it crashed on either assertion "there should be 30
messages in History" or "there should be 40 messages in History",
both resulting to 0 messages in History instead.
Unfortunately, as of the date of this commit, we still do not
understand why it rarely fails. In the meantime, we have decided to
make these errors less likely to happen, by waiting much longer
before the assertions. We are aware that this is a poor solution,
but this is much better than skipping the test, until we find and fix
this issue at a later moment.
Closes#43072
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The test may fail non-deterministically from intercepting an
heartbeat in the local storage. Only a document thread window fold
state change from the local storage should be intercepted.
Closes#43072
Revision on https://github.com/odoo/odoo/commit/141b34f152f36d970d4ff78abe53f563555a8e69
Having async/await as a new promise constructor is an antipattern.
The reason is that it may lead to unnoticed errors: if an inner
promise is rejected, it won't propagate the error to another promise
that will handle the error. As a result, this error becomes unnoticed
and the initial promise is pending indefinitely, which also may lead
to more bugs [1].
[1] https://stackoverflow.com/a/25569299Closes#43072
Avoid double definition of the same field with different string or
help parameters. These parameters are translatable. If one has a
different value depending of the installed module, it is not possible
to properly translate it.
This problem is similar as the menu renaming debate at
odoo/enterprise@cfd4da43eeclosesodoo/odoo#42777
Related: odoo/enterprise#7623
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
"The ordered quantity has been updated." was not translated
closesodoo/odoo#43171
X-original-commit: 00c1b5210c6bae4d4aac796b2d7afb940b7c748f
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
- Set the company currency in USD
- Create a pricelist in EUR
- Create a SO with the EUR pricelist
- Add a stockable product
- Click on 'Add Shipping'
- Select 'Normal Delivery Charges' which has a fixed price
The price is not updated according to the USD - EUR exchange rate.
This happens because no company is set on the delivery method, so no
conversion is performed.
We fall back on the order company, then the current environement
company.
opw-2159838
closesodoo/odoo#43167
X-original-commit: 6a6a7e6e64a7e3727a6de1ca8d35361112d99de8
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>