Commit Graph
145003 Commits
Author SHA1 Message Date
Raphael Collet 0d1908e644 [IMP] base: do partial validation of views
Here is the idea: when creating a view V that inherits another view, and
V only adds elements in the parent view, only the elements added by V
must be validated.  The other elements are not modified, and thus do not
need to be validated again.  However partial validation cannot be done
when modifying an existing view, or when the view replaces elements in
the parent view.  In such cases, the method _check_xml() validates the
whole combined architecture.

The time spent in method _check_xml() to install a database from scratch
with module sale_management went from 2.730s to 2.243s (-18%), and the
number of queries made in the method went from 2283 to 1614 (-29%).

closes odoo/odoo#75796

Related: odoo/enterprise#20633
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-09-06 15:47:03 +00:00
Raphael Collet c70c97b127 [IMP] base: refactor NameManager in views
Also speed up view validation by not calling fields_get when possible.
This avoids a call that is usually not necessary for validating a view.
Most of the time, fields can be found on the model itself.  Only
overridden fields_get() with fake fields are actually useful, like the
one of model 'res.users'.

The time spent in method _check_xml() to install a database from scratch with
module sale_management went from 3.510s to 2.730s (-22%), and the number
of queries made in the method went from 2995 to 2283 (-24%).

Part-of: odoo/odoo#75796
2021-09-06 15:47:03 +00:00
Raphael Collet eda3352cdd [IMP] base: refactor domain methods in view validation
The goal is to avoid calls to obscure methods, and make the code more
understandable.

Part-of: odoo/odoo#75796
2021-09-06 15:47:02 +00:00
Raphael Collet 5fad7a55dc [IMP] base: simplify view validation
Besides simple code improvements, remove node_info['attr_model'], and
check domain on specific elements.  Also refactor _validate_attrs.  The
changes have no impact on performance.

Part-of: odoo/odoo#75796
2021-09-06 15:47:02 +00:00
Raphael Collet 46f1912c9b [REF] base: split view validation from postprocessing
This makes it easier to optimize the algorithms for both cases:
postprocessing without validation, and validation without
postprocessing.  Also factor out some common bits like the editability
of nodes.

The net result is a speedup in performance.  The time spent in method
_check_xml() to install a database from scratch with module
sale_management went from 4.955s to 3.578s (-28%), and the number of
queries made in the method went from 3779 to 2995 (-21%).

Part-of: odoo/odoo#75796
2021-09-06 15:47:02 +00:00
Raphael Collet 331b54770e [REF] base: merge view methods _postprocess_view and postprocess, and simplify
This replaces recursive calls by a stack, which makes profiling
flamegraphs much simpler to analyze.

Part-of: odoo/odoo#75796
2021-09-06 15:47:01 +00:00
Raphael Collet 9ae8c1a7c9 [REF] base: split method handle_view_error() into _raise_view_error() and _log_view_warning()
This improves code readability but does not impact performance.

Part-of: odoo/odoo#75796
2021-09-06 15:47:01 +00:00
Raphael Collet 1de6c4e55a [IMP] base: extra optimization for safe_eval() in views
This generalizes an existing optimization and saves a few time to
validate a view.  The time spent in method _check_xml() to install a
database from scratch with module sale_management went from 5.145s to
5.044s (-2%).

Part-of: odoo/odoo#75796
2021-09-06 15:47:00 +00:00
Sébastien Geelen (sge) 8f51e54f30 [FIX] survey: email html field better height
Adjust the height of the HTML field for the email body
On the survey sharing email.

Regression introduced in 607c5ea4 (#75863)

task-2586137

closes odoo/odoo#76016

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-09-06 14:36:12 +00:00
Thibault Libioulle 28836f48a4 [MOV] project: move the dependent_ids fields to community
This commit moves the project.task dependent_ids field to the community
project module in order to take advantage of this relation for further
development.

closes odoo/odoo#76011

Related: odoo/enterprise#20623
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-09-06 14:36:08 +00:00
Victor FeyensandAntoine Vandevenne (anv) fbfd99e680 [REM] adyen_platforms, *: remove Odoo Payments modules
*: extensions of `adyen_platforms`, namely:
   - pos_adyen: remove related code, records, views, ...
   - payment_odoo: remove the module
   - sale_payment_odoo: remove the module

Modules related to Odoo Payments are already all merged since 14.0 and
14.4 (depending on the module). As the plan is to merge the final
version of Odoo Payments in 15.0 soon after the release, we want to
avoid all the complications that inevitably come with huge diffs, model
changes, XMLID collisions, etc. when merging in a stable version. Even
though it is possible to install these modules since 14.0, no
information could be lost during the upgrade since the entry point of
the application has never been activated.

task-2637770

closes odoo/odoo#75852

Related: odoo/upgrade#2804
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Co-authored-by: Antoine Vandevenne (anv)
2021-09-06 14:35:58 +00:00
Odoo's Mergebot 7cc67aecec [MERGE] project: remove project overview and improve analytic account
The project overview is a significant technical debt
as it is a custom qweb view. It is quite limited:
- It is not possible to group the data, to filter on dates,
SOs or Field Service projects.
- Improving this is very difficult and would require weeks
of development that are not worth it.
In any case, all the information provided by the project overview
can be found elsewhere. The stat buttons of the report are basically
duplicates of the ones from the project form view.
Therefore, we are removing this report and its twin,
the Project Costs and Revenues.

In addition, analytic items lack context for the user to understand
what generated a certain cost or revenue:
- there is no link to the source document;
- the entries are not categorized (e.g. it is not easy to understand
if a cost comes from a timesheet cost, a purchase order or an expense);
- the billable type group by works fine for timesheets but then all
the other entries are flagged as Undefined, which is not very helpful;
- there is no option to easily isolate costs from revenues.

task-2545084
See odoo/enterprise#19250
See odoo/upgrade#2706

closes odoo/odoo#72736

Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-09-06 16:35:49 +02:00
Arnaud GonyandMartin Trigaux 2dee29a7dc [IMP] auth_totp: 2FA Trusted Devices
+ Added the 'Trusted Devices' feature
+ Added 'Remember this Device' checkbox on /web/login/totp
+ Added trusted device's OS / browser on Profile > Account Security

Added '2FA Trusted Devices' feature to allow users to remember their
device to bypass the 2FA for the next connections. The trusted devices
are displayed in a 'Trusted Devices' One2Many under the 'Developer API
Keys'. It is possible to revoke all the trusted devices at once with a
special button. It is also possible to revoke one at a time on the
desired one.

Task-id 2523092

closes odoo/odoo#75535

Related: odoo/upgrade#2800
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Martin Trigaux <mat@odoo.com>
2021-09-06 13:17:48 +00:00
Adrien Widart 717c178a5e [FIX] account: always set the account move name
On payment creation, when changing twice the payment's journal, if the
first journal already has some lines and the second one doesn't have any
lines, the payment name will be incorrect.

To reproduce the error:
1. (If present, delete all payments)
2. Create and save a payment P01:
    - Journal: Bank
3. Create a second payment P02 (do not save it):
    - Journal: Bank
4. Change P02's payment: Cash
5. Change P02's payment: Bank
6. Save P02

Error: The name of P02 is "CSH1/2021/08/0001", which would be correct if
it was a Cash payment. This error has a consequence: suppose the user
creates a third payment (journal: Bank) and confirms it, its name will
be "CSH1/2021/08/0002" (again, name linked to the incorrect journal)

On step 4, when changing the journal to Cash, since the latter hasn't
any payment, the server returns a new name ("CSH1/2021/08/0001"). Then,
on step 5, when changing back the journal to "Bank", since the latter
already has a payment (P01) and since the current record already has a
name ("CSH1/2021/08/0001"), the server doesn't change it and the
`onchange` response doesn't contain anything. As a result, when saving
the payment from the client side, the wrong name is included in the data
("CSH1/2021/08/0001"). Regarding the consequence: later, when creating
and confirming a third payment, the server will take the name of the
previous one in the same journal and will increment it
("CSH1/2021/08/0002").

OPW-2601668

closes odoo/odoo#75986

X-original-commit: 2024ff2b344d841cf775dbb14da9cc9e1e4c05e9
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-09-06 12:03:50 +00:00
Hubert Van de Walle (huvw) cc744d1b12 [FIX] web: prevent error if subscriptions.update is undefined
Steps to follow

- Install web_dashboard,website_sale
- Go to the eCommerce Dashboard
- Click on Favorites
- Click on Add to my dashboard
- Go to the Dashboard app
- Click on orders
-> A traceback occurs

Cause of the issue

`this.subscriptions.update` is undefined

opw-2630849

closes odoo/odoo#75984

X-original-commit: 8ab700fc8e51631663443b6c8e81db9669375d82
Signed-off-by: Hubert Van De Walle <hubvd@users.noreply.github.com>
2021-09-06 12:03:46 +00:00
Raphael Collet 3a4d518303 [FIX] core: missing cursor commit in module installation
Right after some module operation (install, uninstall), the framework
looks for some ir.actions.todo to execute.  Currently those actions
cannot be found, because the cursor seems to see the database in the
state it was just before the operation.  Simply add the commit() which
was removed by revision 1595c0ee27.

closes odoo/odoo#75980

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-09-06 12:03:42 +00:00
Xavier Morel 759e2c5829 [FIX] core: avoid feeding client invalid XML-RPC documents
The XML-RPC interface has a compatibility shim for binaries as
historically Odoo has returned "binary" data as base64 strings. To
avoid breakages during the Python 3 transition, the shim was
introduced to decode the output binary data (under the assumption that
it'd be ASCII-compatible).

In the case where the data is *not* ascii-compatible, however, it can
generate invalid XML documents: "C0" control codes (with the exception
of tab, LF, and CR) are not valid in XML 1.0 (which XML-RPC is an
application of), however they're perfectly valid string characters and
the standard library's marshaller does not check for them, embedding
them directly in the output document and breaking the client's
decoding.

Work around the issue by replacing such binary data with an empty
string.

While at it, move the bytes shim to the customized marshaller, this
way everything's at the same place and it's not necessary to waste
time trying to understand why the marshaller is just not calling what
it's supposed to call.

Fixes #61919

closes odoo/odoo#75973

Forward-port-of: #75952
Forward-port-of: #74699
X-original-commit: 1a0b3f7
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-09-06 12:03:31 +00:00
Xavier-Do 68ea460f3f [IMP] profiling, base: add enable profiling wizard
When using profiling on a fresh test database, it can be tedious to
access settings to enable the feature. This commit adds a wizard to help
enabling profiling without accessing the settings when trying to
activate profiling on a administrator session.

closes odoo/odoo#75967

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-09-06 12:03:27 +00:00
jbw 299ef94bcb [IMP] account: 'Import First Bill' Modal Improvement
Improve the wizard 'import your first bill':  usability + look & feel
    - Removed the PDF viewer interface which was ugly + useless in this context
    - Display an HTML preview instead which is dynamic
        - Current date
        - Company address depending on the Company
        - bill sequence depending on the date

In the modal of upload, detect if there is no hosting domain @false > then remove this third option

PR #75815

Task: 2581377
Related: odoo/upgrade#2806
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-09-06 12:03:10 +00:00
Nikunj Ladava 7a1345876a [IMP] mail: enable tracking on important partner fields
This commit enables tracking on vat, parent_id for the contact, because the
impact of changes of these fields are very important.

We also manually track portal status change. To avoid a costly computed
field, this is done through manually logging portal access change as a note
on the user partner's chatter.

VAT field naming is also updated to match view naming used in inherited
views.

TaskID-2586195

closes odoo/odoo#74692

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-06 12:03:05 +00:00
Thomas Beckers 50c8eb1f8b [FIX] base: manifest cache is empty using cron
When generating some sale order/invoices pdf automatically (via cron for example), the format of the
invoice is not correct (missing style, background image, etc). The html used to generate these pdf's
misses the asset lines (link to css and js files).

The asset lines are not generated because the manifest cache (http.addons_manifest) is empty if we
render a pdf from a cron.

This commit will generate http.addons_manifest if it's not yet done before.

opw-2581621
opw-2597990
opw-2542242

closes odoo/odoo#75092

X-original-commit: 3ae4db7fc8dbc404984e34ac532426d6bf2c6a0f
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Signed-off-by: ThomasBeckers <ThomasBeckers@users.noreply.github.com>
2021-09-06 10:42:44 +00:00
Thibault Libioulle 741663f9de [FIX] project: fix project update default
Prior to this commit, the case where the update status was not set is
not handled in the STATUS COLOR mapping.

This commit associate a lighten dark color to the unset update status.

See PR : #68899
See task-2393768

PR : #70527

task-2458135
2021-09-06 10:41:14 +02:00
Thibault Libioulle 22cd824772 [FIX] account: fix invoice count
Prior to this commit, the count distinct on move_id called in the read
group was not used correctly.

This commit uses the move_id:count_distinct result of the read_group,
which represents the number of distinct invoices.

See task-2469742

PR : #70527

task-2458135
2021-09-06 10:41:14 +02:00
Cedric Prieels (cpr) c5048ebc6a [IMP] test_main_flows: improve test for project,timesheet
This commit improves the test to handle the changes made in the
project, sale_timesheet modules.

PR : #72736
See odoo/upgrade#2706

task-2545084
2021-09-06 10:41:14 +02:00
Cedric Prieels (cpr) fa88c5fd04 [ADD] account_sale_timesheet: extends project form and panel
This commit adds a bridge module in order to extend the project form
and panel.

PR : #72736
See odoo/upgrade#2706

task-2545084
2021-09-06 10:41:14 +02:00
Cedric Prieels (cpr) 69e34a253f [REM] sale_timesheet_purchase: remove bridge
This commit removes the sale_timesheet_purchase module which was meant
to extend project overview feature.

Since this feature is removed in previous commit, this bridge is now
useless.

PR : #72736
See odoo/upgrade#2706

task-2545084
2021-09-06 10:41:14 +02:00
Cedric Prieels (cpr) 2f77c86275 [IMP] sale_timesheet: remove overview and improve updates
This commit removes the project overview feature and views.
This commit improves the project updates right panel informations and
adds the buttons added in the project form view of this module.

/!\ This commit also improves the timesheet_invoice_type granularity
and precision.

The project overview view lacks of genericity and lacks of clarity
regarding the information to report.

PR : #72736
See odoo/upgrade#2706

task-2545084
2021-09-06 10:41:14 +02:00
Cedric Prieels (cpr) 66bf742c15 [IMP] sale_project{,_account}: extend project form and panel
This commit extends project form and panel in order to add buttons
which allow user to view documents linked to the project analytic
account.
This commit removes the computed field related to project overview
feature which is removed in the following commits.

This commit adds bridge modules in order to handle those extensions.

PR : #72736
See odoo/upgrade#2706

task-2545084
2021-09-06 10:41:14 +02:00
Cedric Prieels (cpr) 2b3e3a44a9 [IMP] project_{account,purchase,hr_expense}: extend form and panel
This commit extends project form and panel in order to add buttons
which allow user to view documents linked to the project analytic
account.

This commit adds bridge modules in order to handle those extensions.

PR : #72736
See odoo/upgrade#2706

task-2545084
2021-09-06 10:41:13 +02:00
Cedric Prieels (cpr) 0df93da823 [IMP] account,analytic: move the track cost setting
This commit moves the Track cost setting from account to analytic in
order to use it in modules depending on analytic.

This setting is based on a group defined in analytic
(analytic.group_analytic_accounting), this group is not moved.

PR : #72736
See odoo/upgrade#2706

task-2545084
2021-09-06 10:41:13 +02:00
Cedric Prieels (cpr) e8d0473b3b [IMP] hr_timesheet: remove activities from project update
This commit removes the activities from the project update default
description.

This commit prepares the removal of the project overview feature and is
a part of the global project update description improvement.

PR : #72736
See odoo/upgrade#2706

task-2545084
2021-09-06 10:41:13 +02:00
Cedric Prieels (cpr) 1ec2b3c0b0 [IMP] project: improve project updates
This commit improves the project updates panel and the data reported
in the update description.

This commit prepares the removal of the project overview feature.

PR : #72736
See odoo/upgrade#2706

task-2545084
2021-09-06 10:41:13 +02:00
Arnold Moyaux fd41a4e7a2 [FIX] stock: deadlock with scheduler
revert part of #4467734b77f19e3c4f4623e878d74c529a135bad

compute_qty_to_order is triggered manualy but not commited,
later in the scheduler task action_assign is call. However
product_id.stock_move_ids.state is a trigger of compute_qty_to_order
so it will be trigger a second time and deadlock itself

Also replace the cursor before procure_orderpoint_confirm,
so the procurement could have access to the data commited
by _compute_qty_to_order

closes odoo/odoo#75972

Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-09-06 08:21:45 +00:00
Xavier Morel 972b6bc9d1 [IMP] web: don't check for bad dom after test on failure
Currently, if a test fails there's very high chances the DOM will not
be clean, because qunit doesn't have good cleanup APIs. This means a
test failure will always be prefixed by a dump of the page DOM which
is just confusing and makes it hard to find the actual error.

This change updates the OdooAfterTestHook handler to:

* Receive the `Test` itself, instead of adding more information to the
  synthetic object it currently receives.
* Only show the leftover DOM if the test otherwise succeeded.
* Do the entire reporting via `pushFailure`, rather than having
  duplication between an explicit `console.error` and a test failure.
* Update the QUnit.log handler to
  - not show `undefined`
  - try to improve readability by removing the bracketing and quoting

closes odoo/odoo#75951

Forward-port-of: #75939
X-original-commit: 8bceac8032f48ae77e8a2c0c038f3bc26489e0ac
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-09-06 08:21:42 +00:00
Louis Wicket (wil) 401fc7efe9 [IMP] discuss: add 'Start a meeting' feature
- Add a new stand-alone page "WelcomeView"
    - Redirect people who join using an invitation link to the WelcomeView
    - Add microphone/camera preview
    - Allow guests to choose a name from the WelcomeView
- Add "Start a meeting" button to the discuss sidebar
    - Create a new channel on click on the "Start a meeting" button
    - Display ChannelInvitationForm on click on the "Start a meeting"
button
    - Add a new field to `mail.channel` in order to define the display
mode to use for videos (e.g full screen) when joining a meeting

Task 2494829

closes odoo/odoo#75899

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-06 08:21:38 +00:00
Adrian Torres 9f11a84d71 [IMP] Order groups by selection declaration order in read_group
Before this commit, calling read_group on a model and grouping by a
selection field would return the groups in alphabetical order, meaning
that if your selection field's options were declared as:

('z', 'Z'), ('a', 'A')

read_group would return first group 'a' and then group 'z', instead of
groups 'z' and then 'a' which some might expect.

With this commit, it is now possible to set a fields.Selection
group_expand attribute to `True` when declaring it, which will use a
default group_expand implementation specific to Selection fields, this
means that when grouping by a Selection field with `group_expand=True`
it will always return the groups in the definition order of the
selection options.

We achieve this by leveraging the group_expand field attribute which was
designed for changing the groups returned by read_group.

Since this attribute was thought only to be implemented on a
Model-by-Model basis and here we need to use it as a generic function
for all Selection fields (explicit group_expand declarations have higher
precedence), the generic method has been implemented inside
fields.Selection and takes an extra records parameter which holds a
reference to the recordset/model on which read_group was called. This
extra parameter only applies to field implementations of group_expand
and in this case is what allows this specific feature to work with
dynamic Selection fields (function as options).

A side-effect of this implementation is that a read_group call that
groups by a Selection field with `group_expand=True` that uses the
default group_expand will always return all possible groups, even
empty ones.

Task-ID 2635052

closes odoo/odoo#75856

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-09-06 08:21:34 +00:00
Odoo's Mergebot 1d553043b5 [IMP] crm,{sale}s_team: improve the sales team kanban/list/form UI
PURPOSE

Walk around in the CRM to improve some UI.

SPECIFICATIONS

- In Visit to Leads changing the icon from fa-handshake
   to fa-star, Handshake is for the app, stars are for the leads

- CRM>Configuration>Tags
   Updating the action helper to:
   Create CRM Tags
   Use Tags to manage and track your Opportunities (product structure,
    sales type, etc.)

- CRM > Sales > Customers
   Updating the action helper to:
   Create a Contact in your address book
   Odoo helps you track all activities related to a contact.

- CRM > Sales > Teams
   - The grey bottom border in the Teams kanban card should appear only
      when they have a invoice target.

   - Increase the size of the alias in Teams kanban card a bit because it's hard
     to read.

   - The Teams kanban card is very meh if you have no data. So add some dummy
      data.

- CRM > Configuration > Sales Teams
   In Sales Teams list view add alias and avatar on the team leader.

- If you go CRM>Team>Pipeline, you get a strange action helper
  Instead, display the normal Pipeline action helper one except the gateway
  address is always  the alias of the team.

- Sections should be the same for all columns in team kanban view.
   if leads are activated, they should be in View, New & Reporting
   Activities should be at the bottom of the Reporting list since it has no
   counterpart.

- CRM > Sales > Teams (Select invoice from Kanban view)
  added new action helper in Teams/Invoice.

-  CRM > Reporting > Activities
   Rename Action to "Activities" (no "Pipeline" because it's confusing).

LINKS
PR #73530
Task 2582208

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-06 10:21:30 +02:00
ijas ahammed ea1b009386 [IMP] crm: move 'crm_menu_views.xml' to last in manifest
Usually, the actions are defined before the menu items. So with this
commit, we load the 'crm_menu_views.xml' file at the last.

TaskID-2582208

Part-of: odoo/odoo#73530
2021-09-06 08:21:29 +00:00
ijas ahammed 4c271090c4 [IMP] crm,{sale}s_team: improve the sales team kanban/list/form UI
- If we only install sales_team, on the footer of sale team kanban view
  there's empty grey border which looks ugly. Also, if the data are
  not available, the empty graphs don't look so beautifull.

  This commit improves the kanban view to avoid this empty grey border
  when there's no content within it, and in case of lack of the data,
  we now display sample data in graph with grey color. Note that the
  actual data now has colors, green for the future / present data range
  and pink for the past ones.

- When opening the configuration menu of team kanban from CRM, we observe
  three columns: View, New and Reporting. However, those columns are not
  consistent. For example, when leads are activated, we don't see 'Leads'
  action under 'New' column. Also the order for the actions are not
  consistent for 'View' and 'Reporting' columns.

  This commit re-organizes the sequence of the actions for these columns
  and thus makes them consistent. Note that we want to always show the
  'Activites' at the last, which is being added from crm with 'Leads' and
  'Opportunities' actions. So an empty seperator is introduced to keep
  them seperate, and push the sales related actions on the top of
  'Activities'.

- Right now, the alias on sales team's kanban view is being shown
  with `<small>` tag, but it is hard to read. Apart from that, in
  the list view, only the alias name is displayed even if the alias
  domain is configured.

  This commit makes the alias more easy to read by displaying it
  with `<span>` tag on the kanban view, and by showing the full
  alias along with the domain on list view. Note that on the kanban view,
  alias will now be displayed always, which previously was displayed only
  when 'leads' were enabled.

- This commit also changes of the action 'crm_activity_report_action' from
  'Pipeline Activities' to simply 'Activities' to avoid confusion.

- Apart from that, this commit also adds currency symbol in the form
  view and kanban view (while configuring the target), with the suffix
  ' / month' after the input. Adds the alias name in the
  team list view, and it adds 'many2one_avatar_user' widget on user_id
  field for both list and form view.

TaskID-2582208

Part-of: odoo/odoo#73530
2021-09-06 08:21:29 +00:00
ijas ahammed 6b67b6e41a [IMP] crm,{sale}s_team,base,contacts: add and improve action helpers
- if the alias is configured for the team, the action helper
  with the link of that email will be displayed. Otherwise, it will
  simply indicate user to either create lead manually, or to configure
  email alias.

- This commit improves action helper for the tags and adds
  sample data for better onboarding.

- This commit adds action helper on action 'sale.action_invoice_salesteams'
  for better onboarding.

- This commit updates the action helper for 'CRM > Customers'
  and 'Contacts' actions and make the helper message consistent.

TaskID-2582208

Part-of: odoo/odoo#73530
2021-09-06 08:21:28 +00:00
ijas ahammed 3a25c9a25d [IMP] crm_iap_lead_website: update stat button icons on lead rules form
On 'Visit to Leads Rules' form view, we have stat buttons to access
leads / opportunities. However, the handshake icon on those buttons
in not good choice for representing leads/opportunities.

This commit changes the icon from 'fa-handshake-o' to 'fa-star'
for better representation of leads/opportunities.

TaskID-2582208

Part-of: odoo/odoo#73530
2021-09-06 08:21:28 +00:00
Olivier Dony 808f95fa8f [FIX] web_editor: limit size of generated images
This should avoid disrupting layouts.

closes odoo/odoo#75965

X-original-commit: baca6bd71632e68f4e57380537e6282afbc172bc
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2021-09-06 07:14:48 +00:00
Xavier Morel 94018575c6 [FIX] web: issues with bounding rects and mouse hit locations
On my system in chrome 92 there are issues of chrome's hitboxes (and
rounding) being off leading to tests failures, something which given
the adjustment in `triggerMouseEvent` had been an issue in the past.

The first test failure was / is in the "correctly display year view"
calendar test, where the very first event dialog would fail to open
when clicking on the `2016-11-16`.

After tracing through fullcalendar, it turned out fullcalendar was
told to hit `2016-11-*09*`, suspiciously 7 days before the cell we
were looking for in a monthly calendar, hinting to an incorrect
vertical offset / hitbox.

Fix by offsetting the top coordinate in `triggerMouseEvent`, but
rather than just increment by one update the entire thing by trigger
the event right in the middle of the element being targeted, that
seems more reliable long-term, though it could be slightly confusing
for events like mouseenter/mouseover/...

The second issue was with a list test, where two cells are supposed to
be sized equally. Apparently the offset sizes are supposed to be the
rounded version of the actual size (which can be fractional), but
dumping the information of `foo` and `text` I'd get real widths (via
getBoundingClientRect) of respectively 480.46875 and 480.5, and
offsetWidths of 481 and 480 (the smaller of the two in "real size"
is rounded higher than the other one).

In Python we might use `assertAlmostEqual` for this, but we've
apparently not introduced this in JS take the real width and round up
by hand, this fixes the issue as both end up at 481.

Aside 1:

Before finding out the actual root cause I landed in
`_onYearDateClick` with missing data in the events so looked at the
API to figure what I was looking at, and turns out fullcalendar's
event object has documented properties to get the date-converted start
and end bounds of the event, so use that directly instead of doing the
same thing by hand.

Aside 2:

The attributes passed to `triggerEvent` in `triggerMouseEvent` are
pretty much nonsensical, we're getting the element's location using
`getBoundingClientRect` which is based off of the viewport, but
setting the keys

* `screen(X|Y)`, which should be the location of the hit relative to
  *the physical screen*
* `page(X|Y)`, which should be the location of the hit relative to the
  page / document (so takes in account the content scrolled off-screen)
* `layer(X|Y)`, which is the position of the hit relative to the
  nearest positioned (non-static) element, falling back to page if
  there isn't one

The one attribute which matches the semantics / reference of
`getBoundingClientRect` we didn't even set, instead it would be
automatically copied from `pageX`/`pageY` by the events mapping.

Fix that by just providing `clientX`/`clientY` and updating the
mapping functions to not overwrite it.

If the others are needed they should be computed properly based on the
document's bounding client rect and scroll information, as well as the
window's screenX/screenY (and offsetParent for layerX/layerY though
that seems unlikely to be necessary).

closes odoo/odoo#75953

X-original-commit: d26a4edffd6bdaed46143a30e99f17eb91f44e7e
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-09-06 06:12:43 +00:00
Julien Giannone 19c364ea2d [IMP] mail: add model for message reactions
Add the model in the freeze for next version, the interface is not fully ready
to merge yet but it will be added in https://github.com/odoo/odoo/pull/75630

Part of task-2361194

closes odoo/odoo#75911

Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
2021-09-04 13:01:02 +00:00
Arnold Moyaux 55588eba57 [IMP] stock: reserve on return to select delivered lot
Since return moves are linked to their original move, it's easy to
manage reservation in those case. We just don't bypass the reservation
when it comes from a reservation outside our stock in order to manage
the computation on linked moves and reserve pieces that were not yet
return.

Also add a return picking type for 2 reasons:
- Allow to select existing lot.
- Display reserved move line for an incoming picking.

Note that this picking type is just a default configuration and could be
modify by the user without any issue.

closes odoo/odoo#64384

Related: odoo/enterprise#20605
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-09-04 11:58:36 +00:00
Brieuc-brd 48aa2445e8 [IMP] website: update the bewise-1 color palette
This commit updates the bewise-1 color palette. It replaces the
o-color-2 by the extra color of o_cc4 and improves the compatibility
with the others palettes when we switch between them.

task-2573302

closes odoo/odoo#75159

Related: odoo/design-themes#477
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-09-04 06:24:01 +00:00
Thanh Dodeur ac99b09cdc [IMP] mail*: add audio and video conference with webRTC
*test_discuss_full,test_lint

This commit adds the audio and video conference feature to mail channels
and integrate it with the groupDM/guest features.

Adds new mp3 and ogg files (from task-2554674) for sound effects.

- Adds three new tables:
    * `mail.channel.rtc.session` to manage the peerToPeer interactions
      during rtc calls.
    * `mail.ice.server` to provide ICE servers necessary to establish
      peerToPeer connections with webRtc.
    * `res.users.settings.volumes` to hold the partner-to-partner volume
      settings, each partner can create one new setting per other
      partner to configure the volume coming from those partners during
      calls.

- changes res.config.settings:
    * Adds new fields for the Twilio credentials to use their STUN/TURN
      service.

- changes res.user.settings:
    * Adds 4 fields for the push to talk and voice activation.

- changes mail.channel:
    * Adds a new field `rtc_session_ids` that represents the active
      participants in a rtc call on that channel.

- changes mail.channel.partner:
    * Adds a new field `rtc_inviting_session_id` that represents the
      rtcSession of the user that is inviting that channelPartner to a
      call.

task-2366708

closes odoo/odoo#66611

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-04 06:23:56 +00:00
oco-odoo 0ebe0ede45 [MOV] l10n_eu_oss: new name for l10n_eu_service
This module is now used to support OSS taxes, which replaced MOSS a few months ago. This renaming follows the changes introduced in stable by https://github.com/odoo/odoo/commit/0e7c289003a0a69075188dbfaea724919dac32a4 .

[IMP] l10n_eu_oss: remove dead code from former l10n_eu_service feature

[IMP] account, product, l10n_eu_oss: community adjustements to support enterprise's OSS report

The following changes where introduced in order to support the features implemented in the new l10n_eu_oss_reports module:

- account.tag objects applicable on taxes are no longer required to have a country_id. This way, we allow using tags in generic reports (i.e. the ones available for multiple countries) as well.

- add account_tag_is on product.template and product.category: this fields are m2m to account.account.tag applicable on taxes. When making an entry from this product, these tags will be set on all the tax move lines created for it. We use it in OSS to differentiate between imported and non-imported goods in the report.

- always display country_id on fiscal positions' form view: OSS taxes require to be used in some fiscal position with a country_id set, so that we can infer the country they are mapping the vat from. We make that change in the view so that users are not obliged to create auto-applied fiscal positions to fix the OSS taxes they created manually, and can directly set the country on the fiscal position.

Task 2591541

closes odoo/odoo#73602

Related: odoo/upgrade#2669
Related: odoo/enterprise#19628
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-09-04 05:21:05 +00:00
Raphael ColletandXavier Dollé 1595c0ee27 [REF] core: replace thread-local "envs" by cursor-bound "transaction"
Refactor the Environments object into a Transaction object, which is
bound to one cursor, and is no longer shared among several cursors.

The following methods/properties have been changed:
 - Environment.envs no longer works (because of the design change);
 - Environment.manage() is deprecated (no longer useful);
 - Environment.reset() is now an instance method;
 - env.clear_upon_failure() is deprecated in favor of cr.savepoint().

closes odoo/odoo#75598

Related: odoo/enterprise#20451
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Xavier Dollé <xdo@odoo.com>
2021-09-03 15:45:46 +00:00
Raphael Collet 765ec7837c [REF] core: add methods flush() and clear() on cursor
This deprecates the ugly and inconvenient functions flush_env(),
clear_env(), and avoids explicit calls to precommit.run().

Part-of: odoo/odoo#75598
2021-09-03 15:45:46 +00:00