Before this commit, the SSF would only set up edition views on o2ms at
the toplevel. This usually isn't an issue, but in some cases involing
onchanges on o2ms which themselves contain o2m, odd results could
happen as the second level would try to list the sub-o2m's fields in
order to cleanup its (possible absence of) values (cf the `subfields`
local variable in _cleanup_onchange), which would blow up due to the
missing `"edition"` key.
Fix by recursively processing o2ms and setting up their edition view.
Also fix the fields iteration in fvg processing: don't recurse inside
fields. There still is no support for embedded views (I think?) but we
should not try to treat subview fields as view fields, that could have
very bad results.
closesodoo/odoo#28645
As stated in issue #27752, some Debian packages are only recommended.
As a consequence, these packages are not installed on the Official
Docker image. In that case, if the user wants to install an Odoo module
that needs one of these package, the Docker container has to be
modified.
python3-qrcode and python3-vobject are now part of the latest Debian
stable (stretch) and the latest Ubuntu LTS (Bionic Beaver).
Also, they are pure python, and very small.
Thus, the Debian package can depends on them.
co-author: @sbidoul
Fixes#27752Closes#28588Closes#28371Closes#28372
Put the browser in timezone Sao Paulo (Or like West of UTC)
Trigger the autocomplete (and the subsequent search) on a date field
by writing a date (in the locale format) in the search view
Before this commit, the domain sent to the server contained the date as the day
**before** the one asked for in the input
This is because, the string input is parsed and gives:
input = 12/02/2018
When creating the moment object:
> since there is no explicit time, moment will interpret it as 12am (midnight)
> We force moment to consider the string as being UTC (function: moment.utc())
> the moment contains, as output the time ** 2018-02-12T00:00:00 UTC **
When getting the facet value for making the domain
> we call toDate on the moment object, which, according to the browser is UTC and will
be converted to the locale timezone before formatting
> And the domain will use the date 2018-02-11T22:00:00 Brazil/SaoPaulo
which gives the day before the one we asked for
After this commit, this issue doesn't arise, because we use the string representation of
the moment object in search_inputs (i.e 2018-02-12T00:00:00 UTC), to create a new one
*BUT* we create it with a date format that excludes the time from being interpreted.
Also, the resulting moment object in this case is not flagged as UTC anymore
OPW 1903224
The file relation_fields_tests.js was a huge 12K lines files for which some editors have a
hard time managing.
We have split it in 4 files to be more managable and removed remove unused data
and import.
closesodoo/odoo#28561
The `context.company_ids` variable seems mostly empty in the case of the
Manual Reconciliation widget. Therefore, we fetch the current company of
the user in the session.
Complement of e5c8071484Fixes#28270
opw-1904475
closesodoo/odoo#28541
Be in the timezone Australia/Brisbane
On an object, create a Meeting activity
Create the calendar event and set a start date "tomorrow" at 7:00am
Now go back to the object to see the activity
Before this commit, the activity appeared as due "today"
After this commit, it is due "tomorrow"
OPW 1891110
closesodoo/odoo#28576
Firefox when asked to block format (formatting over a block with
blockquote, h1, ...) has a special case for blockquote (it is documented
in https://developer.mozilla.org/docs/Web/API/Document/execCommand at
formatBlock command) and will wrap any element instead of replacing
existing block formatting.
Thus the code not expecting it was not able to remove a blockquote in
firefox once introduced.
opw-1903735
closes#28587
When we for example do ctrl+a in firefox, the selection is over the
container and not the content.
This is an issue when we apply a format, since the container could be
removed.
eg:
we have selection over `<pre>hello</pre>`, on firefox the selected
node is `pre`, on chromium it is `TextNode "hello"`.
if we remove the style, `pre` is deleted so firefox selection is
broken, whilst chrome has no issue since "hello" still exist.
There was also an issue when the selection was over the blockquote,
there was no error but the style could not be removed.
opw-1903738
opw-1903735
closes#28369
The hr_presence module recently introduced adds
a hook on the bus controller in order to execute
its very important and legally business, but this
hook brings an error as it forgot to propagate the
bus options.
Consequence: the bus_inactivity, responsible of the
bus.presence are not pass to super. So all user
appears offline.
closesodoo/odoo#28531
There was a code that on:
- a form that sent a mail
- with a custom file field
would set the file as attachments, but the code was dead because of a
typo in `if` statement order.
opw-1906883
closes#28525
In mail template a link with reference such as:
${object.user_id.signup_url}
are often used.
These are template directives that are replaced when the mail is saved,
so when editing in the editor and they are prefixed by "http://" this
breaks the link which is not wanted.
Now link beginning with `${` are not prefixed anymore to prevent
shooting oneself in the foot.
opw-1906695
closes#28522
In order to understand more easily the impact of an opt out
or a blacklisted contact on the interface, blacklist and
opt-out demo data are added.
Tests updated to only test mails on contacts created inside
the test environement and not with demo data.
Task ID 1892998
Closes PR #27674
Before this commit, you could only access the activity view of the
Contacts app via the activity icon in activity systray menu.
With this commit, all apps in the activity systray menu that support
the activity view now have this icon that redirects to the
corresponding activity view.
Also, the icon in the activity systray menu has been changed in order
to match the icon of the activity view in the view switcher.
Task-ID 1894900
closesodoo/odoo#28066
This reverts commit c42a130a98
and commit fb7ac56d65.
The runbot is using cross db logging and those commit were breaking the
mechanism. As a result, the master builds logs were empty.
If we update the runbot to use logging_type instead, the other versions
builds will be impacted hence this revert.
closesodoo/odoo#28512
If cost(purchase_price) was 0, margin calculation was incorrect.
The function _product_margin didn't consider the use case
where the cost of the product was set to 0 on the line.
So before the fix it fallback on standard price instead of considering a cost of 0.
opw:1890452, 1885587
- When creating an eCommerce cart using the Public User, the code tries
to access all the sale orders linked to it.
Depending on the count of sale orders linked to the partner, the
loading can take a lot of time.
To avoid this, we only search for the sale orders of connected users
and we only retrieve the last one.
PKG-INFO is generated during the setup phase and is not needed anymore.
Also this file contains outdated informations.
py2exe is not used anymore to build the windows installer.
closesodoo/odoo#28494
c5dc0b2f39 disabled send button on composer sent.
But this is only needed for chatter composer, other composers directly
send the message and are not refreshed asynchronously.
So for other composer, the send button worked one time but then was
disabled and the only way to sent was ENTER (on basic composer) or
CTRL+ENTER (on extended composer).
With this fix, disabling the button is done only for chatter composer.
11.0 backport of 12.0 #28474
issue found when checking opw-1904029
closes#28506
Fine tune the module to improve the business flow:
1/ Allow to force the presence of an employee
2/ Don't notify followers when sending a email
3/ Open the leave request form instead of the leaves list
closesodoo/odoo#28483
On a hr.leave creation on the form view, the fields request_date_from and
request_date_to are set on today. The fields date_from and date_to are set on
now.
We have 2 onchange methods:
- _onchange_request_parameters: Set date_from and date_to according
to the leave configuration.
- _onchange_leave_dates: Set number_of_days according to date_from
and date_to
As _onchange_leave_dates is called before _onchange_request_parameters,
the field number_of_day is always set to 0, even if the leave is taken
for all the day (the default value).
It means that if you don't modify the dates, the value stored in the
database is incorrect.
We have to call manually the method _onchange_leave_dates at the end
of the method _onchange_request_parameters execution to ensure
the validity of the value.
In the compute function _compute_move_without_package, we use self
instead of picking variable, which leads to traceback when more than one
picking is computed
closesodoo/odoo#28482
Purpose
=======
1/ A team leader is not able to validate leaves for his own team.
2/ Another person than the manager can be supposed to validate the leaves for a certain employee
Specification
=============
1/ New hierarchy: Team Leader < Officer < Manager
People in Team Leader access group will now be able to approve leaves for employees in their team.
- Added the new access group
- Added rules for people in this group to read or write appropriate records
2/ Add 'leave_manager_id' field on employees to refer to the Team Leader.
- Added the new field to Employee model
- Added the field to the view so that it is visible
- Modified a filter in a view so that it is more relevant according to its name (My Team Leaves)
- Added a filter in a view for managed employees
TaskID: 1888653
closesodoo/odoo#28352
When loading the Reconciliation Widget, all reconciliation models are
retrieved. This is not correct: only the one matching the company and
the journal should be retrieved.
Fixes#28270
opw-1904475
closesodoo/odoo#28474
Consider the generation of an invoice for a SO having the following lines:
quantity | unit price | taxes | subtotal
----------------------------------------
1 | 100 | 15% | 115
1 | -110 | | -110
Previously, the invoice wrongly received the type 'out_refund' instead of 'out_invoice'. This was because the code was only considering the untaxed amount.
Closes#28259Fixes#26726
Co-authored by pedrobaeza
Purpose :
=======
On the Contract form view the field label for the "contract type" is "Employee Category".
Then it will be good if we keep the same label on the group by also...
Right now on the Group By it is "Contract Type"
closesodoo/odoo#27560
Before this commit, when there was several previews
on the messaging menu that were not linked to any
document, marking one of them as read had the unintended
behaviour to mark all of them as read.
Steps to reproduce:
- Admin with notification management as 'Handle with Odoo'
- Demo assign Admin to two different tasks
- Admin mark one preview as read
> Both previews notifying assignment to a task have been
marked as read
This is caused by the fact that messages of those previews
are not related to any document. As a result, when marking
one preview as read, it maps related messages to mark as
read, which was taking into account all messages that are
not related to any document.
With this commit, previews now tracks message IDs, so that
marking one preview as read only mark the related messages
as read.
Task-ID 1907159
Before this commit, when the user clicked on a preview in the systray
messaging menu that is not linked to any document, there was a
traceback.
Steps to reproduce:
- Admin sets notification management to "Handle with Odoo"
- Demo user assigns Admin to a task
- Admin clicks on preview from being assigned to a task
Those are previews from notifications received from the inbox,
which are not related to any document. It attempts to open a
document that does not exists (i.e. no model/id).
With this commit, when such a preview is not linked to any
document, it now opens Discuss with Inbox.
Task-ID 1891350
Before this commit, if you ask for a small image, you was waiting a picture of
64x64 but in case this image was not found, a placeholder with an other size
was returned.
Now, we try to guess the asked size, and return a resized placeholder.
This bug appear since we change the default placeholder picture with a big one
This will fix several issue and avoid to hard code size everywhere in the code
Eg: commit 92f837c and commit https://github.com/odoo/odoo/commit/154fc7d9dd550d35b7266af024e54c20e18938fc#diff-9af1af2039d16d6b544d481b4ee1ed7cR144closesodoo/odoo#27695