When we "Install Newsletter Popup" from website editor
(which installs the 'mass_mailing' app), the snippet popup
doesn't open after setting a Newsletter.
This is because the code at 'website_mass_mailing' module
which has the following config:
'depends': ['website', 'mass_mailing'],
'auto_install': True,
Requires 'google_recaptcha.ReCaptchaV3' while 'google_recaptcha'
module is not installed.
The goal of this commit is to fix this issue by setting
'google_recaptcha' as a dependency for the 'website_mass_mailing'
module.
task-2312878
closesodoo/odoo#62715
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
before this commit: smiley box popover in rtl langauge takes full space it is
because of left:0 given on o_popover class by default, which will be converted
to right:0 when in rtl language and popover position will computed by popper
will set left:'some pixels' due to which it takes full space.
after this commit: smiley box will be displayed with expected width,
unnecessary will not be added, as we have removed left:0 css, hence it will not
be converted to right:0 when in RTL mode.
task-2418264
closesodoo/odoo#65419
X-original-commit: 0bd842ad62901499abb703c92b15496cdfa05cc0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
As user access the ecommerce and add to cart a free product (0$ total)
Checkout and Confirm
No email will be sent for confirmation
This occur because the confirmation email is normally sent in the
transaction callback, which is not created when the amount is 0
opw-2440335
closesodoo/odoo#65235
X-original-commit: ed3e69df1564eca3becdc57181608bc0211ca4c5
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Fine tunning of c8f031ad77, this commit has the missing code
compatibility for sms_calendar.
closesodoo/odoo#65064
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This PR adds two main features: quick edit and auto save
Quick Edit
---
The quick edit allows to click on fields in readonly form view to switch
into edit mode. After switching mode, the clicked field is automatically
focused.
A few fields have a custom quick edit behaviour after mode switched:
- checkboxes automatically toggle.
- radio buttons are set to the selected value.
- one2many list's cell are focused.
One2many list fields now show the "add a line" in readonly mode.
In order to minify the differences between edit and readonly modes
multiple things have been done done:
- a lot of `o_edit_only`,`o_read_only` labels have been removed and
`placeholder` have been set on fields in a lot of xml templates.
- the render function of many2one and x2many radio
fields have been changed to render them the same in edit mode and read mode.
- margins in inner form groups have been removed.
- a minimum height on rows has been set to align them.
- empty fields are now visible. (as a blank line)
Auto Save
---
Auto save is self explanatory.
With auto save, changing the pager, going back in the breadcrumb,
going to another action or clicking on a menu item doesn't ask to
confirm changes if any but automatically saves them.
In settings, the confirm dialog has been revamped.
We can now decide to "Save" or "Discard" the changes or "Stay Here" to
do nothing.
closesodoo/odoo#60693
Related: odoo/enterprise#14931
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps:
- Edit the current company (1):
- Country: Switzerland
- Currency: CHF
- Install l10n_ch
- Go to Invoicing > Configuration > Bank Accounts
- Edit Bank:
- Bank Account: create a new one:
- Account Holder: (1)
- Go to Configuration > Journal
- Edit Customer Invoices:
- Advanced Settings tab:
- Communication Standards: Switzerland
- Go to Customers > Customers
- Create a new customer (2):
- Fill in street, city, zip code and country
- Edit (2):
- Contacts & Addresses tab:
- Add:
- Select Invoice Address
- Contact Name: Keep this field blank
- Go to Customers > Invoices
- Create a new one:
- Customer: "(2), Invoice Address"
- Add a product
- Validate it
- Click Print QR-Bill
Bug:
Traceback here:
https://github.com/odoo/odoo/blob/b76e9ef658bde0178fa1660b6ad27b880e91632a/addons/l10n_ch/models/res_bank.py#L129
TypeError: 'bool' object is not subscriptable
Explanation:
The contact name of an address is optional. When nothing is filled in
that field, it returns `False`, hence the error.
Using the commercial company name ensures a name is put in the invoice,
even if the contact doesn't belong to a company.
opw:2447158
closesodoo/odoo#65417
X-original-commit: 2537bb01675279f08edf65077e6d41a5bd968ec4
Signed-off-by: backspac <backspac@users.noreply.github.com>
This commit makes the field html quick editable.
We can click on a field html to switch the form view to edit mode but
if we click on a link in the field, the link will have the priority.
task 2330101
This commit adds the quick edit behaviour.
The quick edit allows to click on fields in readonly form view to switch
into edit mode. After switching mode, the clicked field is automatically
focused.
A few fields have a custom quick edit behaviour after mode switched:
- checkboxes automatically toggle.
- radio buttons are set to the selected value.
- one2many list's cell are focused.
One2many list fields now show the "add a line" in readonly mode.
task 2330101
This commit adds the auto save for editable list and form views
but not for settings.
Now with auto save, changing the pager, going back in the breadcrumb,
going to an other action or clicking on a menu item won't ask to
confirm changes if any but will automatically save them.
In settings, the confirm dialog has been revamped.
We can now decide to "Save" or "Discard" the changes or "Stay Here" to
do nothing.
task 2330101
This commit does 4 things in order to reduce the shift when switching
mode in form view:
1. modifies the render function of many2one and x2many radio
fields to render them the same in edit mode and read mode.
2. removes margins in inner form groups.
3. sets a minimum height on rows to align them.
4. empty fields are now visible. (as a blank line)
task 2330101
* account, analytic, calendar, coupon, crm, crm_iap_lead_website,
delivery, digest, event, event_crm, fleet, gamification, hr,
hr_expense, hr_skills, im_livechat, lunch, mail, maintenance,
mass_mailing, membership, mrp, point_of_sale, pos_mercury, product,
purchase, purchase_requisition, sale_management, sales_team, sms,
stock, stock_landed_costs, survey, website_crm_partner_assign,
website_event_exhibitor, website_event_track, website_forum,
website_slides, base
This commit removes oe_edit_only labels and adds placeholder
on fields in form views from a lot of apps to minimize the
shift when switching mode.
task 2330101
Right now, the 'CRM > Reporting' menu is accessible only to the sales
managers. However, we should let users of all access right levels to
see their reporting while making sure it does not give them access to
data that does not match their rights.
This commit thus changes group applied on 'CRM > Reporting' menu from
'sales_team.group_sale_manager' to 'sales_team.group_sale_salesman' so
that from sales person to manager, everyone is able to the reporting
based on their rights.
For the below sub-menus, record rules already exist, preventing data breach:
- Dashboard (crm_enterprise)
- Leads (crm)
- Pipelines (crm)
- Activities (crm)
However, for data under 'Partnership'(website_crm_partner_assign) and
'Lead Generation Views' sub-menus(crm_iap_lead_website), we introduced
the needed access rights / record rules to ensure basic users can only
see the data they have rights for.
TaskId - 2357311
closesodoo/odoo#64202
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Commit [1] adds an override of the getFocusableElement of
AbstractField in FieldRadio, but this function was already defined.
Even though it doesn't crash, this is obviously not something to
do. This commit removes the first occurence (which was overriden
by the second).
[1] https://github.com/odoo/odoo/commit/ebe118fc607391737adc37e18c3278a3d2c87b5eclosesodoo/odoo#65388
X-original-commit: 8b014a57a1930dfc69f14254564af8a43eff9845
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Commit [1] improves the focusout case of the Many2One field: if
the user typed something in the input that matches some records
(i.e. if there are records in the suggestion dropdown), the first
one is automatically set.
The Many2ManyTags field internally uses a FieldMany2One. However,
the same scenario inside a Many2ManyTags crashed. The reason is
that we sent the wrong value in this case (an id, instead of an
object).
[1] https://github.com/odoo/odoo/commit/1d4d2a6closesodoo/odoo#65386
X-original-commit: e3cf207ecaae2785f7d0e8e3afa0fe45c9d6b88d
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
A former constraint made it impossible to import bank statements with lines = 0.
The task #2403369 removed that constraint.
But the user could no longer reconcile Bank Statement Lines = 0.
Drawbacks :
- The user is then blocked when setting a lock date.
- The bank statement remains endlessly in Status Processing
A previous fix made a bank statement line = 0 immediately reconciled.
Closes task #2449127.
closesodoo/odoo#65359
X-original-commit: ee4f7df8d34593bdde3fc6f9bd062f6dad238fcb
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
The name of your first customer invoice is a configuration that
determines the next ones. The problem before is that when you
confirmed a first invoice, you could not alter its document number
anymore. With this commit, as long as it is the first invoice,
you can still change the document number when you reset to draft.
closesodoo/odoo#65341
Related: odoo/enterprise#16058
Signed-off-by: Josse Colpaert <jco@openerp.com>
- Some errors will never get fixed until user intervention, it doesn't make sense to run the CRON when there is such error.
+ some small improvements and esthetic changes
- When we are in a CRON, we need to commit the changes between each call to web-service to avoid loss of data.
- Small refactor of edi.document prepare_jobs and process_jobs
- Added an arbitrary key to create the batches.
We have a 'Title' many2one fields while adding contact of a
partner. However, being a regular m2o field, it's clickable
and sometimes users land on form view of title which not
really useful.
This commit adds 'no_open' field option for 'Title' field to
make it non-clickable.
TaskId : 2446112
closesodoo/odoo#64984
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commits adds a few digest tips concerning the website
customization and shortcuts in timesheet. It also changes
sequence of one.
Add css selectors to include button inside the digest tips,
matching existing style: no underline, white text on odoo
purple button.
PR #63784
Task-2341722
Related: odoo/enterprise#15478
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Usecase to reproduce
- Create a KIT with COMP A (15$) COMP B (25$)
- Enable Margin on SO
- Set the cost on the KIT with compute cost button (40$)
- Create a quotation with the KIT (cost is correct 40$)
- Confirm the quotation -> Cost is updated to 15$ (first component)
It happens because the function to compute the average price doesn't
expect a kit and compute everything from the valuation layer of first
component
opw-2413246
closesodoo/odoo#65301
X-original-commit: 827f65f70634ba7a2e4175f20e5301e514ada0a0
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
# Purpose
Add the currency symbol in the message for the monetary tracking field.
For example, if we have a record with a monetary field displaying
"$ 500". If we modify the currency and the value to have "450 €",
the message containing the tracking values will display:
"500 € -> 450 €".
# Specifications
Add the currency symbol for the monetary tracking field to better
represent the change of a monetary field.
The currency will be fetch from the currency defined in the
monetary field or on the record's company in case there is not.
We only use one field to track the currency of a monetary field.
Indeed, in the case where the currency is changed with the value
of a monetary field, only the new currency is tracked. We focus
on the fact that the more important thing is the new value.
Furthermore, when modifying a currency of a monetary field, the
user can already see the new currency before saving the changes.
This allows him to adapt the value of the field if he needs it.
(N.B. we assume that this case will happen very rarely)
Using only one field takes also into account that there are
millions of record for this model and adding a new field would
take a lot of memory.
task-2387268
odoo/upgrade#2060closesodoo/odoo#61999
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Some tests sometimes require some more queries to be finished.
Task ID-2444908
closesodoo/odoo#65379
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Add the currency symbol for the monetary tracking field to better
represent the change of a monetary field.
The currency will be fetch from the currency defined in the
monetary field or on the record's company in case there is not.
For example, if we have a record with a monetary field displaying
"$ 500". If we modify the currency and the value to have "450 €",
the message containing the tracking values will display:
"500 € -> 450 €".
We only use one field to track the currency of a monetary field.
Indeed, in the case where the currency is changed with the value
of a monetary field, only the new currency is tracked. We focus
on the fact that the more important thing is the new value.
Furthermore, when modifying a currency of a monetary field, the
user can already see the new currency before saving the changes.
This allows him to adapt the value of the field if he needs it.
(N.B. we assume that this case will happen very rarely)
Using only one field takes also into account that there are
millions of record for this model and adding a new field would
take a lot of memory.
odoo/odoo#61999odoo/upgrade#2060
task-2387268
This should be a smarter and properly reliable version of #42071: in
that, the runner requests a port, closes it, and gives the port to
Chrome. However this apparently turns out to be less reliable than
hoped for and the port we just released can immediately be picked up
by somebody else (the original PR assumed the allocation of ephemeral
ports would be random or FIFO but that may not be the case, especially
inside containers).
This uses the same technique of requesting port 0 so the OS allocates
one, but it's Chrome requesting & immediately connecting so there
should be no race condition possible, and we keep the property that as
long as ephemeral ports are available Chrome will be able to open one
without conflicts or overlaps.
This leaves the issue of *retrieving* the port chrome got. Thankfully
it turns out we use a custom user-data-dir in which case Chrome writes
the port it got to `$DATA_DIR/DevToolsActivePort`[0]. Despite the
file's name it *also* contains the path for the devtools endpoint so
we need to only read the first line (rather than be able to read and
intify the entire thing).
Wait up to 10s before giving up entirely, and wait 100ms between each
check for the file's existence: on my machine without significant load
the file appears after 80 to 150ms, waiting up to 90ms seems ok (it's
not like we're in a super hurry as tours tend to be pretty long).
Other paths explored before moc used his eyes and brain and found out
about DevToolsActivePort:
* Chrome prints ws URL on the stderr, however because we don't know
how much garbage Chrome might send there we need to send it to a
continuous sink otherwise Chrome *might* end up blocking on its
stderr because we're not reading from it. This turns out to be a bit
of a mess of processes or additional threads.
* xdo suggested we check what ports Chrome listens on using something
like netstat/ss (turns out `psutil` has support for that OOTB),
which worked great except on WSL (where it didn't work at all), and
the future-proofness was a bit questionable as Chrome might add
other servers in the future.
* fme suggested using socket activation support[1] and passing in the
port we'd opened without closing it, which would really have been
ideal, however it turns out it was removed a few months later when
chrome added pipes support[2], which was a pain to realize as chrome
doesn't exactly do any useful error reporting (so unknown options
just disappear into a void to be never seen or heard of ever).
* And while the pipes system[3] has *serious* positive attributes
(even lower initialization overhead, we could remove the websocket
dependency, also avoids wasting sockets though that's not too much
of an issue here) it would require rewriting a lot more than just
the initialization as it uses its own logical protocol
(NUL-terminated JSON). TBF most of the messaging stuff is properly
contained into just a few `_websocket` methods but still...
[0] https://bugs.chromium.org/p/chromium/issues/detail?id=624837#c4
[1] https://bugs.chromium.org/p/chromium/issues/detail?id=624837
[2] https://chromium-review.googlesource.com/c/chromium/src/+/954405/3#message-ab7415a7db7b94787300d987216e9ce60db47bc2
[3] https://chromium-review.googlesource.com/c/chromium/src/+/954405/3
opw-2378464
closesodoo/odoo#65195
X-original-commit: b679d97a83f1ac898ee0916e92a5b440702bdcdf
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Co-authored-by: Xavier Dollé <xdo@odoo.com>
Co-authored-by: Christophe Monniez <moc@odoo.com>
before this commit: listview buttons on row can be clicked twice due to which
action may trigerred multiple times.
after this commit: listview row button handler is debounce with 500 miliseconds
so that even if user clicks same button multiple time too quickly action is not
trigerred multiple time.
task-2391298
closesodoo/odoo#62217
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps to reproduce:
1. Go to Project App
2. Open and edit a task
3. Click on Customer => search more
5. Click on "Filters"
6. Click on "Group by"
=> The "Filters" and "Group by" dropdown are open at same time => bug
Since odoo/odoo@e4f87710e1, we added a way
to prevent bs and owl dropdown to be open in the same time.
But when the web-editor is present, the CSS selector used to match the
opened modal ("search more" in this case) conflicts with the DOM created
by the web-editor (modals identified by the classes: .web-editor,
.note-picture-dialog, .note-link-dialog, .note-help-dialog).
To avoid this conflict, this commit uses a more restrictive CSS selector
to match only the first (active) opened modal (as web-editor doesn't
attach its modals at the root of the body).
closesodoo/odoo#65358
X-original-commit: 7cb24db622b231b89558755d9c0e7d899fc994bf
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
This commit of merge fix multiple issues in the dynamic routing.
Fix RequestUID error in 308 redirect
Support MissingError / unexisting ID in 308 redirect
Correctly rewrite url on rendering by url_for for non editor user
Related to opw-2420562
closesodoo/odoo#65349
Forward-port-of: odoo/odoo#64397
Forward-port-of: odoo/odoo#64328
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
When using the windows installer in French language, the `Hôte` label
used to configure postgresql server does not display correctly.
The LangString documentation does not specify how to use the special
characters but after some tests, specifying a BOM for the nsi file seems
to be the way to go.
closesodoo/odoo#65370
X-original-commit: 3d0871d1d5895f0f04175f2633344f2f1b05a081
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Increase the distinction between a journal entry linked to a bank
statement line and another one linked to a payment by adding a smart
button linked to them.
Also improve the navigation from the Bank And Cash view to directly
open the linked bank statement line or payment.
Task id #2448618closesodoo/odoo#65316
Signed-off-by: William André (wan) <wan@odoo.com>
2021-02-01 16:58:25 +00:00
Jeremy Kersten"Romain Derie <rde@odoo.com>""Jeremy Kersten <jke@odoo.com>"
Basic tests & tests of the 3 fixes of #64328
Be sure that we have a beautiful error page and not a black/white error
Be sure that slug_matching with 308 redirect works as expected and don't
raise a RequestUID exception.
closesodoo/odoo#64889
X-original-commit: 3af11f0b6db0efb6c912b25bcd04d2cbe9a07d57
Co-authored-by: "Romain Derie <rde@odoo.com>"
Co-authored-by: "Jeremy Kersten <jke@odoo.com>"
Before this commit, a 308 on a route with a modelconverter for a model
that have a seo_name field will crash with an exception:
Cannot iterate on RequestUID
Another simplest solution was to use a with_user(SUPERUSER_ID) but in this case
it bypass the security set and display the name of the record even if not yet
published.
How to reproduce:
Create a 308 from /shop/<product> to /mag/<product>
Unpublish product 10
Try to access /shop/product-10
You have an unmanaged '500 internal error"
because slug_matching -> build -> to_url -> slug with a record with Requestuid
as env._uid.
X-original-commit: 4ac2cab96655a3c5e673b0a04be5599dba507850
Before this commit the Dynamic Products snippet was displaying a message
box instead of its content until its template and product category were
selected.
After this commit the Dynamic Products snippet is automatically
configured on drop with the first available template and the first
available product category. The message box only appears if no product
category exists yet. Also an "All Products" category was added as first
element of the list to make the snippet usable before categories are
defined.
task-2439295
closesodoo/odoo#65342
X-original-commit: db3ced474e44b5a8188f0d77521bfcaee2575060
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
When a user on website sends livechat feedbacks:
- Good -> send an average smiley 😐
- Average -> send ?? instead of smiley
This is because in e4a4ffb value of good (😊) was changed from 10 to 5,
and value for average (😐) was changed from 5 to 3, but it was not
reflected in one part of the code.
opw-2447246
closesodoo/odoo#65338
X-original-commit: 45ea88e58d2a834da4c5ad8ff656481ac1f9ab5d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
In backend, we may want to use tags for advanced use cases like reporting,
filtering, aggregating in spreadsheet, ... However right now we cannot
define tag categories dedicated for 'internal use only'.
Similar to eLearning, this commit introduces facility to decide whether or
not to show the tag categories on the website. It is based on website.published
mixin. is_published field will be used for taht purpose. ACLs are updated
accordingly. If the category is hidden from the website then it is used for
internal purpose only.
In order to make all the events menu together, this commit moves the
'Event Tags Categories' menu after 'Event Stages'.
COM PR odoo/odoo#63485
UPG PR odoo/upgrade#2088
Task Id-2300230
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This patch complements the previous one by ensuring that any
`cache_invalidated=True` flag inherited from the master process
(pre-fork mode) cannot trigger a cache clear.
This could occur when the first request is served, because the flag was
never clear in the master process, which never server any request.
At the end of `check_signaling()`, the local cache has either been
cleared because a (real) increment of the cache sequence was detected,
or it is considered still valid. The final state of the
`cache_invalidated` flag should reflect this, by being `False`.
closesodoo/odoo#65346
X-original-commit: 3585c2c38955ece4292da77de7173fb31a6992ba
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
During loading, the registry clears all `ormcache` data multiple
times, in order to ensure consistency with the newly loaded module
data.
Since 083c70bbb6, this was done by
calling `self.clear_caches()`, with the side-effect
of signalling to all other worker processes that the cache
*needs* to be invalidated, which is actually untrue.
If the other workers have any reason to reload their own registries,
they will also clear their own cache in the process - there is no
need to forcefully invalidate it globally.
One could think that combining the pre-fork mode with the `-d <db>`
parameter would mitigate this issue, by making all workers inherit from
a fully loaded registry, In reality it doesn't work, because they also
inherit from the `cache_invalidated=True` flag, that was never cleared
in the master process. So despite having a fully loaded registry, the
newly forked workers will signal a cache invalidation upon serving
their first request.
Further, in a multi-tenant setup with large numbers of databases,
registries may be recycled and loaded much more frequently than
new workers are starting, due to the limited registry LRU, amplifying
this effect a bit.
~~
This patch directly clears the cache LRU without going through
`clear_cache()`, avoiding setting the `cache_invalidated` flag of the
registry, and thus not signalling to other workers.
This is similar to what was being done before 083c70bbb6,
where the LRU was dropped like all other lazy properties.
X-original-commit: 87aef4e3a36d92462454f51960abf7215c5ab7f1
- Go to Point of Sale > Configuration > Settings & enable "Cash Rounding"
- Configure POS:
* Enable Invoicing
* Enable "Cash Rounding" and "Only on cash methods"
* Select 0.05 HALF-UP Rounding Method
- Start POS session
- Select a Product and change its Price to a value that should be rounded (i.e. $ 16.51)
- Select a Customer
- Proceed to Payment
- Enable Invoice
- Select Bank Payment method
- Validate
No rounding is applied as expected, but the rounding line still appears on printed Invoice.
opw-2449222
closesodoo/odoo#65345
X-original-commit: d207a0fbe63c40eb879964ae6fb6c742d276fa5e
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
In order to make a wow effect right after DB install we enrich the base
company based on the given email address or company website at install.
In order to achieve that goal we use the partner_autocomplete service from
IAP. It uses free credits that are offered to new clients on saas platform.
Only the fields that are not filled yet are enriched to avoid erasing user
entered data, except logo. Indeed as partner_autocomplete is probably installed
as a core app (mail -> iap -> partner_autocomplete auto install chain) it is
unlikely that people already updated their company logo.
We consider that having a call to IAP consuming a token is ok for a standard
use case, especially that
* if no iap service is configured call to IAP won't add much timing;
* on Odoo SaaS free credits are given and company is enriched;
* on custom SaaS with custom iap service, at db creation probably no
credits are given and call will simply give no results back;
We decided to call IAP asynchronously at client web load. Session combined to
a boolean field on company model allows to do this call only once per company.
Doing this allows to avoid adding yet another post init hook. It also eases
behavior tweak through inheritance.
This call is limited to admin for obvious security reasons as well as
performance reason (limiting calls to external providers). As call will be
done once per company generally admin is the first person to log into the
its newly created Odoo.
In addition to enriching companies on the fly, we also enrich companies
when creating them. It allows to have an enrich on companies existing
before using autocomplete, and have results of enrich directly at create
for companies created after installing this module.
LINKS
Task ID-2322455
PR odoo/odoo#64600
PR odoo/upgrade#2086
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: David Beguin <dbe@odoo.com>
Co-authored-by: Thibault Delavallee <tde@odoo.com>
In addition to enriching companies on the fly, we also enrich companies
when creating them. It allows to have an enrich on companies existing
before using autocomplete, and have results of enrich directly at create
for companies created after installing this module.
LINKS
Task ID-2322455
PR #64600
PR odoo/upgrade#2086
Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
In order to make a wow effect right after DB install we enrich the base
company based on the given email address or company website at install.
In order to achieve that goal we use the partner_autocomplete service from
IAP. It uses free credits that are offered to new clients on saas platform.
Only the fields that are not filled yet are enriched to avoid erasing user
entered data, except logo. Indeed as partner_autocomplete is probably installed
as a core app (mail -> iap -> partner_autocomplete auto install chain) it is
unlikely that people already updated their company logo.
We consider that having a call to IAP consuming a token is ok for a standard
use case, especially that
* if no iap service is configured call to IAP won't add much timing;
* on Odoo SaaS free credits are given and company is enriched;
* on custom SaaS with custom iap service, at db creation probably no
credits are given and call will simply give no results back;
We decided to call IAP asynchronously at client web load. Session combined to
a boolean field on company model allows to do this call only once per company.
Doing this allows to avoid adding yet another post init hook. It also eases
behavior tweak through inheritance.
This call is limited to admin for obvious security reasons as well as
performance reason (limiting calls to external providers). As call will be
done once per company generally admin is the first person to log into the
its newly created Odoo.
LINKS
Task ID-2322455
PR odoo/odoo#64600
PR odoo/upgrade#2086
Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
In this commit we move iap functions onto a small tool model. It allows to
hide some details in a sub model. It also allows to define a mock that will
be used in tests afterwards.
LINKS
Task ID-2322455
PR #64600
PR odoo/upgrade#2086
Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
Steps:
- As admin, go to Settings > Users & Companies > Users
- Edit Mark Demo (demo)
- In Human Resources > Attendances, select Manual Attendance or blank
- As demo, go to My Profile
- Click the smart button showing the hours worked for the last month
- Remove all filters
Bug:
The demo user, who hasn't the rights to see the other employees
attendances, can see them.
Explanation:
Every user must have the right to read attendances in order to see their
own attendances. Not giving the users the read rights in the security
record rule prevents the record rule from being applied when reading
attendances. This makes the read access rights the only rule and allows
everyone to see the attendances of the others.
This commit also fixes the default selected employee when going to the
attendances tree view on these paths:
- User
- Employee
- User > Employee
In fact, sometime, `active_id` is the ÌD of the user and not of the
employee. This leads to incorrect results since another employee's
attendances are shown.
Finally, this commit prevents users from creating attendances from other
apps since only attendance officers and above can have access to the
creation form within the Attendances app.
opw:2440117
closesodoo/odoo#65334
X-original-commit: b3247c81200200590d669b76a58d06e6adf66d69
Signed-off-by: backspac <backspac@users.noreply.github.com>