In this commit, we restore the following behavior from v13: when search
resulted to a single product and 'Enter' key is pressed, the product is
added to the order and the search field is cleared. This works for both
manual keyboard input and barcode input.
closesodoo/odoo#59770
X-original-commit: 225e3898f25ddac061be99c43501c99d4bd3226b
Signed-off-by: Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
The date depends on the user's locale, and needs to be consistent with
the `date` field.
closesodoo/odoo#59580
X-original-commit: ed06aab626cb51b86b4178705b45bbcbfbf2c0f2
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
TLDR: fix a mess in journal fields check
Steps:
* Create expense "paid by Company"
* Click Post
Before:
* AttributeError: 'account.journal' object has no attribute
'default_credit_account_id'
After:
* Either posted or shows user error about journal misconfiguration
Notes:
* Field ``default_credit_account_id`` is replaced in https://github.com/odoo/odoo/commit/41f119d5325dfbbf916d1d34e63946646ed4d44c
* The error is introduced during incorrect forward-port #58852
---
task-2355177
closesodoo/odoo#59780
X-original-commit: 5c0fca662279702115b5e61c8227f82086693e38
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Issue
To do on Community:
- Install website_sale (eCommerce)
- Go into Website app
- Navigate through Product/Products
- Edit 'Customizable Desk (CONFIG)' and add '&' and/or '<' and/or '>'
characters into the name
- Save
- Go to the Website app Dashboard and click on 'Go to Website'
- Click on 'Edit' button
- Drag and drop the 'Dynamic Product' snippet into the website
- Click on the block 'Your Dynamic Snippet wil be ...'
- In the right panel, in the 'Dynamic Product' snippet options,
chose a 'Template' and a 'Product Category'
A traceback is shown
Cause
the '&' character crashes lxml.etree.fromstring
Solution
ensure no '&' is sent to lxmx.etree.fromstring by using
odoo.tools.html_escape (in order to ensure no other problematic
characters are sent to the front) on the field values except when
not applicable (widget rendering with record_to_html should not be
escaped).
It is important to note here that this is applicable
to action servers that are used by the dynamic filter.
opw-2357027
closesodoo/odoo#59805
X-original-commit: f91422115c09be484f2868347566b6392ed0effd
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit, the graph y scale in the survey manager screen was based on
the attendees count. But is some attendees do not answer the question, the bars
never reach the maximum height of the graph, and bars can stay really small.
Example: 10 attendees - 4 answers - A: 1 / B: 1 / C: 2
10 |
|
|
| |
0 |_|__|__|_
A B C
After this commit, the max height of the graph is not set on the graph. So the
chart lib will handle itself the height and will adapt automatically the bars
height in function of the data given to the graph. Bars will always take full
height space, relatively to the count of the most voted answer.
Example: 10 attendees - 4 answers - A: 1 / B: 1 / C: 2
2 | |
| |
| | | |
0 |_|__|__|_
A B C
Task ID: 2351455
closesodoo/odoo#59777
X-original-commit: ac64af033f0bbaa698aee424a5cab85fd9b967d2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Fix the design of he notification which is sometimes broken
(if there are lists or buttons display in it for example)
task-2346462
closesodoo/odoo#59776
X-original-commit: 238654ae53582d791154388c827f725c8d136612
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This patch speeds up the performance of method `onchange`. Our use-case
is an invoice with 300 lines, where we modify the unit price or quantity
on several lines. Each modification triggers a call to `onchange` on
the invoice itself. The latter call went from 1.3 to 0.8 seconds, which
represents a speedup of 30% to 40%.
In the implementation of `onchange`, the first snapshot is preceded by a
"prefetching" phase, where the lines of x2many fields are read, so that
the fields of unmodified lines are in cache. This is useful because the
fields of those lines are not sent by the client, which only sends ids.
This prefetching represents more than 40% of the duration of `onchange`,
in our use-case.
The prefetching is inefficient for several reasons. First, it uses
`mapped`, which formats data that is actually never used. Second, it
accesses new records that have the actual lines as origin. And on those
records, computed stored fields are not taken from the origin record,
but are (uselessly) computed instead.
We have optimized the prefetching in the following way. It now reads
stored fields on the actual lines (using `_read` to avoid formatting),
then copies the cache of those fields on the corresponding new lines (to
avoid useless computations). This makes the prefetching about 10 times
faster!
closesodoo/odoo#59781
X-original-commit: ec50c426d7c2a17c7b72e64adab65eda6328e163
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Previously, background-images were not properly optimized when inserted,
whereas they should be just like regular images. This commit fixes that.
It also changes the default quality (used for automatic optimization) to
75 as the difference is not usually very noticeable but can bring a big
decrease in image size.
task-2357332
closesodoo/odoo#59779
X-original-commit: 5d8c0aa0f7678f51e0a0931b0410a0273c7c7d1f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The response we get after updating data contains the new KYC status,
we then update it on the adyen account so that we don't have to wait
for the cron.
X-original-commit: 59fdb24527e6073cb3c4de5662d25d4d0cea08eb
with background-sizing option, user drags background image to adjust its
position using an overlay with the same content from snippet (cloned element).
Some CSS child selector rules will not be applied since the clone element has
a different container from the snippet content.
The CSS "background-attachment" property should be the same in
both parallax snippet & its copy, this will keep the preview more "wysiwyg"
instead of getting different result when bg position saved.
This can be improved by copying all style from snippet content and
override it with overlay related style (copying all css into overlay will
not work since it will change the style of its content too)
task-2327025
closesodoo/odoo#59775
X-original-commit: aaa3e63985789ea07464a5957eb18481e70a383f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit there would be crash on Removing `Unit` field from Sale order lines list view due to missing `product_uom`, Which is necessary for `QtyAtDateWidget` widget.
Now we hide the Widget if `product_uom` is not selected.
Fixes#59492closesodoo/odoo#59724
X-original-commit: ea798c07d31fd186af4bf851966f791a96cb13fd
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
- Prior to this commit, slide content of type document or presentation is
having src as '/slides/embed' and that controller tries to set slide as
viewed. Along with this, for few slide types (including document and
presentation) and for logged in user, it will try to set slide as completed
once slide rendering is done with help of method `_setCompleted`, without
waiting for the iframe to be loaded. This means, the controller called from
the src of iFrame and the above method both tries to update same 'slide_slide'
table at the same time, resulting into concurrency error.
- This commit fixes the issue by marking the slide as completed (with help
of method `_setCompleted`) only after the iFrame is loaded, avoiding the
concurrent updation of 'slide.slide' table.
TaskID 2265863
Closes https://github.com/odoo/odoo/pull/52918closesodoo/odoo#59391
X-original-commit: c5f406c8cbf43c56939cee054f9b911fe3933b3b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit allows user to edit other menus by clicking on them
the same way the global menu is edited.
task-2272226
closesodoo/odoo#55881
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The main purpose of this PR is to convert the GraphRenderer widget into an OWL component.
Along the main changes brought to the module "web", some other changes have been brought:
- the modules "board" and "stock" have been adapted accordingly;
- the function "utils.sortBy" has been given an extra optional parameter "order" (with value 'asc' or 'desc');
- a helper "owlCompatibilityExtraNextTick" has been added. It has the same effect as the "nextTick" helper but should
be used in a specific situation (see the corresponding documentation for more information).
Task ID: 2090967
closesodoo/odoo#54009
Related: odoo/enterprise#12710
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Florimond Husquinet <fhu@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Determines whether user should be warned of all problems and also causes some correctable problems to be fatal. Since we just want the widest compatibility when reading PDF, strict=False seems acceptable.
TASK ID: 2358822
closesodoo/odoo#59736
X-original-commit: 9fb637577e0c13778e253b4f1329f59459ab0824
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
- Create a new Project with 'Portal user and all employees' as
visibility;
- Add a portal user as customer;
- Create a new task in the Project, without assigning the task to
anybody;
- Connect to the portal as the portal user;
- Send a message on the task.
Before this commit, an Error 403 forbidden was raised, this error occurs
because the task don't have an access token created, this token will be
created when an internal user send a message on the task.
Now, the access token is created if the project has a 'Portal user and
all employees' visibility, and the portal user can post a message on
the task.
opw-2345070
closesodoo/odoo#59733
X-original-commit: 64e93794efb4193b3dfa7aa43360a1ef274e623d
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
When PO not saved, no mail can be send. Sending a reminder preview will
get traceback. In this commit, we check if the PO is saved before
sending the mail.
Also clean some useless code in the send_reminder_preview() and fix the
issue when no json object is return to the widget because of on mail
send.
Task 2339431
PR #57961closesodoo/odoo#59399
X-original-commit: 83f2cac4b8ba101d6a7736a8ff408a3fdb5422fe
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
As explained in issues-59664, the commit
f18bdc4fcf2b6b0bdb7699c3b2aa38d332301a84 add
readonly attribute in the `purchase.order.line` state field
to avoid to save bad `state` in the server (then the state of the
PO line != PO line).
But it breaks the feature to add product
when the PO is already confirm (the state will be 'purchase' and the
`product_id` is readonly when state == 'purchase').
To fix both issues, add a `default_state` in the context.
It will "bypass" the attrs of `product_id` and the state of PO
('draft') line won't be save because it is readonly.
resolve#59664closesodoo/odoo#59729
X-original-commit: 74780e95a2a3db9d9875aea7e644bf064ecf6b46
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
When a user sends a plaintext email to a mail-enabled channel, the
rendering of this message in Discuss have present a horizontal scroll
when the text contains long sentences.
This commit fixes it by enabling wrapping of the line's word to fit its
container size and prevent horizontal scrolling.
Note: the required CSS rules were already present since odoo/odoo@0e7e18ff71
but a wrapper element (with the class `.o_thread_message_content`) was
introduced in odoo/odoo@4685e4bc7f and
merged between the testing of the fix above and its actual merging in the
Odoo codebase, making it ineffective. We only have to properly re-enable
it.
opw-2341485
Related task ID: 34931
closesodoo/odoo#59719
X-original-commit: 5e66ca8d2c970eed999782bdd59e9082f3967833
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Starting this commit: 8f57863707
regular pos User now don't have a read access to ir.property model.
Because of this, if a user opens a session, he won't be able to close
it. We sudo the search to stock.move (because the query parameters
requires reading from ir.property) to make sure that closing a session
will succeed.
closesodoo/odoo#59712
X-original-commit: 5e2763fdc94b63eee637f9679f8ea3a07beb74ce
Related: odoo/enterprise#13981
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
Before this commit, the function `sorted` wasn't available on
`safe_eval`, even though it's a Python built-in, which mades it
unavailable for Python-code evaluation, e.g. server actions.
After this commit, the above function is now accessible.
closesodoo/odoo#59715
X-original-commit: a725c8927963848c3f8ada3b71897a54b740cce6
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
A string parameter 'order' has been added to the "sortBy" function of
the utils module to decide in which order the array should be sorted.
The default is 'asc'.
Introduced a function that awaits for an additionnal rendering frame
initiated by the Owl compatibility layer processing.
By default a simple "nextTick" will handle the rendering of any widget/
component stuctures having at most 1 switch between the type of
entities (Component > Widget or Widget > Component). However more time
must be spent rendering in case we have additionnal switches. In such
cases this function must be used (1 call for each additionnal switch)
since it will be removed along with the compatiblity layer once the
framework has been entirely converted, and using this helper will make
it easier to wipe it from the code base.
also hide all messages with empty body and no attachments
task-2282322
closesodoo/odoo#59675
X-original-commit: 60ae42dcda777cd66e4e421dbc02f9ef12a430ef
Related: odoo/enterprise#13974
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
In odoo/odoo@d2238de576 the domain of the
action hr_holidays.hr_leave_action_action_approve_department has been
removed, as the addon was reworked and no domain is needed any more.
However, during a migration from a previous version, the older domain is
not overwritten with an empty value.
With this commit, the domain is set to an empty one, which allows the
migration to correctly update the record.
closesodoo/odoo#59673
X-original-commit: 76c2f412c09ef1169b5cf936f0770cd4200f29e2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Since tz is now (from 6eb4762fee) added to the client cookie,
visitor timezone can directly be set when creating the visitor, using the
request.
Jstz can be removed as even for module in ENT that used this lib,
we can get the timezone using Intl lib instead.
This will also reduce the number of request made only to get visitor's
timezone.
This commit reverts part of 17e8402523
Linked ENT PR: 12963
Task ID: 2333825
closesodoo/odoo#59501
X-original-commit: 3d9a2de3575777c87327691319d89f9de6b8eada
Related: odoo/enterprise#13918
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce:
1. Activate landed costs
2. Create a product that in the purchase tab has active 'Is a landed
cost'
3. Add this product to a purchase order
4. Confirm the PO, create the bill and create landed costs entry
Since they don't use anglosaxon accounting they expect the
invoice line account to be used for the landed cost. It will come in
empty as it is looking at the stock input account.
opw-2332763
closesodoo/odoo#59626
X-original-commit: f500bec7c1a2de799c0d4deb9b7ee43a69b3b46a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Steps to reproduce:
1. Activate landed costs
2. Create a product that in the purchase tab has active 'Is a landed
cost'
3. Add this product to a purchase order
4. Confirm the PO and create the bill
is Landed costs checkbox is not enabled when this product is
being invoiced. Any time you add this product to an invoice manually it
will have it on. They want that same behavior when the invoice line
comes from Purchase Order
opw-2332763
X-original-commit: d8f5ed417deb82151abf7a25ad16ce0720e90780
Issue
- Create promotion program with product_x
- Create new quotation
- Add product_x on the first line
- Add another product_x on the second line
- Press "Promotions" button
Cause
The attribut reward_product_qty except singleton but order_line contain more than one element
Solution
Take the order line with the higher quantity
opw-2350574
closesodoo/odoo#59637
X-original-commit: 30d66b17ea1829e30de176774c7511aab19851a0
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Signed-off-by: Achraf <macadelic80@users.noreply.github.com>
This fixes a crash in some controllers with `auth='None'` where some
updates are flushed with an environment where `uid=None`. When there is
an environment with a real uid, preferably use it.
closesodoo/odoo#59658
X-original-commit: 2795c86df54389b858a454cbc1782b1f34f3ba4f
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Following [1]. The mentioned commit selectors were to be simplified and
actually did not solve the problem in mobile affixed menu. Also,
targeting "o_affix_enabled" to target the non-affix menu was wrong since
when there is no affix menu, no header has the "o_affix_enabled" class
as its names indicates it. So the mentioned commit fixed half of the
problem and only when the website used the affix menu feature... Let's
hope this new commit fixes everything.
[1]: https://github.com/odoo/odoo/commit/21959599d1c25321865afabe7f70191efdda154eclosesodoo/odoo#59652
X-original-commit: 533a4db8efdf2b16f012e3c9253ae2abc88a344c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This reverts commit odoo/odoo@681306d4e7.
Adding groups on assets parts is not a good idea. Indeed as assets are
compiled and optimized we do not want to serve different assets to different
users.
For example if you have several users in parallel on several workers those
could try to regenerate assets for their users. As each user has different
assets this could lead to big performance issue.
As original commit tried to solve a race condition we can safely remove the
assets fix to avoid issues and work on a cleaner solution.
See original ref odoo/odoo#51804 and odoo/enterprise#10737
This also solves an issue notably in website_slides where access to pdfjs
library was depending on connected users, due to assets mismatch. See
task ID-2352391 .
closesodoo/odoo#59610
X-original-commit: 000af2688e32d19b1874df2e909ccf0ddf636b91
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Replacing 'in page' message for the "RVP" and the
countdown snippets so that we avoid to display some element that won't
be there on the saved page.
task-2261649
closesodoo/odoo#51632
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
- Activate debug mode
- Go to Settings > Technical > Templates
- Duplicate "Invoice: Send by email" and edit the copy (Name & Content)
- Go to Accounting > Customers > Invoices and create an Invoice
- Post it
- Send & Print
- In the wizard, select the duplicated template (the content will be updated)
- Uncheck "Email" option, the re-check it
The selected template is still the duplicated one, but the content is the one from the default template.
opw-2345200
closesodoo/odoo#59628
X-original-commit: cd6c54b15ce328b58888a4f33a64ae61c7744a90
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
Before this commit, the option to open dropdown on hover did not work
with mega menu.
task-2312878
closesodoo/odoo#59625
X-original-commit: 9b3b1c623867d3618220d8bd8a729701ae46448b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The `_error_checking()` context manager is used to perform validation
and cleanup after changes on work entries, and is implemented using a
try/finally clause.
This mechanism fails to take into account that the alteration operation
can fail due to a concurrent update (in another transaction). In such a
situation the db cursor becomes instantly invalid, and any attempt to
use it will fail with:
`psycopg2.InternalError: current transaction is aborted`.
This exception will be raised in the `finally` block, and will therefore
discard the original TransactionRollbackException.
The result: instead of being silently retried as expected,
the transaction fails and the user receives a cryptic error message.
Steps to repro: repeatedly click on the button to validate a leave
Solution: specifically handle PostgreSQL `OperationalError` exceptions
and do not attempt to use the cursor when they occur - just let the
exception bubble up.
closesodoo/odoo#59612
X-original-commit: 7ba47e7215df69b6556a848532e4f33ef4243e83
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
- don't reset `stringifiedDomain` when changing thread (this led to the
control panel displaying obsolete filters)
- refresh non-main cache that are currently displayed when there is a known
change of messages in the same thread's main cache
- refresh non-main-cache on displaying them, to fetch potentially new messages
- fix discuss "select all" conditions
task-2171873
task-2282374
closesodoo/odoo#59644
X-original-commit: b89dc5f949b3ad062fc4197a4152066c207e1bf9
Related: odoo/enterprise#13962
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Current behavior before PR:
It is possible to create a BOM that has a BOM line that reference the
same product as the BOM itself. This is undesirable as when we create a
manufacturing order for this product we will have an error.
It is a regression bug that was introduced in commit
575353e251a0cce3bbff759edaeb56b5718beb11 between v12 and v13.
Behavior after PR is merged:
When saving a BOM it will validate that no product line references the
same product, or the same product variant, as the BOM itself. Note that
it is allowed to have a BOM for a product variant that references
another variant of the same product.
opw-2347941
closesodoo/odoo#59633
X-original-commit: 917e4c67b4aa14ca71ec6cba4bc6d20a86459f42
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Same issue than for commit 203bb4d9c11 but for dropship rules instead of
missing dropship types.
closesodoo/odoo#59629
X-original-commit: 1372cc427e9946b3f6ba81b4e895b145468092a2
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
If no bank journal with no account set can be found, we should return False
instead of an empty record.
closesodoo/odoo#59609
X-original-commit: ececa74b96accd86bf9e9448d18526a905fed4c9
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
Purpose of this commit is to add a bridge between sales and sms, notably to
add capability to edit sale order SMS templates for sales managers.
Task ID-2319841
PR odoo/odoo#56297
Upgrade PR odoo/upgrade#1829
Closes#55432
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
- Create companies A & B
- Switch to company B
- Open a POS session in company B, but do not close it
- Switch to company A
- Set a Lock Date for Non-Advisers
The error message 'Please close all the point of sale sessions...' is
raised.
The message shouldn't be raised since the session is not in the company
we are setting a lock date.
We filter the session based on the company.
opw-2351930
closesodoo/odoo#59529
X-original-commit: a1445bf45fadf21a4af5dd2791efda4a4450a825
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>