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 <[email protected]>
  • Loading branch information
carmenbianca committed May 2, 2024
1 parent 53e5f72 commit aba31bb
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 56 deletions.
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",
}
1 change: 1 addition & 0 deletions pos_eater/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import pos_session
from . import res_partner
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: 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: inline-block;
}
22 changes: 22 additions & 0 deletions pos_eater/static/src/js/ActionpadWidget.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/** @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";

const ActionpadWidget = require("point_of_sale.ActionpadWidget");

export 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);
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 aba31bb

Please sign in to comment.