Commit Graph
31 Commits
Author SHA1 Message Date
Aktiv Software b27d1176f8 [FIX] website_crm_partner_assign: fix template variable usage
Fixed error on rendering template of email_template_lead_forward_mail when
clicking Forward to partner.

Issue is
'dict' object has no attribute 'lead_id'.

This was because in Odoo v14, jinja was used and using a dict like properties
was ok. With QWeb it crashes and we have to correctly handle the dict.

Fixes #79492
Task-2657930

closes odoo/odoo#80259

X-original-commit: 7facd634328ad2038a13f75a3616b753e8fef147
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-23 14:42:12 +00:00
Thibault Delavallée 2e5c7fda07 [FIX] website_crm_partner_assign: fix template using unknown variable
Jinja was tolerant to missing variables, QWeb not at all. Let us fix templates
that use outdated or invalid variables.

Task-2657930 (Email templates fixup)

X-original-commit: 1c179d58bf2d4e4c3c9b05d08475966d75754cc6
Part-of: odoo/odoo#79895
2021-11-17 08:26:24 +00:00
std-odoo be996fdc00 [IMP] crm_*: add more fields when we merge multiple leads
Purpose
=======
Add more fields when we merge multiple leads to be sure not lose
valuable information.

Specifications
==============
Those fields are propagated to the destination if the value on the
destination is Falsy
- referred
- color
- recurring_revenue
- recurring_plan
- function
- lang_id
- date_deadline
- reveal_id
- lead_mining_request_id
- reveal_ip
- reveal_iap_credits
- reveal_rule_id
- event_lead_rule_id
- event_id

The "lost_reason" field is propagated to the destination only if it's
lost (otherwise, it makes no sense to have a lost reason on a non-lost
lead).

The field "iap_enrich_done" is set to True if at least one lead has been
enriched.

We also keep the sum of all the lead tags (and remove any potential
duplicates).

The address is taken from the lead with the most non-empty address
fields (sorted by highest rank if multiple lead have the same amount
of non-empty fields).

Task-2447721
PR odoo/odoo#75742
2021-10-19 15:58:58 +00:00
ijas ahammed b28aae2a71 [IMP] website_crm_partner_assign: add data, action helper and rename menu
- For sake of having basic config for 'Partner Level' and 'Activation'
  in contact form view (until user discovers the dedicated menus under
  CRM > Configuration > Resellers) in blank db, this commit moves the
  demo data related to 'Partner Level' to data, and adds new data for
  'Activation', in following sequence:

  - Fully-Operation
  - Ramp-up
  - First Contact

  Also, higher ranks for partner level and activation are considered
  better, and so the tree views for them now display the records in
  the order of their rank (highest on top).

  Note that with this commit, we remove 'Platinum' partner level and
  it's references that were available in demo data.

- Apart from that in this commit we have also done these changes,
  - Renames the menu 'Partner Level' to 'Partner Levels' and adds
    action helper for the same.
  - Adds action helper for the 'Partner Activations' menu.

TaskID-2443894
closes https://github.com/odoo/odoo/pull/67524

Part-of: odoo/odoo#67524
2021-10-19 15:58:48 +00:00
Nicolas Bayet 4813f42997 [IMP] mail,*: replace jinja with qweb
Jinja as a templating engine was problematic in differents respect:
- introduce external dependency to Odoo (less controll)
- add another templating mechanism in the stack
- specific feature in qweb cannot be reused
- difficulty in rendering easily editable templates
- more knowledge required with no betterment

By replacing jinja with qweb we can now build tools to edit a qweb
that will work with the previously jinja encoded document
(essentially `mail.template` records).

There is a catch however. Some email fields (eg. email_to) used jinja
syntax for rendering dynamic variables (ie. ${object.something} and
${object.something_that_should_not_be_escaped | safe}).

We still want user to use dynamic variables for some char fields (eg.
subject, from, to, ...). We made a new rendering engine called
"inline_template" that will render an expression enclosed by `{{` and
`}}`.

To be able to edit the templates from the backend interface, a
plugin to the Odoo editor has been made for seamlessly edit the
document.

This qweb plugin includes:
- make dynamic variables (eg. `<t t-out="variable"/>`) not editable
  (for preventing the user to shoot himself in the foot)
- group and hide related logical branching (ie. t-if, t-elif, and t-else)
  in order to see only one at once
- a floating select input to switch visibility of a particular logical
  branching

Task-27033

X-original-commit: odoo/odoo@68182baff4
Part-of: odoo/odoo#77377
2021-09-28 23:42:54 +00:00
nounoubensebiaandAurélien Warnon e2d11fa279 [IMP] [website_]crm: post crm.leads merge message using a full template
Use a template for merge post messages and clean how fields are displayed,
notably by fixing the display format, and the field order.

Indeed, previously posted lead merge message contained all fields in an
alphabetical order, even ones that had empty values, which is not very user
friendly in terms of display.

Now, the displayed fields are determined and ordered by sections, which greatly
improves understanding the various information.
Please note however, that it has the downside of not including all fields
anymore.

The merged leads information are included in a "read more/read less" enabled
block using the "data-o-mail-quote" feature to get a nice rendering and avoid
cluttering the Odoo chatter UI.

Within the sent mail however, the full text is directly visible when viewing
through a mail client.

Task-2451164

closes odoo/odoo#75946

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Aurélien Warnon <awa@odoo.com>
2021-09-22 12:22:32 +00:00
Thibault Delavallée 80e1987869 [MOV][IMP] crm(_partner_assign): reorganize qweb / jinja templates used for mailing
PURPOSE

Clean organization of templates in odoo apps: mail.template records in data,
qweb templates (views) used directly in code, notably using post with view.
Purpose is to ease future improvements in posting based on templates.

SPECIFICATIONS

  * move those templates in their own file to ease their discovering and
    maintenance;
  * put them into data (as those are not views even if it contains qweb)
  * guidelines are now :

    -> Qweb templates should be in data/mail_templates.xml;
    -> mail.template records should be in data/mail_template_data.xml;

  * put their declaration in no update when not done if template has no
    technical code or complex dependency on underlying code;
  * move found mail data (mail.message.subtype or mail.activity.type) records
    in a mail_data file that should contain only "core" records linked to mail;

LINKS

Task ID-2375767
COM PR odoo/odoo#61814
ENT PR odoo/enterprise#14775
UPG PR odoo/upgrade#1936
2020-11-25 12:31:14 +00:00
DramixDw 9b9829416b [IMP] website: simplify website menu
Some apps, once installed, automatically create a menuitem in website.
What complexify the UI and create useless menu withtout plusvalue.

It is not because you install livechat to make support online, that you want
a link in your menu to show stats e.g.

Now we remove the default menu created, and help user to find it when he create
a link. The autocomplete suggest most of the main App's controllers

task-2189613

closes odoo/odoo#49081

Related: odoo/enterprise#9733
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-05-01 07:59:07 +00:00
Rémy Baranx (bar) fd4798195d [IMP] crm, sales: add crm tags on sale orders
As the crm.lead.tags model shall be used in CRM and/or Sales apps,
it has been moved to the sales_team module, which is a depedency
of the CRM and Sales apps.

As these tags becomes more generic than just "lead tags", the model
has been renamed from crm.lead.tags to crm.tags.

Tags on sale orders were already present but not visible. They are
now visible in the "Other Info" section, and optionally in sale order
tree views.

When a quotation is created from an opportunity (CRM app), existing tags
are populated from the opportunity to the sale order (Sales app).

Views and demo data of several modules have been updated accordingly.

Task ID 2191276
2020-03-23 09:08:47 +00:00
mcm-odooandThibault Delavallée de1743ab12 [REF] mail, various: remove user_signature field from mail.template
RATIONALE

Mail template model holds a field telling odoo mail engine to automatically
add the current user's signature to the body. Its use depends on the use
case

  * using the template in the composer on a single record: it is displayed
    in the rendered template in the composer, meaning people could change it.
    This behavior is interesting as it allows to see the email content;
  * using the template in the composer in mass mail mode: it is not displayed
    as only the raw jinja is displayed. It is therefore not obvious that it
    will be appended to the body of the mail. People could add it manually and
    have 2 signatures as a result;

A mechanism automatically adding a signature to sent emails when posting a
message is already implemented and is based on template existence. If a
template has been used when posting, no signature is added in sent emails.
Otherwise it is automatically added. This behavior should not change.

Behavior will therefore be

  * use a template -> specify signature usage in it manually through jinja;
  * do not use a template -> signature added in sent emails;

SPECIFICATIONS

Remove user_signature.

Update template body accordingly. In customer oriented templates that are using
it and do not already contain it, manually add a call to user.signature within
the jinja code. When set to False, just remove its declaration.

Quickly clean some signature integration.

LINKS

Task ID 2089252
Community PR odoo/odoo#39482
Enterprise PR odoo/enterprise#6459
Upgrade PR odoo/upgrate#761

Related: odoo/enterprise#6459
Related: odoo/upgrade#761
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-02-11 14:01:13 +00:00
Victor Feyens d4e0fe018d [IMP] *: use ref= instead of eval="ref(' in xml field tags.
* Code cleanup
* Avoid a safe evaluation of the field value when loading those records.

closes odoo/odoo#44883

Related: odoo/enterprise#8283
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-02-11 13:07:06 +00:00
Romain Derie cc1d78a80b [IMP] *: correctly read/write website_published
The `website_published` field from the website's mixins is basically a readonly
from `is_published` field.
On read, this field will simply read `is_published` and check if the record's
website_id is accessible (only for the multi mixin).
On write, it will always write on `is_published`.

This commit improves a few things:
- A lot of code was writting on website_published which was just then writting
  on is_published. Writting directly on is_published makes more sense.
- Some backend fields would still reference `website_published` instead of
  `is_published` which would just go through the related for no reason.
  Plus, using `is_published` will make the field tooltip more accurate as we
  are not in a website context ('Visible on current website' to 'Is Published')
- Filter and search on tree view were still using the `website_published`
  related field, which is just a readonly when we are not in a frontend
  context.
- Some create and write function would have security check on
  `website_published` value but that was wrong as the user could bypass that by
  simply writting on `is_published`. For the write method, check `is_published`
  is more accurate as it will cover both case since `website_published` will
  then call the write method on `is_published`
2019-08-03 09:51:22 +00:00
Thibault Delavallée a7ac71ed44 [FIX][IMP] various: perform small cleanup of mail templates
Notably
 * remove cdata and fix html code when necessary;
 * re-order fields declaration to have globally the same order in various
   template definition;
 * remove unnecessary reply-to, make user signature and auto delete fields
   explicit when necessary;
 * improve some name to ease template ordering and understanding in the
   template list view;

Related to task 1972615
Linked to PR #32872

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-23 14:26:50 +00:00
Thibault Delavallée 678e04c19d [FIX][IMP] various: improve lang computation in mail templates
Purpose: add lang definition on templates where it is missing

Related to task 1972615
Linked to PR #32872
2019-04-23 14:26:50 +00:00
Thibault Delavallée 0b74c9ab6e [FIX][IMP] various: improve recipients computation in mail templates
Purpose: use more email_formatted when possible, clean and simplify
email_from, email_to and partner_to computation.

Next step is to try to extract some common patterns in tools or methods in
order to simplify template creation and customization.

Related to task 1972615
Linked to PR #32872
2019-04-23 14:26:50 +00:00
Martin Trigaux 1b2913fcc0 [FIX] website_crm_partner_assign: set correct model name
Fixes odoo/odoo#27321
2018-10-05 11:38:03 +02:00
Fabien Pinckaers 7c8ab8a574 [IMP] base: improve kanban of modules, cards not clickable (top-right menu)
[NEW] base: show enterprise module, with an 'upgrade' button
[IMP] *: some modules renaming, and improved copywriting of manifest
[IMP] *: utm on links to odoo.com
2018-08-06 00:29:51 +02:00
Kirti Choudhary 711a8a82a3 [IMP] website_crm_partner_assign: make templates more modern and updated with Odoo guidelines
In this commit we improve templates used in website_crm_partner_assign.
Purpose of this commit is to have templates that embed or use standard Odoo
email layouts to make them look modern and have a common style across all
emails.

Main guidelines

 * better use of div / p / br to try to lessen layout issues, especially
   when updating templates using the editor;
 * correctly sequence the templates fields definition;
 * correctly set templates values notably auto_delete and user_signature
   fields to avoid confusion;
 * correctly layout the email content using light notification email. It
   can either propagate the layout choice through various send mail methods
   or directly embed the styling in the templates for more technical or
   complex templates;
 * use email_formatted computed field when possible to avoid having hand-made
   from / to addresses;
 * fix various typos and improve subjects when necessary;

Content of emails is not necessarily updated as the purpose of this task is
about styling, not content itself.

This commit is linked to task ID 1841503 (and 1868112) and to PR #25388
(and #25889).
2018-07-24 15:33:22 +02:00
Nirali SapraandDharmraj b2fefbd3c5 [IMP] portal, website, website_*: make footer content easy to customize
Previously, customizing the website footer was not very easy. This
commit will allow users to customize the footer like any other
snippet area.

There are several behavior changes, as mentioned below:

- Removed toggles 'Automatic Footer' and 'Payment Icons' from the
  Customize menu
- Language Selector was moved near the 'Copyright' section of the footer
  and features a dropdown (dropup technically) to select the language
- Moved some footer links from various modules to top menu
  List of the added menus / changed menus:
    (a) Resellers (new menu for previous footer link 'Resellers')
    (b) References (new menu for previous footer link 'Our References')
    (c) Forums (renamed from 'Forum', as a replacement of 'Forums'
        footer link, showing all the forums instead of 'Help', as there
        is no link available to all forums after this commit)
    (d) Live Support (new menu for previous footer link
        'Livechat Support')
    (e) Mailing Lists (new menu for previous footer link 'Mailing List')
    (f) Members (new menu for previous footer link 'Members')
- Links which were already available as a website menus (Presentations,
  Jobs, Events, News, Documentation, etc) are simply removed

Technical Notes:

- Introduced a new template called 'brand_promotion' in website.
  This will help to avoid adding redundant footer content (like
  copyright, language selector etc) from several modules (website_sale,
  website_event, website_quote, etc) while the only intention is to
  replace module page links.
- Removed summernote related fix in portal.less (caused by xpath)
  because footer is now customizable and added padding to structure
  instead of footer itself so that bg-color/img can be applied on
  whole footer.
- Few of the tours are improved to drag and drop snippets at proper
  places and not inside the footer.
- Used Flex in copyright portion of footer, so that text will always be
  horizontally centered (Some themes have different padding for buttons,
  etc, so if we don't align text dynamically, it has to be managed in
  particular theme and in particular layouts like full-screen / boxed.
  And if someone changes height of this portion, we have to re-design
  this portion again, etc).

task-38069
Closes https://github.com/odoo/odoo/pull/22298

Co-authored-by: Dharmraj <dja@odoo.com>
2018-05-29 11:13:28 +02:00
Jeremy Kersten f2cc28268c [FIX] website_crm_partner_assign: fix signature escaping
| safe was applied on '' and not user.signature
So the mail was send with the signature in text plain
2017-08-22 17:38:20 +02:00
Jérome Maes 1f3da58cfe [MOV] base,portal: make portal module empty
The goal is to prepare the removal of
'portal' module.

- demo portal user is moved into base
- 'is_portal' field on res.group too
- remaining security rule are moved to base too
- mail template is moved to website_portal
2017-03-23 09:59:58 +01:00
Martin Trigaux 51d5592a9d [FIX] product_email_template: bad html 2017-01-27 10:35:17 +01:00
Raphael Collet 34c661111b [IMP] base, *: tighten ir.model.access access rights
In `website_crm_partner_assign`, remove duplicate ACLs and reorganize files.
2017-01-03 16:52:50 +01:00
Christophe Simonis c292202a47 [MERGE] forward port branch 10.0 up to 18456b9 2016-12-09 15:58:39 +01:00
Jeremy Kersten 89994fbb88 [FIX[ website_crm_partner_assign: fix mail template
If user had no signature, False was displayed in the mail.
2016-12-07 14:53:42 +01:00
Jeremy Kersten c141fbb46f [IMP] website_crm_partner_assign: add own opportunities management
Allow partners with grades to add their own opportunity in their own pipe.
Until now, it is their saleman which import the opp in csv.
2016-11-21 11:22:05 +01:00
Jeremy Kersten 227aaa572c [FIX] website_crm_partner_assign: add mark as spam to allow auto reassign
Withtout it, we cannot reassign a lead since we don't know if the partner
refuses because he don't want the lead or because it is a wrong / spam lead.
2016-11-04 11:28:55 +01:00
rgo-odoo 053982f48d [MIG] website_crm_partner_assign: Code migration to new api 2016-07-05 17:27:44 +02:00
fwi-odoo c03b29b8b2 [MOV] crm_partner_assign: merge into website_crm_partner_assign 2016-07-01 09:59:10 +02:00
Vipul Bhatt 5dde1626f6 [ADD] website_crm_partner_assign: added frontend view for 'Leads' and 'Opportunities'
- Added 'Leads' and 'Opportunities' in menu and dashboard in 'My Account'
	- Added list views with filters and sorting features and detailed views
2016-07-01 09:58:04 +02:00
Richard Mathot 57e1cc4edd [ADD] website_crm_partner_assign: display demo data on website 2014-05-28 10:35:58 +02:00