Commit Graph
126820 Commits
Author SHA1 Message Date
Xavier-Do de7c119e66 [IMP] mail: reduce message_post query count and clean code
Purpose of this commit is to improve performance of post and notify through
various code improvements.

Containing
  * making of _notify_customize_recipients a mail.thread method;
  * _message_auto_subscribe_followers optimized;
  * renaming and optimisation of _notify_partners;
  * message_post_attachements optization;
  * remove unused mail_post_autofollow_partner_ids context key;
  * minimize message create queries;
  * only check record related access right for thread messages not in pending
    moderation;
  * get attachements from values instead of db;
  * storing lang in ctx from the beginning;
  * don't track on write on attachments;

Related to task 1943901
Linked to PR #32404
2019-05-29 13:34:32 +00:00
Xavier-Do 2fcb3c658d [REF] mail: rename notif_layout to email_layout_xmlid on message model
Purpose is to make field use more obvious by correctly stating in the
name it should contain an xml id to a qweb layout used for email
notifications. This renaming is propagated through various calls and
addons.

Related to task 1943901
Linked to PR #32404
2019-05-29 13:34:32 +00:00
Xavier-Do 581a74143e [REF] mail: simplify notification code
Purpose of this commit is to clean notification process: calls, methods
API, method name, variable propagation.

Contains notably

  * simplify API of methods used to group recipients when sending notification
    emails;
  * improve and rename methods used in email notification process;
  * move some methods on model itself as non mail thread records could be
    mass-mailed and _notify_email_headers could be called on other records;

Related to task 1943901
Linked to PR #32404
2019-05-29 13:34:32 +00:00
Xavier-Do b4e9b3fb45 [FIX] mail: avoid crash when sending emails if no notification layout is found
If no email layout is found when trying to render the layout around the
message content, just send body in notification emails instead of
crashing. See notably 89051058f4 .

Related to task 1943901
Linked to PR #32404
2019-05-29 13:34:32 +00:00
Xavier-Do 7a6269719f [MOV] mail: move notification methods from mail.message / res.partner to mail.thread
Purpose of this commit is to move notification methods to mail.thread. Indeed
currently they are split among several models: thread, message, partner.
It makes code difficult to understand. Base record has to be propagated in
order to run methods on it. It is therefore simpler to make those methods
on mail.thread and correctly have model methods.

All notification methods are moved into a single section in the mail.thread
file. This implies some more code move inside mail.thread but allow to have
methods classified by their purpose.

Related to task 1943901
Linked to PR #32404
2019-05-29 13:34:32 +00:00
XavierDo 6f43977a4e [REF] mail: improve message_post and message_notify API
Message post should always be called on a record (ensure_one). That way we
ensure posting a message is always done in a record's context with right
values computed (reply_to, followers, ...)

Message_notify can be called on record or on mail_thread and must have
partner_ids. It is based on the recently modified user_notification mechanism
and allow to notify a partner on a record or just to push him a message
(aka, not linked to a record).

Small performance improvement

  * browse recipients instead of search in _notify_email_recipients;
  * todo in future optimizations: mayybe be improve by searching on ids
    and is_blacklist immediately;

Related to task 1943901
Linked to PR #32404
2019-05-29 13:32:26 +00:00
Xavier-Do c9d173a3e7 [REF] mail, various: apply light code cleaning
Purpose of this commit is to clean some bits of code, notably calls to
message_post/log as well as notification methods. It will ease performance
improvement work.

Small optimization: account: read content after extension check

Parameter cleaning

 * use message log with kwargs instead of args;
 * remove message post after hook useless parameters;
 * remove _notify_email_recipients useless message parameter;
 * remove message_notify useless send_after_commit parameters;
 * remove message post params matching default values;

Other improvements

 * remove message_post commands support for partners and channels;
 * only calls message_post with ids list for channels and partners. We
   don't support mix of ids and command anymore to simplify code;
 * remove support of private discussion in mail.thread adding partners
   as recipients, as there is no use anymore;

Related to task 1943901
Linked to PR #32404
2019-05-29 13:32:26 +00:00
Xavier-Do 2bfc0bc893 [IMP] test_mail: add a complex performance test for message_post
It includes notification on inbox / email as well as attachments management.
This latter one adds quite a lot of queries and is not currently tested
for performances. Future commits will improve those counters.

Related to task 1943901
Linked to PR #32404
2019-05-29 13:32:25 +00:00
XavierDo d917b2d072 [IMP] mail: improve user notification model in mail.message
Currently if a message has a res_id and a res_model it appears in the
matching record's chatter. Its access rights are computed based on this
record. This is the standard behavior of mail.message model.

User notifications are currently built on messages not having model and
res_id in order to avoid appearing on chatter. This has several drawbacks
notably access rights, redirection to the record, systray, finding back
records, ...

This commit solves those issues by adding new message_type 'user_notification'
that should be as a classic mail.message with model and res_id but without
the whole notification mechanism and without being displayed in the chatter.

An user notification is now a classic message pushed to a given partner only
and not displayed in the chatter.

Related to task 1943901
Linked to PR #32404
2019-05-29 13:32:25 +00:00
Pierre Masereel 49ac956b34 [FIX] point_of_sale: fix onchange pricelist
Since ORM changes, the ids a many2many are new (virtual) ones in a
onchange, so we have to point to origin which are the real records to
check that the many2one is in as it has a real id.

closes odoo/odoo#33763

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-05-29 14:14:40 +00:00
Robot Odoo 5f02ae443f [MERGE] stock,mrp,purchase,sale: rescheduling propagation
Currently the fact that the changes in the expected dates are propagated
or not is based on :
- the value of the field propagate on the stock.rule
- the general inventory setting setting use_propagation_minimum_delta

That's not easy to understand for users and difficult to configure.

The purpose of this task is to clarify this configuration (everything is configured
at the same place + but we keep the flexibility by setting this config on the stock.rule)

task-1913401

closes odoo/odoo#33719

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-29 19:19:45 +02:00
Robot Odoo 1d6bc7286c [IMP] hw_drivers, pos : Listen port in the IoT Box
We use a new method to connect the box to a device in the network.

We use the socket to listen a specific port in the box to connect device through the TCP/IP

Task: 1891152

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#33398

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-05-29 18:16:32 +02:00
lejeune quentin 7c31e0d2e7 [IMP] pos: Improve visual payments lines
This commit improve the display of payments lines and give
a name to last notebook group in /addons/point_of_sale/views/account_statement_view.xml
to be able to override it in enterprise
2019-05-29 15:49:03 +02:00
lejeune quentin ccb2835ccc [IMP] hw_drivers: Adds the ability to listen to a port
With this commit it is now possible for the IoT Box
to listen on a specific port of the box to interact
with a device via TCP / IP.

We use the library 'socket' to listen on port 9000
and if a request comes on this port we create an IoT Device
2019-05-29 15:49:03 +02:00
Haresh Shyara 4dc034ad03 [REF] mrp: rescheduling propagation
Implement the propagation minimum delta per rule in mrp.

Add a basic test.

task-1913401
2019-05-29 13:05:29 +00:00
Haresh Shyara 5a388ac91e [ADD] sale_stock: schedule date tests
task-1913401
2019-05-29 13:05:29 +00:00
Haresh Shyara 77b283f307 [REF] purchase_stock: rescheduling propagation
Implement the propagation minimum delta per rule in purchase_stock. Override
properly the write to handle both RFQ and PO. Take care of not merging po lines
where the expecte date should be different

Add propre test cases.

task-1913401
2019-05-29 13:05:19 +00:00
Haresh Shyara c514e8ae6a [REF] stock: rescheduling propagation
This commit moves the "propagation minimum delta" from a company setting to a
per-rule setting.

We implement this idea in the stock module and take this opportunity to clean
up the override of stock move's write.

We add a few basics tests.

task-1913401
2019-05-29 12:48:52 +00:00
Fabrice Henrion 4cae62baba [IMP] account: clarify portal label for invoices and bills
closes odoo/odoo#33732

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-29 12:47:52 +00:00
William Henrotin 0bc8e68044 [FIX] mrp: relax asserts on date
This commit relax, by one second, two datetimes comparison regarding
workorder planning to avoid any false positives

closes odoo/odoo#33740

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-29 08:36:41 +00:00
Carel d0a8c3b2a9 [CLA] signature for IvyWeb (Pty. Ltd.)
This is the corporate licence agreement for IvyWeb (Pty. Ltd.)

closes odoo/odoo#33728

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-29 10:51:46 +00:00
Yannick Tivisse 97e33b00e5 [FIX] mail: Fix suggested companies behavior
closes odoo/odoo#33721

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-29 08:33:18 +00:00
Yannick Tivisse 1cdbeeca55 [IMP] test_mail: Add multi company test from _redirect_to_record 2019-05-29 08:33:18 +00:00
Yannick Tivisse fd2fb47028 [IMP] model.py: Don't erase 'allowed_company_id' on with_context with args 2019-05-29 08:33:18 +00:00
Yannick Tivisse 3233c70026 [IMP] account: Retrieve 'allowed_company_ids' in a cleaner way 2019-05-29 08:09:15 +00:00
Yannick Tivisse f5dfe4727c [IMP] api.py: Rename company_id/company_ids into company/companies
The goal is to be coherent with the user property.

Actually, company_id and company_ids on the environment are no fields.

Calling env.company_id returns a browse record, not an id.
2019-05-29 08:09:15 +00:00
Pierre Rousseau 11cab26fb0 [IMP] crm_iap_lead_website: make it compatible with multi-website
The purpose of this commit is to allow to define lead generations rules based on the website visited.

Task-ID: 1964025

closes odoo/odoo#33391

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2019-05-15 12:39:08 +00:00
MaxLarue e0b33e280e [IMP] sale_timesheet: overview usability and styling
In order to make the overview more understandable, we provide some modifications:

- remove some value when they are zero ("No task found", ...)
- the whole middle column (percentages) is merged inside the hours one
- provide some tooltips
- renaming titles
- ...

To do so and to avoid leaving empty lines or doing complicated template branching, the
above table is split in two different tables, so that we can remove lines independently.

We also added a new category in the overview, concerning timesheets that are related to a cancelled so. This meant tweaking the project_overview plan_prepare_value method, in order to have the new numbers calculated and keep the others consitent.

Task-1968121

closes odoo/odoo#33015

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-05-29 07:29:21 +00:00
Juhil Somaiya 1f3a00fb3e [FIX] calendar: traceback on recurrent meetings when repetition number is 0
If the user tries to save the recurrent event with 0 as the number of
repitations or interval there will be a traceback so instead of traceback
display the warning so user will not be able to save that event.

Task-1930809

closes odoo/odoo#31388

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-29 08:39:13 +00:00
Martin Trigaux 9aac7c9286 [IMP] web: unify the use of GROUPABLE_TYPES
cf discussion on #31789

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-28 15:47:49 +00:00
Martin Trigaux b9f8e234ae [IMP] web: allow to group by integer
No technical reason to forbid it

Fixes odoo/odoo#31684
Closes odoo/odoo#31789
2019-05-28 15:47:36 +00:00
Rafis Bikbov f203a89859 [IMP] base: remove unused variable 'last_update'
closes odoo/odoo#28725

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-28 16:15:01 +00:00
Rafis Bikbov 5c9e5aadf3 [CLA] Add Rafis Bikbov from IT-Projects LLC 2019-05-28 16:14:55 +00:00
Antoine Huvelle 7e4f46c0fe [FIX] stock: tooltip of product_min_qty field
The field description didn't match the behavior
Reported by a learning partner

closes odoo/odoo#32260

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-04-08 11:45:41 +00:00
Yannick Tivisse 1245905279 [IMP] base: Improve label for company_id on res.users form
closes odoo/odoo#33723

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-28 14:31:34 +00:00
Yannick Tivisse ac6cbbaf5d [IMP] web: Improve switch company bar layout
fp request: add 0.1rem padding-top and -bottom to the items of the multicompany dropdown menu
2019-05-28 14:31:34 +00:00
Yannick Tivisse ec670beb4b [IMP] web: Keep multi company config when switching company
when moving from company A to company B, company A should not be 'uncheck' (it should stay in the set of visible companies)
use case: https://drive.google.com/file/d/1o9lN_8jHSxDOkeqTpo7F_NgmvO4NwF2l/view
I start in A with only A visible
I check B to make both A and B visible
I move to B and A is not visible anymore
when moving to a company that is not checked, it should be checked, but the reverse is not true (moving out of a company should not uncheck it)

fp request
2019-05-28 14:31:34 +00:00
Robot Odoo 73474f56fa [MERGE] website_sale, *: review shop layouts and options
* website, website_sale_comparison, website_sale_coupon,
website_sale_delivery, website_sale_wishlist

- Use cards to match event and forum recent design refactoring
- Make the shop use responsive and perfect-squared product grid items
- Make the shop product list view option a CSS-only option, which
visitors can toggle to/out
- Use better XML and JS for existing options and add new options
- Allow to set ppg/ppr
- Better mobile responsiveness
- Make more robust xpath
- ...

Note: the design will be reviewed in an upcoming task, this ensures
more robust XML to work on and new options to start with.

See sub-commits for details.

task-1925327

closes odoo/odoo#31147

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-28 19:45:27 +02:00
qsm-odoo f685d5ad9d [IMP] website_sale: implement better edition usability
- Allow to switch from grid to list view in edition
- Do not show grid options when in list view

Part of https://github.com/odoo/odoo/pull/31147
task-1925327
2019-05-28 15:05:42 +00:00
qsm-odoo 2e7300c043 [IMP] website_sale: review sorting labels
Part of https://github.com/odoo/odoo/pull/31147
task-1925327
2019-05-28 15:05:42 +00:00
qsm-odoo 1f1edd2432 [FIX] website_sale: adapt design to make it work on all browsers
Part of https://github.com/odoo/odoo/pull/31147
task-1925327
2019-05-28 15:05:42 +00:00
qsm-odoo 900b765b43 [REF] website_sale: allow to customize default aspect ratio of grid shop
Part of https://github.com/odoo/odoo/pull/31147
task-1925327
2019-05-28 15:05:42 +00:00
qsm-odoo d0573de2b6 [IMP] website_sale, *: save the layout mode in the user session
* website

Part of https://github.com/odoo/odoo/pull/31147
task-1925327
2019-05-28 15:05:42 +00:00
qsm-odoo c65233aa9b [IMP] website_sale: review alignment and mobile behaviors
- On mobile, both list view and grid view are the same, the toggle
  button is thus hidden to simplify the UI
- Review table alignements and button behaviors on mobile
- ...

Part of https://github.com/odoo/odoo/pull/31147
task-1925327
2019-05-28 15:05:42 +00:00
qsm-odoo dd5ecfcbd5 [IMP] website_sale: use collapse for /shop filters in mobile
Part of https://github.com/odoo/odoo/pull/31147
task-1925327
2019-05-28 15:05:42 +00:00
qsm-odoo 699fd6e303 [REF] website_sale: make better xpath to split /shop layout
Part of https://github.com/odoo/odoo/pull/31147
task-1925327
2019-05-28 15:05:42 +00:00
qsm-odoo da634afed5 [REF] website_sale: make robust xpath for collapse categories
Part of https://github.com/odoo/odoo/pull/31147
task-1925327
2019-05-28 15:05:42 +00:00
qsm-odoo d1240ee5d9 [IMP] website_sale: allow custom PPR and PPG
Part of https://github.com/odoo/odoo/pull/31147
task-1925327
2019-05-28 15:05:42 +00:00
qsm-odoo 5521bcd81c [IMP] website_sale, *: review layouts and options
* website_sale_comparison, website_sale_wishlist

- Use cards to match event and forum recent design refactoring
- Make the shop use responsive and perfect-squared product grid items
- Make the shop product list view option a CSS-only option, which
  visitors can toggle to/out.
- Use better XML and JS for existing options.
- Better mobile responsiveness

Part of https://github.com/odoo/odoo/pull/31147
task-1925327
2019-05-28 15:05:42 +00:00
qsm-odoo 3b9bfced29 [REF] website_sale, *: remove useless classes
- 'border_primary' -> BS4 equivalent: 'border border-primary'
- 'noborder' -> BS4 equivalent: 'border-0'
- 'font-weight-normal' -> BS4 has the same class for the same behavior
- 'break-word' -> Unused, and probably a bad idea to use anyway

Part of https://github.com/odoo/odoo/pull/31147
task-1925327
2019-05-28 15:05:42 +00:00