Skip to content

Commit

Permalink
[MIG] pos_eater: Migration to 16.0
Browse files Browse the repository at this point in the history
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
  • Loading branch information
carmenbianca committed May 2, 2024
1 parent 53e5f72 commit 5f0bedc
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 102 deletions.
15 changes: 9 additions & 6 deletions pos_eater/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
POS Eater
=========

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1b2557c6c403b8c1ddac87cb59f8bfdfe44bb87c8b17fec33cac593784107c1a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
Expand All @@ -14,10 +17,10 @@ POS Eater
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-beescoop%2FObeesdoo-lightgray.png?logo=github
:target: https://github.com/beescoop/Obeesdoo/tree/12.0/pos_eater
:target: https://github.com/beescoop/Obeesdoo/tree/16.0/pos_eater
:alt: beescoop/Obeesdoo

|badge1| |badge2| |badge3|
|badge1| |badge2| |badge3|

Adds the eaters of the customer to the POS ActionpadWidget.

Expand All @@ -31,8 +34,8 @@ Bug Tracker

Bugs are tracked on `GitHub Issues <https://github.com/beescoop/Obeesdoo/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/beescoop/Obeesdoo/issues/new?body=module:%20pos_eater%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/beescoop/Obeesdoo/issues/new?body=module:%20pos_eater%0Aversion:%2016.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 All @@ -54,6 +57,6 @@ Contributors
Maintainers
~~~~~~~~~~~

This module is part of the `beescoop/Obeesdoo <https://github.com/beescoop/Obeesdoo/tree/12.0/pos_eater>`_ project on GitHub.
This module is part of the `beescoop/Obeesdoo <https://github.com/beescoop/Obeesdoo/tree/16.0/pos_eater>`_ project on GitHub.

You are welcome to contribute.
7 changes: 3 additions & 4 deletions pos_eater/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@
"author": "BEES coop - Cellule IT, Coop IT Easy SC",
"website": "https://github.com/beescoop/Obeesdoo",
"category": "Point Of Sale",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"depends": ["point_of_sale", "eater"],
"data": ["views/assets.xml"],
"assets": {
"point_of_sale.assets": [
"pos_eater/static/src/css/pos.css",
"pos_eater/static/src/js/**/*.js",
"pos_eater/static/src/xml/**/*.xml",
],
}
"qweb": ["static/src/xml/templates.xml"],
},
"installable": True,
"license": "AGPL-3",
}
2 changes: 1 addition & 1 deletion pos_eater/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import res_partner
from . import pos_session
14 changes: 14 additions & 0 deletions pos_eater/models/pos_session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-FileCopyrightText: 2024 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

from odoo import models


class PosSession(models.Model):
_inherit = "pos.session"

def _loader_params_res_partner(self):
result = super()._loader_params_res_partner()
result["search_params"]["fields"].append("child_eater_ids")
return result
10 changes: 0 additions & 10 deletions pos_eater/models/res_partner.py

This file was deleted.

55 changes: 26 additions & 29 deletions pos_eater/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Beescoop Point of sale</title>
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>POS Eater</title>
<style type="text/css">

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.

See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/

Expand Down Expand Up @@ -360,58 +359,56 @@
</style>
</head>
<body>
<div class="document" id="beescoop-point-of-sale">
<h1 class="title">Beescoop Point of sale</h1>
<div class="document" id="pos-eater">
<h1 class="title">POS Eater</h1>

<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1b2557c6c403b8c1ddac87cb59f8bfdfe44bb87c8b17fec33cac593784107c1a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/beescoop/obeesdoo/tree/12.0/beesdoo_pos"><img alt="beescoop/obeesdoo" src="https://img.shields.io/badge/github-beescoop%2Fobeesdoo-lightgray.png?logo=github" /></a></p>
<p>This module :
- adds the eaters of the customer to the POS ActionpadWidget and PaymentScreenWidget.
- maintains “Available in POS” (<cite>available_in_pos</cite>) value when unchecking “Can be Sold” (<cite>sale_ok</cite>).
- hides phone and address field in pos customer list
- do not allow customer creation from the POS</p>
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/beescoop/Obeesdoo/tree/16.0/pos_eater"><img alt="beescoop/Obeesdoo" src="https://img.shields.io/badge/github-beescoop%2FObeesdoo-lightgray.png?logo=github" /></a></p>
<p>Adds the eaters of the customer to the POS ActionpadWidget.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/beescoop/obeesdoo/issues">GitHub Issues</a>.
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/beescoop/Obeesdoo/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/beescoop/obeesdoo/issues/new?body=module:%20beesdoo_pos%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/beescoop/Obeesdoo/issues/new?body=module:%20pos_eater%0Aversion:%2016.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">
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<ul class="simple">
<li>Beescoop - Cellule IT</li>
<li>BEES coop - Cellule IT</li>
<li>Coop IT Easy SC</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Beescoop - Cellule IT</li>
<li>BEES coop - Cellule IT</li>
<li>Coop IT Easy SC</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
<p>This module is part of the <a class="reference external" href="https://github.com/beescoop/obeesdoo/tree/12.0/beesdoo_pos">beescoop/obeesdoo</a> project on GitHub.</p>
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<p>This module is part of the <a class="reference external" href="https://github.com/beescoop/Obeesdoo/tree/16.0/pos_eater">beescoop/Obeesdoo</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
</div>
Expand Down
10 changes: 10 additions & 0 deletions pos_eater/static/src/css/pos.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 Coop IT Easy SC
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

.pos .actionpad .button.set-partner .eaters {
font-weight: normal;
display: block;
}
20 changes: 20 additions & 0 deletions pos_eater/static/src/js/ActionpadWidget.esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/** @odoo-module alias=pos_eater.ActionpadWidget **/
// SPDX-FileCopyrightText: 2024 Coop IT Easy SC
//
// SPDX-License-Identifier: AGPL-3.0-or-later

import Registries from "point_of_sale.Registries";
import ActionpadWidget from "point_of_sale.ActionpadWidget";

const EaterActionpadWidget = (ActionpadWidget) =>
class extends ActionpadWidget {
get eaterNames() {
const names = this.props.partner.child_eater_ids.map(
(id) => this.env.pos.db.get_partner_by_id(id).name
);
return names.join(", ");
}
};

Registries.Component.extend(ActionpadWidget, EaterActionpadWidget);
export default EaterActionpadWidget;
41 changes: 0 additions & 41 deletions pos_eater/static/src/js/screens.js

This file was deleted.

23 changes: 23 additions & 0 deletions pos_eater/static/src/xml/ActionpadWidget.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
SPDX-FileCopyrightText: 2024 Coop IT Easy SC
SPDX-License-Identifier: AGPL-3.0-or-later
-->
<templates id="template" xml:space="preserve">

<t
t-name="ActionpadWidget"
t-inherit="point_of_sale.ActionpadWidget"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//t[@t-esc='props.partner.name']" position="after">
<t t-if="props.partner.child_eater_ids">
<span class="eaters">
<t t-esc="eaterNames" />
</span>
</t>
</xpath>
</t>

</templates>
11 changes: 0 additions & 11 deletions pos_eater/static/src/xml/templates.xml

This file was deleted.

0 comments on commit 5f0bedc

Please sign in to comment.