Fixes#29694Close#47204Fix#37554
Before this commit, There was Traceback on calling this method w/o any inventories as variable `res` was not declared but Returned or Calling this methord over RPC will raise TypeError as this method does not returns amything.
In this commit, We return True at original `post_inventory` method and Declare `res` to prevent undefined variable.
closesodoo/odoo#51320
X-original-commit: cfb2f00ae2fcbe33184d76383e3b624700101a75
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Purpose
=======
Update Lead Probability CRON is currently running in a single transaction
and is locking lead table for too long.
This task aim to improve the performance of the cron by:
- reducing the number of update (instead of updating one by one the leads,
update all lead with same value to update)
- Making it multi-transactional (to avoid locking table during
the whole process)
Spec
====
- compute probability and automated probability values with only 2 decimals
(needed to compare new and old probability + to avoid too many values
in the group by probability)
- Group the leads to update by Probability value (rounded by 2 decimals)
Note : This commit doesn't change the field definition to avoid migration.
- Update leads by batch of limited number (=step), to avoid transaction to take
too long. After each batch execution, commit to unlock the table before
continuing with next batch.
Task ID: 2224677
closesodoo/odoo#51310
X-original-commit: ee346936efc6cabce14cb73223ecd2e6a0cc1e3f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
-Configure alias on sales team;
-Send email, opportunity is created for sales team;
-Enable leads on CRM settings and enable leads for sales team;
-Send email to alias, lead is created for sales team;
-Disable leads in CRM settings;
-Send email to sales team alias;
Before this commit a lead is created even those these have been disabled
in CRM settings and you cannot access this menu anymore.
Now, an opportunity is created for sales team.
opw-2244379
closesodoo/odoo#50943
X-original-commit: 3e9f07e8fe2f31b66087db4b0fc274df2e6253c8
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Merge account_analytic_default into account
Merge account_analytic_default_hr_expense into hr
Merge account_analytic_default_purchase into purchase
Prevent having to manually install default modules after activating analytics
closesodoo/odoo#50816
Task: 2182900
Related: odoo/upgrade#1186
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
To ensure backward compatibility, stuff removed by ab4000fb3 have
been restored.
closesodoo/odoo#49603
Task: 2234749
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Purpose
=======
Currently a custom override of Cleaner.allow_element()
exists in tools to allow object tags for SVG images.
This was due to the first prototype of website builder
and its first implementation of image and svg management.
This is not necessary anymore as using the tag is sufficient.
We can safely clean code in the cleaner, allowing to speedup
its performances. As it is used in most html fields and email
parsing each unnecessary code removed is time gainged.
Task 2215228
closesodoo/odoo#51294
X-original-commit: 4a0b09fd3b0d3b63f2df00f002e4d6825cac4eef
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Currently posts are hidden at the post level only (by giving a 404).
The posts are still visible in the list of posts on the main forum page.
Now we hide the posts of users with negative amount of karma.
task-2093636
closesodoo/odoo#46194
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Fine tuning of the test of https://github.com/odoo/odoo/commit/d9eaae8acc600f936fbc4fa48a49a7f4d65fcd7f
As the journal was not explicitely set, a default journal with a company different that the one set up from
function setUpClass() defined in class InvoiceTestCommon
So a traceback was sometimes raised in the test saying:
Some records are incompatible with the company of the Journal Item.\n\nIncompatibilities:\nFields: account_id\nRecord ids: 1809, 1810, 1811
opw:2244708
closesodoo/odoo#51285
X-original-commit: dd40fb63b4ebdd4dd7b44c75d415e99b52d633a1
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit displays the currency of the `Expected Revenue` field of
lead in the list view.
Known drawback : the sum is not correct if multiple currencies are involved.
Task-ID 2238661
Closes#49954
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Historically, it was possible to import addons via a naked import. It is
no more possible since 9e1f13bac, since that commit, the only possible
way to import odoo addons is via the `import odoo.addons' prefix.
closesodoo/odoo#46995
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This reverts commit eda451f99fe050bace503d422ebb1a3842c046e7.
closesodoo/odoo#51270
X-original-commit: d7e7eb65aa9f45f78e636360bfaa7277204ba0ff
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
With this code, we can do an XML customization on
customers database if they want to have the product
configurator.
Note that this is not the entire feature, just
a "workaround" waiting for a real feature.
OPW-2214095
X-original-commit: ad467a6c1e1e1905ca43912047de4897f3a8fc8c
* Wrong environment for project & task creation
On company creation, a leave project and task are created, but with the
wrong environment, potentially leading to inconsistent values in a
multi-company environment.
* Company creation in batch
Also fix the create override decorator to specify the create override
supports batch creation of companies.
closesodoo/odoo#51264
X-original-commit: e6bd644851819692eeddadaa50950efd0f83f6d9
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Editable stored fields are copy by default if their base field
allow it (char, integer, ...). Purpose of this commit is to remove
unnecessary copy=True statements added when using stored editable
fields.
PR #49464
Task 2225253
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When creating a new database, a random master password for it is
generated and strongly suggested to be used.
The motivation for this change is to have, by default, a secure master
password set for any Odoo deployment.
Often, users do not realise that, when making an Odoo installation
accessible on internet, anyone else can also access it.
Use autocomplete="new-password" for updating the master password and
play nice with password managers
When generating a new password, use autocomplete="new-password" as
well to prevent autofill of password potentially saved in password
manager.
Make the eye click to toogle on click instead of need to maintain.
closesodoo/odoo#45117
Task-id: 2091260
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Only system and designer users can access `ir.ui.view` records.
An employee, portal or public user should not be able to read a view arch, while
ok in standard (all views are in the code anyway), one may want to integrate
confidential business logic in some views.
All operations on views must be done in `sudo` or use helpers like
`fields_view_get` or `_render`.
This PR is part of the long-term task id 8203 that plans to remove all access to
`ir.*` models
**Changes of ACL**:
- remove read for all on `ir.ui.view`
- remove read for all on `website.page` (uses `_inherits`)
- add read on `ir.ui.view` for website publisher (cf `read_template`)
(maintain all for system and designer)
**Changes of method**:
- `fields_view_get` uses `sudo`. Can only be called only if we have the read
access on the linked model.
- `render*` becomes private `_render*` and uses `sudo`. Shouldn't be able to
arbitraly render any template. A QWeb template is not linked to a model so
can't apply the same ACL check as in `fields_view_get`.
- `read_templates` remains public but without `sudo`. It is called by the method
`load` method (now private too) or by the web_editor module
**Changes of behaviour**
- the `groups_id` parameter may be used on a view to relax the access and allow
a specific group to access its content (e.g. frontend assets for employees)
closesodoo/odoo#44993
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
It was considered important to precise that image fields without
limitations weren't checked
at all and could therefore contain non image content (and precise some
other things on Image fields).
Forward-port of #51200closesodoo/odoo#51259
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Allow groups_id on top level view as a way to relax the access of some
views
There was some scenarios where ir.ui.view were still needed to be
accessible.
For instance the website.snippet is needed to display the website
editor sidebar to designers. The website.compiled_assets_wysiwyg is
needed to display the app switcher on the website to employees.
This should cover most of the cases where a view still must be
accessible and no specific controller is available.
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id
Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
The method fields_view_get should be the only way to retrieve the view
content. This method is executed in a super-user context.
To avoid retrieving views for a model a user does not have access to
(as it may reveal some informations like name of fields), add a
verification of 'read' rights before retrieving the view content.
Execute _postprocess_access_rights with sudo(False) as this method is
used to evaluate which buttons should be displayed.
Remove the su flag to avoid misleading the user and displaying a
button they won't be able to use.
Retrieving the database id from an view key is not considered as a
sensitive information and get_view_id and viewref can be left as a
public methods.
Add missing sudo when needed
Change _handle_visibility in website to avoid increasing the query
count: Checking the visibility (to fail most of the time) to retry in
sudo was making unecessary queries.
Only system users should be able to access directly ir.ui.view records
Other users should use helper methods like fields_view_get or render
to interact with view records (or use sudo)
Give read access to views to publisher
He needs to call read_template on some views like
'web_editor.colorpicker' in edition mode
Restrict ACL on website.page
Apply the same ACL than on ir.ui.view as the model inherits from it.
Give access to designer to modify views
Currently, scheduled Actions only work if you choose "Python Code" as
the action type ("Action To Do"). Other action types are not really
supported as they work "record-wise" (using active_ids) which makes no
sense for scheduled actions.
We should help users avoid surprises by hiding the "Action To Do" field
on scheduled actions, and default to "Python Code" implicitly.
Example steps to reproduce :
- go to scheduled actions > create a new action
- select "Execute several actions" as action to do
- add several actions to execute
- run this action
=> the sub-actions were not executed
opw-2227082
closesodoo/odoo#51242
X-original-commit: b19c7c54efceb780806d876efc65a8813e3491d1
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
If the original field is defined with a selection list, overrides with
method or methods names fall back on the list.
closesodoo/odoo#51232
X-original-commit: 272ba8d2238d1d1b87f47b114b55e6eed25314a8
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
- Activate Studio from dashboard of database A
- Export studio customizations
- Activate Studio from dashboard of database B
- Import studio customizations previously exported
The imported data don't have the boolean studio field set to True.
Since v12, when loading a module, a query is executed to create or update XML ids.
The create and write methods are not called anymore.
Therefore the overridden create and write methods of "ir.model.data" defined in Studio module
are not called and thus cannot set the studio field to True.
The generation of the query creating XML ids has been moved to a private method
allowing another module like Studio to override it.
opw-2245578
closesodoo/odoo#51203
X-original-commit: 198ab837e466f3155ea1c3b35811b981b1c1e537
Related: odoo/enterprise#10586
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Issue
- Install Contacts
- Add a tag on a contact like:
"LongTagName_Forcepaymentcomplement"
and give it a color
- Go back to kanban view
- Resize your window
With some sizes, the tag gets out of
the kanban box
Cause
The tag is moved under the color ball
when it is too long with some resolution
But there is others resolutions where
the tag is too long even if it is moved
to the next line
Solution
Add word-break: all which will force the
tags to break if it is too long.
OPW-2251780
closesodoo/odoo#51243
X-original-commit: 2ac6a8f289fd498794a4e5407eace0e0cd18df4c
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Steps to reproduce the bug:
Let's consider a company C with french accounting
Create a new journal entry JE with one line L with debit = 100 and credit = 0
and account = 601100 Achats stockés - Matières premières ou groupe A)
Set TVA déductible (achat) 20,0% TTC on JE (where this tax is included
in price but not included in base amount)
Bug:
A new line is created on account 445660 TVA déductible sur autre bien et service with a debit = 16,67 instead of 20.0 and credit 0
Now with this fix, we consider that the amount encoded by the user is the base on which each taxes must be computed (instead of
magically subtracting included tax from the base)
opw:2244708
closesodoo/odoo#51219
X-original-commit: c9ce26534d2f8fa69068bfdbeb9994eb12d4124e
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
- Configure your outgoing email server to be sure that a failure will be triggered
when trying to send an email
- Make sure you don't have enough sms credit to send a sms
- Go to a contact page
- Send a message to the contact via the chatter
- An notification error should appear in the conversations icon in the systray
- Send a sms to the contact
- An notification error should appear in the conversations icon in the systray
- Click on the "Mark as read" icon on the notification error for the email
- A "Discard mail delivery failures" wizard will appear
- Click on "DISCARD DELIVERY FAILURES"
All email and sms delivery failures are discarded.
Only the email delivery failures should be discarded.
opw-2247617
closesodoo/odoo#51204
X-original-commit: d8c177969239a9bd6dcbd6654a914d40a6ba479f
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Added common Chart of Accounts, standard taxes,
fiscal positions etc.
Originates from a module of Osis. We were unable
to contact them for further information.
closesodoo/odoo#51199
Task: 1918677
X-original-commit: 0d8ad9221baebe909aae387498297d403f9ecc0b
Signed-off-by: Josse Colpaert <jco@openerp.com>
* Cmdline interface: how to trigger database population
* Testing: how to implement database population on a given model.
* autodocumentation of the population methods
+ improve population methods docstrings.
closesodoo/odoo#50596
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Exceptions were not logged correctly due to a typo in ExceptionLogger.
closesodoo/odoo#51191
X-original-commit: 9ac2ad249bddc631de9a9d587058d6109918f584
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
The purpose of task is to update the 'user/employee avatar' to the new
widget in all the kanban view across all modules.
The below new widget are introduced for avatar:
- many2one_avatar_user (for user_id fields)
- many2one_avatar_employee (for employee_id fields)
which displays the avatar (i.e. picture) of a user/employee in front
of his name and clicking on the avatar will open a chatbox to message
that specific user/employee.
So in this commit, For each kanban view with a user or employee avatar,
replaced it by the field with the new 'many2one_avatar' widget.
TaskID: 2244928
Related Enterprise PR: https://github.com/odoo/enterprise/pull/10420
closes odoo/odoo#50789
Closes: #50789
Related: odoo/enterprise#10420
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
- Create a PO, order 5 items
- Validate Receipt with 5 items
- Return 1 item to Vendor
- Update Order Quantity on PO, from 5 to 8
A picking of 3 units is created.
If the same workflow is used in Sales, a picking of 4 units would be
created, which is the expected behavior.
We adapt the logic of Sales [1] to Purchase.
[1] https://github.com/odoo/odoo/commit/8a3284685856b6980e3b620abdbbb3e2c79f57c4
opw-2233826
closesodoo/odoo#51174
X-original-commit: 74e8b9ab2311ed2c1c9cea53d09e3b352db3dbe6
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Oversight of efafadc3ee
This commit fixes typos that raise an error when a crm.reveal.rule is created.
Task 2250137
closesodoo/odoo#51173
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, a traceback occured when user clicked in the Sales Analysis in the sales team dashboard
closesodoo/odoo#51170
Taskid: 2246368
X-original-commit: fb5e9cb68c922706e356c78680ddfc4876bbbf85
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The supported case of check_company on `res_company` model fields was
not considered when specifying a default domain on `check_company=True`
fields.
closesodoo/odoo#48674
Nb: It is already correctly supported in the `_check_company()` method.
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Issue
- Install Survey & Contacts
- Have 2 contacts with the same email address
(e.g. test@example.com)
- Create a survey, send it only to that
email address
Email sent 2 times
Cause
When looking for partners linked
to that email address, we do not
provide any limit so the system
send the email to all partners
found.
Solution
If I set one email address,
I expect one email to be sent.
So, the solution would be to
apply a limit of 1 when login
is not required.
OPW-2247693
closesodoo/odoo#51155
X-original-commit: 55b1cc3108d6b672f10ece26db7e13a65ff655d3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Partner autocomplete suggestion popup cropped from the top in small devices.
once you type anything in M2O box, autocomplete popup will display with all
maximum possibilities consist of the database records and records got from
global search partner API.
Currently, we have limit of database record search is 7 and autocomplete
display maximum 16 items databse records + API generated records.
So with this commit, we have reduced the API record display limit for small
devices, based on height it will display number of items in autocomplete box,
this will reduce chance of cropped issue.
Task:2206844
closesodoo/odoo#51151
X-original-commit: ded375786557ae6c7680409faa32cbe3a4e30e99
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Have two x2many lists in a group in a form view. Increase the
width of a column in the first table. Before this commit, the
second table was also expanded.
task-2189968
closesodoo/odoo#47652
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
1. Install eCommerce
2. Enable Pricelist settings
3. Choose a product P and enable it in the ecommerce view
4. Create 2 pricelists, for P with:
- PL1: One with "Benelux" as country group with a price of X
- PL2: One with a price of Y
5. Assign PL2 to the portal user (Joel Wilis) through "Website > Customer"
6. Connect as the portal user
7. Go into the ecommerce page of the product P
The pricelist PL1 is used instead of PL2, this occur because
geoIp localisation take priority over customer assigned pricelists.
Fixing filter by allowing pricelist with no country defined to be used
opw-2242152
closesodoo/odoo#51115
X-original-commit: aab3c03b2bdab97796e678d3f876ff64d5ecc4d9
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
The properties must always be accessed using the company of the journal entry defined by
its journal.
closesodoo/odoo#51094
Task: 2244829
X-original-commit: bf416d95b1216c5780d3dbeaa32f0e57dc50c574
Related: odoo/enterprise#10543
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Since January 2020, users are required to validate their IAP account via
SMS code validation. This new behaviour needed to be properly ported to
the client to correctly inform the user.
This commit adds support of a new failure_type: 'Unregistered Account'.
Task #2209567closesodoo/odoo#48512
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Some country names were not properly handled by the provider.
closesodoo/odoo#51134
X-original-commit: 285d5d65c3c04a12db399000566c8658306622f9
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Introduced in 7daa85dd, in kanban view .value on a number is formatted
and raw_value is the raw value, so if we had an product.image with ID
like 1000 we could have an query argument `id=1,000` which would result
in server error.
opw-2229427
closes#51105closesodoo/odoo#51133
X-original-commit: 84294948a4cc248e8c4e26f8ea93e2ff67435bb1
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
- Go to Sales > Configuration > Settings
- Activate "Variant Grid Entry"
- Go to Products and edit a product with variants (lets call it "Product A")
- For "Sales Variant Selection" in "Variants tab", choose "Order Grid Entry"
- Go to Sales > Orders > Quotations and create a quotation
* Add any product except "Product A"
* Add another product except "Product A" and the previous one
* Switch the 2 added products with the sequence arrow widget.
It allows to be sure that the 2 added products have 2 different sequences.
* Add "Product A" with 1 attribute
- Here there are 3 products in the quotation with "Product A" at the third position
- Save the quotation
After the save the position of "Product A" is not the same anymore.
The bug comes from the fact that when using the matrix configurator, no sequence is provided
and the product is added with the default sequence of the SO line which is 10.
The issue is fixed by checking the sequence of the previous SO line if there is one.
[All of the above steps and explanations can also be applied to Purchase]
opw-2221991
closesodoo/odoo#51112
X-original-commit: 1a2d7e3fa0f33d90c74d3fd5a5ef486b56d8f512
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>