Commit Graph
53 Commits
Author SHA1 Message Date
Didier (did) 533e0451aa [IMP] mail: populate data for discuss
This PR add a populate command for models `mail.channel`, `mail.channel.member`
and `mail.message`.
It will only create channel of type `channel` and `group`.

I used this bash function to quickly delete/create a database and populate it.

```bash
 # Quickly drop the current db (it use the git branch name as database name) and
 # create a new one that will be populated.
 # usage: odoo-populate model_name size
odoo-populate() {
    dropdb $(git branch --show-current)
    odoo -i mail --stop-after-init
    ./odoo-bin populate --models $1 --size $2 -d $(git branch --show-current) --addons-path=~/projets/pro/odoo/addons,~/projets/pro/enterprise --c ~/projets/pro/.odoorc
}
```

closes odoo/odoo#115827

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-30 12:54:30 +02:00
Thibault Delavallée cb67c23888 [MOV] mail: reorder controllers and views
As mail grows and will continue to grow, ordering views and having right
files is important to understand module organization and content.

Split main.py controller file into two files, one for mail related controllers
(redirections) and one for discuss.

Rename files according to guidelines for wizards and views.

No functional change comes with this commit. This is only code move.

Task-2631873
PR odoo/odoo#75571
2021-08-25 13:12:11 +00:00
Thibault Francois 9b4c101484 [IMP] crm|mail: Use flanker to check email correctness
Context
-------
Lead assignement is now based on PLS probability.
We want to avoid giving the same score to real email addresses
and email addresses that are just well formed

Flanker try to acheive that be checking specific
criteria according to the domain, check the dns and mx record

Improvement
-----------
Define a mail_validate function seach as phone_validate.
If flanker is installed, use flanker for validation of
email addresses else use email_normalize.
It should help the PLS to give a bad score to well formed addresses
that flanker suspect to be wrong.

Setup
-----
NB: flanker is not available as debian package, we make it optional

To install flanker
```
pip install flanker
pip install redis
pip install dnsq
```

If you have installed it as root you may need to run
```py
from flanker.addresslib import address
```
as root for the first initialisation

closes odoo/odoo#66429

X-original-commit: f540976c8751e2bf402fed8db830ec0fbf98f654
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-18 09:15:35 +00:00
Martin Trigaux 776ef47492 [FIX] *: do not import tests folder
saas-13.5 version of odoo/odoo@15f2bbd40a

The tests must be only imported in a test context, not in a running
context.
Since 92a7f8c a new test requirement was added but it should
not be necessary to run a module, only to execute the tests.

closes odoo/odoo#57728

X-original-commit: 5a74fdad59144a68ed8b6670dbd63731c8090048
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-15 11:36:12 +00:00
Thibault Delavallée c3be4c3bc6 [IMP][MOV] mail: move / pimp test tools and asserts to mail
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in application tests or force them
to write custom quick and dirty tools and asserts. Purpose of this merge
is therefore to move tools classes and mocks to mail directly and use them
in various sub modules.

SPECIFICATIONS

Have class, mocks, tools and asserts available in mail so that all modules
below from mail can use them.

Including

  * mock mail gateway in a clean way: mock server connection, email building
    and sending;
  * allow to simulate errors while sending emails to test corner cases;
  * provide tools to insert emails in mail gateway;
  * mock mail application to check record creation (message, notifications,
    mails, ...);
  * mock bus notification;
  * provide clearer assert methods for bus and mail notifications;
  * provide clearer emails sending and content methods;
  * provide a with_user tool context manager for tests allowing to quickly
    change current user given a login;

Most of those tools, asserts and mocks come from test_mail/tests/common.py.
They have been partially rewritten to be easier to use or to perform tests
more cleanly.

Future commits will gradually update existing tests in test_mail, test_mass
mailing and test_mail_full.

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:00:32 +00:00
Hiral Bhavsar b2de618f9f [IMP] base,mail: allow to customize the activity view
The activity view has been greatly improved to allow to customize it
more easily. It works quite similarly to the kanban view, defining
`<field>` tags at the top and using these fields in the `<template>`
section. The template name used to define the activity cards is
`activity-box`.

Note that these activity cards are rendered using `KanbanRecord` widget
(this has implied that ActivityView inherits from `BasicView`).

Also note that the view validation has been moved in base to include the
common grammar.

Task 1894990
2019-05-03 10:19:40 +00:00
Martin Geubelle e273407157 [FIX] mail: consider activity as a valid view type
The recently introduced `activity` view (see rev. odoo/odoo@1de9496 has not
received all the consideration it deserves as a real view type (no RNG, not in
the valid view `type`, no doc, etc.). It was currently only working based on a
`_get_default_activity_view` method.

Even if the RNG is currently really basic, its grammar could evolve in the future.

This was causing an issue when opening Studio with this view as a default view
with an invalid type was created.
2018-09-03 13:40:22 +02:00
Thibault Delavallée d040bfde89 [MOV] (test_)mail: move tests into their dedicated module
Purpose: avoid having useless tables for test models in a
production environment.
2017-11-29 10:11:15 +01:00
Thibault Delavallée 2a3ac4ce22 [MOV] mail: reorganize content of tests, separate tests from models and data
Purpose of this commit is to reorganize the mail tests. Containing

 * move test models into mail/tests/models/;
 * move data into mail/tests/data even if it is python code, as it is
   likely that some additional data will appear soon;
 * split test_mail_features into test for discuss app and test related
   to message post and composer, to better identify test target;
 * split and remove test_portal, those tests are now integrated in the
   other tests;

There is no change in this commit. Only some renaming and file move or
split.

mergeup: remove / split test portal
2017-11-29 10:05:01 +01:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Thibault Delavallée 4f9105a4ef [IMP] mail: handle forwarded emails in mailgateway
If the 'To' of an incoming email is an alias on another model we now consider
this emails as a forward to a new alias. A use case for this is an email on
a task that should be considered as an issue and forwarded to another alias.
2016-09-01 13:25:26 +02:00
Thibault Delavallée 4a975f1b7d [MOV] mail: moved files according to the new module organization 2015-04-27 12:52:45 +02:00
Julien De Coster d88c34d11e [IMP] Mass mailings send in cron
1. The merge of the "email_template" module into the "mail" module.
2. The send action of the mass mailing has been moved from the frontend to a cron, because it was too slow to send over 10,000 mails (the user's browser was blocked for 15 - 20 minutes). Mass mailings have now their own process in the kanban view.
3. Mails sent from the mail form are sent immediatly instead of from the mail queue (for instance, when you go to sales > customers > list view > select 2 -3 customers > More > Partner Mass Mailing).
4. Users have now the choice from which mailing list they want to unsubscribe when they click on the unsubscribe link at the bottom of the mail.
5. Mass mailings inherit from their campaign UTMs and mass mailing campaigns are linked to an UTM campaign.
6. Many little improvements
2015-01-07 18:01:58 +01:00
Leonardo Donelli 4a0b13ed92 [REF] remove vim modelines and resulting trailing blank lines
Let 2015 be a year without modelines!
cf #4174
2014-12-31 15:52:13 +01:00
Thibault Delavallée 0b2d085c1b [IMP] shop: added openchatter on product shop
- product.template now inherits from mail.thread
- added opencahtter on product.template form view
- added discussion thread + attachments in product website view
- added file_type field on ir_attachment, that replaces the javascript thing
from mail.js
- added a controller to comment a product.template

bzr revid: tde@openerp.com-20140106135727-uf0zaxav28pdx4sv
2014-01-06 14:57:27 +01:00
Thibault Delavallée b541e7ce64 [MERGE] Sync with trunk. Cleaned a bit things lastly added in trunk/mail/tests.
bzr revid: tde@openerp.com-20121211161458-d7wv4lnkvs9s7srj
2012-12-11 17:14:58 +01:00
Christophe Matthieu 6c73d8dff8 [IMP] web: move controler download_attachment into mail.
bzr revid: chm@openerp.com-20121211145343-jhjj9sohn2shkbt9
2012-12-11 15:53:43 +01:00
Thibault Delavallée 45e1682327 [FIX] [CLEAN] mail: fixed some access rules issues; removed now unused files.
bzr revid: tde@openerp.com-20121211143301-b52ji02vynvgo3m9
2012-12-11 15:33:01 +01:00
Thibault Delavallée 13a49a855c [IMP] mail: updated notified_partner_ids field string and help; udpated demo data; updated __init__ to avoid issues with non existing columns in mail_favorite.
bzr revid: tde@openerp.com-20121102142322-prq9vvtec93u9mah
2012-11-02 15:23:22 +01:00
Thibault Delavallée 91f4e942db [IMP] mail: star is renamed as favorite (propagated changes through module); added views for this model in technical feature, under emails. Cleaned message_read and message_read_get_expandable because the code was quite obfuscated.
bzr revid: tde@openerp.com-20121018152322-cakaas3a77h1pi7m
2012-10-18 17:23:22 +02:00
Christophe Matthieu a88378cd4c [IMP]mail: stared/unstared
bzr revid: chm@openerp.com-20121012152505-1rmms2k10vjr3yd4
2012-10-12 17:25:05 +02:00
Antony Lesuisse 3c26ec305a [IMP] mail: move the code from publisher_warranty to mail
bzr revid: stw@openerp.com-20121004044624-hwa3kztl58zrjguh
2012-10-04 06:46:24 +02:00
Thibault Delavallée fa27dde6c9 [MERGE] Merged with addons/trunk.
bzr revid: tde@openerp.com-20120919111000-w3xmyatd6new8ghm
2012-09-19 13:10:00 +02:00
Atul Patel (OpenERP) d3ba827de7 [MERGE]: Merged with lp:openobject-addons
bzr revid: atp@tinyerp.com-20120906113441-sutt7m5zv1wa0814
2012-09-06 17:04:41 +05:30
Sanjay Gohel (Open ERP) 91c022497b [MERGE]merge with lp:~openerp-dev/openobject-addons/trunk-mail-cleaning-fp and done changes as needed
bzr revid: sgo@tinyerp.com-20120830112426-15b9jere67yyoa3q
2012-08-30 16:54:26 +05:30
Fabien Pinckaers 6ac583c0f7 [IMP] mail cleaning
bzr revid: fp@tinyerp.com-20120817111936-2d33nlqlbvkjb374
2012-08-17 13:19:36 +02:00
Foram Katharotiya (OpenERP) 4f696f004e [MERGE/IMP] merge with parent branch & improve message_create method in mail_thread
bzr revid: fka@tinyerp.com-20120816100908-q9mqmz49h6og0m6f
2012-08-16 15:39:08 +05:30
Fabien Pinckaers a2b7f82a81 [IMP] no auto_follow, we will use auto-compose instead on some actions
bzr revid: fp@tinyerp.com-20120816090243-nzu6ounygswiceqi
2012-08-16 11:02:43 +02:00
Fabien Pinckaers e5b76be9b8 [IMP] merge trunk
bzr revid: fp@tinyerp.com-20120816072402-7w1avco6ryt12x10
2012-08-16 09:24:02 +02:00
Atul Patel (OpenERP) cbb41e6ed3 [FIX]: Remove mail_subscription
bzr revid: atp@tinyerp.com-20120816064026-f3egkm1h2ximajzm
2012-08-16 12:10:26 +05:30
Atul Patel (OpenERP) 22a810507c [MERGE]: Merged with lp:openobject-addons
bzr revid: atp@tinyerp.com-20120816052021-igdj7knaimwg9x7z
2012-08-16 10:50:21 +05:30
Thibault Delavallée 61274acd89 [MERGE] Merged with addons/trunk.
bzr revid: tde@openerp.com-20120815195652-839w3fyumomq0ubf
2012-08-15 21:56:52 +02:00
Fabien Pinckaers d820e866ee [MERGE] trunk
bzr revid: fp@openerp.com-20120815185713-82zylb0yqqgs008y
2012-08-15 20:57:13 +02:00
Fabien Pinckaers af93ab5290 [IMP] factorisation of objects
bzr revid: fp@openerp.com-20120815170822-udsmc9geqmm6jae8
2012-08-15 19:08:22 +02:00
Thibault Delavallée 5249a3fadf [FIX] mail_thread: import res_partner before res_users.
bzr revid: tde@openerp.com-20120814170342-y10dzgromrpppa6i
2012-08-14 19:03:42 +02:00
Thibault Delavallée 0eccca51d5 [MERGE] Merged with addons/trunk.
bzr revid: tde@openerp.com-20120814114638-pkj3d70sg9mr2hkv
2012-08-14 13:46:38 +02:00
Fabien Pinckaers 29eb174ce5 [ADD] mail: mail groups
extract groups and add new features to them?

bzr revid: fp@tinyerp.com-20120814065136-nlwh14rwbgj57tqx
2012-08-14 08:51:36 +02:00
Thibault Delavallée 9a3680e7f5 [REF] mail: init and openerp files updated with followers instead of subscription.
bzr revid: tde@openerp.com-20120813191501-tapi42znpz9bckiy
2012-08-13 21:15:01 +02:00
Foram Katharotiya (OpenERP) 1bf105837e [MERGE]merge with lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa
bzr revid: fka@tinyerp.com-20120813102519-9h3fpqj29dse2p3m
2012-08-13 15:55:19 +05:30
Thibault Delavallée c510b34778 [REF] mail: mail has now a mesage_subscriber_ids field, many2many modified field, to avoid doing asynchronous queries to have them. Added temp debug field on mail_group.
bzr revid: tde@openerp.com-20120809144345-y03iqvhxv8jxo59v
2012-08-09 16:43:45 +02:00
Atul Patel (OpenERP) c92422b2ac [ADD]: Add vote system in openchatter
bzr revid: atp@tinyerp.com-20120809095341-xn70i8beof20b07h
2012-08-09 15:23:41 +05:30
Foram Katharotiya (OpenERP) 003ac3c053 [ADD] Add mail.message.subtype model in mail
bzr revid: fka@tinyerp.com-20120730065435-u586t9y9gtfmx5tl
2012-07-30 12:24:35 +05:30
Olivier Dony be021419ae [MERGE] Sync with trunk and correct upstream mistakes
bzr revid: odo@openerp.com-20120705102219-p6wy1obp4t0b89z3
2012-07-05 12:22:19 +02:00
Olivier Dony 0b67a7537e [IMP] mail: simpler config wizard for catchall domain, merge duplicate demo data files
bzr revid: odo@openerp.com-20120703171130-l8h16xp2dm8ilc6g
2012-07-03 19:11:30 +02:00
Jigar Amin - OpenERP ae8f2af542 [IMP] added mail alias under depedancy of the mail,group
bzr revid: jam@tinyerp.com-20120622052557-xmzgdsk85nyv1668
2012-06-22 10:55:57 +05:30
Olivier Dony 53d54c80a0 [IMP] mail: initial model for mail.alias - work-in-progress
bzr revid: odo@openerp.com-20120614141732-oa6fhfqgl887c04i
2012-06-14 16:17:32 +02:00
Thibault Delavallée dc890702a5 [FIX] mail module: added ir_needaction file to __init__.py .
bzr revid: tde@openerp.com-20120608132312-j4wc631omemb15ah
2012-06-08 15:23:12 +02:00
Thibault Delavallée a3ca99e7bc [MOVE] Moved log analysis (based on now removed res.Logs) to mail.message reports.
bzr revid: tde@openerp.com-20120404132328-gfjop8t7n14ghpf8
2012-04-04 15:23:28 +02:00
Thibault Delavallée bb1b6fe176 [ADD] res_users: added res_users.py file, making res.users in heriting from mail.thread. This is necessary to use mail.thread API on users (for tweets).
bzr revid: tde@openerp.com-20120222115924-i55twzupuuzuc3gl
2012-02-22 12:59:24 +01:00
Thibault Delavallée fe065c137d Moved subscription model from mail_group to mail_subscription file
bzr revid: tde@openerp.com-20120201164902-ensm98a517vdz9nb
2012-02-01 17:49:02 +01:00