It should be possible to use several transport mode between
- A company car
- A public transportation
- Another transport mode
This commit split the selection field into 3 boolean fields.
The payroll rules have to be modified too to take all the costs into account
on payslips.
Intellectual property rights guarantee their holders a temporary and territorially
restricted, exclusive exploitation of their intellectual property. This monopoly
stimulates innovations that are indispensable for economic growth, but can go against
the right of free competition which is indispensable for the free market economy.
It makes sense to display this piece of information on the employee contract.
It allows HR users to see users information about the employee company car without
having access to the whole fleet module.
This merge cleans a bit code called during notification process to avoid
browsing / prefetching unnecessary data and optimize a bit performances.
Please see sub-commits for more details.
All performance tests in test_mail are improved. On overall community
runbot about 13K queries are gained with this merge.
This merge is linked to task ID 1838693. Closes#24374. Please also refer
to commit https://github.com/odoo/enterprise/commit/0a3ba658f18e03fd76caba86cba7be32d047f0a9 done in enterprise
that cleans a bit mobile notification code.
Purpose is to lessen query count by avoiding to browse and/or fetch data when
not necessary. This commit does two main things
* first one is to avoid checking for existing statistics in mass_mailing
where only checking existing of a mass_mailing on a mail to send is
sufficient. It allows to avoid fetching data from statistics table;
* second one is to rewrite part of the post_process code called after sending
emails. Using list comprehension and mailing_id existence on mail_mail
allows to save several queries on standard post flows;
Most tests benefit from this code update. On overall community runbot about
3K queries are saved with those small optimizations.
mail_push module in enterprise was adding too much extra queries. mail_push
being auto-install in enterprise mail performance tests were done with its
overhead taken into account. Commit done in enterprise cleaned a bit the code
to lessen mail_push impact allowing to lessen some top counters. Community
runbot counters are now nearer enterprise-based counters.
This commit is related to enterprise commit https://github.com/odoo/enterprise/commit/0a3ba658f18e03fd76caba86cba7be32d047f0a9 .
Well, it seems we gain a lot of query when avoiding to format a message we
actually don't have to send on any bus. Cheers.
Formatting message for bus notification is quite costly as it has to fetch
data from message, partner, attachments, subtypes, ... meaning a lot of
queries. With this commit we avoid calling that method when not necessary.
It allows a gain of queries in simple cases when no-one has to be notified
as shown in the performance counters. On overall community runbot about 9K
queries are saved which is not bad for a 2-lines commit.
In some cases when subscribing followers code may ask to force subtypes
of the subscription. It means existing followers should have only asked
subtypes independently from existing subtypes. Previously it was done
by unlinking and creating new followers for same partner or channel.
This commit proposes to instead update missing subtypes and remove extra
subtypes.
It has a small impact in real life as forcing subtype is not done often.
Some tests are improved thanks to this commit. This commit is linked to
task ID 1839043. Closes#24417.
In order to make the module more userfriendly:
- Some labels have been changed/added
- The Commitement date is now called the Expected date
- The Requested date becomes the Commitement date
- The Effective date is now related to the picking `date_done`
Task #34343Closes#18325
In LESS, writing `100% / 4` gives `25%`.
In SCSS, to get `25%` the operation must be wrapped with parenthesis.
This commit is even using a better method: using the `percentage`
function.
Closes https://github.com/odoo/odoo/pull/24501
In order for the user to easily add the date of the events to his
calendar we need to facilitate the integration with Outlook/ Google
Calendar.
For this we add two buttons at the end of the subscription phase (one
for Google Calendar and one for Outlook [ics file download])
Task ID: 39315
Closes#21854
In order for the user to understand what the chat_input_placeholder
field means we should add a tooltip.
We should reorganize the fields in order to put them in logical order.
This commit is related to task 1837812.
Closes#24336
Purpose
=======
Move some internal development into the standard solution.
Specification
=============
- Add a default value for 'acquisition_date'
- Make the license plate not required
- Display all the stages on the fleet.vehicle kanban view
- Remove the unicity constraint on the driver
- Order cars by plate, then by acquisition date
- Add an informative 'First Contract Date' field
- Add 'Next Activities' on vehicles
- Create a related contract when creating a new car
- Archive related contracts when archiving a vehicle
- Allow to search vehicles based on the driver name
- Set default values on model onchange
- Add subtype to track driver modifications
- Introduce fleet.vehicle.assignation.log model
- Add track_visibility='onchange' on some fields
- Rename purchaser_id from 'Contractor' to 'Driver'
- Modify slightly some fleet views
TASK ID: 1839868
1/ Remove 'odometer' from vehicle tree view
2/ Replace 'Activation Cost' by 'Driver' on contracts tree view
3/ Add fields to search on in contract search view
4/ Hide 'Renew Contract' button if in open state
5/ Move models menuitem from 'Configuration' to 'Vehicles'
1/ Use track_visibility instead of overriding write method on a fleet.vehicle
Instead of posting messages in the write method to notify that the record value
changes, use the attribute track_visibility='onchange' instead.
2/ Add track_visibility='onchange' on some fields
3/ Track visibility on 'recurring_cost_amount_depreciated'
Purpose
=======
Currently it's impossible to know who was driving a given car at a given time.
We have some piece of information like the immatriculation date of a vehicle
or the date of the first contract. But it's not enough.
This is problematic to solve a rather common issue:
- Who is gonna pay the fine for having exceeded the speed limit?
Specification
=============
Introduce a simple model fleet.vehicle.assignation.log, containing info about:
- The driver
- The vehicle
- The start Date
- The end Date
A simple button on the fleet vehicle should be sufficient to solve the issue.
We cannot generate data from the salary package as these dates can't be predicted
at the contract signature.
The goal of this field is to be able to keep the value of the first contract
even if it has been closed/deteled.
It could be used to compute the depreciation of the car.
* Reconciliation
Change the way the reconciliation method was written to optimize performances.
Remove the "skip_full_reconcile_check" stuff that is more confusing than helping.
* Object creation
Remove the creation of tax_line from tax_ids in the account_move_line create method.
Remove a bunch of context that were invalidating the cache way too often
Was PR #21498
Was task 37976
* when refunding an invoice/bill with the option 'modify', it now opens the draft document in form view (chatter reworked for more clarity)
* payments list views are now using filters instead of domain, so that user can easily find back any payments (also transfer that haven't their dedicated menuitem)
* when clicking on a ling to create a new payment from the dashboard, the form view is directly open instead of the list view
Was PR #23402. Was task 58392
Since 1a58e108 (on 10.0 and over) parameters are no longer present when
logging sql queries.
This removes some of the usefulness of the feature, and this commit adds
them back.
Since mogrify returns a byte string in the database encoding, we decode
it using the corresponding python encoding.
opw-1839241
closes#24446
Here is the story of the problem: back in 10.0, everything *seemed*
fine with button rendering except it was very messy duplicated codes.
The system was still not consistent:
-> In Header, button with:
no class -> btn-default
btn-primary -> btn-default btn-primary
oe_highlight -> btn-primary
btn-default -> btn-default
btn-link -> btn-default btn-link
oe_link -> btn-default oe_link
btn-danger -> btn-default btn-danger
some_class -> btn-default some_class
-> Not in header, button with:
no class -> no class
btn-primary -> btn-primary
oe_highlight -> btn-primary
btn-default -> btn-default
btn-link -> btn-link
oe_link -> oe_link
btn-danger -> btn-danger
some_class -> some_class
So, outside the header, the system seemed to not process anything except
transforming the oe_highlight class. In the header, the btn-default was
always added, except if using the oe_highlight class. The style is fine
for those, except for .btn-default.btn-link and .btn-default.oe_link
where the link class has no effect (which is fine as header are not
supposed to contain links).
In 11.0, the new views were introduced alongside websitepocalypse. The
new system led to:
-> In Header, button with:
no class -> btn-default
btn-primary -> btn-default btn-primary
oe_highlight -> btn-default oe_highlight
btn-default -> btn-default
btn-link -> btn-default btn-link
oe_link -> btn-default oe_link
btn-danger -> btn-default btn-danger
some_class -> btn-default some_class
-> Not in header, button with:
no class -> btn-default
btn-primary -> btn-primary
oe_highlight -> oe_highlight
btn-default -> btn-default
btn-link -> btn-link
oe_link -> oe_link
btn-danger -> btn-danger
some_class -> some_class
So, it worsened the header buttons by not processing the oe_highlight
class and adding the btn-default class in all cases. This is even
worse since in 11.0 .btn-default.btn-link do have a specific style and
thus not appear as .btn-default anymore. Those may be invisible "bugs"
though as .btn-link are not supposed to be in header and oe_highlight
is styled correctly in css. For buttons outside the header, a little
processing was added to add "btn-default" class for buttons which did
not specify a class (and oe_highlight is not processed anymore there
too).
In master, with the less2scss task, the system had to change again but
led this time to visible bugs:
-> In Header, button with:
no class -> btn-default
btn-primary -> btn-primary
oe_highlight -> btn-primary
btn-default -> btn-default
btn-link -> btn-link
oe_link -> btn-link
btn-danger -> btn-danger
some_class -> some_class
-> Not in header, button with:
no class -> btn-default
btn-primary -> btn-primary
oe_highlight -> btn-primary
btn-default -> btn-default
btn-link -> btn-link
oe_link -> btn-link
btn-danger -> btn-danger
some_class -> some_class
As you can see, the system is now the same for both header button and
normal buttons. The system is also better for all cases as it produce
only *one* *bootstrap* class for all cases. However, the problematic
case is the last one for header buttons: it did not receive the
btn-default class automatically. Even though this is the API for the
rest of odoo (dialogs, renderButton (old WidgetButton), ...), this is
a problem here as fixing this would require to add the 'btn-default'
class in every view which is using this case.
While waiting for a better solution, this commit is instead forcing
the btn-default class in that header case only (so only when a class
was mentioned but it did not contain any bootstrap btn type class).
So the new system gives:
-> In Header, button with:
no class -> btn-default
btn-primary -> btn-primary
oe_highlight -> btn-primary
btn-default -> btn-default
btn-link -> btn-link
oe_link -> btn-link
btn-danger -> btn-danger
some_class -> btn-default some_class
-> Not in header, button with:
no class -> btn-default
btn-primary -> btn-primary
oe_highlight -> btn-primary
btn-default -> btn-default
btn-link -> btn-link
oe_link -> btn-link
btn-danger -> btn-danger
some_class -> some_class
This commit also adds tests which will prevent the system to change
again without noticing it.
Closes https://github.com/odoo/odoo/pull/24443
This commit has several purposes:
- Group public/portal/employees access rights into a single selection field
- Rename the 'Employee' access right into 'Internal User'
- Remove the groups reified view on the user form and replace it by real
computed fields: Selection fields for the application groups, and
Boolean fields for the isolated groups.
For more information about the specification please check the related commits
Task ID: 32258
The reified view on the res users will be dropped in the following commit.
The previous commit adds support to define each group as a computed field on the res users.
This commit defines:
- A boolean field for each 'isolated' res.group, i.e. a group in the hidden category.
- A selection field for each 'Application' res.group, i.e. a group in a application category.
Example:
- The group to manage pricelist in sales becomes a boolean field
- The groups project user/manager become a selection field
Purpose
=======
Allow to define users groups on a res.user with computed fields based on the 'groups_id' field.
Specification
=============
Add compute/inverse methods to manage specific groups on a res.users.
These methods should be used on fields defined like one the following cases:
1. A boolean field with the compute/inverse method and an attribute group_xml_id.
Example:
has_group_discount_per_so_line = fields.Boolean(
"Discount on lines",
compute='_compute_groups_id', inverse='_inverse_groups_id',
group_xml_id='sale.group_discount_per_so_line')
2. A selection field with the compute/inverse method, the selection got from '_get_group_selection'
and an attribute 'category_xml_id'
Example:
group_sales_team_user = fields.Selection(
selection=lambda self: self._get_group_selection('base.module_category_sales_management'),
string="Sales", compute='_compute_groups_id', inverse='_inverse_groups_id',
category_xml_id='base.module_category_sales_management')
The fields will be set according to the groups defined in the 'groups_id' field, and the 'groups_id'
field will be modified according to the modifications made on theses fields when saving the users's
form.
The cover image top and bottom margins should be the same on a kanban record.
The bottom margin on `o_attachment_image` has thus been removed as it is already
defined on `o_kanban_record_body` class, which makes a double bottom margin.
Task 54019