Skip to content

Commit

Permalink
Add "Sale Feedback" module for customer feedback requests
Browse files Browse the repository at this point in the history
This new module introduces automated email feedback functionality for invoices. It includes configurations for scheduling feedback requests, customizable email templates, and rating integration with products. Additional resources like documentation, views, and translations are also included.
  • Loading branch information
dhongu committed Jan 5, 2025
1 parent f8001a9 commit 68017a9
Show file tree
Hide file tree
Showing 19 changed files with 783 additions and 0 deletions.
70 changes: 70 additions & 0 deletions deltatech_sale_feedback/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
=============
Sale Feedback
=============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:20af6dbb0b950795d5cebd12046a270c03e5c137b01a38cc6ab72bbf1f036aba
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-dhongu%2Fdeltatech-lightgray.png?logo=github
:target: https://github.com/dhongu/deltatech/tree/16.0/deltatech_sale_feedback
:alt: dhongu/deltatech

|badge1| |badge2| |badge3|

Features:
- Sends an automated e-mail to clients based on out invoices
- A cron job (default not active) is used to send the e-mails at 3 days after the invoice date. Another interval can be set using the sale.days_request_feedback system parameter
- E-mail template used: Invoice: request feedback

Descriere:
- Trimite la client un email pentru a cere feedback pentru produsele vandute.
- Trimiterea se face prin cron job (la instalare inactiv), default la 3 zile dupa data facturii. Daca se doreste alt interval, se foloseste paramentrul de sistem sale.days_request_feedback
- Template-ul de e-mail: Invoice: request feedback

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `Terrabit Issues <https://www.terrabit.ro/helpdesk>`_.
In case of trouble, please check there if your issue has already been reported.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Terrabit
* Dorin Hongu

Maintainers
~~~~~~~~~~~

.. |maintainer-dhongu| image:: https://github.com/dhongu.png?size=40px
:target: https://github.com/dhongu
:alt: dhongu

Current maintainer:

|maintainer-dhongu|

This module is part of the `dhongu/deltatech <https://github.com/dhongu/deltatech/tree/16.0/deltatech_sale_feedback>`_ project on GitHub.

You are welcome to contribute.
4 changes: 4 additions & 0 deletions deltatech_sale_feedback/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# © 2015-2022 Deltatech
# See README.rst file on addons root folder for license details

from . import models
22 changes: 22 additions & 0 deletions deltatech_sale_feedback/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# © 2015-2019 Deltatech
# See README.rst file on addons root folder for license details

{
"name": "Sale Feedback",
"summary": "Sale Feedback",
"version": "17.0.1.0.5",
"category": "Sales",
"author": "Terrabit, Dorin Hongu",
"website": "https://www.terrabit.ro",
"depends": ["sale", "account", "portal_rating"],
"license": "LGPL-3",
"data": [
"data/mail_data.xml",
"views/account_move_view.xml",
"data/ir_cron_data.xml",
"views/res_config_settings_views.xml",
],
"images": ["static/description/main_screenshot.png"],
"development_status": "Beta",
"maintainers": ["dhongu"],
}
22 changes: 22 additions & 0 deletions deltatech_sale_feedback/data/ir_cron_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version='1.0' encoding='utf-8' ?>
<odoo>
<data noupdate="1">


<record id="ir_cron_feedback" model="ir.cron">
<field name="name">Request Feedback</field>
<field name="model_id" ref="model_account_move" />
<field name="state">code</field>
<field name="numbercall">-1</field>
<field name="code">
model.cron_request_feedback()
</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="user_id" ref="base.user_root" />
<field name="active" eval="False" />
<field name="doall" eval="False" />
</record>

</data>
</odoo>
108 changes: 108 additions & 0 deletions deltatech_sale_feedback/data/mail_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version='1.0' encoding='utf-8' ?>
<odoo>
<data noupdate="0">
<record id="mail_template_sale_feedback" model="mail.template">
<field name="name">Invoice: request feedback</field>
<field name="model_id" ref="sale.model_account_move"/>
<field name="subject">${object.company_id.name} (Ref ${object.name or 'n/a' })</field>
<field name="email_from">${(object.user_id.email_formatted or user.email_formatted) | safe}</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 12px;">
Dear
<t t-if="object.partner_id.parent_id">
<t t-esc="object.partner_id.parent_id.name"/>
<t t-esc="' (' + object.partner_id.name + ')'"/>
</t>
<t t-else="">
<t t-esc="object.partner_id.name"/>
</t>
,
</p>
<p>
Please take a moment to rate our products related to the invoice "<strong t-out="object.name"/>"
</p>
<br/>
<div style="margin: 0px; padding: 0px;">
<t t-foreach="object.invoice_line_ids" t-as="line">

<t t-if="line.display_type in ['line_section', 'line_note']">
<table width="100%" style="color: #454748; font-size: 12px; border-collapse: collapse;">
<tr>
<td colspan="4">
<t t-if="line.display_type == 'line_section'">
<strong t-out="line.name"/>
</t>
<t t-elif="line.display_type == 'line_note'">
<i t-out="line.name"/>
</t>
</td>
</tr>
</table>
</t>
<t t-else="">
<t t-set="access_token" t-value="line.rating_get_access_token()"/>


<table t-attf-width="100%"
style="color: #454748; font-size: 12px; border-collapse: collapse;">
<tr>
<td style="width: 100px;">
<img
t-att-src="'/web/image/product.product/' + str(line.product_id.id) + '/image_128'"
style="width: 64px; height: 64px; object-fit: contain;"
alt="Product image"/>
</td>
<td align="left">
<a t-att-href="line.product_id.website_url">
<t t-esc="line.product_id.name"/>
</a>
</td>
<td width="15%" align="center">
<t t-esc="line.quantity"/>
</td>
<td style="font-size: 10px;">
<table style="width:100%;text-align:center;">
<tr>
<td>
<a t-att-href="'/rate/' + access_token + '/5'">
<img alt="Satisfied"
src="/rating/static/src/img/rating_5.png"
title="Satisfied"/>
</a>
</td>
<td>
<a t-att-href="'/rate/' + access_token + '/3'">
<img alt="Not satisfied"
src="/rating/static/src/img/rating_3.png"
title="Not satisfied"/>
</a>
</td>
<td>
<a t-att-href="'/rate/' + access_token + '/1'">
<img alt="Highly Dissatisfied"
src="/rating/static/src/img/rating_1.png"
title="Highly Dissatisfied"/>
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>

</t>
</t>
</div>


</div>
</field>


<field name="lang">${object.partner_id.lang}</field>
<field name="auto_delete" eval="True"/>
</record>
</data>
</odoo>
Loading

0 comments on commit 68017a9

Please sign in to comment.