When a field is related, defining a selection or selection_add will
have no effect and the paramater is ignored.
Log a warning and fix all fields badly definied
Closesodoo/odoo#45716closesodoo/odoo#45832
Related: odoo/enterprise#8613
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Commit 9a482fc introduced change for the document layout preview:
all "td" tag included in clearfix were in display: flex;
Because of this some styles were broken in form views on mobile.
We could have only put this rule in the right scope but
we preferred to fix this correctly.
Steps to reproduce:
- Go to Settings
- General Settings
- Click on Configure Document Layout
Related to task-ID: 2184243
closesodoo/odoo#45830
X-original-commit: 0206ee8f8a3652ae0eeb5aa78a94b92bd6e84921
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
The default product category and uom should be fixed on generic
undeletable records (in data files).
And by caching those default values, we can gain up to 20% time when
creating products without providing uom and categories.
Also remove the unnecessary defaults on the compute fields, which do the
same as the compute (and have no use because it is a non stored field).
closesodoo/odoo#45791
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Each search on member_ids will trigger a ref call (one exists query each
time), whereas we could just directly use the appropriate share field on
res_users.
This commit cleans some useless .decode('utf-8') calls when we return rendered
templates results in the survey controllers.
The http module is capable of handling that type of results and the calls were
not necessary / added complexity.
Task '2187328'
closesodoo/odoo#44540
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit ComponentAdapter warned on every update and render.
This can make a lot of noises when we use some adpaters.
After this commit ComponentAdapter will warn only in debug=assets mode.
closesodoo/odoo#45583
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
addEventListener supports an `options` argument, which can
be useful to listen on events during the capture phase
This commit allows to pass these options to the hook useListener
closesodoo/odoo#45478
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Purpose
=======
Lighten the survey layout. It should be free of website footer and header.
Also, livechat button should not appear on survey pages.
Specifications
===========
Survey Layout inherits from web.frontend_layout, mainly to be able to use all the
styles rules defined in it and keep consistency between other frontend pages and survey.
Instead of inheriting another layout, this PR sets no_footer and no_header to True
for all survey layout. The idea is to show only the survey itself without having
other web/website object in the layout.
Also, to avoid having the livechat button displayed on survey layout, 'no_livechat' template variable
has been introduced. The livechat button will be displayed on all layout inheriting from frontend_layout (that is extended in website_livechat to add that livechat button) only if 'no_livechat'
is False. By default, this variable is not set so will be considered as False.
In survey layout, no_livechat is set to True.
Links
=====
Task ID: 2195185
closesodoo/odoo#45112
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
- create a SO with a section;
- create an invoice from the SO.
Before this commit, an SQL constraint was raised : 'Forbidden unit
price, account and quantity on non-accountable invoice line'. This error
occurs, because the default_get function adds a default account_id to
all the lines (including section lines) if a journal_id is passed in the
context. The journal_id is added in the context since : 03353118d3176463fbf779471cc272d31fb11b2e
Now, the default_get function only adds a default account_id if the line
is not a section line or a note line. This avoids the SQL constraint to
be raised, and the invoice is correctly created.
opw-2199356
opw-2199017
opw-2198781
opw-2198650
closesodoo/odoo#45809
X-original-commit: d71830f5d9f9a717194aaa8ec993d99739fe09e7
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
In case of MTO+Manufacture, a sale order have a count of
manufacturing order created from it :
1. create SO with MFG+MTO product with quantity of 5.
2. confirm it. MO will be created for 5 Nos.
3. increase it to 7 . another MO created for 2 Nos.
4. there are 2 MO created based on 1 SO.
It was due that new stock move was merge, and the
'created_production_id' info was lost during the merge (keep only
the original one). To fix, avoid merging stock move with distinct
'created_production_id' (done by override
'_prepare_merge_moves_distinct_fields' and
'_prepare_merge_move_sort_method' methods ).
task-2199568
closesodoo/odoo#45800
X-original-commit: 1fb32cfd17122b625d211a7d22ec319fba35e87f
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
Incorrect forward-port of e09798098679f made in 51d49517a8b5af2d1c85d9c6.
closesodoo/odoo#45775
X-original-commit: 099d0d6785b85dd67ef091fdaef084713fafb3c0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The product demo file marks a lot of product as 'invoice on delivery'
(the default is invoice on order), but the invoice status and amount to
invoice on order lines is _not_ recomputed when the product's invoice
policy changes (this is a conscious choice, as it would trigger
recomputation on past orders).
This means that the demo for products must be loaded _before_ the orders
demo, otherwise the computation for what is to invoice or not will seem
to make no sense on a demo db (even though the computation is in fact
correct): a lot of orders where marked as 'to invoice' while the
products where not delivered; invoice those and the system will again
mark them as 'to invoice' and will immediately want to generate a
refund...
closesodoo/odoo#45778
X-original-commit: e10f473fa2aba411755b76a0c1af7ff107cde5de
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Issue
- Install Sale and/or Purchase
- Create new order
- Debugger > Set Defaults
- Set default value for payment terms
- Quit and re-create
Default value is not filled
Cause
The default value is set but it's overridden
by a onchange
Solution
Remove the override who puts the value to False
OPW-2197940
closesodoo/odoo#45776
X-original-commit: 4d03e6dd81fab2aa12e3205106fd59758c6c90f6
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
The button which allows to indicate that an answer is correct is
supposed to turn green once the answer is validated. This was not the
case anymore since the link button was missing its href. Indeed BS4
forces those links to "color: inherit".
closesodoo/odoo#45769
X-original-commit: ee2fb7c05c9065c9d349682e60376566b96f1c1f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The idea is to make the dispatching and error-handling consistent for
JsonRequest and HTTPRequest.
In 8809c77f60 we introduced a way for
request-specific error-handling, but JsonRequest.dispatch() was
still catching all errors internally, instead of letting them bubble
up to ir_http._handle_exception()
By removing the internal try except in JsonRequest.dispatch(), we do not
change the behavior much as there are only a couple of "if" in
ir_http._handle_exception() before returning to the request-specific
handle_exception. However we give the opportunity to modules to
customize exception handling even for JsonRPC, the same way it is
possible for HTTP requests.
Here is a simple pseudo code of the flow
ir_http.dispatch():
try:
request.dispatch()
catch Exception as e:
ir_http._handle_exception(e)
ir_http.handle_exception(e)
request._handle_exception(e)
closesodoo/odoo#45639
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
This fixes the following issue. Set the field `arch` on a view; this
automatically writes on `arch_db`, which is a translated field. If some
translations are discarded, a call to `unlink()` invalidates the whole
cache. And then things go wrong: when `arch_db` is validated, the field
`arch` is missing from cache, and the ORM sets it to `None` because the
field is still protected by the initial write!
Fix the issue by avoiding the call to `unlink()`, and do it in SQL
instead.
closesodoo/odoo#45740
X-original-commit: e7679152ee480a51ef2b6d208ae7a05b2ef61941
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
In the previous snippet cleanup, a lot of superfluous row > col were
removed in favour of having the bare content directly in the section,
this streamlines the interface and prevents having many useless UI
elements.
At the same time however, there are some snippets on which you might
want columns so that you can pull the content off-center and give the
block a background color independently of its containing section
(namely: the cover, title and text-block snippets)
this commit adds an option to add columns on those snippets (and remove
those columns completely if they're no longer wanted)
task-2120360
closesodoo/odoo#45712
X-original-commit: a44bfc4f7bba16d700650ecc2369fa1445ecbfb9
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Steps to reproduce the bug:
- Let's consider two companies C1 and C2
- Let's consider two production locations L1 in C1 and L2 in C2
- Let's consider that the company of SUPERUSER is C1
- Add the field Production location in the form view of mrp.production
- Log in C2
- Create a product P with a BOM in C2 with L2 as production location
- Create a MO for P
Bug:
The production location of P was L1 instead L2
PS: related_sudo is set to True by default.
opw:2196707
closesodoo/odoo#45692
X-original-commit: aef3d1864826a939fbd9cfd9b666614169a1db0e
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
The widget Selectbo was performing a search_read on every field while
only using the fields id and name. This search_read has become very costly
in the latest version due to some new fields.
We now limit the search_read to the useful fields.
closesodoo/odoo#45707
X-original-commit: a4832ccdeedd777b43825e41ffb8c20937022279
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
PURPOSE
As CRM is going to be updated (onchange -> compute, code improvements, better
management of sales teams) cleaning and improving code is a necessary first
step.
SPECIFICATIONS
Add tests. Amazing. Notably about matching partner / duplicate based on email
as there is some weird behavior.
closesodoo/odoo#45477
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
On a standard odoo install, `MigrationManager._get_files` represent
more than 4% of an install. This is because the legacy
odoo/base/maintenance/migration path was added to upgrade.__path__
once by module, making the get_filed check 574^2 os.path.exists.
This commit adds a check on initialize_sys_path to call it only once,
and merge legacy path with upgrade-path management in order to benefit
of the `up not in upgrade.__path__` check. This second part of the fix
will also remove the local dir from the upgrades paths.
A further improvement would be to fix MigrationManager in order to skip
_get_file work on a fresh install, (wip by rco-odoo)
closesodoo/odoo#45699
X-original-commit: 497330a695ed52a33f9c9b9c27b149446de0db29
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Before this commit:
When we change a contract to stage 'open', we write this contract
on employee. But it causes error when it's a template contract
(without employee).
After this commit:
When we change a contract to stage 'open', we write this contract
on employee only if contract has an employee.
[FIX] hr_contract: Allow overlapping in template contract
Before this commit:
We check for all contract that there are no overlapping for a
same employee.
After this commit:
We check that there are no overlapping for contract with
employee.
[FIX] hr_payroll, hr_holidays: Avoid some constrains with company time off
Before this commit:
We can't create company (or team) time off if you have 2 or more
template contract in your database.
We can't create mutliple company or team time off that overlaps.
After this commit:
We can create company (or team) time off if you have 2 or more
template contract in your database.
If a time off is set across multiple contract, print those contracts
in error message.
We can create multiple company or team time off that overlaps.
closesodoo/odoo#45696
Taskid: 2196185
X-original-commit: 3fdada6f8f19ae7123d9b35b3e7c557d072c1bc0
Related: odoo/enterprise#8553
Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
PURPOSE
If a visitor closes the livechat window, he is redirected on rating / feedback
/ send_transcript screen but he cannot go back to the conversation unless he
reloads the whole page.
Conversation should be considered as inactive after the first click on X.
SPECIFICATIONS
This merge holds two main commits
* move close livechat session to base livechat module in order to be able
to flag the livechat as inactive when the visitor leave the conversation;
* set livechat inactive _onCloseChatWindow: closes the conversation (set
as livechat inactive and send the 'has left conversation' message) at
first time the visitor closes the conversation;
See sub commits for more details.
LINKS
Task ID: 2120210
Community PR odoo/odoo#39939
Upgrade odoo/upgrade#772
Related: odoo/upgrade#772
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce the bug:
- The field expense_policy in the product.product form view was not visible before saving
PS: The default value was always set to False.
opw:2194236
closesodoo/odoo#45594
X-original-commit: 7068ae7ec740525bbf5702ad1e78e8e6b0d551e0
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Steps to reproduce:
- install crm
- go to any lead and schedule an activity in the mail thread
- select "email" as activity type and type some text in the note field
- change the activity type to "call"
Previous behavior:
The text you had in the note field is erased even if there
is nothing set as a default message
Current behavior:
the note field gets erased only if there is a default message set
for the current activity type
opw-2195368
closesodoo/odoo#45603
X-original-commit: 1445b694e6111727d93d548f2830c53180fb9aa7
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This reverts commit db691dbebf because the appropriate solution was to filter lines with 0 debit and credit during the reverse_move before the reconciliation (which apparently has already been done by another patch).
This patch, however, was causing the followup report to show lines on a receivable account with a partner and 0 balance with 0 way to remove them.
X-original-commit: 6a5271b7f4109a4f2a20378698fbe479d73ed9cb
Use date_stop instead, and remove the instruction to remove the computed
field.
closesodoo/odoo#45669
X-original-commit: 3650adbac52d19ecc6265d90babeb6fc270d3ac2
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
- When browsing the blogs, in some cases the code need
to fix the URL to properly slugify the tags.
When so, the code crashes since it is trying to maniapulate
a `werkzeug.wrappers.Response` as if it was a `dict`.
To avoid this, we directly return the `werkzeug.wrappers.Response`
instead of trying to modify it.
closesodoo/odoo#45658
X-original-commit: d26ba7e4b71138a324bbb729f406cbad562881e7
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Commit c883ed1087 let the possibility to
add additional stock moves in a confirmed production. The issue is those
move don't get the production group and their procure method is set
(and never changed) to make_to_stock.
This commit call adjust_procure_method before confirming additional
moves.
closesodoo/odoo#45660
X-original-commit: 96cc10fa79a120172b3cde88d50ba2fda5e75ab5
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Purpose
=======
Fix kanban state default value and display in community.
Fix question answers not correctly parsed from frontend.
Fix sale availability ACLs issue when having tickets.
Do not group the event tracks by location.
See sub commits for more details.
Task 2188857
PR #44545closesodoo/odoo#45655
Forward-port-of: odoo/odoo#44545
Related: odoo/enterprise#8533
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When we buy a ticket on website, a sale order is automatically created and
confirmed if the ticket is free. When we buy a second ticket we will edit the
old SO, but we can't, because the SO was confirmed.
Solution
========
In `_create_attendees_from_registration_post`, reset the sale information.
Task ID 2188857
PR #44545
X-original-commit: d0e80ffdcc3a1ca2d872df66e1aee336f1777378
Indeed this field is notably based on tickets availability. Reading tickets
products is not necessarily granted to everyone. People reading events should
be able to know if the sale is available or not independently of their access
on product model. Let us therefore use a compute sudo.
Task 2188857
PR #44545
X-original-commit: cfabf12ef888a9dac48cbb19763740e2c65225d5
When user register to an event from website, they can answer questions
specific to a given registration or to all registrations. However they
are not correctly parsed and not saved.
Task 2188857
PR #44545
X-original-commit: e27d9b5c4f234f6ce64456c2f52e7cfb0331332f
In the event form view, when only community is installed, kanban state
is not on the right part of the form.
Moreover it should have a default value.
Task 2188857
PR #44545
X-original-commit: 1813f064bdcbc09131197484ed3c075dcba8bcb7
PURPOSE
Update tree view to add optional fields to make it easier to read.
SPECIFICATION
Modify the event_views files to add some fields (optional or not)
It add some more informations about the seats, the tracks and sponsors
and if the event is online or not.
LINKS
Task ID : 2192652
PR : #44938
Related: odoo/upgrade#801
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
This field is deprecated. Since its usage was to trigger a warning when
trying to confirm an event and confirming an event is not done anymore,
it has become obsolete.
SPECIFICATION
remove seats_min field and usage from event.event
remove default_registration_min field and usage from event.type
LINKS
Task ID : 2192652
PR : #44938
Formerly the vendor bills, customer invoices and regular journal items were
evaluated by the _check_unique_sequence_number method, but this is wrong
and also was overwritten Odoo original constraint error message.
Now the _check_unique_sequence_number evaluate the account.moves that are
not vendor bills that use documents because this kind of bills uniqueness
depends on the vendor: we can have same name of vendor bill from different
partners. This is evaluated in the already existing
_check_unique_vendor_number method
closesodoo/odoo#44813closesodoo/odoo#45643
Original-signed-off-by: Josse Colpaert <jco@openerp.com>
X-original-commit: beaa3bbacd4bd35ed11962a7466f111e5e85f0d8
Signed-off-by: Josse Colpaert <jco@openerp.com>