diff --git a/helpdesk_mgmt/README.rst b/helpdesk_mgmt/README.rst index 80ae18137a..c2b0c793d5 100644 --- a/helpdesk_mgmt/README.rst +++ b/helpdesk_mgmt/README.rst @@ -55,7 +55,7 @@ Channels 3. Set the name for the channel. 4. You can also Activate or Deactivate channels. -|image1| +|image0| Categories ---------- @@ -66,7 +66,7 @@ Categories 3. Set the name for the category. 4. You can also Activate or Deactivate categories. -|image2| +|image1| Stages ------ @@ -83,7 +83,7 @@ Stages 8. You can add a description for the stage. 9. You can also Activate or Deactivate stages. -|image3| +|image2| You can also sort the stage sequence if you move up or down the stages in the list view. @@ -97,7 +97,7 @@ Teams 4. Add the teams members. 5. You can also Activate or Deactivate teams. -|image4| +|image3| Tags ---- @@ -109,7 +109,7 @@ Tags 4. Set the color index for the tag. 5. You can also Activate or Deactivate tags. -|image5| +|image4| Permissions ----------- @@ -125,11 +125,11 @@ permissions set in Helpdesk. not assigned to any team nor user. 3. *User*: User is able to see all the tickets. -.. |image1| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Channels.PNG -.. |image2| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Categories.PNG -.. |image3| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Stages.PNG -.. |image4| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Teams.PNG -.. |image5| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Tags.PNG +.. |image0| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Channels.PNG +.. |image1| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Categories.PNG +.. |image2| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Stages.PNG +.. |image3| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Teams.PNG +.. |image4| image:: https://raw.githubusercontent.com/OCA/helpdesk/17.0/helpdesk_mgmt/static/description/Tags.PNG Usage ===== @@ -162,11 +162,11 @@ To create a new ticket from the kanban view: Known issues / Roadmap ====================== -- Add a tour feature similar to what the ``project`` module defines to - discover projects / tasks. -- Update portal tests defined in ``tests/test_portal.py`` to rely on - tour specs (in JS) in order to replicate the navigation behavior of - portal users. +- Add a tour feature similar to what the ``project`` module defines to + discover projects / tasks. +- Update portal tests defined in ``tests/test_portal.py`` to rely on + tour specs (in JS) in order to replicate the navigation behavior of + portal users. Bug Tracker =========== @@ -195,54 +195,54 @@ Authors Contributors ------------ -- `Domatix `__: +- `Domatix `__: - - Carlos Martínez - - Catalin Airimitoaie - - Álvaro López - - Samuel Calvo + - Carlos Martínez + - Catalin Airimitoaie + - Álvaro López + - Samuel Calvo -- `Adaptive City `__: +- `Adaptive City `__: - - Aitor Bouzas + - Aitor Bouzas -- `SDi Soluciones, S.L. `__: +- `SDi Soluciones, S.L. `__: - - Oscar Soto - - Jorge Luis Quinteros + - Oscar Soto + - Jorge Luis Quinteros -- `C2i Change 2 improve `__: +- `C2i Change 2 improve `__: - - Eduardo Magdalena + - Eduardo Magdalena -- `Factor Libre `__: +- `Factor Libre `__: - - María Alhambra - - Daniel Cano + - María Alhambra + - Daniel Cano -- `Tecnativa `__: +- `Tecnativa `__: - - Pedro M. Baeza - - Víctor Martínez - - Carolina Fernandez - - Carlos Roca + - Pedro M. Baeza + - Víctor Martínez + - Carolina Fernandez + - Carlos Roca -- `ID42 Sistemas `__: +- `ID42 Sistemas `__: - - Marcel Savegnago - - Eduardo Aparício + - Marcel Savegnago + - Eduardo Aparício -- `Obertix `__: +- `Obertix `__: - - Vicent Cubells + - Vicent Cubells -- `Solvos `__: +- `Solvos `__: - - David Alonso + - David Alonso -- `XCG Consulting `__: +- `XCG Consulting `__: - - Houzéfa Abbasbhay + - Houzéfa Abbasbhay Maintainers ----------- diff --git a/helpdesk_mgmt/__manifest__.py b/helpdesk_mgmt/__manifest__.py index eb6c169bef..2aa6b0bad3 100644 --- a/helpdesk_mgmt/__manifest__.py +++ b/helpdesk_mgmt/__manifest__.py @@ -36,7 +36,7 @@ "demo": ["demo/helpdesk_demo.xml"], "assets": { "web.assets_frontend": [ - "helpdesk_mgmt/static/src/js/new_ticket.js", + "helpdesk_mgmt/static/src/js/new_ticket.esm.js", ], }, "development_status": "Production/Stable", diff --git a/helpdesk_mgmt/static/description/index.html b/helpdesk_mgmt/static/description/index.html index a195d245a2..acd683d6b6 100644 --- a/helpdesk_mgmt/static/description/index.html +++ b/helpdesk_mgmt/static/description/index.html @@ -413,7 +413,7 @@

Channels

  • Set the name for the channel.
  • You can also Activate or Deactivate channels.
  • -

    image1

    +

    image0

    Categories

    @@ -424,7 +424,7 @@

    Categories

  • Set the name for the category.
  • You can also Activate or Deactivate categories.
  • -

    image2

    +

    image1

    Stages

    @@ -441,7 +441,7 @@

    Stages

  • You can add a description for the stage.
  • You can also Activate or Deactivate stages.
  • -

    image3

    +

    image2

    You can also sort the stage sequence if you move up or down the stages in the list view.

    @@ -454,7 +454,7 @@

    Teams

  • Add the teams members.
  • You can also Activate or Deactivate teams.
  • -

    image4

    +

    image3

    Tags

    @@ -466,7 +466,7 @@

    Tags

  • Set the color index for the tag.
  • You can also Activate or Deactivate tags.
  • -

    image5

    +

    image4

    Permissions

    diff --git a/helpdesk_mgmt/static/src/js/new_ticket.esm.js b/helpdesk_mgmt/static/src/js/new_ticket.esm.js new file mode 100644 index 0000000000..92c11ecbce --- /dev/null +++ b/helpdesk_mgmt/static/src/js/new_ticket.esm.js @@ -0,0 +1,35 @@ +// /** @odoo-module **/ +import {_t} from "@web/core/l10n/translation"; +import {humanNumber} from "@web/core/utils/numbers"; +import publicWidget from "@web/legacy/js/public/public_widget"; + +publicWidget.registry.NewTicket = publicWidget.Widget.extend({ + selector: "form[action='/submitted/ticket']", + events: { + 'change input[name="attachment"]': "_onChangeAttachment", + }, + _onChangeAttachment(ev) { + ev.preventDefault(); + const attachment_input = document.getElementById("attachment"); + const information_input = document.getElementById("attachment_information"); + information_input.style.display = "none"; + const max_upload_size = parseInt( + attachment_input.getAttribute("max_upload_size"), + 10 + ); + const dt = new DataTransfer(); + for (const file of attachment_input.files) { + if (file.size > max_upload_size) { + information_input.textContent = _t( + "The selected file (%sB) is over the maximum allowed file size (%sB).", + humanNumber(file.size), + humanNumber(max_upload_size) + ); + information_input.style.display = ""; + } else { + dt.items.add(file); + } + } + attachment_input.files = dt.files; + }, +}); diff --git a/helpdesk_mgmt/static/src/js/new_ticket.js b/helpdesk_mgmt/static/src/js/new_ticket.js deleted file mode 100644 index 5c7625c321..0000000000 --- a/helpdesk_mgmt/static/src/js/new_ticket.js +++ /dev/null @@ -1,36 +0,0 @@ -odoo.define("helpdesk_mgmt.new_ticket", function (require) { - "use strict"; - var publicWidget = require("web.public.widget"); - var core = require("web.core"); - var utils = require("web.utils"); - var _t = core._t; - - publicWidget.registry.NewTicket = publicWidget.Widget.extend({ - selector: "form[action='/submitted/ticket']", - events: { - 'change input[name="attachment"]': "_onChangeAttachment", - }, - _onChangeAttachment(ev) { - ev.preventDefault(); - const attachment_input = document.getElementById("attachment"); - const max_upload_size = attachment_input.getAttribute("max_upload_size"); - const dt = new DataTransfer(); - for (const file of attachment_input.files) { - if (file.size > max_upload_size) { - this.displayNotification({ - title: _t("File upload"), - message: _.str.sprintf( - _t("%s file exceed the maximum file size of %s."), - file.name, - utils.human_size(max_upload_size) - ), - type: "danger", - }); - } else { - dt.items.add(file); - } - } - attachment_input.files = dt.files; - }, - }); -}); diff --git a/helpdesk_mgmt/views/helpdesk_ticket_templates.xml b/helpdesk_mgmt/views/helpdesk_ticket_templates.xml index f102037fd0..1a2983fc61 100644 --- a/helpdesk_mgmt/views/helpdesk_ticket_templates.xml +++ b/helpdesk_mgmt/views/helpdesk_ticket_templates.xml @@ -479,6 +479,11 @@ t-att-max_upload_size="max_upload_size" />
    +