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>
- 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>
Let field F of model M be a Selection field.
Before this commit, creating a database with field F, removing/renaming
field F by changing its definition within the code then upgrading the
database to reflect the changes would result in a registry crash because
the field would still exist in the database but not in the ORM (memory),
thus trying to fetch the field in DB from the memory would result in a
KeyError.
This is due to the fact that field renames / removals are not stable
operations and should be handled with a migration script when upgrading
an existing database, nevertheless this can be quite an annoying
behavior while developing which is why this commit simply skips the
processing of the field if it does not exist in memory.
The ORM already foresees these cases and logs a warning to the developer
saying that the field was deleted anyway but that it was only a
partial delete and that it should be handled in a migration script in
order for the change to be production ready.
closesodoo/odoo#51099
X-original-commit: a54fecc35386f8e00018ff3d858b383d43f1dded
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
`**` rules for `py` files in `mail` and `sms` were not working as expected: they
only matched files directly inside the folder, without any depth. Indeed
`gitignore` syntax specifies that a slash must follow the double asterisks.
Doc: https://git-scm.com/docs/gitignore#_pattern_format
Added `rd-sm` to the various mail test folders, and removed `rd-discuss` from
`test_mass_mailing` specifically.
Specified which files are to be observed in `tools` for `rd-images`, as it would
otherwise generate too much noise.
closesodoo/odoo#51019
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
In a form view, have an x2many list with two fields A and B (e.g.
A is a many2one, and B is a char). There is an onchange on the
x2many that is triggered when the user sets A, and that sets B.
In this scenario, let's assume that the user first writes something
in B, but directly deletes it. Then, he sets A. Before this commit,
in this situation, B wasn't updated with the value returned by the
onchange.
Indeed, B's field widget was still flagged as 'isDirty', because
the user interacted with it, but it didn't commit its value, as it
hasn't actually changed. Basically, it remained flagged as 'isDirty'
forever, and thus couldn't be updated with the value returned by
the onchange.
This commit ensures that the 'isDirty' status is correctly updated
when the change is actually undone.
Task 1958793
closesodoo/odoo#51085
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: pka-odoo <pka@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
In a form view, have an x2many list with two fields A and B (e.g.
A is a many2one, and B is a char). There is an onchange on the
x2many that is triggered when the user sets A, and that sets B.
In this scenario, let's assume that the user first writes something
in B, but directly deletes it. Then, he sets A. In this situation,
B isn't updated with the value returned by the onchange.
Commit [1] is an attempt to fix this, but it actually broke what
has been done in [2]. However, tests of [2] still passed, because
they didn't accurately reproduce what happens in practice (outside
the test environment).
An input field widget listens to 'input' and 'change' events. It
commits its value when both occur, but in the 'input' case, the
action is debounced with a large value (so that it actually only
commits the value on 'change', i.e. when the field is focusset
out). In the tests, the debounce value is 0, so fields actually
commit their value directly when 'input' events occur. This is
something we may want to change in the future, to remove this
discrepancy.
This commit adds a test with a large debounce value, so that we
accurately test what happens in practice, and we make sure that
this won't be broken in an attempt of fixing something else.
[1] cdca11db2ec207363df1d4fb3c87014d9c931d25
[2] a71f223702
Related to task 1958793
Due to cache records being used in onchange currently virtual records are
added in onchange, leading to some members being duplicated when moderation
is used on channels.
Spotted in task ID 2238597
closesodoo/odoo#51104
X-original-commit: be6f169edab705a1a89bdc16cf3a1ac60b217c14
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
For most localizations, decreasing quantity of an orderline is
prohibited. This commit generalizes this behavior and is now available
in core point_of_sale.