Skip to content

Commit

Permalink
[14.0][BACKPORT] pos_customer_comment 16.0->14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GabbasovDinar committed Jul 14, 2023
1 parent 6dbef7b commit b973d8f
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 61 deletions.
18 changes: 9 additions & 9 deletions pos_customer_comment/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ Point of Sale - Cashier Comment
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github
:target: https://github.com/OCA/pos/tree/16.0/pos_customer_comment
:target: https://github.com/OCA/pos/tree/14.0/pos_customer_comment
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_customer_comment
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/184/16.0
:target: https://runbot.odoo-community.org/runbot/184/14.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends the functionality of point of sale module, to allow display and edit
customer note field in the point of sale UI for the cashier.
Expand All @@ -38,18 +38,18 @@ Usage

* Go to your partner view and write or edit new PoS comments

.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_customer_comment/static/description/res_partner_form.png
.. figure:: https://raw.githubusercontent.com/OCA/pos/14.0/pos_customer_comment/static/description/res_partner_form.png

* Then Open your Point of sale

in the customer tree view, a new icon is available to mention that the customer
has a PoS Comment to read:

.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_customer_comment/static/description/pos_customer_tree.png
.. figure:: https://raw.githubusercontent.com/OCA/pos/14.0/pos_customer_comment/static/description/pos_customer_tree.png

It is possible to see or edit the comment in the customer form view:

.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_customer_comment/static/description/pos_customer_form.png
.. figure:: https://raw.githubusercontent.com/OCA/pos/14.0/pos_customer_comment/static/description/pos_customer_form.png

Known issues / Roadmap
======================
Expand All @@ -64,7 +64,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_customer_comment%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_customer_comment%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand Down Expand Up @@ -107,8 +107,8 @@ promote its widespread use.

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-legalsylvain|
|maintainer-legalsylvain|

This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/16.0/pos_customer_comment>`_ project on GitHub.
This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/14.0/pos_customer_comment>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
17 changes: 6 additions & 11 deletions pos_customer_comment/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,21 @@
"name": "Point of Sale - Cashier Comment",
"summary": "Display Customer comment in the PoS front office and allow"
" to edit and save it by the cashier",
"version": "16.0.1.0.0",
"version": "14.0.1.0.0",
"category": "Point of Sale",
"maintainers": ["legalsylvain"],
"author": "GRAP,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/pos",
"license": "AGPL-3",
"depends": ["point_of_sale"],
"data": [
"views/assets.xml",
"views/view_res_partner.xml",
],
"assets": {
"point_of_sale.assets": [
"pos_customer_comment/static/src/css/pos_customer_comment.scss",
"pos_customer_comment/static/src/xml/PartnerDetailsEdit.xml",
"pos_customer_comment/static/src/xml/PartnerLine.xml",
],
"web.assets_tests": [
"pos_customer_comment/tests/tours/PosCustomerComment.tour.js",
],
},
"qweb": [
"static/src/xml/PartnerDetailsEdit.xml",
"static/src/xml/PartnerLine.xml",
],
"demo": [
"demo/res_partner.xml",
],
Expand Down
2 changes: 1 addition & 1 deletion pos_customer_comment/demo/res_partner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
-->
<odoo>
<record id="base.res_partner_address_31" model="res.partner">
<record id="base.res_partner_2" model="res.partner">
<field
name="pos_comment"
>Important information to display in Point of Sale</field>
Expand Down
2 changes: 1 addition & 1 deletion pos_customer_comment/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-03-02 16:30+0000\n"
"Last-Translator: Patricia Lorenzo Bartolomé <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion pos_customer_comment/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-03-09 13:22+0000\n"
"Last-Translator: mymage <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion pos_customer_comment/i18n/pos_customer_comment.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down
1 change: 0 additions & 1 deletion pos_customer_comment/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import pos_session
from . import res_partner
14 changes: 0 additions & 14 deletions pos_customer_comment/models/pos_session.py

This file was deleted.

12 changes: 6 additions & 6 deletions pos_customer_comment/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Point of Sale - Cashier Comment</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/pos/tree/16.0/pos_customer_comment"><img alt="OCA/pos" src="https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_customer_comment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/184/16.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/pos/tree/14.0/pos_customer_comment"><img alt="OCA/pos" src="https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_customer_comment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/184/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of point of sale module, to allow display and edit
customer note field in the point of sale UI for the cashier.</p>
<p><strong>Table of contents</strong></p>
Expand All @@ -391,19 +391,19 @@ <h1><a class="toc-backref" href="#id1">Usage</a></h1>
<li>Go to your partner view and write or edit new PoS comments</li>
</ul>
<div class="figure">
<img alt="https://raw.githubusercontent.com/OCA/pos/16.0/pos_customer_comment/static/description/res_partner_form.png" src="https://raw.githubusercontent.com/OCA/pos/16.0/pos_customer_comment/static/description/res_partner_form.png" />
<img alt="https://raw.githubusercontent.com/OCA/pos/14.0/pos_customer_comment/static/description/res_partner_form.png" src="https://raw.githubusercontent.com/OCA/pos/14.0/pos_customer_comment/static/description/res_partner_form.png" />
</div>
<ul class="simple">
<li>Then Open your Point of sale</li>
</ul>
<p>in the customer tree view, a new icon is available to mention that the customer
has a PoS Comment to read:</p>
<div class="figure">
<img alt="https://raw.githubusercontent.com/OCA/pos/16.0/pos_customer_comment/static/description/pos_customer_tree.png" src="https://raw.githubusercontent.com/OCA/pos/16.0/pos_customer_comment/static/description/pos_customer_tree.png" />
<img alt="https://raw.githubusercontent.com/OCA/pos/14.0/pos_customer_comment/static/description/pos_customer_tree.png" src="https://raw.githubusercontent.com/OCA/pos/14.0/pos_customer_comment/static/description/pos_customer_tree.png" />
</div>
<p>It is possible to see or edit the comment in the customer form view:</p>
<div class="figure">
<img alt="https://raw.githubusercontent.com/OCA/pos/16.0/pos_customer_comment/static/description/pos_customer_form.png" src="https://raw.githubusercontent.com/OCA/pos/16.0/pos_customer_comment/static/description/pos_customer_form.png" />
<img alt="https://raw.githubusercontent.com/OCA/pos/14.0/pos_customer_comment/static/description/pos_customer_form.png" src="https://raw.githubusercontent.com/OCA/pos/14.0/pos_customer_comment/static/description/pos_customer_form.png" />
</div>
</div>
<div class="section" id="known-issues-roadmap">
Expand All @@ -417,7 +417,7 @@ <h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/pos/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/pos/issues/new?body=module:%20pos_customer_comment%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/pos/issues/new?body=module:%20pos_customer_comment%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -450,7 +450,7 @@ <h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external" href="https://github.com/legalsylvain"><img alt="legalsylvain" src="https://github.com/legalsylvain.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/pos/tree/16.0/pos_customer_comment">OCA/pos</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/pos/tree/14.0/pos_customer_comment">OCA/pos</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions pos_customer_comment/static/src/css/pos_customer_comment.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
*/

.pos .partnerlist-screen .partner-details textarea {
.pos .clientlist-screen .client-details textarea {
padding: 4px;
border-radius: 3px;
border: solid 1px #cecbcb;
Expand All @@ -17,6 +17,6 @@
box-sizing: border-box;
}

.pos .partnerlist-screen .partner-details span.label {
.pos .clientlist-screen .client-details span.label {
vertical-align: top;
}
6 changes: 6 additions & 0 deletions pos_customer_comment/static/src/js/models.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
odoo.define("pos_customer_comment.models", function (require) {
"use strict";

var models = require("point_of_sale.models");
models.load_fields("res.partner", ["pos_comment"]);
});
6 changes: 3 additions & 3 deletions pos_customer_comment/static/src/xml/PartnerDetailsEdit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<templates id="template" xml:space="preserve">

<t
t-name="PartnerDetailsEdit"
t-inherit="point_of_sale.PartnerDetailsEdit"
t-name="ClientDetailsEdit"
t-inherit="point_of_sale.ClientDetailsEdit"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//select[@name='country_id']/.." position="after">
<div class="partner-detail partner-detail-pos-comment">
<div class="client-detail client-detail-pos-comment">
<span class="label">Comment</span>
<textarea
class="detail"
Expand Down
6 changes: 3 additions & 3 deletions pos_customer_comment/static/src/xml/PartnerLine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<templates id="template" xml:space="preserve">

<t
t-name="PartnerLine"
t-inherit="point_of_sale.PartnerLine"
t-name="ClientLine"
t-inherit="point_of_sale.ClientLine"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//button[@class='edit-partner-button']" position="after">
<xpath expr="//button[@class='edit-client-button']" position="after">
<div t-if="props.partner.pos_comment != ''">
<i
class="fa fa-comment"
Expand Down
8 changes: 4 additions & 4 deletions pos_customer_comment/tests/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
@tagged("post_install", "-at_install")
class TestUi(TestPointOfSaleHttpCommon):
def test_pos_customer_comment(self):
self.main_pos_config.open_ui()
self.main_pos_config.open_session_cb(check_coa=False)
self.main_pos_config.current_session_id.set_cashbox_pos(0, None)

self.start_tour(
f"/pos/ui?config_id={self.main_pos_config.id}",
"PosCustomerCommentTour",
login="accountman",
login="admin",
)
customer = self.env.ref("base.res_partner_address_31")
self.assertEqual(customer.pos_comment, "New Comment")
partner = self.env.ref("base.res_partner_2")
self.assertEqual(partner.pos_comment, "New Comment")
13 changes: 9 additions & 4 deletions pos_customer_comment/tests/tours/PosCustomerComment.tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ odoo.define("pos_customer_comment.tour.PosCustomerComment", function (require) {
{
content: "Test pos_customer_content: Waiting for loading to finish",
trigger: "body:not(:has(.loader))",
run: function () {},
},
{
content: "Test pos_customer_content: open customer list",
trigger: "button.set-partner",
trigger: ".actionpad .button.set-customer",
},
{
content: "Test pos_customer_content: select 'Addison Olson' Customer",
trigger: ".partner-line:contains('Addison Olson') .edit-partner-button",
content: "Test pos_customer_content: select 'Deco Addict' Customer",
trigger: ".client-line:contains('Deco Addict')",
},
{
content: "Test pos_customer_content: Edit client 'Deco Addict' Customer",
trigger: ".edit-client-button",
},
{
content: "Test pos_customer_content: Check if value is correctly loaded",
Expand All @@ -38,7 +43,7 @@ odoo.define("pos_customer_comment.tour.PosCustomerComment", function (require) {
},
{
content: "Test pos_customer_content: Save Customer changes",
trigger: ".partnerlist-screen .button.highlight",
trigger: ".clientlist-screen .button.highlight",
},
{
content: "Test pos_customer_content: Close the Point of Sale frontend",
Expand Down
25 changes: 25 additions & 0 deletions pos_customer_comment/views/assets.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script
type="text/javascript"
src="/pos_customer_comment/static/src/js/models.js"
/>
<link
rel="stylesheet"
type="text/scss"
href="/pos_customer_comment/static/src/css/pos_customer_comment.scss"
/>
</xpath>
</template>

<template id="assets_tests" inherit_id="web.assets_tests">
<xpath expr="." position="inside">
<script
type="text/javascript"
src="/pos_customer_comment/tests/tours/PosCustomerComment.tour.js"
/>
</xpath>
</template>
</odoo>

0 comments on commit b973d8f

Please sign in to comment.