Commit Graph
36 Commits
Author SHA1 Message Date
ijas ahammed d361d49481 [IMP] website_crm_partner_assign: improve opportunity front-end page
This commit improves the following:
 - Hides the icons under the 'Contact' section if the related
   information is not available.
 - Moves the 'Next Activity Date' next to 'Next Activity' on
   opportunity edition dialog, and opens the date-picker to
   schedule next activity below the input instead of above it.
 - Increased the height of 'Details Next Activity' textarea so
   that 'Next Activity Date' picker can be shown within the modal
   without introducing scroll-bar.
 - This commit renames the label 'Title' to 'Opportunity' to avoid
   confusion, and auto-fills it based on the 'Contact Name' for the
   modal that is used for creating opportunities from front-end.

   Apart from that, this commit also improves string of the button
   responsible to create new opportunity from front-end.

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

Part-of: odoo/odoo#67524
2021-10-19 15:58:49 +00:00
Dharmraj Jhala a8d23ac374 [IMP] website_crm_partner_assign: fix multi datepickers on portal
When a portal user is editing opportunity from front-end, there are
two date inputs, 'Expected Cloing' and 'Next Activity Date'. But both
of them have two pickers for selecting date, a native one and a
bootstrap one, which was probably side effect of commit[1].

With this commit, we only keep the bootstrap picker so that it
respects the date format based on language, and for the check,
to make sure it doesnt break the backend (see ticket from commit[1]
for more details), we simply consider the date with year less than
1900 as invalid.

We also provide a bit more space for bootstrap datpicker to open while
setting the closing date, so that the scrollbar is not introduced on
the modal. And for the next activity date, we make sure that the
picker is opened always on top of the input (which is not the case
currenlty in some screensizes, sometimes it is opened below the input
so it is hidden under the extra scroll introduced with picker).

commit[1] - https://github.com/odoo/odoo/commit/b2b639b693dd7215e3ee501ac89c35f3a6b88bb5

TaskID-2624728

closes odoo/odoo#77289

X-original-commit: da7cac9b1293a0b8d5375e1b4a470f41fe76e8a4
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2021-09-28 06:48:45 +00:00
Nasreddin Boulif (bon) e566844378 [FIX] website_crm_partner_assign: allow editing contact from portal
Issue

  - Install 'addons/website_crm_partner_assign' module
  - Create a partner X without a phone number (edit only name).
  - Save and click on "Opportnuties" stat button
  - Create an opportunity Y and set X as customer
  - Edit it and set "Joekl Willis" as assigned partner
  - Logout then login with portal user (Joel Willis)
  - Go to "My account" page and click on "Opportunities"
  - Select the opportunity Y and edit "Contact"
  - Change phone number then save

  Access error message:
  (not allowed to access 'Contact' (res.partner) records)

Cause

  When editing the opportunity (OPP) phone (or email_from) field,
  if a partner is linked to the OPP and the phone is different,
  we will update also the phone of the partner.
  User portal is not allowed to edit partner.

Solution

  If user has write access on lead, use sudo() to update lead.
  Raise an error if a user want to update a non allowed field
  from portal through the contact lead form.

opw-2530744

closes odoo/odoo#72453

X-original-commit: 7d41ab05e5b3d78df5f60848ad440988cd98b6e0
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-06-21 14:45:16 +00:00
Patrick Hoste 8066ab4348 [REF] crm: update revenue fields names
PURPOSE

Link field name with their content.

SPECIFICATIONS

This commit changes the field name "expected_revenue" into "prorated_revenue"
and the field name "planned_revenue" into "expected_revenue".

Indeed content of those fields evolved since their first naming. Their content
is not what the field name indicates. Better rename those fields to understand
code flow inside CRM.

LINKS

Task ID-2283052
odoo/odoo#54194
odoo/enterprise#12423
odoo/upgrade#1463
2020-08-14 12:59:27 +00:00
Kevin Baptiste 6cbe824871 [REV] web: reverts update to fontawesome 5.11.2
This reverts commit ff1c35513a.

closes odoo/odoo#41480

X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc
Related: odoo/enterprise#7110
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-09 10:33:36 +00:00
Kevin Baptiste ff1c35513a [IMP] web: update to fontawesome 4.7.0 to 5.11.2
FontAwesome 5 introduced new names for some icons as described on
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes

This commit replaces the old names to the new ones.

closes odoo/odoo#35826

Taskid: 2050241
Related: odoo/enterprise#5180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 10:05:12 +00:00
Nicolas Seinlet 0855f94181 [FIX] website_crm_partner_assign: force date format as format is forced in XML
https://github.com/odoo/odoo/blame/saas-12.3/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml#L674

closes odoo/odoo#35697

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-08-13 14:02:48 +00:00
Martin Trigaux 40421be73c [MERGE] Forward port of saas-12.2 to saas-12.3 up to cf8e74a1a7
closes odoo/odoo#34907

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 11:44:38 +00:00
Julien Castiaux b2b639b693 [FIX] website_crm_partner_assign: use html5 input date over text
Create a lead, assign it to a partner who has portal access. Go to that
opportunity on the portal, edit any date to set 3-digit year (0-999) and
submit the form. Go to the opportunity using the web app, traceback.

Dates are only supported starting to 1900 thus many parsing function
assume the year to be a 4-digits year. The html form has been changed to
use an input type date with a minimum value instead of a plain text
input. This ensure a better support by browser (they use their built-in
calendar) and allow basic html5 form validation.

opw-2033276

closes odoo/odoo#34796

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-07-11 12:05:54 +00:00
Lucas Perais (lpe) 74bd66e1b5 [FIX] website_crm_partner_assign: portal edit activity change activity type
On the portal, edit a Lead in order to make/edit the
next activity
Change the activity type

Before this commit, the modal closed when clicking on the selection field
This was because the wrong method was called

After this commit, the modal stays and the activity type is changed

OPW 1943428

closes odoo/odoo#31349
2019-02-25 09:38:39 +00:00
Jeremy Kersten 7c68d2ac19 [FIX] website_crm_partner_assign: fix next activity on change + datepicker
next_activity broken by a previous refactoring of js.
date picker broken by bs4 and JS don't handle local format.

closes odoo/odoo#32263

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-29 14:23:11 +00:00
7a899753c1 [REF] website_crm_partner_assign: adapt code after jQuery update
Part of task 1896658

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-03-06 20:07:17 +01:00
Christophe Simonis 25e5f0c7ab [MERGE] forward port branch saas-12.2 up to 06898fac3c 2019-02-28 14:45:13 +01:00
qsm-odoo d946b7a85d [REF] website, *: use public widgets instead of website animations
* website_blog, website_crm_partner_assign, website_event,
  website_event_track, website_form, website_forum, website_links,
  website_mail, website_mail_channel, website_mass_mailing,
  website_sale, website_sale_comparison, website_sale_delivery,
  website_sale_stock, website_sale_wishlist, website_slides,
  website_twitter

While using the 'Animation' class of website instead of the frontend
'Widget' class leads to the same behaviors, this refactoring is done for
two reasons:
- Stop using the confusing 'Animation' name for non-animated behaviors
- Instantiation of 'Widget' is slightly faster than 'Animation'

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:09:23 +00:00
qsm-odoo 335a505d1f [REF] website, *: move and review the notion of edit mode
* portal, sale, web, website_blog, website_crm_partner_assign,
  website_forum, website_event_track, website_links, website_mail,
  website_slides, website_mail_channel, website_mass_mailing,
  website_sale, website_sale_comparison, website_sale_delivery,
  website_sale_wishlist

The `editableMode` option and its related options in public widget
should only be part of website, this commit moves them there. This is
also the occasion to implement something that is long overdue: stop
creating 'animations' / public widgets in edit mode by default. Indeed,
lots of 'animations' were defined by beginning with 'if not edit mode'.
Now, if a public widget should be considered in edit mode, it must be
defined explicitely through a property at *definition* of the widget.

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:09:22 +00:00
qsm-odoo 6d67ce5b7c [REF] website_*: review reorganization and enforce conventions
Review the JS reorganization made by direct parent commits and do more
to use our defined JS conventions. Also simplify JS which can be
obviously improved.
2018-11-28 10:28:53 +00:00
Andrea Ulliana 0bd719caac [REF] website_crm_partner_assign: reorganize javascript 2018-11-28 09:49:09 +00:00
qsm-odoo 55131b8f5b [REF] website, *: add automatic context for call_kw rpc
* web_editor, website_blog, website_crm_partner_assign, website_links,
  website_livechat, website_mail_channel, website_mass_mailing,
  website_slides

Calling a model's method thanks to an RPC will now always send the
web_editor context automatically, making sure the method gets the
website_id all the time, removing the need to guess the current website
(now the get_current_website method uses the context website_id if any).

Note: other routes already have the website_id via request.env.context
if they correctly set website=True (this commit also adds website=True
for scss files customization routes).
2018-09-30 19:55:17 +02:00
stefanorigano 1d9208c4fa [REF] *: improve app icons, add SVG version
- Uniform colors and design
- Replace duplicated icons (eg. sale / sale_management)
- Improve misleading icons (eg. POS)
- Add icons for new apps

Add SVG versions to lossless future editing and print/marketing use.

task-54681
2018-08-09 15:46:06 +02:00
qsm-odoo 2972976962 [REF] web_editor, website, *: complete refactoring
* mass_mailing, payment, point_of_sale, portal, survey, web, web_tour,
  website_blog, website_crm_partner_assign, website_event,
  website_event_questions, website_form, website_forum, website_gengo,
  website_hr_recruitment, website_links, website_mail,
  website_mail_channel, website_mass_mailing, website_quote,
  website_sale, website_sale_options, website_slides, website_twitter

This commit reviews the whole "JS side" of the web_editor and website
apps. This is a first step to be able to improve them with new and
better functionnalities; this commit is not supposed to change any
visual behavior.

The main goal was to achieve a structure similar to the backend one.
Now, the frontend side also has a root widget (like the WebClient)
and all other widgets are attached to it one way or another. This allows
the benefits of using the 'trigger_up' functionnality for example.

As RPC are now mainly done with the `this._rpc` functionnality (being
possible thanks to the parent hierarchy), the frontend will also be
possible to test thanks to QUnit in a future update (besides the "text"
editor side which still requires a refactoring to be able to do that).

---

Here are some of the changes:

(-) conventions and documentation

The code has been updated to follow JS conventions and a lot of code has
been commented (around +2000 lines of comment). This also means that
lots of functions have been renamed to use camelCase or simply to make
their name understandable.
See https://github.com/odoo/odoo/wiki/Javascript-coding-guidelines.

(-) deprecated: web_editor.base

The "web_editor.base" module has been split and does not force the
modules which require it to wait for DOM ready anymore. This was indeed
slowing loading times, but also prevented to use some modules in some
contexts (see the LESS editor use in web_studio which is the subject of
another task).
Now the "editor context" can be got thanks to the "web_editor.context"
JS module with its "get" function.
The "web_editor.base" module should probably not be used anymore (see
its code and recent updates).

(-) new: web.dom_ready

If a JS module should wait for the DOM to be ready to be executed, a
new JS module has been created: "web.dom_ready". This should always
be used in a module which only want to instantiate stuff. Do not
extend (or worst, include) classes after DOM ready.

(-) website.website

The "website.website" module has been split. "website.website" does not
return anything useful anymore, it just initialize some miscellaneous
stuff, without waiting for the DOM to be ready. You might want to check
"website.utils", "website.content.compatibility" or `WebsiteRoot`. Also
`website.form` has been deleted (use `this._rpc`), so has been
`website.error`. `website.prompt` will be removed in a future update to
be replaced by `Dialog.prompt`.

(-) widgets are great

Many classes which were not widgets are now widgets. This allows them to
use the 'events', the 'xmlDependencies' and the 'this._rpc' features for
example. Here are some of the main ones:

- Snippet options: these were classes with a `$el` for the menu element
    and `$target` for the customized element. This is still the case
    but following standard `Widget` structure (one exception: using
    `this.$(...)` searches in the `$target` as before this update).

- Snippet animations: instead of class instances with a `$target`
    element which can be `start` and `stop`, these are now standard
    widgets which can be `start` and `destroy`. `this.$target` is
    an alias to `this.$el` for ease of compatibility.

- Snippet editors: instead of class instances in charge of an editor
    overlay, these are now widgets. Each "child" snippet editor is
    properly attached as a "child", which allows editors to communicate
    and to be properly destroyed.

(-) root widgets and website navbar

The frontend is different of the backend. In the backend, the page has
an empty <body/> element and all the components are instantiated from
parent to children (i.e. the `WebClient` is instantiated and is in
charge of instantiating the `ControlPanel`, etc). The frontend cannot
work like that on page loadings as they are way more frequent than in
the backend and we do not want them to flicker. A frontend page is
loaded as a <body/> element which already contains the website navbar
and its menus and the whole content page. JS code has to be "attached"
to these existing elements. This is possible thanks to the `RootWidget`
instances and the specialized `WebsiteRoot`, `IframeRoot` and
`WebsiteNavbar` (see code for details).

(-) lazy loading

No more (or at least a lot less) XML/JS has to be loaded on page
loading, thanks to the use of the `Widget.xmlDependencies` feature.
XML which have to be lazy loaded is loaded only on related Widget
instantiation if necessary, which allows to execute a lot of JS code
before the DOM is ready and to start many widgets on DOM ready (not
later). A visual benefit of this is clicking on the 'edit' button as
soon as it is possible: before this commit, this was sometimes not
doing anything as event handlers were not binded yet.

Still a possible exception: loading the session and locales. This may
be asynchronous stuff which is still required before widget
instantiations but this will be the subject of another task.

(-) deprecated code and code location

More than reviewing code and organizing it, many apparent dead code was
removed. More importantly, mislocated code was put in the right app.
This is the case for snippet animations which is a concept for website
apps but was defined in the web_editor app, or some translation concepts
which were part of website but should have been part of web_editor.

---

There are probably more things to say about this commit but I will let
the comments speak for those.
2017-08-16 11:04:14 +02:00
Géry Debongnie 2106e3dd2e [REF] web, *: simplify our RPC system (in JS)
The RPC system was not completely satisfactory, we decided to prepare
the future and do it properly.  This commit introduces the new rpc
system, which replace the previous new one.  We now simply have a
method, this._rpc, which takes a dictionary of parameters.  The idea is
that depending on the parameters, it is able to add correct default
value when necessary.

For situations where we don't have the this._rpc method, we can use the
rpc.query method, which takes the same arguments, but directly calls
ajax.rpc instead of triggering up some events.
2017-04-11 19:44:38 +02:00
Géry Debongnie 86a87aa8b0 [REF] *: use _rpc method for all rpcs
The _rpc method is now the preferred method to do a rpc, so we need to
update all calls.
2017-04-11 19:44:38 +02:00
Géry Debongnie e574027056 [REF] web,*: remove 'web.model' and 'web.dataModel
Use this.rpc instead of Model object, with web.ajax if necessary.

nb: EventDispatcherMixin include now the custom_events managment instead
of widget
2017-04-11 19:44:38 +02:00
Jeremy Kersten 4334715294 [fix] website_crm_partner_assign: avoid duplicate creation of opp in portal.
Disable confirm button during creation to avoid double click, triple click,
quadruple click, quintuple click and even undecuple click ... n-tuple click
2017-02-01 09:05:45 +01:00
Jeremy Kersten 85f7d4b5f2 [FIX] website_crm_partner_assign: fix date_deadline and active_date_deadline mixing
Now we only update/create activity if a date has been setted.
Now we save the deadline that user encode
2017-02-01 09:05:45 +01:00
Ravi Gadhia 87e457158e [IMP] crm, website_crm: replace support of activities
crm.lead model now supports activities. Filters have been added to ease
their management. Mail activities replace the old crm.activity model. All code
related to crm.activity is then removed, including views and custom widget.
Standard activities feature is now used widely in Odoo addons and replace
those custom activities.

A small update is required in website_crm_partner_assign. Now the portal user
can only update or create its own activities aka assigned to him. If he has
an activity assigned to him it is displayed in the opportunity website view.
If not editing the opportunity will create a new activity assigned to him.
2016-12-21 10:58:49 +01:00
Thibault Delavallée 0bc2cbe149 [FIX] website_crm_partner_assign: fix selector use 2016-12-21 10:53:38 +01:00
Christophe Simonis c292202a47 [MERGE] forward port branch 10.0 up to 18456b9 2016-12-09 15:58:39 +01:00
Jeremy Kersten d3ea014f56 [FIX] website_crm_partner_assign: avoid double click on button
Disable the button at first click to avoid concurrent update when the
user press several time the same button before the end of the first request.

Replace tab by space indentation
Clean unused variable
2016-12-07 15:48:20 +01:00
Jeremy Kersten 1f34c507c7 [TYPO] website_crm_partner_assign: convert tab to space 2016-11-21 11:22:25 +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
Christophe Simonis 856476d441 [MERGE] forward port branch saas-12 up to b1b700a 2016-09-22 15:23:45 +02:00
Jeremy Kersten 6dc985b0ad [FIX] website_crm_partner_assign: allow partner to be uninteressed for a lead.
Avoid traceback "'int' object has no attribute 'partner_id'"
uid is the id and not the browser record of 'user'

Avoid traceback: Database fetch misses ids (u'<id>') and has extra ids (<id>),
 may be caused by a type incoherence in a previous request.
JS call with id as string.

Avoid traceback: Invalid value res.partner(x,y,z) in domain term ('partner_id', 'in', res.partner(x,y,z))
Search in new api return browseRecord now

Avoid to write on a lead without the right on it.
2016-09-21 16:21:51 +02:00
Jainik Patel a4d7540ed9 [ADD] various: add missing icons for website apps 2016-08-18 16:45:38 +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